mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 02:25:28 +00:00
Allow modules be managed in core only mode, and add notice in UI
This commit is contained in:
parent
7fb4777c1c
commit
5109b9abfd
@ -50,6 +50,8 @@ public class MagiskFragment extends BaseFragment
|
|||||||
|
|
||||||
@BindView(R.id.swipeRefreshLayout) SwipeRefreshLayout mSwipeRefreshLayout;
|
@BindView(R.id.swipeRefreshLayout) SwipeRefreshLayout mSwipeRefreshLayout;
|
||||||
|
|
||||||
|
@BindView(R.id.core_only_notice) CardView coreOnlyNotice;
|
||||||
|
|
||||||
@BindView(R.id.magisk_update) RelativeLayout magiskUpdate;
|
@BindView(R.id.magisk_update) RelativeLayout magiskUpdate;
|
||||||
@BindView(R.id.magisk_update_icon) ImageView magiskUpdateIcon;
|
@BindView(R.id.magisk_update_icon) ImageView magiskUpdateIcon;
|
||||||
@BindView(R.id.magisk_update_status) TextView magiskUpdateText;
|
@BindView(R.id.magisk_update_status) TextView magiskUpdateText;
|
||||||
@ -217,6 +219,7 @@ public class MagiskFragment extends BaseFragment
|
|||||||
safetyNetCard.setVisibility(hasNetwork ? View.VISIBLE : View.GONE);
|
safetyNetCard.setVisibility(hasNetwork ? View.VISIBLE : View.GONE);
|
||||||
installOptionCard.setVisibility(hasNetwork ? View.VISIBLE : View.GONE);
|
installOptionCard.setVisibility(hasNetwork ? View.VISIBLE : View.GONE);
|
||||||
uninstallButton.setVisibility(isUpToDate && hasRoot ? View.VISIBLE : View.GONE);
|
uninstallButton.setVisibility(isUpToDate && hasRoot ? View.VISIBLE : View.GONE);
|
||||||
|
coreOnlyNotice.setVisibility(mm.prefs.getBoolean(Const.Key.COREONLY, false) ? View.VISIBLE : View.GONE);
|
||||||
|
|
||||||
int image, color;
|
int image, color;
|
||||||
|
|
||||||
|
@ -119,13 +119,12 @@ public class MainActivity extends BaseActivity
|
|||||||
|
|
||||||
public void checkHideSection() {
|
public void checkHideSection() {
|
||||||
Menu menu = navigationView.getMenu();
|
Menu menu = navigationView.getMenu();
|
||||||
menu.findItem(R.id.magiskhide).setVisible(
|
menu.findItem(R.id.magiskhide).setVisible(Shell.rootAccess() &&
|
||||||
Shell.rootAccess() && Data.magiskVersionCode >= Const.MAGISK_VER.UNIFIED
|
Data.magiskVersionCode >= Const.MAGISK_VER.UNIFIED &&
|
||||||
&& mm.prefs.getBoolean(Const.Key.MAGISKHIDE, false));
|
mm.prefs.getBoolean(Const.Key.MAGISKHIDE, false));
|
||||||
menu.findItem(R.id.modules).setVisible(!mm.prefs.getBoolean(Const.Key.COREONLY, false) &&
|
menu.findItem(R.id.modules).setVisible(Shell.rootAccess() && Data.magiskVersionCode >= 0);
|
||||||
Shell.rootAccess() && Data.magiskVersionCode >= 0);
|
menu.findItem(R.id.downloads).setVisible(Download.checkNetworkStatus(this)
|
||||||
menu.findItem(R.id.downloads).setVisible(!mm.prefs.getBoolean(Const.Key.COREONLY, false)
|
&& Shell.rootAccess() && Data.magiskVersionCode >= 0);
|
||||||
&& Download.checkNetworkStatus(this) && Shell.rootAccess() && Data.magiskVersionCode >= 0);
|
|
||||||
menu.findItem(R.id.log).setVisible(Shell.rootAccess());
|
menu.findItem(R.id.log).setVisible(Shell.rootAccess());
|
||||||
menu.findItem(R.id.superuser).setVisible(Shell.rootAccess() &&
|
menu.findItem(R.id.superuser).setVisible(Shell.rootAccess() &&
|
||||||
!(Const.USER_ID > 0 && Data.multiuserMode == Const.Value.MULTIUSER_MODE_OWNER_MANAGED));
|
!(Const.USER_ID > 0 && Data.multiuserMode == Const.Value.MULTIUSER_MODE_OWNER_MANAGED));
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
android:id="@+id/warning"
|
android:id="@+id/warning"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawableStart="@drawable/ic_su_warning"
|
android:drawableStart="@drawable/ic_warning"
|
||||||
android:textColor="?android:textColorSecondary"
|
android:textColor="?android:textColorSecondary"
|
||||||
android:text="@string/su_warning"
|
android:text="@string/su_warning"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
|
@ -20,6 +20,45 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/core_only_notice"
|
||||||
|
style="?attr/cardStyle"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="4dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginTop="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_marginBottom="12dp"
|
||||||
|
android:layout_marginTop="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="25dp"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_toStartOf="@+id/core_only"
|
||||||
|
android:src="@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>
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
<android.support.v7.widget.CardView
|
||||||
style="?attr/cardStyle"
|
style="?attr/cardStyle"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
Reference in New Issue
Block a user