mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-02-06 22:54:47 +01:00
Compare commits
No commits in common. "0b74574fa635defa46a7801ee99b0701dcfa0f78" and "f4c33e08e251da5eaedcf17f4a1139977e9a20f6" have entirely different histories.
0b74574fa6
...
f4c33e08e2
@ -554,6 +554,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy
|
|||||||
.into(((PostBaseViewHolder) holder).iconGifImageView);
|
.into(((PostBaseViewHolder) holder).iconGifImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (holder.getBindingAdapterPosition() >= 0) {
|
||||||
|
post.setSubredditIconUrl(iconUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (!post.getSubredditIconUrl().equals("")) {
|
} else if (!post.getSubredditIconUrl().equals("")) {
|
||||||
@ -1079,6 +1082,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy
|
|||||||
.into(((PostCompactBaseViewHolder) holder).iconGifImageView);
|
.into(((PostCompactBaseViewHolder) holder).iconGifImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (holder.getBindingAdapterPosition() >= 0) {
|
||||||
|
post.setSubredditIconUrl(iconUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (!post.getSubredditIconUrl().equals("")) {
|
} else if (!post.getSubredditIconUrl().equals("")) {
|
||||||
|
@ -172,8 +172,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
private boolean mHideUpvoteRatio;
|
private boolean mHideUpvoteRatio;
|
||||||
private boolean mHideTheNumberOfAwards;
|
private boolean mHideTheNumberOfAwards;
|
||||||
private boolean mHideSubredditAndUserPrefix;
|
private boolean mHideSubredditAndUserPrefix;
|
||||||
|
|
||||||
private boolean mShowDisplayNames;
|
|
||||||
private boolean mHideTheNumberOfVotes;
|
private boolean mHideTheNumberOfVotes;
|
||||||
|
|
||||||
private boolean mSeperateUpvoteAndDownvote;
|
private boolean mSeperateUpvoteAndDownvote;
|
||||||
@ -347,7 +345,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
mHideUpvoteRatio = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_UPVOTE_RATIO, false);
|
mHideUpvoteRatio = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_UPVOTE_RATIO, false);
|
||||||
mHideTheNumberOfAwards = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS, false);
|
mHideTheNumberOfAwards = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS, false);
|
||||||
mHideSubredditAndUserPrefix = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_SUBREDDIT_AND_USER_PREFIX, false);
|
mHideSubredditAndUserPrefix = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_SUBREDDIT_AND_USER_PREFIX, false);
|
||||||
mShowDisplayNames = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.POST_DETAIL_DISPLAY_NAME_INSTEAD_OF_USERNAME, true);
|
|
||||||
mHideTheNumberOfVotes = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_VOTES, false);
|
mHideTheNumberOfVotes = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_VOTES, false);
|
||||||
mHideDownvotes = !currentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, true);
|
mHideDownvotes = !currentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, true);
|
||||||
mSeperateUpvoteAndDownvote = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.POST_DETAIL_SEPARATE_UP_AND_DOWN_VOTES, true) && !mHideDownvotes;
|
mSeperateUpvoteAndDownvote = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.POST_DETAIL_SEPARATE_UP_AND_DOWN_VOTES, true) && !mHideDownvotes;
|
||||||
@ -531,6 +528,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((PostDetailBaseViewHolder) holder).mIconGifImageView);
|
.into(((PostDetailBaseViewHolder) holder).mIconGifImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mPost.setSubredditIconUrl(iconImageUrl);
|
||||||
});
|
});
|
||||||
} else if (!mPost.getSubredditIconUrl().equals("")) {
|
} else if (!mPost.getSubredditIconUrl().equals("")) {
|
||||||
mGlide.load(mPost.getSubredditIconUrl())
|
mGlide.load(mPost.getSubredditIconUrl())
|
||||||
@ -581,14 +580,13 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
|
|||||||
((PostDetailBaseViewHolder) holder).mCrosspostImageView.setVisibility(View.VISIBLE);
|
((PostDetailBaseViewHolder) holder).mCrosspostImageView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
((PostDetailBaseViewHolder) holder).mUserTextView.setText((mShowDisplayNames) ? mPost.getAuthor() : mPost.getAuthorInfo().getUsername());
|
|
||||||
((PostDetailBaseViewHolder) holder).mSubredditTextView.setText((mShowDisplayNames) ? mPost.getSubredditName() : mPost.getCommunityInfo().getName());
|
|
||||||
if (mHideSubredditAndUserPrefix) {
|
if (mHideSubredditAndUserPrefix) {
|
||||||
((PostDetailBaseViewHolder) holder).mUserTextView.setText((mShowDisplayNames) ? mPost.getAuthor() : mPost.getAuthorInfo().getUsername());
|
((PostDetailBaseViewHolder) holder).mSubredditTextView.setText(mPost.getSubredditName());
|
||||||
|
((PostDetailBaseViewHolder) holder).mUserTextView.setText(mPost.getAuthor());
|
||||||
} else {
|
} else {
|
||||||
((PostDetailBaseViewHolder) holder).mSubredditTextView.setText((mShowDisplayNames) ? mPost.getSubredditName() : mPost.getCommunityInfo().getName());
|
((PostDetailBaseViewHolder) holder).mSubredditTextView.setText(mPost.getSubredditName());
|
||||||
((PostDetailBaseViewHolder) holder).mCommunityInstanceTextView.setText('@' + mPost.getSubredditNamePrefixed().split(Pattern.quote("@"))[1]);
|
((PostDetailBaseViewHolder) holder).mCommunityInstanceTextView.setText('@' + mPost.getSubredditNamePrefixed().split(Pattern.quote("@"))[1]);
|
||||||
|
((PostDetailBaseViewHolder) holder).mUserTextView.setText(mPost.getAuthor());
|
||||||
((PostDetailBaseViewHolder) holder).mUserInstanceTextView.setText('@' + mPost.getAuthorNamePrefixed().split(Pattern.quote("@"))[1]);
|
((PostDetailBaseViewHolder) holder).mUserInstanceTextView.setText('@' + mPost.getAuthorNamePrefixed().split(Pattern.quote("@"))[1]);
|
||||||
((PostDetailBaseViewHolder) holder).mCommunityInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mSubredditColor, 0.7f));
|
((PostDetailBaseViewHolder) holder).mCommunityInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mSubredditColor, 0.7f));
|
||||||
((PostDetailBaseViewHolder) holder).mUserInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mPost.isModerator() || mPost.isAdmin() ? mModeratorColor : mUsernameColor, 0.7f));
|
((PostDetailBaseViewHolder) holder).mUserInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mPost.isModerator() || mPost.isAdmin() ? mModeratorColor : mUsernameColor, 0.7f));
|
||||||
|
@ -227,7 +227,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
private boolean mHidePostFlair;
|
private boolean mHidePostFlair;
|
||||||
private boolean mHideTheNumberOfAwards;
|
private boolean mHideTheNumberOfAwards;
|
||||||
private boolean mHideSubredditAndUserPrefix;
|
private boolean mHideSubredditAndUserPrefix;
|
||||||
private boolean mShowDisplayNames;
|
|
||||||
private boolean mHideTheNumberOfVotes;
|
private boolean mHideTheNumberOfVotes;
|
||||||
|
|
||||||
private boolean mSeparateUpandDownVotes;
|
private boolean mSeparateUpandDownVotes;
|
||||||
@ -314,7 +313,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
mHidePostFlair = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_POST_FLAIR, false);
|
mHidePostFlair = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_POST_FLAIR, false);
|
||||||
mHideTheNumberOfAwards = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS, false);
|
mHideTheNumberOfAwards = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS, false);
|
||||||
mHideSubredditAndUserPrefix = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_SUBREDDIT_AND_USER_PREFIX, false);
|
mHideSubredditAndUserPrefix = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_SUBREDDIT_AND_USER_PREFIX, false);
|
||||||
mShowDisplayNames = sharedPreferences.getBoolean(SharedPreferencesUtils.POST_DISPLAY_NAME_INSTEAD_OF_USERNAME, true);
|
|
||||||
mHideTheNumberOfVotes = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_VOTES, false);
|
mHideTheNumberOfVotes = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_VOTES, false);
|
||||||
mHideDownvotes = !currentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, true);
|
mHideDownvotes = !currentAccountSharedPreferences.getBoolean(SharedPreferencesUtils.CAN_DOWNVOTE, true);
|
||||||
mSeparateUpandDownVotes = sharedPreferences.getBoolean(SharedPreferencesUtils.POST_SEPARATE_UP_AND_DOWN_VOTES, true) && !mHideDownvotes;
|
mSeparateUpandDownVotes = sharedPreferences.getBoolean(SharedPreferencesUtils.POST_SEPARATE_UP_AND_DOWN_VOTES, true) && !mHideDownvotes;
|
||||||
@ -538,10 +536,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
}
|
}
|
||||||
String authorPrefixed = post.getAuthorNamePrefixed();
|
String authorPrefixed = post.getAuthorNamePrefixed();
|
||||||
|
|
||||||
((PostBaseViewHolder) holder).userTextView.setText((mShowDisplayNames) ? post.getAuthor() : post.getAuthorInfo().getUsername());
|
if (mHideSubredditAndUserPrefix) {
|
||||||
((PostBaseViewHolder) holder).subredditTextView.setText((mShowDisplayNames) ? post.getSubredditName() : post.getCommunityInfo().getName());
|
((PostBaseViewHolder) holder).subredditTextView.setText(post.getSubredditName());
|
||||||
if (!mHideSubredditAndUserPrefix) {
|
((PostBaseViewHolder) holder).userTextView.setText(post.getAuthor());
|
||||||
|
} else {
|
||||||
|
((PostBaseViewHolder) holder).subredditTextView.setText(post.getSubredditName());
|
||||||
((PostBaseViewHolder) holder).communityInstanceTextView.setText('@' + post.getSubredditNamePrefixed().split(Pattern.quote("@"))[1]);
|
((PostBaseViewHolder) holder).communityInstanceTextView.setText('@' + post.getSubredditNamePrefixed().split(Pattern.quote("@"))[1]);
|
||||||
|
((PostBaseViewHolder) holder).userTextView.setText(post.getAuthor());
|
||||||
((PostBaseViewHolder) holder).userInstanceTextView.setText('@' + post.getAuthorNamePrefixed().split(Pattern.quote("@"))[1]);
|
((PostBaseViewHolder) holder).userInstanceTextView.setText('@' + post.getAuthorNamePrefixed().split(Pattern.quote("@"))[1]);
|
||||||
((PostBaseViewHolder) holder).communityInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mSubredditColor, 0.7f));
|
((PostBaseViewHolder) holder).communityInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mSubredditColor, 0.7f));
|
||||||
((PostBaseViewHolder) holder).userInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(post.isModerator() || post.isAdmin() ? mModeratorColor : mUsernameColor, 0.7f));
|
((PostBaseViewHolder) holder).userInstanceTextView.setTextColor(CustomThemeWrapper.darkenColor(post.isModerator() || post.isAdmin() ? mModeratorColor : mUsernameColor, 0.7f));
|
||||||
@ -598,6 +599,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((PostBaseViewHolder) holder).iconGifImageView);
|
.into(((PostBaseViewHolder) holder).iconGifImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (holder.getBindingAdapterPosition() >= 0) {
|
||||||
|
post.setSubredditIconUrl(iconUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (!post.getSubredditIconUrl().equals("")) {
|
} else if (!post.getSubredditIconUrl().equals("")) {
|
||||||
@ -1186,6 +1191,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
.into(((PostCompactBaseViewHolder) holder).iconGifImageView);
|
.into(((PostCompactBaseViewHolder) holder).iconGifImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (holder.getBindingAdapterPosition() >= 0) {
|
||||||
|
post.setSubredditIconUrl(iconUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (!post.getSubredditIconUrl().equals("")) {
|
} else if (!post.getSubredditIconUrl().equals("")) {
|
||||||
@ -1202,8 +1210,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
|
|||||||
}
|
}
|
||||||
|
|
||||||
((PostCompactBaseViewHolder) holder).nameTextView.setTextColor(mSubredditColor);
|
((PostCompactBaseViewHolder) holder).nameTextView.setTextColor(mSubredditColor);
|
||||||
((PostCompactBaseViewHolder) holder).nameTextView.setText((mShowDisplayNames) ? post.getAuthor() : post.getAuthorInfo().getUsername());
|
if (mHideSubredditAndUserPrefix) {
|
||||||
if (!mHideSubredditAndUserPrefix) {
|
((PostCompactBaseViewHolder) holder).nameTextView.setText(post.getSubredditName());
|
||||||
|
} else {
|
||||||
|
((PostCompactBaseViewHolder) holder).nameTextView.setText(post.getSubredditName());
|
||||||
((PostCompactBaseViewHolder) holder).instanceTextView.setText('@' + post.getSubredditNamePrefixed().split(Pattern.quote("@"))[1]);
|
((PostCompactBaseViewHolder) holder).instanceTextView.setText('@' + post.getSubredditNamePrefixed().split(Pattern.quote("@"))[1]);
|
||||||
((PostCompactBaseViewHolder) holder).instanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mSubredditColor, 0.7f));
|
((PostCompactBaseViewHolder) holder).instanceTextView.setTextColor(CustomThemeWrapper.darkenColor(mSubredditColor, 0.7f));
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,7 @@ import java.util.concurrent.Executor;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import eu.toldi.infinityforlemmy.community.BasicCommunityInfo;
|
|
||||||
import eu.toldi.infinityforlemmy.postfilter.PostFilter;
|
import eu.toldi.infinityforlemmy.postfilter.PostFilter;
|
||||||
import eu.toldi.infinityforlemmy.user.BasicUserInfo;
|
|
||||||
import eu.toldi.infinityforlemmy.utils.JSONUtils;
|
import eu.toldi.infinityforlemmy.utils.JSONUtils;
|
||||||
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
import eu.toldi.infinityforlemmy.utils.LemmyUtils;
|
||||||
import eu.toldi.infinityforlemmy.utils.Utils;
|
import eu.toldi.infinityforlemmy.utils.Utils;
|
||||||
@ -190,25 +188,25 @@ public class ParsePost {
|
|||||||
boolean saved = data.getBoolean("saved");
|
boolean saved = data.getBoolean("saved");
|
||||||
String distinguished = (creator.getBoolean("admin") ? "admin" : "");
|
String distinguished = (creator.getBoolean("admin") ? "admin" : "");
|
||||||
String suggestedSort = "";
|
String suggestedSort = "";
|
||||||
ArrayList<Post.Preview> previews = new ArrayList<>();
|
ArrayList <Post.Preview> previews = new ArrayList<>();
|
||||||
if (!post.isNull("thumbnail_url")) {
|
if(!post.isNull("thumbnail_url")) {
|
||||||
String thumbnail = post.getString("thumbnail_url");
|
String thumbnail = post.getString("thumbnail_url");
|
||||||
//int[] wh_array = getImageDimension(thumbnail);
|
//int[] wh_array = getImageDimension(thumbnail);
|
||||||
previews.add(new Post.Preview(thumbnail, 0, 0, "", ""));
|
previews.add(new Post.Preview(thumbnail, 0, 0, "", ""));
|
||||||
}
|
}
|
||||||
BasicUserInfo authorInfo = new BasicUserInfo(creator.getInt("id"), author, authorFull, creator.optString("avatar", ""), creator.optString("display_name", author));
|
|
||||||
BasicCommunityInfo communityInfo = new BasicCommunityInfo(community.getInt("id"), subredditName, subredditNamePrefixed, community.optString("icon", ""), community.optString("title", subredditName));
|
|
||||||
|
|
||||||
return parseData(data, permalink, id, communityInfo,
|
|
||||||
authorInfo, postTimeMillis, title, previews,
|
return parseData(data, permalink, id, fullName, subredditName, subredditNamePrefixed,
|
||||||
downvotes, upvotes, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
author,authorFull, postTimeMillis, title, previews,
|
||||||
distinguished, suggestedSort);
|
downvotes,upvotes, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
||||||
|
distinguished, suggestedSort);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Post parseData(JSONObject data, String permalink, int id, BasicCommunityInfo communityInfo, BasicUserInfo author,
|
private static Post parseData(JSONObject data, String permalink, int id, String fullName,
|
||||||
|
String subredditName, String subredditNamePrefixed, String author, String authorFull,
|
||||||
long postTimeMillis, String title, ArrayList<Post.Preview> previews,
|
long postTimeMillis, String title, ArrayList<Post.Preview> previews,
|
||||||
int downvotes, int upvotes, int voteType, int nComments, int upvoteRatio,
|
int downvotes,int upvotes, int voteType, int nComments, int upvoteRatio,
|
||||||
boolean nsfw, boolean locked,
|
boolean nsfw, boolean locked,
|
||||||
boolean saved,
|
boolean saved,
|
||||||
String distinguished, String suggestedSort) throws JSONException {
|
String distinguished, String suggestedSort) throws JSONException {
|
||||||
@ -230,7 +228,7 @@ public class ParsePost {
|
|||||||
if (!data.getJSONObject("post").isNull("body") && url.equals("")) {
|
if (!data.getJSONObject("post").isNull("body") && url.equals("")) {
|
||||||
//Text post
|
//Text post
|
||||||
int postType = Post.TEXT_TYPE;
|
int postType = Post.TEXT_TYPE;
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, permalink, downvotes, upvotes,
|
postTimeMillis, title, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw,
|
postType, voteType, nComments, upvoteRatio, nsfw,
|
||||||
locked, saved, distinguished, suggestedSort);
|
locked, saved, distinguished, suggestedSort);
|
||||||
@ -243,9 +241,9 @@ public class ParsePost {
|
|||||||
//Image post
|
//Image post
|
||||||
int postType = Post.IMAGE_TYPE;
|
int postType = Post.IMAGE_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||||
|
|
||||||
if (previews.isEmpty()) {
|
if (previews.isEmpty()) {
|
||||||
previews.add(new Post.Preview(url, 0, 0, "", ""));
|
previews.add(new Post.Preview(url, 0, 0, "", ""));
|
||||||
@ -256,7 +254,7 @@ public class ParsePost {
|
|||||||
//No preview video post
|
//No preview video post
|
||||||
int postType = Post.VIDEO_TYPE;
|
int postType = Post.VIDEO_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author, postTimeMillis, title, permalink, downvotes, upvotes, postType, voteType,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull, postTimeMillis, title, permalink, downvotes,upvotes, postType, voteType,
|
||||||
nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||||
|
|
||||||
post.setVideoUrl(url);
|
post.setVideoUrl(url);
|
||||||
@ -264,7 +262,7 @@ public class ParsePost {
|
|||||||
} else if (!url.equals("")) {
|
} else if (!url.equals("")) {
|
||||||
//No preview link post
|
//No preview link post
|
||||||
int postType = Post.NO_PREVIEW_LINK_TYPE;
|
int postType = Post.NO_PREVIEW_LINK_TYPE;
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||||
if (data.isNull(JSONUtils.SELFTEXT_KEY)) {
|
if (data.isNull(JSONUtils.SELFTEXT_KEY)) {
|
||||||
@ -298,7 +296,7 @@ public class ParsePost {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int postType = Post.TEXT_TYPE;
|
int postType = Post.TEXT_TYPE;
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, permalink, downvotes, upvotes,
|
postTimeMillis, title, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw,
|
postType, voteType, nComments, upvoteRatio, nsfw,
|
||||||
locked, saved, distinguished, suggestedSort);
|
locked, saved, distinguished, suggestedSort);
|
||||||
@ -337,7 +335,7 @@ public class ParsePost {
|
|||||||
String videoUrl = Html.fromHtml(redditVideoObject.getString(JSONUtils.HLS_URL_KEY)).toString();
|
String videoUrl = Html.fromHtml(redditVideoObject.getString(JSONUtils.HLS_URL_KEY)).toString();
|
||||||
String videoDownloadUrl = redditVideoObject.getString(JSONUtils.FALLBACK_URL_KEY);
|
String videoDownloadUrl = redditVideoObject.getString(JSONUtils.FALLBACK_URL_KEY);
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author, postTimeMillis, title, permalink, downvotes, upvotes, postType, voteType,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull, postTimeMillis, title, permalink, downvotes, upvotes, postType, voteType,
|
||||||
nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||||
|
|
||||||
post.setPreviews(previews);
|
post.setPreviews(previews);
|
||||||
@ -348,8 +346,8 @@ public class ParsePost {
|
|||||||
//Image post
|
//Image post
|
||||||
int postType = Post.IMAGE_TYPE;
|
int postType = Post.IMAGE_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
authorFull, postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
||||||
distinguished, suggestedSort);
|
distinguished, suggestedSort);
|
||||||
|
|
||||||
@ -360,7 +358,7 @@ public class ParsePost {
|
|||||||
} else if (path.endsWith(".gif")) {
|
} else if (path.endsWith(".gif")) {
|
||||||
//Gif post
|
//Gif post
|
||||||
int postType = Post.GIF_TYPE;
|
int postType = Post.GIF_TYPE;
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio,
|
postType, voteType, nComments, upvoteRatio,
|
||||||
nsfw, locked, saved,
|
nsfw, locked, saved,
|
||||||
@ -376,7 +374,7 @@ public class ParsePost {
|
|||||||
url = url.substring(0, url.length() - 5) + ".mp4";
|
url = url.substring(0, url.length() - 5) + ".mp4";
|
||||||
}
|
}
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio,
|
postType, voteType, nComments, upvoteRatio,
|
||||||
nsfw, locked, saved,
|
nsfw, locked, saved,
|
||||||
@ -389,7 +387,7 @@ public class ParsePost {
|
|||||||
//Video post
|
//Video post
|
||||||
int postType = Post.VIDEO_TYPE;
|
int postType = Post.VIDEO_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
||||||
distinguished, suggestedSort);
|
distinguished, suggestedSort);
|
||||||
@ -400,7 +398,7 @@ public class ParsePost {
|
|||||||
//Link post
|
//Link post
|
||||||
int postType = Post.LINK_TYPE;
|
int postType = Post.LINK_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved,
|
||||||
distinguished, suggestedSort);
|
distinguished, suggestedSort);
|
||||||
@ -441,7 +439,7 @@ public class ParsePost {
|
|||||||
//Image post
|
//Image post
|
||||||
int postType = Post.IMAGE_TYPE;
|
int postType = Post.IMAGE_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||||
|
|
||||||
@ -453,7 +451,7 @@ public class ParsePost {
|
|||||||
//Video post
|
//Video post
|
||||||
int postType = Post.VIDEO_TYPE;
|
int postType = Post.VIDEO_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||||
post.setPreviews(previews);
|
post.setPreviews(previews);
|
||||||
@ -463,9 +461,9 @@ public class ParsePost {
|
|||||||
//CP No Preview Link post
|
//CP No Preview Link post
|
||||||
int postType = Post.NO_PREVIEW_LINK_TYPE;
|
int postType = Post.NO_PREVIEW_LINK_TYPE;
|
||||||
|
|
||||||
post = new Post(id, communityInfo, author,
|
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,authorFull,
|
||||||
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
postTimeMillis, title, url, permalink, downvotes, upvotes,
|
||||||
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
postType, voteType, nComments, upvoteRatio, nsfw, locked, saved, distinguished, suggestedSort);
|
||||||
//Need attention
|
//Need attention
|
||||||
if (data.isNull(JSONUtils.SELFTEXT_KEY)) {
|
if (data.isNull(JSONUtils.SELFTEXT_KEY)) {
|
||||||
post.setSelfText("");
|
post.setSelfText("");
|
||||||
@ -581,7 +579,7 @@ public class ParsePost {
|
|||||||
singleGalleryObject.getJSONObject(JSONUtils.S_KEY).getInt(JSONUtils.Y_KEY), galleryItemCaption, galleryItemCaptionUrl));
|
singleGalleryObject.getJSONObject(JSONUtils.S_KEY).getInt(JSONUtils.Y_KEY), galleryItemCaption, galleryItemCaptionUrl));
|
||||||
}
|
}
|
||||||
|
|
||||||
Post.Gallery postGalleryItem = new Post.Gallery(mimeType, galleryItemUrl, "", communityInfo.getDisplayName() + "-" + galleryId + "." + mimeType.substring(mimeType.lastIndexOf("/") + 1), galleryItemCaption, galleryItemCaptionUrl);
|
Post.Gallery postGalleryItem = new Post.Gallery(mimeType, galleryItemUrl, "", subredditName + "-" + galleryId + "." + mimeType.substring(mimeType.lastIndexOf("/") + 1), galleryItemCaption, galleryItemCaptionUrl);
|
||||||
|
|
||||||
// For issue #558
|
// For issue #558
|
||||||
// Construct a fallback image url
|
// Construct a fallback image url
|
||||||
@ -677,8 +675,8 @@ public class ParsePost {
|
|||||||
if (data.getJSONObject("post").getBoolean("featured_local")) {
|
if (data.getJSONObject("post").getBoolean("featured_local")) {
|
||||||
post.setFeaturedOnInstance(true);
|
post.setFeaturedOnInstance(true);
|
||||||
}
|
}
|
||||||
|
post.setAuthorIconUrl(authorAvatar);
|
||||||
|
post.setSubredditIconUrl(communityURL);
|
||||||
return post;
|
return post;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,9 +8,6 @@ import androidx.annotation.Nullable;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import eu.toldi.infinityforlemmy.community.BasicCommunityInfo;
|
|
||||||
import eu.toldi.infinityforlemmy.user.BasicUserInfo;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by alex on 3/1/18.
|
* Created by alex on 3/1/18.
|
||||||
*/
|
*/
|
||||||
@ -36,8 +33,13 @@ public class Post implements Parcelable {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
private int id;
|
private int id;
|
||||||
private BasicCommunityInfo communityInfo;
|
private String fullName;
|
||||||
private BasicUserInfo author;
|
private String subredditName;
|
||||||
|
private String subredditNamePrefixed;
|
||||||
|
private String subredditIconUrl;
|
||||||
|
private String author;
|
||||||
|
private String authorNamePrefixed;
|
||||||
|
private String authorIconUrl;
|
||||||
private String title;
|
private String title;
|
||||||
private String selfText;
|
private String selfText;
|
||||||
private String selfTextPlain;
|
private String selfTextPlain;
|
||||||
@ -78,15 +80,18 @@ public class Post implements Parcelable {
|
|||||||
private ArrayList<Preview> previews = new ArrayList<>();
|
private ArrayList<Preview> previews = new ArrayList<>();
|
||||||
private ArrayList<Gallery> gallery = new ArrayList<>();
|
private ArrayList<Gallery> gallery = new ArrayList<>();
|
||||||
|
|
||||||
public Post(int id, BasicCommunityInfo communityInfo,
|
public Post(int id, String fullName, String subredditName, String subredditNamePrefixed,
|
||||||
BasicUserInfo userInfo, long postTimeMillis,
|
String author,String authorNamePrefixed, long postTimeMillis,
|
||||||
String title, String permalink, int downvotes, int upvotes, int postType, int voteType, int nComments,
|
String title, String permalink, int downvotes,int upvotes, int postType, int voteType, int nComments,
|
||||||
int upvoteRatio,
|
int upvoteRatio,
|
||||||
boolean nsfw, boolean locked, boolean saved,
|
boolean nsfw, boolean locked, boolean saved,
|
||||||
String distinguished, String suggestedSort) {
|
String distinguished, String suggestedSort) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.communityInfo = communityInfo;
|
this.fullName = fullName;
|
||||||
this.author = userInfo;
|
this.subredditName = subredditName;
|
||||||
|
this.subredditNamePrefixed = subredditNamePrefixed;
|
||||||
|
this.author = author;
|
||||||
|
this.authorNamePrefixed = authorNamePrefixed;
|
||||||
this.postTimeMillis = postTimeMillis;
|
this.postTimeMillis = postTimeMillis;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.permalink = permalink;
|
this.permalink = permalink;
|
||||||
@ -107,14 +112,17 @@ public class Post implements Parcelable {
|
|||||||
isRead = false;
|
isRead = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Post(int id, BasicCommunityInfo communityInfo,
|
public Post(int id, String fullName, String subredditName, String subredditNamePrefixed,
|
||||||
BasicUserInfo author, long postTimeMillis, String title,
|
String author, String authorNamePrefixed, long postTimeMillis, String title,
|
||||||
String url, String permalink, int downvotes, int upvotes, int postType, int voteType, int nComments,
|
String url, String permalink, int downvotes,int upvotes, int postType, int voteType, int nComments,
|
||||||
int upvoteRatio,
|
int upvoteRatio,
|
||||||
boolean nsfw, boolean locked, boolean saved, String distinguished, String suggestedSort) {
|
boolean nsfw, boolean locked, boolean saved, String distinguished, String suggestedSort) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.communityInfo = communityInfo;
|
this.fullName = fullName;
|
||||||
|
this.subredditName = subredditName;
|
||||||
|
this.subredditNamePrefixed = subredditNamePrefixed;
|
||||||
this.author = author;
|
this.author = author;
|
||||||
|
this.authorNamePrefixed = authorNamePrefixed;
|
||||||
this.postTimeMillis = postTimeMillis;
|
this.postTimeMillis = postTimeMillis;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.url = url;
|
this.url = url;
|
||||||
@ -138,8 +146,13 @@ public class Post implements Parcelable {
|
|||||||
|
|
||||||
protected Post(Parcel in) {
|
protected Post(Parcel in) {
|
||||||
id = in.readInt();
|
id = in.readInt();
|
||||||
communityInfo = in.readParcelable(BasicCommunityInfo.class.getClassLoader());
|
fullName = in.readString();
|
||||||
author = in.readParcelable(BasicUserInfo.class.getClassLoader());
|
subredditName = in.readString();
|
||||||
|
subredditNamePrefixed = in.readString();
|
||||||
|
subredditIconUrl = in.readString();
|
||||||
|
author = in.readString();
|
||||||
|
authorNamePrefixed = in.readString();
|
||||||
|
authorIconUrl = in.readString();
|
||||||
postTimeMillis = in.readLong();
|
postTimeMillis = in.readLong();
|
||||||
title = in.readString();
|
title = in.readString();
|
||||||
selfText = in.readString();
|
selfText = in.readString();
|
||||||
@ -182,24 +195,27 @@ public class Post implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getFullName() {
|
public String getFullName() {
|
||||||
return communityInfo.getQualifiedName();
|
return fullName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubredditName() {
|
public String getSubredditName() {
|
||||||
return communityInfo.getDisplayName();
|
return subredditName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubredditNamePrefixed() {
|
public String getSubredditNamePrefixed() {
|
||||||
return communityInfo.getQualifiedName();
|
return subredditNamePrefixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubredditIconUrl() {
|
public String getSubredditIconUrl() {
|
||||||
return communityInfo.getIcon();
|
return subredditIconUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setSubredditIconUrl(String subredditIconUrl) {
|
||||||
|
this.subredditIconUrl = subredditIconUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getAuthor() {
|
public String getAuthor() {
|
||||||
return author.getDisplayName();
|
return author;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAuthorDeleted() {
|
public boolean isAuthorDeleted() {
|
||||||
@ -207,19 +223,20 @@ public class Post implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setAuthor(String author) {
|
public void setAuthor(String author) {
|
||||||
|
this.author = author;
|
||||||
|
this.authorNamePrefixed = "u/" + author;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAuthorNamePrefixed() {
|
public String getAuthorNamePrefixed() {
|
||||||
return author.getQualifiedName();
|
return authorNamePrefixed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAuthorIconUrl() {
|
public String getAuthorIconUrl() {
|
||||||
return (author.getAvatar() == null) ? "" : author.getAvatar();
|
return authorIconUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAuthorIconUrl(String authorIconUrl) {
|
public void setAuthorIconUrl(String authorIconUrl) {
|
||||||
|
this.authorIconUrl = authorIconUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getPostTimeMillis() {
|
public long getPostTimeMillis() {
|
||||||
@ -495,19 +512,16 @@ public class Post implements Parcelable {
|
|||||||
this.gallery = gallery;
|
this.gallery = gallery;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasicCommunityInfo getCommunityInfo() {
|
|
||||||
return communityInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BasicUserInfo getAuthorInfo() {
|
|
||||||
return author;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeToParcel(Parcel parcel, int i) {
|
public void writeToParcel(Parcel parcel, int i) {
|
||||||
parcel.writeInt(id);
|
parcel.writeInt(id);
|
||||||
parcel.writeParcelable(communityInfo, i);
|
parcel.writeString(fullName);
|
||||||
parcel.writeParcelable(author, i);
|
parcel.writeString(subredditName);
|
||||||
|
parcel.writeString(subredditNamePrefixed);
|
||||||
|
parcel.writeString(subredditIconUrl);
|
||||||
|
parcel.writeString(author);
|
||||||
|
parcel.writeString(authorNamePrefixed);
|
||||||
|
parcel.writeString(authorIconUrl);
|
||||||
parcel.writeLong(postTimeMillis);
|
parcel.writeLong(postTimeMillis);
|
||||||
parcel.writeString(title);
|
parcel.writeString(title);
|
||||||
parcel.writeString(selfText);
|
parcel.writeString(selfText);
|
||||||
|
@ -54,10 +54,6 @@ public class SharedPreferencesUtils {
|
|||||||
|
|
||||||
public static final String COMMENT_SEPARATE_UP_AND_DOWN_VOTES = "comment_separate_down_and_up_votes";
|
public static final String COMMENT_SEPARATE_UP_AND_DOWN_VOTES = "comment_separate_down_and_up_votes";
|
||||||
|
|
||||||
public static final String POST_DISPLAY_NAME_INSTEAD_OF_USERNAME = "post_display_name_instead_of_user_name";
|
|
||||||
|
|
||||||
public static final String POST_DETAIL_DISPLAY_NAME_INSTEAD_OF_USERNAME = "post_detail_display_name_instead_of_user_name";
|
|
||||||
|
|
||||||
public static final String SORT_TYPE_SHARED_PREFERENCES_FILE = "eu.toldi.infinityforlemmy.sort_type";
|
public static final String SORT_TYPE_SHARED_PREFERENCES_FILE = "eu.toldi.infinityforlemmy.sort_type";
|
||||||
public static final String SORT_TYPE_BEST_POST = "sort_type_best_post";
|
public static final String SORT_TYPE_BEST_POST = "sort_type_best_post";
|
||||||
public static final String SORT_TIME_BEST_POST = "sort_time_best_post";
|
public static final String SORT_TIME_BEST_POST = "sort_time_best_post";
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
package eu.toldi.infinityforlemmy.community
|
|
||||||
|
|
||||||
import android.os.Parcel
|
|
||||||
import android.os.Parcelable
|
|
||||||
|
|
||||||
data class BasicCommunityInfo(
|
|
||||||
val id: Int,
|
|
||||||
val name: String,
|
|
||||||
val qualifiedName: String,
|
|
||||||
val icon: String?,
|
|
||||||
val displayName: String
|
|
||||||
) : Parcelable {
|
|
||||||
constructor(parcel: Parcel) : this(
|
|
||||||
parcel.readInt(),
|
|
||||||
parcel.readString()!!,
|
|
||||||
parcel.readString()!!,
|
|
||||||
parcel.readString(),
|
|
||||||
parcel.readString()!!
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
|
||||||
parcel.writeInt(id)
|
|
||||||
parcel.writeString(name)
|
|
||||||
parcel.writeString(qualifiedName)
|
|
||||||
parcel.writeString(icon)
|
|
||||||
parcel.writeString(displayName)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun describeContents(): Int {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object CREATOR : Parcelable.Creator<BasicCommunityInfo> {
|
|
||||||
override fun createFromParcel(parcel: Parcel): BasicCommunityInfo {
|
|
||||||
return BasicCommunityInfo(parcel)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun newArray(size: Int): Array<BasicCommunityInfo?> {
|
|
||||||
return arrayOfNulls(size)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
package eu.toldi.infinityforlemmy.user
|
|
||||||
|
|
||||||
import android.os.Parcel
|
|
||||||
import android.os.Parcelable
|
|
||||||
|
|
||||||
data class BasicUserInfo(
|
|
||||||
val id: Int,
|
|
||||||
val username: String,
|
|
||||||
val qualifiedName: String,
|
|
||||||
val avatar: String?,
|
|
||||||
val displayName: String
|
|
||||||
) : Parcelable {
|
|
||||||
constructor(parcel: Parcel) : this(
|
|
||||||
parcel.readInt(),
|
|
||||||
parcel.readString()!!,
|
|
||||||
parcel.readString()!!,
|
|
||||||
parcel.readString(),
|
|
||||||
parcel.readString()!!
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun writeToParcel(parcel: Parcel, flags: Int) {
|
|
||||||
parcel.writeInt(id)
|
|
||||||
parcel.writeString(username)
|
|
||||||
parcel.writeString(qualifiedName)
|
|
||||||
parcel.writeString(avatar)
|
|
||||||
parcel.writeString(displayName)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun describeContents(): Int {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object CREATOR : Parcelable.Creator<BasicUserInfo> {
|
|
||||||
override fun createFromParcel(parcel: Parcel): BasicUserInfo {
|
|
||||||
return BasicUserInfo(parcel)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun newArray(size: Int): Array<BasicUserInfo?> {
|
|
||||||
return arrayOfNulls(size)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1365,6 +1365,4 @@
|
|||||||
<string name="action_unblock_user">Unblock User</string>
|
<string name="action_unblock_user">Unblock User</string>
|
||||||
<string name="unblock_user_success">Unblocked</string>
|
<string name="unblock_user_success">Unblocked</string>
|
||||||
<string name="unblock_user_failed">Failed to unblock user</string>
|
<string name="unblock_user_failed">Failed to unblock user</string>
|
||||||
<string name="settings_hide_community_and_user_instance">Hide community and user instance</string>
|
|
||||||
<string name="settings_show_display_name_instead_of_user_name">Show community and user display names</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -25,13 +25,7 @@
|
|||||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||||
app:defaultValue="false"
|
app:defaultValue="false"
|
||||||
app:key="hide_subreddit_and_user_prefix"
|
app:key="hide_subreddit_and_user_prefix"
|
||||||
app:title="@string/settings_hide_community_and_user_instance" />
|
app:title="@string/settings_hide_community_and_user_prefix" />
|
||||||
|
|
||||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
|
||||||
app:defaultValue="true"
|
|
||||||
app:key="post_detail_display_name_instead_of_user_name"
|
|
||||||
app:title="@string/settings_show_display_name_instead_of_user_name" />
|
|
||||||
|
|
||||||
|
|
||||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||||
app:defaultValue="false"
|
app:defaultValue="false"
|
||||||
|
@ -31,12 +31,7 @@
|
|||||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||||
app:defaultValue="false"
|
app:defaultValue="false"
|
||||||
app:key="hide_subreddit_and_user_prefix"
|
app:key="hide_subreddit_and_user_prefix"
|
||||||
app:title="@string/settings_hide_community_and_user_instance" />
|
app:title="@string/settings_hide_community_and_user_prefix" />
|
||||||
|
|
||||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
|
||||||
app:defaultValue="true"
|
|
||||||
app:key="post_display_name_instead_of_user_name"
|
|
||||||
app:title="@string/settings_show_display_name_instead_of_user_name" />
|
|
||||||
|
|
||||||
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
|
||||||
app:defaultValue="false"
|
app:defaultValue="false"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user