From 587f58ed30fea0df714f9aa9a3a46fd2ea1c527a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Pich?= Date: Wed, 20 May 2020 16:20:07 +0200 Subject: [PATCH] Remove instructions dialog --- .../MainActivity.java | 54 +--- .../main/res/layout/activity_instructions.xml | 85 ----- app/src/main/res/layout/activity_main.xml | 21 +- appkillermanager/build.gradle | 10 - .../appkillermanager/devices/Asus.kt | 6 - .../appkillermanager/devices/Device.kt | 13 - .../appkillermanager/devices/Huawei.kt | 4 - .../appkillermanager/devices/Samsung.kt | 3 - .../ui/DialogKillerManagerBuilder.java | 302 ------------------ .../appkillermanager/utils/ActionsUtils.java | 59 ---- .../appkillermanager/utils/ActionsUtils.kt | 52 +++ .../src/main/res/drawable/asus_autostart.png | Bin 104931 -> 0 bytes .../main/res/drawable/asus_notification.png | Bin 208566 -> 0 bytes .../main/res/drawable/huawei_powersaving.png | Bin 22753 -> 0 bytes .../src/main/res/drawable/samsung.png | Bin 18283 -> 0 bytes .../main/res/layout/md_dialog_custom_view.xml | 51 --- 16 files changed, 65 insertions(+), 595 deletions(-) delete mode 100644 app/src/main/res/layout/activity_instructions.xml delete mode 100644 appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/ui/DialogKillerManagerBuilder.java delete mode 100644 appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.java create mode 100644 appkillermanager/src/main/java/com/thelittlefireman/appkillermanager/utils/ActionsUtils.kt delete mode 100644 appkillermanager/src/main/res/drawable/asus_autostart.png delete mode 100644 appkillermanager/src/main/res/drawable/asus_notification.png delete mode 100644 appkillermanager/src/main/res/drawable/huawei_powersaving.png delete mode 100644 appkillermanager/src/main/res/drawable/samsung.png delete mode 100644 appkillermanager/src/main/res/layout/md_dialog_custom_view.xml diff --git a/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java b/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java index 1bfa2d2..40522c1 100644 --- a/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java +++ b/app/src/main/java/com/thelittlefireman/appkillermanager_exemple/MainActivity.java @@ -7,11 +7,8 @@ import android.widget.Button; import android.widget.TextView; -import androidx.appcompat.widget.AppCompatCheckBox; - import com.thelittlefireman.appkillermanager.AppKillerManager; import com.thelittlefireman.appkillermanager.exceptions.NoActionFoundException; -import com.thelittlefireman.appkillermanager.ui.DialogKillerManagerBuilder; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -25,7 +22,6 @@ public class MainActivity extends Activity { Button powerSavingManagerButton; Button autoStartManagerButton; Button notificationManagerButton; - AppCompatCheckBox mAppCompatCheckBoxByDialog; AppKillerManager.Action currentAction = null; @@ -50,7 +46,6 @@ protected void log(int priority, @Nullable String tag, @NotNull String message, powerSavingManagerButton = findViewById(R.id.powerSavingManagerButton); autoStartManagerButton = findViewById(R.id.autoStartManagerButton); notificationManagerButton = findViewById(R.id.notificationManagerButton); - mAppCompatCheckBoxByDialog = findViewById(R.id.idByDialog); //ButterKnife.bind(this); @@ -58,14 +53,10 @@ protected void log(int priority, @Nullable String tag, @NotNull String message, @Override public void onClick(View v) { currentAction = AppKillerManager.Action.ACTION_POWER_SAVING; - if (mAppCompatCheckBoxByDialog.isChecked()) { - startDialog(currentAction); - } else { - try { - AppKillerManager.doActionPowerSaving(MainActivity.this); - } catch (NoActionFoundException e) { - Timber.e(e); - } + try { + AppKillerManager.doActionPowerSaving(MainActivity.this); + } catch (NoActionFoundException e) { + Timber.e(e); } } }); @@ -73,14 +64,10 @@ public void onClick(View v) { @Override public void onClick(View v) { currentAction = AppKillerManager.Action.ACTION_AUTO_START; - if (mAppCompatCheckBoxByDialog.isChecked()) { - startDialog(currentAction); - } else { - try { - AppKillerManager.doActionAutoStart(MainActivity.this); - } catch (NoActionFoundException e) { - Timber.e(e); - } + try { + AppKillerManager.doActionAutoStart(MainActivity.this); + } catch (NoActionFoundException e) { + Timber.e(e); } } }); @@ -88,14 +75,10 @@ public void onClick(View v) { @Override public void onClick(View v) { currentAction = AppKillerManager.Action.ACTION_NOTIFICATIONS; - if (mAppCompatCheckBoxByDialog.isChecked()) { - startDialog(currentAction); - } else { - try { - AppKillerManager.doActionNotification(MainActivity.this); - } catch (NoActionFoundException e) { - Timber.e(e); - } + try { + AppKillerManager.doActionNotification(MainActivity.this); + } catch (NoActionFoundException e) { + Timber.e(e); } } }); @@ -107,19 +90,6 @@ public void onClick(View v) { } - public void startDialog(AppKillerManager.Action action) { - - try { - new DialogKillerManagerBuilder(this).setAction(action).show(); - - } catch (DialogKillerManagerBuilder.UnAvailableActionException e) { - Timber.e(e); - } catch (DialogKillerManagerBuilder.UnSupportedDeviceException e) { - Timber.e(e); - } - - } - @Override public void onResume() { diff --git a/app/src/main/res/layout/activity_instructions.xml b/app/src/main/res/layout/activity_instructions.xml deleted file mode 100644 index 7a79701..0000000 --- a/app/src/main/res/layout/activity_instructions.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - -