1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2024-12-18 19:43:35 +01:00

fixed tab label color

This commit is contained in:
Mariotaku Lee 2015-03-30 23:23:49 +08:00
parent 0b490524de
commit 7c6d4dd4ec
2 changed files with 17 additions and 1 deletions

View File

@ -771,6 +771,7 @@ public class HomeActivity extends BaseActionBarActivity implements OnClickListen
homeActionButton.setIconColor(contrastColor, Mode.SRC_ATOP);
mTabIndicator.setStripColor(contrastColor);
mTabIndicator.setIconColor(contrastColor);
mTabIndicator.setLabelColor(contrastColor);
ActivityAccessor.setTaskDescription(this, new TaskDescriptionCompat(null, null, themeColor));
mColorStatusFrameLayout.setDrawColor(true);
mColorStatusFrameLayout.setDrawShadow(false);
@ -784,6 +785,7 @@ public class HomeActivity extends BaseActionBarActivity implements OnClickListen
homeActionButton.setIconColor(foregroundColor, Mode.SRC_ATOP);
mTabIndicator.setStripColor(themeColor);
mTabIndicator.setIconColor(foregroundColor);
mTabIndicator.setLabelColor(foregroundColor);
mColorStatusFrameLayout.setDrawColor(false);
mColorStatusFrameLayout.setDrawShadow(false);
}

View File

@ -142,6 +142,10 @@ public class TabPagerIndicator extends RecyclerView implements PagerIndicator {
mIndicatorAdapter.setIconColor(color);
}
public void setLabelColor(int color) {
mIndicatorAdapter.setLabelColor(color);
}
public void setStripColor(int color) {
mIndicatorAdapter.setStripColor(color);
}
@ -339,6 +343,10 @@ public class TabPagerIndicator extends RecyclerView implements PagerIndicator {
}
}
public void setLabelColor(int color) {
labelView.setTextColor(color);
}
public void setPadding(int horizontalPadding, int verticalPadding) {
itemView.setPadding(horizontalPadding, verticalPadding, horizontalPadding, verticalPadding);
}
@ -393,7 +401,7 @@ public class TabPagerIndicator extends RecyclerView implements PagerIndicator {
private LayoutInflater mInflater;
private TabProvider mTabProvider;
private int mStripColor, mIconColor;
private int mStripColor, mIconColor, mLabelColor;
private boolean mDisplayBadge;
public TabPagerIndicatorAdapter(TabPagerIndicator indicator) {
@ -426,6 +434,7 @@ public class TabPagerIndicator extends RecyclerView implements PagerIndicator {
holder.setStripHeight(mIndicator.getStripHeight());
holder.setStripColor(mStripColor);
holder.setIconColor(mIconColor);
holder.setLabelColor(mLabelColor);
holder.setBadge(mUnreadCounts.get(position, 0), mDisplayBadge);
holder.setDisplayOption(mIndicator.isIconDisplayed(), mIndicator.isLabelDisplayed());
}
@ -451,6 +460,11 @@ public class TabPagerIndicator extends RecyclerView implements PagerIndicator {
notifyDataSetChanged();
}
public void setLabelColor(int color) {
mLabelColor = color;
notifyDataSetChanged();
}
public void setStripColor(int color) {
mStripColor = color;
notifyDataSetChanged();