Reduce boilerplate

This commit is contained in:
topjohnwu
2017-08-28 00:27:10 +08:00
parent 1ce1a94a35
commit a78950e822
6 changed files with 23 additions and 14 deletions
@@ -8,6 +8,7 @@ import android.view.WindowManager;
import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.R;
import com.topjohnwu.magisk.utils.Shell;
import com.topjohnwu.magisk.utils.Topic;
public class Activity extends AppCompatActivity {
@@ -40,6 +41,10 @@ public class Activity extends AppCompatActivity {
return (MagiskManager) super.getApplicationContext();
}
public Shell getShell() {
return Shell.getShell(this);
}
protected void setFloating() {
boolean isTablet = getResources().getBoolean(R.bool.isTablet);
if (isTablet) {
@@ -1,6 +1,7 @@
package com.topjohnwu.magisk.components;
import com.topjohnwu.magisk.MagiskManager;
import com.topjohnwu.magisk.utils.Shell;
import com.topjohnwu.magisk.utils.Topic;
import com.topjohnwu.magisk.utils.Utils;
@@ -10,6 +11,10 @@ public class Fragment extends android.support.v4.app.Fragment {
return Utils.getMagiskManager(getActivity());
}
public Shell getShell() {
return Shell.getShell(getActivity());
}
@Override
public void onResume() {
super.onResume();