mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-02-27 16:23:57 +01:00
Fix issue related to loading community data
In some cases loading the creation date of the community made the app crash. Now it has been resolved.
This commit is contained in:
parent
a8d63c7480
commit
252e00b67a
@ -542,7 +542,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
if (mDisplaySubredditName) {
|
||||
if (authorPrefixed.equals(post.getSubredditNamePrefixed())) {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
mFragment.loadIcon(post.getAuthor(), false, (subredditOrUserName, iconUrl) -> {
|
||||
mFragment.loadIcon(post.getAuthorNamePrefixed(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && post.getAuthor().equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@ -608,7 +608,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
} else {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
String authorName = post.isAuthorDeleted() ? post.getSubredditName() : post.getAuthor();
|
||||
mFragment.loadIcon(authorName, post.isAuthorDeleted(), (subredditOrUserName, iconUrl) -> {
|
||||
mFragment.loadIcon(post.getSubredditNamePrefixed(), post.isAuthorDeleted(), (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0) {
|
||||
if (iconUrl == null || iconUrl.equals("") && authorName.equals(subredditOrUserName)) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
@ -1109,8 +1109,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
if (mDisplaySubredditName) {
|
||||
if (authorPrefixed.equals(subredditNamePrefixed)) {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
mFragment.loadIcon(post.getAuthor(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && post.getAuthor().equals(subredditOrUserName)) {
|
||||
mFragment.loadIcon(post.getAuthorNamePrefixed(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && post.getAuthorNamePrefixed().equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||
@ -1181,8 +1181,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
||||
}
|
||||
} else {
|
||||
if (post.getAuthorIconUrl() == null) {
|
||||
String authorName = post.getSubredditName();
|
||||
mFragment.loadIcon(authorName, post.isAuthorDeleted(), (subredditOrUserName, iconUrl) -> {
|
||||
String authorName = post.getAuthorNamePrefixed();
|
||||
mFragment.loadIcon(post.getAuthorNamePrefixed(), false, (subredditOrUserName, iconUrl) -> {
|
||||
if (mActivity != null && getItemCount() > 0 && authorName.equals(subredditOrUserName)) {
|
||||
if (iconUrl == null || iconUrl.equals("")) {
|
||||
mGlide.load(R.drawable.subreddit_default_icon)
|
||||
|
@ -182,13 +182,13 @@ public class ParseSubredditData {
|
||||
|
||||
public static String formatISOTime(String isoTime) {
|
||||
// Truncate the time to millisecond precision
|
||||
String truncatedTime = isoTime.substring(0, 23);
|
||||
//String truncatedTime = isoTime.substring(0, 23);
|
||||
|
||||
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US);
|
||||
isoFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
|
||||
try {
|
||||
Date date = isoFormat.parse(truncatedTime);
|
||||
Date date = isoFormat.parse(isoTime);
|
||||
|
||||
// Set your desired output format here
|
||||
SimpleDateFormat outputFormat = new SimpleDateFormat("MMM dd, yyyy HH:mm:ss", Locale.US);
|
||||
|
Loading…
x
Reference in New Issue
Block a user