1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2025-09-10 10:49:42 +02:00

Fix lint warnings in opoc ; update langprefs; more power for contextutils

This commit is contained in:
Gregor Santner 2017-10-31 14:18:52 +01:00
parent d1c4e68df3
commit 0393bf274f
No known key found for this signature in database
GPG key ID: 7E83A7834AECB009
2 changed files with 18 additions and 6 deletions

View file

@ -54,7 +54,6 @@ import android.text.SpannableString;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ForegroundColorSpan;
import android.util.DisplayMetrics;
import android.view.Menu;
import android.view.MenuItem;
@ -446,7 +445,7 @@ public class ContextUtils {
public File writeImageToFileDetectFormat(File imageFile, Bitmap image, int quality) {
CompressFormat format = CompressFormat.JPEG;
String lc = imageFile.getAbsolutePath().toLowerCase();
String lc = imageFile.getAbsolutePath().toLowerCase(Locale.ROOT);
if (lc.endsWith(".png")) {
format = CompressFormat.PNG;
}
@ -544,4 +543,18 @@ public class ContextUtils {
}
return this;
}
public void showRateOnGplayDialog() {
String pkgId = "details?id=" + _context.getPackageName();
Intent goToMarket = new Intent(Intent.ACTION_VIEW, Uri.parse("market://" + pkgId));
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
(Build.VERSION.SDK_INT >= 21 ? Intent.FLAG_ACTIVITY_NEW_DOCUMENT : Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET) |
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
try {
_context.startActivity(goToMarket);
} catch (ActivityNotFoundException e) {
_context.startActivity(new Intent(Intent.ACTION_VIEW,
Uri.parse("http://play.google.com/store/apps/" + pkgId)));
}
}
}