diff --git a/app/src/main/java/com/topjohnwu/magisk/BaseModuleFragment.java b/app/src/main/java/com/topjohnwu/magisk/BaseModuleFragment.java index 4a418b89e..fee8abd48 100644 --- a/app/src/main/java/com/topjohnwu/magisk/BaseModuleFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/BaseModuleFragment.java @@ -10,7 +10,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.CheckBox; -import com.topjohnwu.magisk.R; import com.topjohnwu.magisk.module.Module; import com.topjohnwu.magisk.rv.ItemClickListener; import com.topjohnwu.magisk.rv.ModulesAdapter; @@ -33,6 +32,7 @@ public abstract class BaseModuleFragment extends Fragment { recyclerView.setAdapter(new ModulesAdapter(listModules(), new ItemClickListener() { @Override public void onItemClick(View view, int position) { + // On Checkbox change listener CheckBox chbox = (CheckBox) view; if (!chbox.isChecked()) { @@ -46,9 +46,19 @@ public abstract class BaseModuleFragment extends Fragment { }, new ItemClickListener() { @Override public void onItemClick(View view, int position) { + // On delete button click listener + listModules().get(position).createRemoveFile(); Snackbar.make(view, R.string.remove_file_created, Snackbar.LENGTH_SHORT).show(); } + }, new ItemClickListener() { + @Override + public void onItemClick(View view, int position) { + // On undelete button click listener + + listModules().get(position).deleteRemoveFile(); + Snackbar.make(view, R.string.remove_file_deleted, Snackbar.LENGTH_SHORT).show(); + } })); return view; } diff --git a/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java b/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java index 67e5018dd..8de0d2f3e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java +++ b/app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java @@ -141,8 +141,7 @@ public class ModulesFragment extends Fragment { private class TabsAdapter extends FragmentPagerAdapter { String[] tabTitles = new String[]{ - "Modules", "Cache Modules" - // TODO stringify + getString(R.string.modules), getString(R.string.cache_modules) }; public TabsAdapter(FragmentManager fm) { diff --git a/app/src/main/java/com/topjohnwu/magisk/RootFragment.java b/app/src/main/java/com/topjohnwu/magisk/RootFragment.java deleted file mode 100644 index 7f31b265c..000000000 --- a/app/src/main/java/com/topjohnwu/magisk/RootFragment.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.topjohnwu.magisk; - -import android.support.v4.app.Fragment; - -public class RootFragment extends Fragment { - -} diff --git a/app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java b/app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java index f03cdb88c..964f6f71e 100644 --- a/app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java +++ b/app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java @@ -122,10 +122,6 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView setTitle(R.string.magisk); navFragment = new MagiskFragment(); break; - case R.id.root: - setTitle(R.string.root); - navFragment = new RootFragment(); - break; case R.id.modules: setTitle(R.string.modules); navFragment = new ModulesFragment(); diff --git a/app/src/main/java/com/topjohnwu/magisk/rv/ModulesAdapter.java b/app/src/main/java/com/topjohnwu/magisk/rv/ModulesAdapter.java index fd6a99d11..28f846520 100644 --- a/app/src/main/java/com/topjohnwu/magisk/rv/ModulesAdapter.java +++ b/app/src/main/java/com/topjohnwu/magisk/rv/ModulesAdapter.java @@ -23,11 +23,13 @@ public class ModulesAdapter extends RecyclerView.Adapter mList; private final ItemClickListener chboxListener; private final ItemClickListener deleteBtnListener; + private final ItemClickListener unDeleteBtnListener; - public ModulesAdapter(List list, ItemClickListener chboxListener, ItemClickListener deleteBtnListener) { + public ModulesAdapter(List list, ItemClickListener chboxListener, ItemClickListener deleteBtnListener, ItemClickListener undeleteBtnListener) { this.mList = list; this.chboxListener = chboxListener; this.deleteBtnListener = deleteBtnListener; + this.unDeleteBtnListener = undeleteBtnListener; } @Override @@ -56,21 +58,27 @@ public class ModulesAdapter extends RecyclerView.Adapter + + diff --git a/app/src/main/res/drawable/root.xml b/app/src/main/res/drawable/root.xml deleted file mode 100644 index bca20e4d8..000000000 --- a/app/src/main/res/drawable/root.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/layout/log_fragment.xml b/app/src/main/res/layout/log_fragment.xml index 6ca9092d5..7513fff3a 100644 --- a/app/src/main/res/layout/log_fragment.xml +++ b/app/src/main/res/layout/log_fragment.xml @@ -1,43 +1,36 @@ - + - - + android:layout_height="match_parent" + tools:ignore="ScrollViewSize"> - + - + - + - + - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/root_fragment.xml b/app/src/main/res/layout/root_fragment.xml deleted file mode 100644 index b9ef7dca2..000000000 --- a/app/src/main/res/layout/root_fragment.xml +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/menu/drawer.xml b/app/src/main/res/menu/drawer.xml index 5924d7d33..5bba3eec5 100644 --- a/app/src/main/res/menu/drawer.xml +++ b/app/src/main/res/menu/drawer.xml @@ -8,11 +8,6 @@ android:icon="@drawable/magisk" android:title="@string/magisk"/> - - #009688 #00796B - #B2DFDB #FFC107 #212121 - #757575 #FFFFFF - #BDBDBD #F44336 #4CAF50 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9fa9e4313..4b29046c0 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -6,28 +6,20 @@ Safety Net (Android Pay) should work, but no root temporarily SELinux is enforced SELinux is permissive\nOnly turn off SELinux if necessary! - (unavailable) - Boot Version: - Root Status: - SeLinux is %s Root Toggle SeLinux Toggle Improperly Installed Root improperly installed. Safety Net (Android Pay) will NOT work, and impossible to toggle Not Rooted Safety Net (Android Pay) should work - Magisk v%1$s + Installed Magisk v%1$s Samsung do not support switching SELinux status! - Loading… Open navigation drawer Close navigation drawer - Root Modules Log - Remove - Disable No root access, functionality limited Module will be removed at next reboot Module will be disabled at next reboot @@ -43,5 +35,7 @@ This feature will not work without permission to write external storage. Module will be enabled at next reboot Magisk + Module will not be removed at next reboot + Cache modules