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); } }
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, new ViewGroup.LayoutParams(-2, -1)); }
private boolean performExpand() { if (isCollapsed()) { removeView(this.mTabSpinner); addView(this.mTabLayout, new ViewGroup.LayoutParams(-2, -1)); setTabSelected(this.mTabSpinner.getSelectedItemPosition()); } return false; }
private LinearLayoutCompat createTabLayout() { LinearLayoutCompat tabLayout = new LinearLayoutCompat(getContext(), null, R.attr.actionBarTabBarStyle); tabLayout.setMeasureWithLargestChildEnabled(true); tabLayout.setGravity(17); tabLayout.setLayoutParams(new LayoutParams(-2, -1)); return tabLayout; }
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, boolean setSelected) { TabView tabView = createTabView(tab, false); this.mTabLayout.addView(tabView, position, new LayoutParams(0, -1, 1.0f)); if (this.mTabSpinner != null) { ((TabAdapter) this.mTabSpinner.getAdapter()).notifyDataSetChanged(); } if (setSelected) { tabView.setSelected(true); } if (this.mAllowCollapse) { requestLayout(); } }
private boolean performExpand() { if (!isCollapsed()) { return false; } removeView(this.mTabSpinner); addView(this.mTabLayout, new ViewGroup.LayoutParams(-2, -1)); setTabSelected(this.mTabSpinner.getSelectedItemPosition()); return false; }
private Spinner createSpinner() { Spinner spinner = new AppCompatSpinner(getContext(), null, R.attr.actionDropDownStyle); spinner.setLayoutParams(new LayoutParams(-2, -1)); spinner.setOnItemSelectedListener(this); return spinner; }