Merge branch 'dev' into numerical

pull/627/head
Nam Nguyen 5 years ago
commit 54eff25b5a

@ -46,6 +46,14 @@ public class SnoozeDelayPickerActivity extends FragmentActivity
habit = appComponent.getHabitList().getById(parseId(getIntent().getData()));
if (habit == null) finish();
// Unlock device on clicking notification action
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
KeyguardManager km = (KeyguardManager) getSystemService(KEYGUARD_SERVICE);
km.requestDismissKeyguard(this, null);
} else {
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
}
int theme = R.style.Theme_AppCompat_Light_Dialog_Alert;
dialog = new AlertDialog.Builder(new ContextThemeWrapper(this, theme))
.setTitle(R.string.select_snooze_delay)

@ -67,7 +67,6 @@ public class WidgetReceiver extends BroadcastReceiver
IntentParser parser = app.getComponent().getIntentParser();
WidgetBehavior controller = component.getWidgetController();
Preferences prefs = app.getComponent().getPreferences();
Log.i(TAG, String.format("Received intent: %s", intent.toString()));
@ -105,6 +104,9 @@ public class WidgetReceiver extends BroadcastReceiver
data.getTimestamp());
break;
case ACTION_SET_NUMERICAL_VALUE:
// close Notification drawer
context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
Intent numberSelectorIntent = new Intent(context, NumericalCheckmarkWidgetActivity.class);
numberSelectorIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
numberSelectorIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);

@ -51,6 +51,14 @@ class NumericalCheckmarkWidgetActivity : Activity(), ListHabitsBehavior.NumberPi
component.notificationTray)
widgetUpdater = component.widgetUpdater
showNumberSelector(this)
// Unlock device on clicking notification action
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val km = getSystemService(KEYGUARD_SERVICE) as KeyguardManager
km.requestDismissKeyguard(this, null)
} else {
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD)
}
}
override fun onNumberPicked(newValue: Double) {

Loading…
Cancel
Save