Remove core only card

This commit is contained in:
topjohnwu 2019-01-30 14:45:45 -05:00
parent 4df1047b07
commit 3e9174deed
5 changed files with 25 additions and 45 deletions

View File

@ -19,6 +19,7 @@ public class UpdateCardHolder {
@BindView(R.id.status) public TextView status;
@BindView(R.id.current_version) public TextView currentVersion;
@BindView(R.id.latest_version) public TextView latestVersion;
@BindView(R.id.additional) public TextView additional;
@BindView(R.id.install) public Button install;
public View itemView;

View File

@ -57,8 +57,6 @@ public class MagiskFragment extends BaseFragment
@BindView(R.id.swipeRefreshLayout) SwipeRefreshLayout mSwipeRefreshLayout;
@BindView(R.id.linearLayout) LinearLayout root;
@BindView(R.id.core_only_notice) CardView coreOnlyNotice;
@BindView(R.id.safetyNet_card) CardView safetyNetCard;
@BindView(R.id.safetyNet_refresh) ImageView safetyNetRefreshIcon;
@BindView(R.id.safetyNet_status) TextView safetyNetStatusText;
@ -138,8 +136,6 @@ public class MagiskFragment extends BaseFragment
magisk = new UpdateCardHolder(inflater, root);
manager = new UpdateCardHolder(inflater, root);
magisk.install.setOnClickListener(this::magiskInstall);
manager.install.setOnClickListener(this::managerInstall);
root.addView(magisk.itemView, 0);
root.addView(manager.itemView, 1);
@ -150,7 +146,17 @@ public class MagiskFragment extends BaseFragment
mSwipeRefreshLayout.setOnRefreshListener(this);
coreOnlyNotice.setVisibility(Config.get(Config.Key.COREONLY) ? View.VISIBLE : View.GONE);
magisk.install.setOnClickListener(this::magiskInstall);
manager.install.setOnClickListener(this::managerInstall);
if (Config.get(Config.Key.COREONLY)) {
magisk.additional.setText(R.string.core_only_enabled);
magisk.additional.setVisibility(View.VISIBLE);
}
if (!app.getPackageName().equals(BuildConfig.APPLICATION_ID)) {
manager.additional.setText("(" + app.getPackageName() + ")");
manager.additional.setVisibility(View.VISIBLE);
}
safetyNetCard.setVisibility(hasGms() && Networking.checkNetworkStatus(app) ?
View.VISIBLE : View.GONE);

View File

@ -19,45 +19,6 @@
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="@+id/core_only_notice"
style="?attr/cardStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="4dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="4dp"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/core_only"
app:srcCompat="@drawable/ic_warning" />
<TextView
android:id="@+id/core_only"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:gravity="center"
android:minWidth="225dp"
android:padding="6dp"
android:text="@string/settings_core_only_title"
android:textStyle="bold" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/safetyNet_card"
style="?attr/cardStyle"

View File

@ -77,11 +77,22 @@
android:visibility="gone"
app:autoSizeMinTextSize="1sp"
app:autoSizeTextType="uniform"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@+id/status"
app:layout_constraintStart_toStartOf="@+id/status"
app:layout_constraintTop_toBottomOf="@+id/current_version" />
<TextView
android:id="@+id/additional"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:maxLines="1"
android:visibility="gone"
app:autoSizeMinTextSize="1sp"
app:autoSizeTextType="uniform"
app:layout_constraintEnd_toEndOf="@+id/status"
app:layout_constraintStart_toStartOf="@+id/status"
app:layout_constraintTop_toBottomOf="@+id/latest_version" />
<Button
android:id="@+id/install"
android:layout_width="wrap_content"

View File

@ -29,6 +29,7 @@
<string name="uninstall_magisk_title">Uninstall Magisk</string>
<string name="uninstall_magisk_msg">All modules will be disabled/removed. Root will be removed, and your data potentially encrypted if not already.</string>
<string name="update">Update</string>
<string name="core_only_enabled">(Core only mode enabled)</string>
<!--Module Fragment-->
<string name="no_info_provided">(No info provided)</string>