mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Merge branch 'dev' into feature/refactoring-mvc
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
<manifest
|
||||
package="org.isoron.uhabits"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:versionCode="21"
|
||||
android:versionName="1.5.5">
|
||||
android:versionCode="22"
|
||||
android:versionName="1.5.6">
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
||||
|
||||
|
||||
@@ -175,7 +175,8 @@ public class HabitBroadcastReceiver extends BroadcastReceiver
|
||||
dismissPendingIntent =
|
||||
HabitPendingIntents.dismissNotification(context);
|
||||
PendingIntent checkIntentPending =
|
||||
HabitPendingIntents.toggleCheckmark(context, habit, timestamp);
|
||||
HabitPendingIntents.toggleCheckmark(context, habit,
|
||||
timestamp, 1);
|
||||
PendingIntent snoozeIntentPending =
|
||||
HabitPendingIntents.snoozeNotification(context, habit);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class HabitPendingIntents
|
||||
Intent deleteIntent = new Intent(context, HabitBroadcastReceiver.class);
|
||||
deleteIntent.setAction(HabitBroadcastReceiver.ACTION_DISMISS);
|
||||
return PendingIntent.getBroadcast(context, 0, deleteIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
|
||||
public static PendingIntent snoozeNotification(Context context, Habit habit)
|
||||
@@ -47,20 +47,21 @@ public abstract class HabitPendingIntents
|
||||
snoozeIntent.setData(data);
|
||||
snoozeIntent.setAction(HabitBroadcastReceiver.ACTION_SNOOZE);
|
||||
return PendingIntent.getBroadcast(context, 0, snoozeIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
|
||||
public static PendingIntent toggleCheckmark(Context context,
|
||||
Habit habit,
|
||||
Long timestamp)
|
||||
Long timestamp,
|
||||
int requestCode)
|
||||
{
|
||||
Uri data = habit.getUri();
|
||||
Intent checkIntent = new Intent(context, HabitBroadcastReceiver.class);
|
||||
checkIntent.setData(data);
|
||||
checkIntent.setAction(HabitBroadcastReceiver.ACTION_CHECK);
|
||||
if (timestamp != null) checkIntent.putExtra("timestamp", timestamp);
|
||||
return PendingIntent.getBroadcast(context, 0, checkIntent,
|
||||
PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
return PendingIntent.getBroadcast(context, requestCode, checkIntent,
|
||||
PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
|
||||
public static PendingIntent viewHabit(Context context, Habit habit)
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CheckmarkWidget extends BaseWidget
|
||||
@Override
|
||||
public PendingIntent getOnClickPendingIntent(Context context)
|
||||
{
|
||||
return HabitPendingIntents.toggleCheckmark(context, habit, null);
|
||||
return HabitPendingIntents.toggleCheckmark(context, habit, null, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user