@SuppressLint("CommitPrefEdits") @Test public void testOnAppLockActivate_APPLOCK_DEACTIVATED() { sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, true).commit(); mainActivityPresenter.onAppLockActivateClick(); verify(mainActivityView).hideActivateButton(); verify(mainActivityView).hideActivateHeader(); verify(mainActivityView).showWarningText(); verify(mainActivityView).setWarningText(Constants.PAUSE_WARNING_MESSAGE_FIRST); }
public void onAppLockActivateClick() { boolean appLockActivate = Utils.isAppLockActivated(sharedPreferences); if (!appLockActivate) { sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, true).apply(); checkAndActivateAppLock(); } else { showWarning(); } }
MainActivityPresenter implements DialogInterface.OnClickListener { public void onAppLockActivateClick() { boolean appLockActivate = Utils.isAppLockActivated(sharedPreferences); if (!appLockActivate) { sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, true).apply(); checkAndActivateAppLock(); } else { showWarning(); } } }
MainActivityPresenter implements DialogInterface.OnClickListener { public void onAppLockActivateClick() { boolean appLockActivate = Utils.isAppLockActivated(sharedPreferences); if (!appLockActivate) { sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, true).apply(); checkAndActivateAppLock(); } else { showWarning(); } } @Inject  MainActivityPresenter(Set<String> activatedPackages, SharedPreferences sharedPreferences,
      Context context, AccessibilityChecker accessibilityChecker); }
MainActivityPresenter implements DialogInterface.OnClickListener { public void onAppLockActivateClick() { boolean appLockActivate = Utils.isAppLockActivated(sharedPreferences); if (!appLockActivate) { sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, true).apply(); checkAndActivateAppLock(); } else { showWarning(); } } @Inject  MainActivityPresenter(Set<String> activatedPackages, SharedPreferences sharedPreferences,
      Context context, AccessibilityChecker accessibilityChecker); void setView(MainActivityView mainActivityView); void checkAccessibilityEnabled(); void onAppLockActivateClick(); void onTimingClick(String timing); void onWarningTextClick(); void onCreditTextClick(); void onGithubClick(); @Override void onClick(DialogInterface dialog, int which); }
MainActivityPresenter implements DialogInterface.OnClickListener { public void onAppLockActivateClick() { boolean appLockActivate = Utils.isAppLockActivated(sharedPreferences); if (!appLockActivate) { sharedPreferences.edit().putBoolean(Constants.APP_LOCK_ACTIVATED, true).apply(); checkAndActivateAppLock(); } else { showWarning(); } } @Inject  MainActivityPresenter(Set<String> activatedPackages, SharedPreferences sharedPreferences,
      Context context, AccessibilityChecker accessibilityChecker); void setView(MainActivityView mainActivityView); void checkAccessibilityEnabled(); void onAppLockActivateClick(); void onTimingClick(String timing); void onWarningTextClick(); void onCreditTextClick(); void onGithubClick(); @Override void onClick(DialogInterface dialog, int which);  }