aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/anysoftkeyboard/ui/tutorials
diff options
context:
space:
mode:
authorMenny Even Danan <menny@evendanan.net>2015-09-04 12:27:10 +0000
committerMenny Even Danan <menny@evendanan.net>2015-09-04 12:27:10 +0000
commit41b5c03a753d01bd9e0f278d4939d52be1c28293 (patch)
tree05df9819abb515cfb966e370046e3412b3027deb /src/main/java/com/anysoftkeyboard/ui/tutorials
parent2c18d655016587dd5a2f75ebe53304019f4a3a65 (diff)
parentc5dbee5c6264c3fc9737b1d92abb095e9a7cf96b (diff)
downloadAnySoftKeyboard-41b5c03a753d01bd9e0f278d4939d52be1c28293.tar.gz
AnySoftKeyboard-41b5c03a753d01bd9e0f278d4939d52be1c28293.tar.bz2
Merge tag '1.5-r4'
v1.5 release 4
Diffstat (limited to 'src/main/java/com/anysoftkeyboard/ui/tutorials')
-rw-r--r--src/main/java/com/anysoftkeyboard/ui/tutorials/TutorialsProvider.java33
-rw-r--r--src/main/java/com/anysoftkeyboard/ui/tutorials/VersionChangeLogs.java5
2 files changed, 15 insertions, 23 deletions
diff --git a/src/main/java/com/anysoftkeyboard/ui/tutorials/TutorialsProvider.java b/src/main/java/com/anysoftkeyboard/ui/tutorials/TutorialsProvider.java
index b54133fa4..800666796 100644
--- a/src/main/java/com/anysoftkeyboard/ui/tutorials/TutorialsProvider.java
+++ b/src/main/java/com/anysoftkeyboard/ui/tutorials/TutorialsProvider.java
@@ -16,7 +16,6 @@
package com.anysoftkeyboard.ui.tutorials;
-import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
@@ -26,6 +25,7 @@ import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.preference.PreferenceManager;
+import android.support.v4.app.NotificationCompat;
import com.anysoftkeyboard.ui.dev.DeveloperUtils;
import com.anysoftkeyboard.utils.Log;
@@ -73,33 +73,20 @@ public class TutorialsProvider {
return !currentHash.equals(lastDebugVersionHash);
}
- public static int getPackageVersion(Context context) {
- try {
- PackageInfo pi = DeveloperUtils.getPackageInfo(context);
- return pi.versionCode;
- } catch (NameNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- return 0;
- }
- }
-
public synchronized static void showNotificationIcon(Context context, IntentToLaunch notificationData) {
final NotificationManager manager = ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE));
- Notification notification = new Notification(notificationData.NotificationIcon, context.getText(notificationData.NotificationText), System.currentTimeMillis());
-
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationData.IntentToStart, 0);
- notification.setLatestEventInfo(context,
- context.getText(notificationData.NotificationTitle), context.getText(notificationData.NotificationText),
- contentIntent);
- notification.defaults = 0;// no sound, vibrate, etc.
- //Cancel on click
- notification.flags = Notification.FLAG_AUTO_CANCEL;
- // notifying
- //need different id for each notification, so we can cancel easily
- manager.notify(notificationData.NotificationID, notification);
+ NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context);
+ notificationBuilder.setSmallIcon(notificationData.NotificationIcon)
+ .setContentText(context.getText(notificationData.NotificationText))
+ .setWhen(System.currentTimeMillis())
+ .setContentIntent(contentIntent)
+ .setDefaults(0/*no sound, vibrate, etc*/)
+ .setAutoCancel(true);
+
+ manager.notify(notificationData.NotificationID, notificationBuilder.build());
}
}
diff --git a/src/main/java/com/anysoftkeyboard/ui/tutorials/VersionChangeLogs.java b/src/main/java/com/anysoftkeyboard/ui/tutorials/VersionChangeLogs.java
index f41e33642..1e191126d 100644
--- a/src/main/java/com/anysoftkeyboard/ui/tutorials/VersionChangeLogs.java
+++ b/src/main/java/com/anysoftkeyboard/ui/tutorials/VersionChangeLogs.java
@@ -15,6 +15,11 @@ public class VersionChangeLogs {
"Next Words prediction is here! It learns from your typing (so, give it a little time to start suggesting).",
"Localization update: "));
+ log.add(new VersionChangeLog(1, 5, "r4", Uri.parse("https://github.com/AnySoftKeyboard/AnySoftKeyboard/milestones/v1.5_r4"),
+ "Linguistics say 'Help' and 'help' are the same word. Completion will take care of that now. #TheCustomerAlwaysRight",
+ "People complained about crashes. I fixed them. #TheCustomerAlwaysRight2",
+ "Updating build tools - yes, it's that boring."));
+
log.add(new VersionChangeLog(1, 5, "r3", Uri.parse("https://github.com/AnySoftKeyboard/AnySoftKeyboard/milestones/v1.5_r3"),
"...and then pressing SHIFT changed symbols on the bottom row.",
"Heard of some crashes hanging around in the keyboard. Crushed them!",