Adds description to media

This commit is contained in:
stom79 2017-10-27 16:00:54 +02:00
parent fb9e1e2521
commit 89562d900d
1 changed files with 7 additions and 23 deletions

View File

@ -58,7 +58,6 @@ import android.support.design.widget.NavigationView;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat; import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.text.Html; import android.text.Html;
import android.text.Spannable; import android.text.Spannable;
import android.text.SpannableString; import android.text.SpannableString;
@ -80,7 +79,6 @@ import android.webkit.WebSettings;
import android.webkit.WebView; import android.webkit.WebView;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -575,6 +573,7 @@ public class Helper {
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName); request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
DownloadManager dm = (DownloadManager) context.getSystemService(DOWNLOAD_SERVICE); DownloadManager dm = (DownloadManager) context.getSystemService(DOWNLOAD_SERVICE);
assert dm != null;
dm.enqueue(request); dm.enqueue(request);
dialog.dismiss(); dialog.dismiss();
} }
@ -750,8 +749,10 @@ public class Helper {
*/ */
public static void copy(File src, File dst) throws IOException { public static void copy(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src); InputStream in = new FileInputStream(src);
//noinspection TryFinallyCanBeTryWithResources
try { try {
OutputStream out = new FileOutputStream(dst); OutputStream out = new FileOutputStream(dst);
//noinspection TryFinallyCanBeTryWithResources
try { try {
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int len; int len;
@ -972,7 +973,7 @@ public class Helper {
@SuppressWarnings("SameParameterValue") @SuppressWarnings("SameParameterValue")
public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int roundPixelSize) { private static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int roundPixelSize) {
Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(output); Canvas canvas = new Canvas(output);
final Paint paint = new Paint(); final Paint paint = new Paint();
@ -1147,6 +1148,7 @@ public class Helper {
* @param mentions List<Mention> * @param mentions List<Mention>
* @return TextView * @return TextView
*/ */
@SuppressWarnings("SameParameterValue")
public static SpannableString clickableElements(final Context context, String fullContent, List<Mention> mentions, final List<Emojis> emojis, final int position, boolean useHTML, final OnRetrieveEmojiInterface listener) { public static SpannableString clickableElements(final Context context, String fullContent, List<Mention> mentions, final List<Emojis> emojis, final int position, boolean useHTML, final OnRetrieveEmojiInterface listener) {
final SpannableString spannableString; final SpannableString spannableString;
@ -1418,9 +1420,9 @@ public class Helper {
// Create Hex String // Create Hex String
StringBuilder hexString = new StringBuilder(); StringBuilder hexString = new StringBuilder();
for (byte aMessageDigest : messageDigest) { for (byte aMessageDigest : messageDigest) {
String h = Integer.toHexString(0xFF & aMessageDigest); StringBuilder h = new StringBuilder(Integer.toHexString(0xFF & aMessageDigest));
while (h.length() < 2) while (h.length() < 2)
h = "0" + h; h.insert(0, "0");
hexString.append(h); hexString.append(h);
} }
return hexString.toString(); return hexString.toString();
@ -1589,24 +1591,6 @@ public class Helper {
} }
} }
/**
* Returns true if a ListView is at its top position
* @param listView ListView
* @return boolean
*/
public static boolean listIsAtTop(RecyclerView listView) {
return listView.getChildCount() == 0 || listView.getChildAt(0).getTop() == 0;
}
/**
* Returns true if a ListView is at its top position
* @param listView ListView
* @return boolean
*/
public static boolean listIsAtTop(ListView listView) {
return listView.getChildCount() == 0 || listView.getChildAt(0).getTop() == 0;
}
/** /**
* Changes the menu layout * Changes the menu layout