Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use icons AND text to be used for the PagerSlidingTab. #188

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rogerhu
Copy link

@rogerhu rogerhu commented Feb 28, 2015

If text is also provided, then we will use a TextView with a drawable left icon.

@AlexBravo
Copy link

Hi,
Any timeline on when this is going to be merged??

@sumitsharmadesi
Copy link

private void addIconTab(final int position, int resId,String title) {
LinearLayout tab = new LinearLayout(getContext());
LinearLayout.LayoutParams ll = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,LinearLayout.LayoutParams.MATCH_PARENT,1.0f);
tab.setLayoutParams(ll);
tab.setOrientation(LinearLayout.VERTICAL);
ImageView iv = new ImageView(getContext());
iv.setImageResource(resId);
iv.setLayoutParams(ll);
TextView tv = new TextView(getContext());
tv.setTextColor(Color.parseColor("#ffffff"));
tv.setText(title);
shouldExpand = true;
tv.setGravity(Gravity.CENTER);
tv.setLayoutParams(ll);
tabPadding = 0;
tab.addView(iv);
tab.addView(tv);
addTab(position, tab);
}

This will add Text and Icon on tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants