本文整理汇总了Java中com.astuetz.pagerslidingtabstrip.R类的典型用法代码示例。如果您正苦于以下问题:Java R类的具体用法?Java R怎么用?Java R使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
R类属于com.astuetz.pagerslidingtabstrip包,在下文中一共展示了R类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addIconTab
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void addIconTab(final int position, String url) {
// ImageButton tab = new ImageButton(getContext());
//
// tab.setImageResource(resId);
//
// addTab(position, tab);
View v = mInflater.inflate(net.coding.program.R.layout.imageview_head, null, false);
ImageView head = (ImageView) v.findViewById(net.coding.program.R.id.head);
if (url.isEmpty()) {
head.setImageResource(net.coding.program.R.drawable.icon_all_task);
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) head.getLayoutParams();
lp.leftMargin += myFirstExtraPdddingLeft;
head.setLayoutParams(lp);
} else {
ImageLoader.getInstance().displayImage(Global.makeSmallUrl(head, url), head, ImageLoadTool.options);
}
addTab(position, v);
}
示例2: addTab
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void addTab(final int position, CharSequence title, View tabView) {
TextView textView = (TextView) tabView.findViewById(R.id.psts_tab_title);
if (textView != null) {
if (title != null) textView.setText(title);
}
tabView.setFocusable(true);
tabView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (pager.getCurrentItem() != position) {
View tab = tabsContainer.getChildAt(pager.getCurrentItem());
notSelected(tab);
pager.setCurrentItem(position);
} else if (tabReselectedListener != null) {
tabReselectedListener.onTabReselected(position);
}
}
});
tabsContainer.addView(tabView, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}
示例3: updateTabStyles
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void updateTabStyles() {
for (int i = 0; i < tabCount; i++) {
View v = tabsContainer.getChildAt(i);
v.setBackgroundResource(tabBackgroundResId);
v.setPadding(tabPadding, v.getPaddingTop(), tabPadding, v.getPaddingBottom());
TextView tab_title = (TextView) v.findViewById(R.id.psts_tab_title);
if (tab_title != null) {
tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, tabTextSize);
// setAllCaps() is only available from API 14, so the upper case is made manually if we are on a
// pre-ICS-build
if (textAllCaps) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
tab_title.setAllCaps(true);
} else {
tab_title.setText(tab_title.getText().toString().toUpperCase(locale));
}
}
}
}
}
示例4: notifyDataSetChanged
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
public void notifyDataSetChanged() {
mTabsContainer.removeAllViews();
mTabCount = mPager.getAdapter().getCount();
View tabView;
for (int i = 0; i < mTabCount; i++) {
if (isCustomTabs) {
tabView = ((CustomTabProvider) mPager.getAdapter()).getCustomTabView(this, i);
} else {
tabView = LayoutInflater.from(getContext()).inflate(R.layout.psts_tab, this, false);
}
CharSequence title = mPager.getAdapter().getPageTitle(i);
addTab(i, title, tabView);
}
updateTabStyles();
}
示例5: addTab
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void addTab(final int position, CharSequence title, View tabView) {
TextView textView = (TextView) tabView.findViewById(R.id.psts_tab_title);
if (textView != null) {
if (title != null) textView.setText(title);
}
tabView.setFocusable(true);
tabView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mPager.getCurrentItem() != position) {
View tab = mTabsContainer.getChildAt(mPager.getCurrentItem());
unSelect(tab);
mPager.setCurrentItem(position);
} else if (mTabReselectedListener != null) {
mTabReselectedListener.onTabReselected(position);
}
}
});
mTabsContainer.addView(tabView, position, mTabLayoutParams);
}
示例6: updateTabStyles
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void updateTabStyles() {
for (int i = 0; i < mTabCount; i++) {
View v = mTabsContainer.getChildAt(i);
v.setBackgroundResource(mTabBackgroundResId);
v.setPadding(mTabPadding, v.getPaddingTop(), mTabPadding, v.getPaddingBottom());
TextView tab_title = (TextView) v.findViewById(R.id.psts_tab_title);
if (tab_title != null) {
tab_title.setTextColor(mTabTextColor);
tab_title.setTypeface(mTabTextTypeface, mTabTextTypefaceStyle);
tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTabTextSize);
// setAllCaps() is only available from API 14, so the upper case is made manually if we are on a
// pre-ICS-build
if (isTabTextAllCaps) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
tab_title.setAllCaps(true);
} else {
tab_title.setText(tab_title.getText().toString().toUpperCase(getResources().getConfiguration().locale));
}
}
}
}
}
示例7: initView
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void initView(Context context, AttributeSet attrs) {
setBackgroundColor(getResources().getColor(R.color.common_bg));
TypedArray ta = context.obtainStyledAttributes(attrs,
R.styleable.SlidingTabWithIndicatorLayout);
indicator = ta.getResourceId(R.styleable.SlidingTabWithIndicatorLayout_indicator, -1);
tabHeight = ta.getDimensionPixelOffset(
R.styleable.SlidingTabWithIndicatorLayout_tab_height, dp2px(40)
);
ta.recycle();
View view = LayoutInflater.from(context).inflate(R.layout.sliding_tabs, this, true);
ll_indicator_container =
(LinearLayout) view.findViewById(R.id.ll_indicator_container);
tabs = (PagerSlidingTabStrip) view.findViewById(R.id.top_tabs);
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) tabs.getLayoutParams();
lp.height = tabHeight;
tabs.setLayoutParams(lp);
}
示例8: notifyDataSetChanged
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
public void notifyDataSetChanged() {
mTabsContainer.removeAllViews();
mTabCount = mPager.getAdapter().getCount();
View tabView;
for (int i = 0; i < mTabCount; i++) {
if (isCustomTabs) {
tabView = ((CustomTabProvider) mPager.getAdapter()).getCustomTabView(this, i);
} else {
tabView = LayoutInflater.from(getContext()).inflate(R.layout.psts_tab, this, false);
}
CharSequence title = mPager.getAdapter().getPageTitle(i);
addTab(i, title, tabView);
}
updateTabStyles();
}
示例9: addTab
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void addTab(final int position, CharSequence title, View tabView) {
TextView textView = (TextView) tabView.findViewById(R.id.psts_tab_title);
if (textView != null) {
if (title != null) textView.setText(title);
}
tabView.setFocusable(true);
tabView.setOnClickListener(new OnClickListener() {
@Override public void onClick(View v) {
if (mPager.getCurrentItem() != position) {
View tab = mTabsContainer.getChildAt(mPager.getCurrentItem());
unSelect(tab);
mPager.setCurrentItem(position);
} else if (mTabReselectedListener != null) {
mTabReselectedListener.onTabReselected(position);
}
}
});
mTabsContainer.addView(tabView, position, mTabLayoutParams);
}
示例10: updateTabStyles
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void updateTabStyles() {
for (int i = 0; i < mTabCount; i++) {
View v = mTabsContainer.getChildAt(i);
//v.setBackgroundResource(mTabBackgroundResId);
v.setPadding(mTabPadding, v.getPaddingTop(), mTabPadding, v.getPaddingBottom());
TextView tab_title = (TextView) v.findViewById(R.id.psts_tab_title);
if (tab_title != null) {
tab_title.setTextColor(mTabTextColor);
tab_title.setTypeface(mTabTextTypeface, mTabTextTypefaceStyle);
tab_title.setTextSize(TypedValue.COMPLEX_UNIT_PX, mTabTextSize);
// setAllCaps() is only available from API 14, so the upper case is made manually if we are on a
// pre-ICS-build
if (isTabTextAllCaps) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
tab_title.setAllCaps(true);
} else {
tab_title.setText(tab_title.getText()
.toString()
.toUpperCase(getResources().getConfiguration().locale));
}
}
}
}
}
示例11: notifyDataSetChanged
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
public void notifyDataSetChanged() {
tabsContainer.removeAllViews();
tabCount = pager.getAdapter().getCount();
View tabView;
for (int i = 0; i < tabCount; i++) {
if (pager.getAdapter() instanceof CustomTabProvider) {
tabView = ((CustomTabProvider) pager.getAdapter()).getCustomTabView(this, i);
} else {
tabView = LayoutInflater.from(getContext()).inflate(R.layout.psts_tab, this, false);
}
CharSequence title = pager.getAdapter().getPageTitle(i);
addTab(i, title, tabView);
}
updateTabStyles();
getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
@SuppressWarnings("deprecation")
@SuppressLint("NewApi")
@Override
public void onGlobalLayout() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
getViewTreeObserver().removeGlobalOnLayoutListener(this);
} else {
getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
}
});
}
示例12: notSelected
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void notSelected(View tab) {
if (tab != null) {
TextView title = (TextView) tab.findViewById(R.id.psts_tab_title);
if (title != null) {
title.setTypeface(tabTypeface, tabTypefaceStyle);
title.setTextColor(tabTextColor);
}
}
}
示例13: selected
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void selected(View tab) {
if (tab != null) {
TextView title = (TextView) tab.findViewById(R.id.psts_tab_title);
if (title != null) {
title.setTypeface(tabTypeface, tabTypefaceSelectedStyle);
title.setTextColor(tabTextColorSelected);
}
}
}
示例14: addTab
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void addTab(final int position, View tab) {
tab.setFocusable(true);
tab.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
pager.setCurrentItem(position);
}
});
tab.setPadding(tabPadding, 0, tabPadding, 0);
RippleDrawable.createRipple(tab, getContext().getResources().getColor(com.nantaphop.pantipfanapp.R.color.base_color_bright));
tabsContainer.addView(tab, position, shouldExpand ? expandedTabLayoutParams : defaultTabLayoutParams);
}
示例15: unSelect
import com.astuetz.pagerslidingtabstrip.R; //导入依赖的package包/类
private void unSelect(View tab) {
if (tab != null) {
// >> Vuze
tab.setSelected(false);
// << Vuze
TextView tab_title = (TextView) tab.findViewById(R.id.psts_tab_title);
if (tab_title != null) {
tab_title.setSelected(false);
}
if (isCustomTabs) ((CustomTabProvider) mPager.getAdapter()).tabUnselected(tab);
}
}