private void performCollapse() {
if (!isCollapsed()) {
if (this.mTabSpinner == null) {
this.mTabSpinner = createSpinner();
}
removeView(this.mTabLayout);
addView(this.mTabSpinner,new ViewGroup.LayoutParams(-2,-1));
if (this.mTabSpinner.getAdapter() == null) {
this.mTabSpinner.setAdapter(new TabAdapter());
}
if (this.mTabSelector != null) {
removeCallbacks(this.mTabSelector);
this.mTabSelector = null;
}
this.mTabSpinner.setSelection(this.mSelectedTabIndex);
}
}
项目:shengyiplus-android
文件:TableActivity.java
private void checkInterfaceOrientation(Configuration config) {
Boolean isLandscape = (config.orientation == Configuration.ORIENTATION_LANDSCAPE);
if (isLandscape) {
// mAnimloading.setVisibility(View.VISIBLE);
WindowManager.LayoutParams lp = getwindow().getAttributes();
lp.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
getwindow().setAttributes(lp);
getwindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
// new LoadReportData().execute();
} else {
WindowManager.LayoutParams attr = getwindow().getAttributes();
attr.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN);
getwindow().setAttributes(attr);
getwindow().clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
}
public ScrollingTabContainerView(Context context) {
super(context);
setHorizontalScrollBarEnabled(false);
ActionBarPolicy abp = ActionBarPolicy.get(context);
setContentHeight(abp.getTabContainerHeight());
this.mStackedTabMaxWidth = abp.getStackedTabMaxWidth();
this.mTabLayout = createTabLayout();
addView(this.mTabLayout,-1));
}
private boolean performExpand() {
if (isCollapsed()) {
removeView(this.mTabSpinner);
addView(this.mTabLayout,-1));
setTabSelected(this.mTabSpinner.getSelectedItemPosition());
}
return false;
}
private TabView createTabView(Tab tab,boolean forAdapter) {
TabView tabView = new TabView(getContext(),tab,forAdapter);
if (forAdapter) {
tabView.setBackgroundDrawable(null);
tabView.setLayoutParams(new AbsListView.LayoutParams(-1,this.mContentHeight));
} else {
tabView.setFocusable(true);
if (this.mTabClickListener == null) {
this.mTabClickListener = new TabClickListener();
}
tabView.setonClickListener(this.mTabClickListener);
}
return tabView;
}
public void addTab(Tab tab,boolean setSelected) {
TabView tabView = createTabView(tab,false);
this.mTabLayout.addView(tabView,new LayoutParams(0,-1,1.0f));
if (this.mTabSpinner != null) {
((TabAdapter) this.mTabSpinner.getAdapter()).notifyDataSetChanged();
}
if (setSelected) {
tabView.setSelected(true);
}
if (this.mAllowCollapse) {
requestLayout();
}
}
public void addTab(Tab tab,int position,position,1.0f));
if (this.mTabSpinner != null) {
((TabAdapter) this.mTabSpinner.getAdapter()).notifyDataSetChanged();
}
if (setSelected) {
tabView.setSelected(true);
}
if (this.mAllowCollapse) {
requestLayout();
}
}
项目:FMTech
文件:ScrollingTabContainerView.java
private boolean performExpand()
{
if (!isCollapsed()) {
return false;
}
removeView(this.mTabSpinner);
addView(this.mTabLayout,-1));
setTabSelected(this.mTabSpinner.getSelectedItemPosition());
return false;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。