mirror of
https://github.com/gsantner/dandelion
synced 2024-11-22 12:22:08 +01:00
Share screenshot fix; Minor Aspects rework
This commit is contained in:
parent
a1962a723d
commit
6003cdfb7e
3 changed files with 10 additions and 14 deletions
|
@ -697,10 +697,9 @@ public class MainActivity extends AppCompatActivity
|
||||||
|
|
||||||
Date dateNow = new Date();
|
Date dateNow = new Date();
|
||||||
DateFormat dateFormat = new SimpleDateFormat("yy_MM_dd--HH_mm_ss", Locale.getDefault());
|
DateFormat dateFormat = new SimpleDateFormat("yy_MM_dd--HH_mm_ss", Locale.getDefault());
|
||||||
File fileSaveDirectory = new File(hasToShareScreenshot ? getCacheDir().getAbsolutePath()
|
File fileSaveDirectory = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) + "/Diaspora");
|
||||||
: 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()) {
|
if (!fileSaveDirectory.exists()) {
|
||||||
fileSaveDirectory.mkdirs();
|
fileSaveDirectory.mkdirs();
|
||||||
}
|
}
|
||||||
|
@ -739,8 +738,7 @@ public class MainActivity extends AppCompatActivity
|
||||||
Uri bmpUri = Uri.fromFile(new File(fileSaveDirectory, fileSaveName));
|
Uri bmpUri = Uri.fromFile(new File(fileSaveDirectory, fileSaveName));
|
||||||
sharingIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
|
sharingIntent.putExtra(Intent.EXTRA_STREAM, bmpUri);
|
||||||
startActivity(Intent.createChooser(sharingIntent, getString(R.string.share_dotdotdot)));
|
startActivity(Intent.createChooser(sharingIntent, getString(R.string.share_dotdotdot)));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Broadcast that this file is indexable
|
// Broadcast that this file is indexable
|
||||||
File file = new File(fileSaveDirectory, fileSaveName);
|
File file = new File(fileSaveDirectory, fileSaveName);
|
||||||
Uri uri = Uri.fromFile(file);
|
Uri uri = Uri.fromFile(file);
|
||||||
|
|
|
@ -95,19 +95,17 @@ public class Helpers {
|
||||||
public static void showAspectList(final WebView wv, final App app) {
|
public static void showAspectList(final WebView wv, final App app) {
|
||||||
wv.stopLoading();
|
wv.stopLoading();
|
||||||
PodUserProfile profile = app.getPodUserProfile();
|
PodUserProfile profile = app.getPodUserProfile();
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuilder sb = new StringBuilder();
|
||||||
int intColor = ContextCompat.getColor(app, R.color.colorAccent);
|
|
||||||
String strColor = String.format("#%06X", (0xFFFFFF & intColor));
|
sb.append("<html><body style='margin-top: 25px; margin-left:auto;margin-right:auto; font-size: 400%;'>");
|
||||||
|
|
||||||
sb.append("<html><body style='width:80%; margin-left:auto;margin-right:auto; font-size: 400%;'><center><b>");
|
|
||||||
sb.append(String.format("<h1 style='color: %s; text-shadow: 4px 4px 12px #000000;'>%s</h1>", strColor, app.getString(R.string.jb_aspects)));
|
|
||||||
sb.append("</b></center>");
|
|
||||||
// Content
|
// Content
|
||||||
for (PodAspect aspect : profile.getAspects()) {
|
for (PodAspect aspect : profile.getAspects()) {
|
||||||
sb.append("» ");
|
sb.append("<span style='margin-left: 30px; '></span>» ");
|
||||||
sb.append(aspect.toHtmlLink(app));
|
sb.append(aspect.toHtmlLink(app));
|
||||||
sb.append("</br></br>");
|
sb.append("<hr style='height:5px;' />");
|
||||||
}
|
}
|
||||||
|
|
||||||
// End
|
// End
|
||||||
sb.append("</body></html>");
|
sb.append("</body></html>");
|
||||||
wv.loadData(sb.toString(), "text/html", "UTF-16");
|
wv.loadData(sb.toString(), "text/html", "UTF-16");
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<group android:checkableBehavior="single">
|
<group android:checkableBehavior="none">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_stream"
|
android:id="@+id/nav_stream"
|
||||||
android:icon="@drawable/jb_stream"
|
android:icon="@drawable/jb_stream"
|
||||||
|
|
Loading…
Reference in a new issue