54 lines
1.5 KiB
Java
54 lines
1.5 KiB
Java
package com.ubt.jimu.widgets.choosePhotos;
|
|
|
|
import com.ubt.jimu.widgets.choosePhotos.media.HPMedia;
|
|
import java.util.Comparator;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class HPMediaComparator implements Comparator<HPMedia> {
|
|
@Override // java.util.Comparator
|
|
/* renamed from: a, reason: merged with bridge method [inline-methods] */
|
|
public int compare(HPMedia hPMedia, HPMedia hPMedia2) {
|
|
String str;
|
|
if (hPMedia == null && hPMedia2 == null) {
|
|
return 0;
|
|
}
|
|
if (hPMedia == null) {
|
|
return 1;
|
|
}
|
|
if (hPMedia2 == null) {
|
|
return -1;
|
|
}
|
|
String str2 = null;
|
|
try {
|
|
str = hPMedia.getModifyDate();
|
|
} catch (Exception unused) {
|
|
str = null;
|
|
}
|
|
try {
|
|
str2 = hPMedia2.getModifyDate();
|
|
} catch (Exception unused2) {
|
|
}
|
|
if (str == null) {
|
|
return 1;
|
|
}
|
|
if (str2 == null) {
|
|
return -1;
|
|
}
|
|
if (str.equals(str2)) {
|
|
return 0;
|
|
}
|
|
if (!Utils.a(str) || !Utils.a(str2)) {
|
|
if (Utils.a(str) || Utils.a(str2)) {
|
|
return !Utils.a(str) ? 1 : -1;
|
|
}
|
|
return 0;
|
|
}
|
|
long parseLong = Long.parseLong(hPMedia.getModifyDate());
|
|
long parseLong2 = Long.parseLong(hPMedia2.getModifyDate());
|
|
if (parseLong == parseLong2) {
|
|
return 0;
|
|
}
|
|
return parseLong > parseLong2 ? -1 : 1;
|
|
}
|
|
}
|