mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-26 02:48:23 +01:00
Fixed UI in dark theme. Minor bugs fixed.
This commit is contained in:
parent
70e65565ae
commit
44e2987a84
@ -166,16 +166,16 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
|
|||||||
if(mPost.getAuthorIconUrl() == null) {
|
if(mPost.getAuthorIconUrl() == null) {
|
||||||
new LoadUserDataAsyncTask(UserRoomDatabase.getDatabase(mActivity).userDao(), mPost.getAuthor(), mOauthRetrofit, iconImageUrl -> {
|
new LoadUserDataAsyncTask(UserRoomDatabase.getDatabase(mActivity).userDao(), mPost.getAuthor(), mOauthRetrofit, iconImageUrl -> {
|
||||||
if(mActivity != null && getItemCount() > 0) {
|
if(mActivity != null && getItemCount() > 0) {
|
||||||
if(!iconImageUrl.equals("")) {
|
if(iconImageUrl == null || iconImageUrl.equals("")) {
|
||||||
|
mGlide.load(R.drawable.subreddit_default_icon)
|
||||||
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
|
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
||||||
|
} else {
|
||||||
mGlide.load(iconImageUrl)
|
mGlide.load(iconImageUrl)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
||||||
} else {
|
|
||||||
mGlide.load(R.drawable.subreddit_default_icon)
|
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
|
||||||
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(holder.getAdapterPosition() >= 0) {
|
if(holder.getAdapterPosition() >= 0) {
|
||||||
@ -202,16 +202,16 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
|
|||||||
mLoadSubredditIconAsyncTask = new LoadSubredditIconAsyncTask(
|
mLoadSubredditIconAsyncTask = new LoadSubredditIconAsyncTask(
|
||||||
SubredditRoomDatabase.getDatabase(mActivity).subredditDao(), mPost.getSubredditNamePrefixed().substring(2),
|
SubredditRoomDatabase.getDatabase(mActivity).subredditDao(), mPost.getSubredditNamePrefixed().substring(2),
|
||||||
mRetrofit, iconImageUrl -> {
|
mRetrofit, iconImageUrl -> {
|
||||||
if(!iconImageUrl.equals("")) {
|
if(iconImageUrl == null || iconImageUrl.equals("")) {
|
||||||
|
mGlide.load(R.drawable.subreddit_default_icon)
|
||||||
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
|
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
||||||
|
} else {
|
||||||
mGlide.load(iconImageUrl)
|
mGlide.load(iconImageUrl)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
.error(mGlide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
||||||
} else {
|
|
||||||
mGlide.load(R.drawable.subreddit_default_icon)
|
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
|
||||||
.into(((PostDetailViewHolder) holder).mIconGifImageView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mPost.setSubredditIconUrl(iconImageUrl);
|
mPost.setSubredditIconUrl(iconImageUrl);
|
||||||
|
@ -138,7 +138,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
final String id = post.getFullName();
|
final String id = post.getFullName();
|
||||||
final String subredditNamePrefixed = post.getSubredditNamePrefixed();
|
final String subredditNamePrefixed = post.getSubredditNamePrefixed();
|
||||||
String subredditName = subredditNamePrefixed.substring(2);
|
String subredditName = subredditNamePrefixed.substring(2);
|
||||||
String author = "u/" + post.getAuthor();
|
String authorPrefixed = "u/" + post.getAuthor();
|
||||||
final String postTime = post.getPostTime();
|
final String postTime = post.getPostTime();
|
||||||
final String title = post.getTitle();
|
final String title = post.getTitle();
|
||||||
final String permalink = post.getPermalink();
|
final String permalink = post.getPermalink();
|
||||||
@ -161,20 +161,20 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(displaySubredditName) {
|
if(displaySubredditName) {
|
||||||
if(author.equals(subredditNamePrefixed)) {
|
if(authorPrefixed.equals(subredditNamePrefixed)) {
|
||||||
if(post.getAuthorIconUrl() == null) {
|
if(post.getAuthorIconUrl() == null) {
|
||||||
new LoadUserDataAsyncTask(userDao, post.getAuthor(), mRetrofit, iconImageUrl -> {
|
new LoadUserDataAsyncTask(userDao, post.getAuthor(), mRetrofit, iconImageUrl -> {
|
||||||
if(mContext != null && getItemCount() > 0) {
|
if(mContext != null && getItemCount() > 0) {
|
||||||
if(!iconImageUrl.equals("")) {
|
if(iconImageUrl == null || iconImageUrl.equals("")) {
|
||||||
|
glide.load(R.drawable.subreddit_default_icon)
|
||||||
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
|
} else {
|
||||||
glide.load(iconImageUrl)
|
glide.load(iconImageUrl)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(glide.load(R.drawable.subreddit_default_icon)
|
.error(glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
} else {
|
|
||||||
glide.load(R.drawable.subreddit_default_icon)
|
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(holder.getAdapterPosition() >= 0) {
|
if(holder.getAdapterPosition() >= 0) {
|
||||||
@ -187,29 +187,27 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(glide.load(R.drawable.subreddit_default_icon)
|
.error(glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
} else {
|
} else {
|
||||||
glide.load(R.drawable.subreddit_default_icon)
|
glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(post.getSubredditIconUrl() == null) {
|
if(post.getSubredditIconUrl() == null) {
|
||||||
new LoadSubredditIconAsyncTask(subredditDao, subredditName, mRetrofit,
|
new LoadSubredditIconAsyncTask(subredditDao, subredditName, mRetrofit,
|
||||||
iconImageUrl -> {
|
iconImageUrl -> {
|
||||||
if(mContext != null && getItemCount() > 0) {
|
if(mContext != null && getItemCount() > 0) {
|
||||||
if(iconImageUrl == null) {
|
if(iconImageUrl == null || iconImageUrl.equals("")) {
|
||||||
|
glide.load(R.drawable.subreddit_default_icon)
|
||||||
} else if(!iconImageUrl.equals("")) {
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
|
} else {
|
||||||
glide.load(iconImageUrl)
|
glide.load(iconImageUrl)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(glide.load(R.drawable.subreddit_default_icon)
|
.error(glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
} else {
|
|
||||||
glide.load(R.drawable.subreddit_default_icon)
|
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(holder.getAdapterPosition() >= 0) {
|
if(holder.getAdapterPosition() >= 0) {
|
||||||
@ -222,18 +220,18 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(glide.load(R.drawable.subreddit_default_icon)
|
.error(glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
} else {
|
} else {
|
||||||
glide.load(R.drawable.subreddit_default_icon)
|
glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
((DataViewHolder) holder).subredditNameTextView.setTextColor(mContext.getResources().getColor(R.color.colorAccent));
|
((DataViewHolder) holder).nameTextView.setTextColor(mContext.getResources().getColor(R.color.colorAccent));
|
||||||
((DataViewHolder) holder).subredditNameTextView.setText(subredditNamePrefixed);
|
((DataViewHolder) holder).nameTextView.setText(subredditNamePrefixed);
|
||||||
|
|
||||||
((DataViewHolder) holder).subredditIconNameLinearLayout.setOnClickListener(view -> {
|
((DataViewHolder) holder).iconNameLinearLayout.setOnClickListener(view -> {
|
||||||
if(canStartActivity) {
|
if(canStartActivity) {
|
||||||
canStartActivity = false;
|
canStartActivity = false;
|
||||||
if(post.getSubredditNamePrefixed().startsWith("u/")) {
|
if(post.getSubredditNamePrefixed().startsWith("u/")) {
|
||||||
@ -253,16 +251,16 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
if(post.getAuthorIconUrl() == null) {
|
if(post.getAuthorIconUrl() == null) {
|
||||||
new LoadUserDataAsyncTask(userDao, post.getAuthor(), mRetrofit, iconImageUrl -> {
|
new LoadUserDataAsyncTask(userDao, post.getAuthor(), mRetrofit, iconImageUrl -> {
|
||||||
if(mContext != null && getItemCount() > 0) {
|
if(mContext != null && getItemCount() > 0) {
|
||||||
if(!iconImageUrl.equals("")) {
|
if(iconImageUrl == null || iconImageUrl.equals("")) {
|
||||||
|
glide.load(R.drawable.subreddit_default_icon)
|
||||||
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
|
} else {
|
||||||
glide.load(iconImageUrl)
|
glide.load(iconImageUrl)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(glide.load(R.drawable.subreddit_default_icon)
|
.error(glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
} else {
|
|
||||||
glide.load(R.drawable.subreddit_default_icon)
|
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(holder.getAdapterPosition() >= 0) {
|
if(holder.getAdapterPosition() >= 0) {
|
||||||
@ -275,17 +273,17 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.error(glide.load(R.drawable.subreddit_default_icon)
|
.error(glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
} else {
|
} else {
|
||||||
glide.load(R.drawable.subreddit_default_icon)
|
glide.load(R.drawable.subreddit_default_icon)
|
||||||
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
.apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))
|
||||||
.into(((DataViewHolder) holder).subredditIconGifImageView);
|
.into(((DataViewHolder) holder).iconGifImageView);
|
||||||
}
|
}
|
||||||
|
|
||||||
((DataViewHolder) holder).subredditNameTextView.setTextColor(mContext.getResources().getColor(R.color.textColorPrimaryDark));
|
((DataViewHolder) holder).nameTextView.setTextColor(mContext.getResources().getColor(R.color.textColorPrimaryDark));
|
||||||
((DataViewHolder) holder).subredditNameTextView.setText(author);
|
((DataViewHolder) holder).nameTextView.setText(authorPrefixed);
|
||||||
|
|
||||||
((DataViewHolder) holder).subredditIconNameLinearLayout.setOnClickListener(view -> {
|
((DataViewHolder) holder).iconNameLinearLayout.setOnClickListener(view -> {
|
||||||
if(canStartActivity) {
|
if(canStartActivity) {
|
||||||
canStartActivity = false;
|
canStartActivity = false;
|
||||||
Intent intent = new Intent(mContext, ViewUserDetailActivity.class);
|
Intent intent = new Intent(mContext, ViewUserDetailActivity.class);
|
||||||
@ -652,9 +650,9 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
|
|
||||||
class DataViewHolder extends RecyclerView.ViewHolder {
|
class DataViewHolder extends RecyclerView.ViewHolder {
|
||||||
@BindView(R.id.card_view_item_post) MaterialCardView cardView;
|
@BindView(R.id.card_view_item_post) MaterialCardView cardView;
|
||||||
@BindView(R.id.subreddit_icon_name_linear_layout_view_item_post) LinearLayout subredditIconNameLinearLayout;
|
@BindView(R.id.icon_name_linear_layout_view_item_post) LinearLayout iconNameLinearLayout;
|
||||||
@BindView(R.id.subreddit_icon_gif_image_view_item_post) AspectRatioGifImageView subredditIconGifImageView;
|
@BindView(R.id.icon_gif_image_view_item_post) AspectRatioGifImageView iconGifImageView;
|
||||||
@BindView(R.id.subreddit_text_view_item_post) TextView subredditNameTextView;
|
@BindView(R.id.name_text_view_item_post) TextView nameTextView;
|
||||||
@BindView(R.id.stickied_post_image_view_item_post) ImageView stickiedPostImageView;
|
@BindView(R.id.stickied_post_image_view_item_post) ImageView stickiedPostImageView;
|
||||||
@BindView(R.id.post_time_text_view_best_item_post) TextView postTimeTextView;
|
@BindView(R.id.post_time_text_view_best_item_post) TextView postTimeTextView;
|
||||||
@BindView(R.id.title_text_view_best_item_post) TextView titleTextView;
|
@BindView(R.id.title_text_view_best_item_post) TextView titleTextView;
|
||||||
@ -709,7 +707,7 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo
|
|||||||
public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
|
public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
|
||||||
if(holder instanceof DataViewHolder) {
|
if(holder instanceof DataViewHolder) {
|
||||||
glide.clear(((DataViewHolder) holder).imageView);
|
glide.clear(((DataViewHolder) holder).imageView);
|
||||||
glide.clear(((DataViewHolder) holder).subredditIconGifImageView);
|
glide.clear(((DataViewHolder) holder).iconGifImageView);
|
||||||
((DataViewHolder) holder).stickiedPostImageView.setVisibility(View.GONE);
|
((DataViewHolder) holder).stickiedPostImageView.setVisibility(View.GONE);
|
||||||
((DataViewHolder) holder).relativeLayout.setVisibility(View.GONE);
|
((DataViewHolder) holder).relativeLayout.setVisibility(View.GONE);
|
||||||
((DataViewHolder) holder).gildedImageView.setVisibility(View.GONE);
|
((DataViewHolder) holder).gildedImageView.setVisibility(View.GONE);
|
||||||
|
@ -73,8 +73,12 @@ public class ViewUserDetailActivity extends AppCompatActivity {
|
|||||||
private String userName;
|
private String userName;
|
||||||
private boolean subscriptionReady = false;
|
private boolean subscriptionReady = false;
|
||||||
private boolean isInLazyMode = false;
|
private boolean isInLazyMode = false;
|
||||||
private int colorPrimary;
|
private int expandedTabTextColor;
|
||||||
private int white;
|
private int expandedTabBackgroundColor;
|
||||||
|
private int expandedTabIndicatorColor;
|
||||||
|
private int collapsedTabTextColor;
|
||||||
|
private int collapsedTabBackgroundColor;
|
||||||
|
private int collapsedTabIndicatorColor;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Named("no_oauth")
|
@Named("no_oauth")
|
||||||
@ -122,20 +126,25 @@ public class ViewUserDetailActivity extends AppCompatActivity {
|
|||||||
viewPager.setOffscreenPageLimit(2);
|
viewPager.setOffscreenPageLimit(2);
|
||||||
tabLayout.setupWithViewPager(viewPager);
|
tabLayout.setupWithViewPager(viewPager);
|
||||||
|
|
||||||
colorPrimary = getResources().getColor(R.color.colorPrimary);
|
expandedTabTextColor = getResources().getColor(R.color.tabLayoutWithExpandedCollapsingToolbarTextColor);
|
||||||
white = getResources().getColor(android.R.color.white);
|
expandedTabBackgroundColor = getResources().getColor(R.color.tabLayoutWithExpandedCollapsingToolbarTabBackground);
|
||||||
|
expandedTabIndicatorColor = getResources().getColor(R.color.tabLayoutWithExpandedCollapsingToolbarTabIndicator);
|
||||||
|
|
||||||
|
collapsedTabTextColor = getResources().getColor(R.color.tabLayoutWithCollapsedCollapsingToolbarTextColor);
|
||||||
|
collapsedTabBackgroundColor = getResources().getColor(R.color.tabLayoutWithCollapsedCollapsingToolbarTabBackground);
|
||||||
|
collapsedTabIndicatorColor = getResources().getColor(R.color.tabLayoutWithCollapsedCollapsingToolbarTabIndicator);
|
||||||
|
|
||||||
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
appBarLayout.addOnOffsetChangedListener(new AppBarStateChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
void onStateChanged(AppBarLayout appBarLayout, State state) {
|
void onStateChanged(AppBarLayout appBarLayout, State state) {
|
||||||
if(state == State.EXPANDED) {
|
if(state == State.EXPANDED) {
|
||||||
tabLayout.setTabTextColors(colorPrimary, colorPrimary);
|
tabLayout.setTabTextColors(expandedTabTextColor, expandedTabTextColor);
|
||||||
tabLayout.setSelectedTabIndicatorColor(colorPrimary);
|
tabLayout.setSelectedTabIndicatorColor(expandedTabIndicatorColor);
|
||||||
tabLayout.setBackgroundColor(white);
|
tabLayout.setBackgroundColor(expandedTabBackgroundColor);
|
||||||
} else if(state == State.COLLAPSED) {
|
} else if(state == State.COLLAPSED) {
|
||||||
tabLayout.setTabTextColors(white, white);
|
tabLayout.setTabTextColors(collapsedTabTextColor, collapsedTabTextColor);
|
||||||
tabLayout.setSelectedTabIndicatorColor(white);
|
tabLayout.setSelectedTabIndicatorColor(collapsedTabIndicatorColor);
|
||||||
tabLayout.setBackgroundColor(colorPrimary);
|
tabLayout.setBackgroundColor(collapsedTabBackgroundColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/colorPrimary"
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:layout_scrollFlags="scroll|enterAlways"
|
app:layout_scrollFlags="scroll|enterAlways"
|
||||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/subreddit_icon_name_linear_layout_view_item_post"
|
android:id="@+id/icon_name_linear_layout_view_item_post"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constrainedWidth="true"
|
app:layout_constrainedWidth="true"
|
||||||
@ -30,13 +30,13 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent">
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
<CustomView.AspectRatioGifImageView
|
<CustomView.AspectRatioGifImageView
|
||||||
android:id="@+id/subreddit_icon_gif_image_view_item_post"
|
android:id="@+id/icon_gif_image_view_item_post"
|
||||||
android:layout_width="24dp"
|
android:layout_width="24dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="24dp"
|
||||||
android:layout_gravity="center"/>
|
android:layout_gravity="center"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/subreddit_text_view_item_post"
|
android:id="@+id/name_text_view_item_post"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="16dp"
|
android:layout_marginStart="16dp"
|
||||||
@ -53,7 +53,7 @@
|
|||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:tint="@color/backgroundColorPrimaryDark"
|
android:tint="@color/backgroundColorPrimaryDark"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toEndOf="@id/subreddit_icon_name_linear_layout_view_item_post"
|
app:layout_constraintStart_toEndOf="@id/icon_name_linear_layout_view_item_post"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/post_time_text_view_best_item_post"
|
app:layout_constraintEnd_toStartOf="@+id/post_time_text_view_best_item_post"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"/>
|
app:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
@ -27,4 +27,18 @@
|
|||||||
<color name="roundedBottomSheetPrimaryBackground">#242424</color>
|
<color name="roundedBottomSheetPrimaryBackground">#242424</color>
|
||||||
|
|
||||||
<color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
|
<color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
|
||||||
|
|
||||||
|
<color name="voteUnavailableVoteButtonColor">#3C3C3C</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithExpandedCollapsingToolbarTextColor">#FFFFFF</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithExpandedCollapsingToolbarTabBackground">@color/backgroundColor</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithExpandedCollapsingToolbarTabIndicator">@color/tabLayoutWithExpandedCollapsingToolbarTextColor</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithCollapsedCollapsingToolbarTextColor">#FFFFFF</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithCollapsedCollapsingToolbarTabBackground">@color/colorPrimary</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithCollapsedCollapsingToolbarTabIndicator">@color/tabLayoutWithCollapsedCollapsingToolbarTextColor</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -29,4 +29,16 @@
|
|||||||
<color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
|
<color name="roundedBottomSheetPrimaryNavigationBarColor">#000000</color>
|
||||||
|
|
||||||
<color name="voteUnavailableVoteButtonColor">#F0F0F0</color>
|
<color name="voteUnavailableVoteButtonColor">#F0F0F0</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithExpandedCollapsingToolbarTextColor">@color/colorPrimary</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithExpandedCollapsingToolbarTabBackground">#FFFFFF</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithExpandedCollapsingToolbarTabIndicator">@color/tabLayoutWithExpandedCollapsingToolbarTextColor</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithCollapsedCollapsingToolbarTextColor">#FFFFFF</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithCollapsedCollapsingToolbarTabBackground">@color/colorPrimary</color>
|
||||||
|
|
||||||
|
<color name="tabLayoutWithCollapsedCollapsingToolbarTabIndicator">@color/tabLayoutWithCollapsedCollapsingToolbarTextColor</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user