Move fragments to separate package

This commit is contained in:
topjohnwu 2018-08-30 03:57:48 -04:00
parent 5c483745ff
commit aa374b51f1
12 changed files with 44 additions and 13 deletions

View File

@ -15,6 +15,13 @@ import android.view.MenuItem;
import android.view.View;
import com.topjohnwu.magisk.components.BaseActivity;
import com.topjohnwu.magisk.fragments.LogFragment;
import com.topjohnwu.magisk.fragments.MagiskFragment;
import com.topjohnwu.magisk.fragments.MagiskHideFragment;
import com.topjohnwu.magisk.fragments.ModulesFragment;
import com.topjohnwu.magisk.fragments.ReposFragment;
import com.topjohnwu.magisk.fragments.SettingsFragment;
import com.topjohnwu.magisk.fragments.SuperuserFragment;
import com.topjohnwu.magisk.utils.Download;
import com.topjohnwu.magisk.utils.Topic;
import com.topjohnwu.superuser.Shell;
@ -29,8 +36,8 @@ public class MainActivity extends BaseActivity
private int mDrawerItem;
private boolean fromShortcut = true;
@BindView(R.id.toolbar) Toolbar toolbar;
@BindView(R.id.drawer_layout) DrawerLayout drawer;
@BindView(R.id.toolbar) public Toolbar toolbar;
@BindView(R.id.nav_view) public NavigationView navigationView;
private float toolbarElevation;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.os.Bundle;
@ -8,6 +8,10 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.Data;
import com.topjohnwu.magisk.MainActivity;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.adapters.TabFragmentAdapter;
import com.topjohnwu.magisk.components.BaseFragment;
@ -29,7 +33,7 @@ public class LogFragment extends BaseFragment {
View v = inflater.inflate(R.layout.fragment_log, container, false);
unbinder = ButterKnife.bind(this, v);
((MainActivity) getActivity()).toolbar.setElevation(0);
((MainActivity) requireActivity()).toolbar.setElevation(0);
TabFragmentAdapter adapter = new TabFragmentAdapter(getChildFragmentManager());

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.app.NotificationManager;
import android.content.Context;
@ -20,6 +20,11 @@ import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.topjohnwu.magisk.BuildConfig;
import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.Data;
import com.topjohnwu.magisk.MainActivity;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.asyncs.CheckSafetyNet;
import com.topjohnwu.magisk.asyncs.CheckUpdates;
import com.topjohnwu.magisk.components.BaseActivity;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.os.Bundle;
import android.support.annotation.NonNull;
@ -12,6 +12,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.SearchView;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.adapters.ApplicationAdapter;
import com.topjohnwu.magisk.components.BaseFragment;
import com.topjohnwu.magisk.utils.Topic;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.Manifest;
import android.os.Bundle;
@ -16,6 +16,8 @@ import android.widget.ProgressBar;
import android.widget.ScrollView;
import android.widget.TextView;
import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.components.BaseFragment;
import com.topjohnwu.magisk.components.SnackbarMaker;
import com.topjohnwu.magisk.utils.Download;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.Manifest;
import android.app.Activity;
@ -16,6 +16,9 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.FlashActivity;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.adapters.ModulesAdapter;
import com.topjohnwu.magisk.components.BaseFragment;
import com.topjohnwu.magisk.container.Module;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.app.AlertDialog;
import android.os.Bundle;
@ -15,6 +15,9 @@ import android.view.ViewGroup;
import android.widget.SearchView;
import android.widget.TextView;
import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.Data;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.adapters.ReposAdapter;
import com.topjohnwu.magisk.asyncs.UpdateRepos;
import com.topjohnwu.magisk.components.BaseFragment;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.content.Context;
import android.content.SharedPreferences;
@ -24,6 +24,10 @@ import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.Toast;
import com.topjohnwu.magisk.Const;
import com.topjohnwu.magisk.Data;
import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.asyncs.CheckUpdates;
import com.topjohnwu.magisk.asyncs.PatchAPK;
import com.topjohnwu.magisk.components.CustomAlertDialog;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -11,6 +11,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.adapters.SuLogAdapter;
import com.topjohnwu.magisk.components.BaseFragment;

View File

@ -1,4 +1,4 @@
package com.topjohnwu.magisk;
package com.topjohnwu.magisk.fragments;
import android.content.pm.PackageManager;
import android.os.Bundle;
@ -9,6 +9,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.adapters.PolicyAdapter;
import com.topjohnwu.magisk.components.BaseFragment;
import com.topjohnwu.magisk.container.Policy;

View File

@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.topjohnwu.magisk.LogFragment">
tools:context="com.topjohnwu.magisk.fragments.LogFragment">
<android.support.design.widget.TabLayout
android:layout_width="match_parent"

View File

@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.topjohnwu.magisk.SuLogFragment">
tools:context="com.topjohnwu.magisk.fragments.SuLogFragment">
<TextView
android:id="@+id/empty_rv"