From 6003cdfb7e5a0872edacc27595bc9118465024e7 Mon Sep 17 00:00:00 2001 From: Gregor Santner Date: Mon, 18 Jul 2016 13:25:10 +0200 Subject: [PATCH] Share screenshot fix; Minor Aspects rework --- .../diaspora_android/activity/MainActivity.java | 8 +++----- .../github/dfa/diaspora_android/util/Helpers.java | 14 ++++++-------- app/src/main/res/menu/main__navdrawer.xml | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java index fa0df4ca..09bb4e07 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/activity/MainActivity.java @@ -697,10 +697,9 @@ public class MainActivity extends AppCompatActivity Date dateNow = new Date(); DateFormat dateFormat = new SimpleDateFormat("yy_MM_dd--HH_mm_ss", Locale.getDefault()); - File fileSaveDirectory = new File(hasToShareScreenshot ? getCacheDir().getAbsolutePath() - : Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/Diaspora"); + File fileSaveDirectory = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/Diaspora"); - String fileSaveName = String.format("DfA_%s.jpg", hasToShareScreenshot ? "share" : dateFormat.format(dateNow)); + String fileSaveName = hasToShareScreenshot ? ".DfA_share.jpg" : String.format("DfA_%s.jpg", dateFormat.format(dateNow)); if (!fileSaveDirectory.exists()) { fileSaveDirectory.mkdirs(); } @@ -739,8 +738,7 @@ public class MainActivity extends AppCompatActivity Uri bmpUri = Uri.fromFile(new File(fileSaveDirectory, fileSaveName)); sharingIntent.putExtra(Intent.EXTRA_STREAM, bmpUri); startActivity(Intent.createChooser(sharingIntent, getString(R.string.share_dotdotdot))); - } - else { + } else { // Broadcast that this file is indexable File file = new File(fileSaveDirectory, fileSaveName); Uri uri = Uri.fromFile(file); diff --git a/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java b/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java index 6bd3ea51..133a2bf0 100644 --- a/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java +++ b/app/src/main/java/com/github/dfa/diaspora_android/util/Helpers.java @@ -95,19 +95,17 @@ public class Helpers { public static void showAspectList(final WebView wv, final App app) { wv.stopLoading(); PodUserProfile profile = app.getPodUserProfile(); - StringBuffer sb = new StringBuffer(); - int intColor = ContextCompat.getColor(app, R.color.colorAccent); - String strColor = String.format("#%06X", (0xFFFFFF & intColor)); + StringBuilder sb = new StringBuilder(); - sb.append("
"); - sb.append(String.format("

%s

", strColor, app.getString(R.string.jb_aspects))); - sb.append("
"); + sb.append(""); + // Content for (PodAspect aspect : profile.getAspects()) { - sb.append("»  "); + sb.append("»  "); sb.append(aspect.toHtmlLink(app)); - sb.append("

"); + sb.append("
"); } + // End sb.append(""); wv.loadData(sb.toString(), "text/html", "UTF-16"); diff --git a/app/src/main/res/menu/main__navdrawer.xml b/app/src/main/res/menu/main__navdrawer.xml index 1bf2b99e..0ffe8b5b 100644 --- a/app/src/main/res/menu/main__navdrawer.xml +++ b/app/src/main/res/menu/main__navdrawer.xml @@ -1,7 +1,7 @@ - +