mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
parent
900bd4ff2f
commit
6cbce9d283
8 changed files with 15 additions and 45 deletions
|
|
@ -55,13 +55,6 @@ public class DateUtils {
|
|||
}
|
||||
|
||||
public static String dateInLocaleFormat(Date date){
|
||||
String formatter;
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
formatter = new SimpleDateFormat(DateFormat.getBestDateTimePattern(Locale.getDefault(), "dd MMM yyyy"), Locale.getDefault()).format(date);
|
||||
}
|
||||
else {
|
||||
formatter = String.valueOf(new SimpleDateFormat("dd MMM yyyy", Locale.getDefault()));
|
||||
}
|
||||
return formatter;
|
||||
return new SimpleDateFormat(DateFormat.getBestDateTimePattern(Locale.getDefault(), "dd MMM yyyy"), Locale.getDefault()).format(date);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,9 +30,7 @@ public class DialogUtil {
|
|||
return;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
isActivityDestroyed = activity.isDestroyed();
|
||||
}
|
||||
isActivityDestroyed = activity.isDestroyed();
|
||||
if (activity.isFinishing() || isActivityDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -55,10 +53,7 @@ public class DialogUtil {
|
|||
return;
|
||||
}
|
||||
|
||||
boolean isActivityDestroyed = false;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
isActivityDestroyed = activity.isDestroyed();
|
||||
}
|
||||
boolean isActivityDestroyed = activity.isDestroyed();
|
||||
if (activity.isFinishing() || isActivityDestroyed) {
|
||||
Timber.e("Activity is not running. Could not show dialog. ");
|
||||
return;
|
||||
|
|
@ -83,9 +78,7 @@ public class DialogUtil {
|
|||
return;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
isActivityDestroyed = activity.isDestroyed();
|
||||
}
|
||||
isActivityDestroyed = activity.isDestroyed();
|
||||
if (activity.isFinishing() || isActivityDestroyed) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue