Made notification actions pro instead of notification previews

This commit is contained in:
M66B
2019-05-06 13:59:26 +02:00
parent 1a0dac6e70
commit bf36d6789e
6 changed files with 84 additions and 68 deletions

View File

@@ -34,10 +34,10 @@ import android.net.Uri;
import android.os.Build;
import android.os.DeadSystemException;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.webkit.CookieManager;
import androidx.annotation.RequiresApi;
import androidx.preference.PreferenceManager;
import org.json.JSONArray;
import org.json.JSONException;
@@ -90,6 +90,7 @@ public class ApplicationEx extends Application {
}
});
upgrade(this);
createNotificationChannels();
if (Helper.hasWebView(this))
CookieManager.getInstance().setAcceptCookie(false);
@@ -118,6 +119,25 @@ public class ApplicationEx extends Application {
Log.i(message + " " + mb + " MB" + " " + perc + " %");
}
static void upgrade(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
int version = prefs.getInt("version", 468);
if (version < BuildConfig.VERSION_CODE) {
Log.i("Upgrading from " + version + " to " + BuildConfig.VERSION_CODE);
SharedPreferences.Editor editor = prefs.edit();
editor.remove("notify_trash");
editor.remove("notify_archive");
editor.remove("notify_reply");
editor.remove("notify_flag");
editor.remove("notify_seen");
editor.putInt("version", BuildConfig.VERSION_CODE);
editor.apply();
}
}
static Context getLocalizedContext(Context context) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean english = prefs.getBoolean("english", false);