Java Code Examples for android.support.v7.app.ActionBar.LayoutParams

The following are top voted examples for showing how to use android.support.v7.app.ActionBar.LayoutParams. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: boohee_v5.6   File: DietSportCalendarActivity.java   View source code 6 votes vote down vote up
private void initToolsBar() {
    View toolbar_diet_sport = LayoutInflater.from(this).inflate(R.layout.ov, null);
    this.tv_date = (TextView) toolbar_diet_sport.findViewById(R.id.tv_date);
    this.iv_previous = (ImageView) toolbar_diet_sport.findViewById(R.id.iv_previous);
    this.iv_next = (ImageView) toolbar_diet_sport.findViewById(R.id.iv_next);
    this.iv_previous.setOnClickListener(this.mOnIndicator);
    this.iv_next.setOnClickListener(this.mOnIndicator);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(toolbar_diet_sport, new LayoutParams(-1, -1));
    this.tv_date.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            if (DietSportCalendarActivity.this.dietPopView.isShowing()) {
                DietSportCalendarActivity.this.dietPopView.dismiss();
                return;
            }
            MobclickAgent.onEvent(DietSportCalendarActivity.this.ctx, Event
                    .tool_foodandsport_calendar);
            DietSportCalendarActivity.this.dietPopView.show();
        }
    });
}
 
Example 2
Project: boohee_v5.6   File: GoodsDetailActivity.java   View source code 6 votes vote down vote up
private void initActionbar() {
    View view_tab = LayoutInflater.from(this).inflate(R.layout.h1, null);
    this.mSlidingTab = (PagerSlidingTabStrip) view_tab.findViewById(R.id.sliding_tabs);
    LayoutParams layoutParams = new LayoutParams(-2, -1);
    layoutParams.gravity = GravityCompat.END;
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(view_tab, layoutParams);
    this.mSlidingTab.setViewPager(this.viewpager);
    this.mSlidingTab.setOnPageChangeListener(new SimpleOnPageChangeListener() {
        public void onPageSelected(int position) {
            super.onPageSelected(position);
            if (position == 1 && !GoodsDetailActivity.this.isSecondLoad) {
                GoodsDetailActivity.this.goodsPostsFragment.loadFirst();
                GoodsDetailActivity.this.isSecondLoad = true;
            }
        }
    });
}
 
Example 3
Project: FMTech   File: Toolbar.java   View source code 6 votes vote down vote up
public final void ensureMenuView()
{
  if (this.mMenuView == null)
  {
    this.mMenuView = new ActionMenuView(getContext());
    this.mMenuView.setPopupTheme(this.mPopupTheme);
    this.mMenuView.setOnMenuItemClickListener(this.mMenuViewItemClickListener);
    ActionMenuView localActionMenuView = this.mMenuView;
    MenuPresenter.Callback localCallback = this.mActionMenuPresenterCallback;
    MenuBuilder.Callback localCallback1 = this.mMenuBuilderCallback;
    localActionMenuView.mActionMenuPresenterCallback = localCallback;
    localActionMenuView.mMenuBuilderCallback = localCallback1;
    LayoutParams localLayoutParams = new LayoutParams();
    localLayoutParams.gravity = (0x800005 | 0x70 & this.mButtonGravity);
    this.mMenuView.setLayoutParams(localLayoutParams);
    addSystemView(this.mMenuView, false);
  }
}
 
Example 4
Project: boohee_v5.6   File: FriendShipActivity.java   View source code 5 votes vote down vote up
private void initView() {
    this.mViewPager = (ViewPager) findViewById(R.id.viewpager);
    this.mViewPager.setAdapter(new MainPagerAdapter(getSupportFragmentManager(), this
            .mContentFragments));
    this.mCustomView = LayoutInflater.from(this).inflate(R.layout.lz, null);
    this.mSlidingTab = (PagerSlidingTabStrip) this.mCustomView.findViewById(R.id.sliding_tabs);
    this.mSlidingTab.setViewPager(this.mViewPager);
    this.mViewPager.setCurrentItem(this.position);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    LayoutParams layoutParams = new LayoutParams(-2, -1);
    layoutParams.gravity = GravityCompat.END;
    getSupportActionBar().setCustomView(this.mCustomView, layoutParams);
}
 
Example 5
Project: boohee_v5.6   File: SearchSportActivity.java   View source code 5 votes vote down vote up
private void initToolsBar() {
    this.mCustomView = LayoutInflater.from(this).inflate(R.layout.mo, null);
    this.et_search = (EditText) this.mCustomView.findViewById(R.id.et_search);
    this.iv_clear = (ImageView) this.mCustomView.findViewById(R.id.view_clear);
    this.iv_search = (ImageView) this.mCustomView.findViewById(R.id.view_scan);
    this.et_search.setHint(R.string.a3g);
    this.iv_search.setImageDrawable(getResources().getDrawable(R.drawable.a55));
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(this.mCustomView, new LayoutParams(-1, -1));
}
 
Example 6
Project: boohee_v5.6   File: CookSearchActivity.java   View source code 5 votes vote down vote up
private void initToolsBar() {
    this.mCustomView = LayoutInflater.from(this).inflate(R.layout.mo, null);
    this.et_search = (EditText) this.mCustomView.findViewById(R.id.et_search);
    this.iv_clear = (ImageView) this.mCustomView.findViewById(R.id.view_clear);
    this.iv_search = (ImageView) this.mCustomView.findViewById(R.id.view_scan);
    this.iv_search.setVisibility(8);
    this.et_search.setHint("请输入食材名称");
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(this.mCustomView, new LayoutParams(-1, -1));
}
 
Example 7
Project: boohee_v5.6   File: SearchFoodActivity.java   View source code 5 votes vote down vote up
private void initToolsBar() {
    this.mCustomView = LayoutInflater.from(this).inflate(R.layout.mo, null);
    this.et_search = (EditText) this.mCustomView.findViewById(R.id.et_search);
    this.iv_clear = (ImageView) this.mCustomView.findViewById(R.id.view_clear);
    this.iv_search = (ImageView) this.mCustomView.findViewById(R.id.view_scan);
    this.et_search.setHint(R.string.a3f);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(this.mCustomView, new LayoutParams(-1, -1));
}
 
Example 8
Project: boohee_v5.6   File: DietChartActivity.java   View source code 5 votes vote down vote up
private void initActionbar() {
    View actionBar = LayoutInflater.from(this).inflate(R.layout.f1, null);
    LayoutParams layoutParams = new LayoutParams(-2, -1);
    layoutParams.gravity = GravityCompat.END;
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(actionBar, layoutParams);
}
 
Example 9
Project: boohee_v5.6   File: CopyRecordActivity.java   View source code 5 votes vote down vote up
private void initToolsBar() {
    View toolbar_diet_sport = LayoutInflater.from(this).inflate(R.layout.n5, null);
    ((TextView) toolbar_diet_sport.findViewById(R.id.txt_date)).setText(TextUtils.isEmpty
            (this.record_on) ? "" : this.record_on);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    LayoutParams layoutParams = new LayoutParams(-1, -1);
    layoutParams.setMargins(0, 0, ViewUtils.dip2px(this.activity, 48.0f), 0);
    getSupportActionBar().setCustomView(toolbar_diet_sport, layoutParams);
}
 
Example 10
Project: boohee_v5.6   File: WeightRecordActivity.java   View source code 5 votes vote down vote up
private void initView() {
    View view_date_top = LayoutInflater.from(this).inflate(R.layout.om, null);
    this.txt_date = (TextView) view_date_top.findViewById(R.id.txt_date);
    view_date_top.findViewById(R.id.rl_left).setOnClickListener(this);
    view_date_top.findViewById(R.id.rl_right).setOnClickListener(this);
    this.calendarGrid.setOnItemClickListener(this);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(view_date_top, new LayoutParams(-1, -1));
    showOpenBleMsg();
}
 
Example 11
Project: boohee_v5.6   File: DimensionRecordActivity.java   View source code 5 votes vote down vote up
private void initToolsBar() {
    View view_date_top = LayoutInflater.from(this).inflate(R.layout.om, null);
    this.txt_date = (TextView) view_date_top.findViewById(R.id.txt_date);
    view_date_top.findViewById(R.id.rl_left).setOnClickListener(this);
    view_date_top.findViewById(R.id.rl_right).setOnClickListener(this);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(view_date_top, new LayoutParams(-1, -1));
}
 
Example 12
Project: boohee_v5.6   File: PeriodCalendarActivity.java   View source code 5 votes vote down vote up
private void initToolsBar() {
    View view_date_top = LayoutInflater.from(this).inflate(R.layout.om, null);
    this.txt_date = (TextView) view_date_top.findViewById(R.id.txt_date);
    view_date_top.findViewById(R.id.rl_left).setOnClickListener(this.dateClickListener);
    view_date_top.findViewById(R.id.rl_right).setOnClickListener(this.dateClickListener);
    getSupportActionBar().setDisplayShowCustomEnabled(true);
    getSupportActionBar().setCustomView(view_date_top, new LayoutParams(-1, -1));
}
 
Example 13
Project: crockpod   File: CrockpodActivity.java   View source code 5 votes vote down vote up
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
    View view = getLayoutInflater().inflate(R.layout.crockpod_actionbar, null);
    LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    getSupportActionBar().setCustomView(view, layoutParams);
    Toolbar parent = (Toolbar) view.getParent();
    parent.setContentInsetsAbsolute(0, 0);
}
 
Example 14
Project: FMTech   File: Toolbar.java   View source code 5 votes vote down vote up
private void addCustomViewsWithGravity(List<View> paramList, int paramInt)
{
  int i = 1;
  if (ViewCompat.getLayoutDirection(this) == i) {}
  int j;
  int k;
  for (;;)
  {
    j = getChildCount();
    k = GravityCompat.getAbsoluteGravity(paramInt, ViewCompat.getLayoutDirection(this));
    paramList.clear();
    if (i == 0) {
      break;
    }
    for (int n = j - 1; n >= 0; n--)
    {
      View localView2 = getChildAt(n);
      LayoutParams localLayoutParams2 = (LayoutParams)localView2.getLayoutParams();
      if ((localLayoutParams2.mViewType == 0) && (shouldLayout(localView2)) && (getChildHorizontalGravity(localLayoutParams2.gravity) == k)) {
        paramList.add(localView2);
      }
    }
    i = 0;
  }
  for (int m = 0; m < j; m++)
  {
    View localView1 = getChildAt(m);
    LayoutParams localLayoutParams1 = (LayoutParams)localView1.getLayoutParams();
    if ((localLayoutParams1.mViewType == 0) && (shouldLayout(localView1)) && (getChildHorizontalGravity(localLayoutParams1.gravity) == k)) {
      paramList.add(localView1);
    }
  }
}
 
Example 15
Project: FMTech   File: Toolbar.java   View source code 5 votes vote down vote up
private void ensureNavButtonView()
{
  if (this.mNavButtonView == null)
  {
    this.mNavButtonView = new ImageButton(getContext(), null, R.attr.toolbarNavigationButtonStyle);
    LayoutParams localLayoutParams = new LayoutParams();
    localLayoutParams.gravity = (0x800003 | 0x70 & this.mButtonGravity);
    this.mNavButtonView.setLayoutParams(localLayoutParams);
  }
}
 
Example 16
Project: FMTech   File: Toolbar.java   View source code 5 votes vote down vote up
private static LayoutParams generateLayoutParams(ViewGroup.LayoutParams paramLayoutParams)
{
  if ((paramLayoutParams instanceof LayoutParams)) {
    return new LayoutParams((LayoutParams)paramLayoutParams);
  }
  if ((paramLayoutParams instanceof ActionBar.LayoutParams)) {
    return new LayoutParams((ActionBar.LayoutParams)paramLayoutParams);
  }
  if ((paramLayoutParams instanceof ViewGroup.MarginLayoutParams)) {
    return new LayoutParams((ViewGroup.MarginLayoutParams)paramLayoutParams);
  }
  return new LayoutParams(paramLayoutParams);
}
 
Example 17
Project: FMTech   File: Toolbar.java   View source code 5 votes vote down vote up
private int layoutChildLeft(View paramView, int paramInt1, int[] paramArrayOfInt, int paramInt2)
{
  LayoutParams localLayoutParams = (LayoutParams)paramView.getLayoutParams();
  int i = localLayoutParams.leftMargin - paramArrayOfInt[0];
  int j = paramInt1 + Math.max(0, i);
  paramArrayOfInt[0] = Math.max(0, -i);
  int k = getChildTop(paramView, paramInt2);
  int m = paramView.getMeasuredWidth();
  paramView.layout(j, k, j + m, k + paramView.getMeasuredHeight());
  return j + (m + localLayoutParams.rightMargin);
}
 
Example 18
Project: FMTech   File: Toolbar.java   View source code 5 votes vote down vote up
private int layoutChildRight(View paramView, int paramInt1, int[] paramArrayOfInt, int paramInt2)
{
  LayoutParams localLayoutParams = (LayoutParams)paramView.getLayoutParams();
  int i = localLayoutParams.rightMargin - paramArrayOfInt[1];
  int j = paramInt1 - Math.max(0, i);
  paramArrayOfInt[1] = Math.max(0, -i);
  int k = getChildTop(paramView, paramInt2);
  int m = paramView.getMeasuredWidth();
  paramView.layout(j - m, k, j, k + paramView.getMeasuredHeight());
  return j - (m + localLayoutParams.leftMargin);
}
 
Example 19
Project: FMTech   File: Toolbar.java   View source code 5 votes vote down vote up
public final boolean expandItemActionView$29f2911(MenuItemImpl paramMenuItemImpl)
{
  Toolbar.access$200(Toolbar.this);
  if (Toolbar.this.mCollapseButtonView.getParent() != Toolbar.this) {
    Toolbar.this.addView(Toolbar.this.mCollapseButtonView);
  }
  Toolbar.this.mExpandedActionView = paramMenuItemImpl.getActionView();
  this.mCurrentExpandedItem = paramMenuItemImpl;
  if (Toolbar.this.mExpandedActionView.getParent() != Toolbar.this)
  {
    Toolbar.LayoutParams localLayoutParams = Toolbar.generateDefaultLayoutParams();
    localLayoutParams.gravity = (0x800003 | 0x70 & Toolbar.this.mButtonGravity);
    localLayoutParams.mViewType = 2;
    Toolbar.this.mExpandedActionView.setLayoutParams(localLayoutParams);
    Toolbar.this.addView(Toolbar.this.mExpandedActionView);
  }
  Toolbar localToolbar = Toolbar.this;
  for (int i = -1 + localToolbar.getChildCount(); i >= 0; i--)
  {
    View localView = localToolbar.getChildAt(i);
    if ((((Toolbar.LayoutParams)localView.getLayoutParams()).mViewType != 2) && (localView != localToolbar.mMenuView))
    {
      localToolbar.removeViewAt(i);
      localToolbar.mHiddenViews.add(localView);
    }
  }
  Toolbar.this.requestLayout();
  paramMenuItemImpl.setActionViewExpanded(true);
  if ((Toolbar.this.mExpandedActionView instanceof CollapsibleActionView)) {
    ((CollapsibleActionView)Toolbar.this.mExpandedActionView).onActionViewExpanded();
  }
  return true;
}
 
Example 20
Project: FMTech   File: Toolbar.java   View source code 5 votes vote down vote up
public LayoutParams(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
{
  super();
  this.leftMargin = paramMarginLayoutParams.leftMargin;
  this.topMargin = paramMarginLayoutParams.topMargin;
  this.rightMargin = paramMarginLayoutParams.rightMargin;
  this.bottomMargin = paramMarginLayoutParams.bottomMargin;
}
 
Example 21
Project: hefesto   File: Cronometro.java   View source code 5 votes vote down vote up
public static Cronometro getInstance(Context context){
       if(instance == null) {
           instance = new Cronometro(context);
           instance.setTextColor(ContextCompat.getColor(context, R.color.primary_text));
           instance.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
           instance.setTypeface(Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Medium.ttf"));
           instance.setGravity(Gravity.END|Gravity.CENTER_VERTICAL);
           instance.setTextSize(TypedValue.COMPLEX_UNIT_SP,16);
           instance.setTextColor(ContextCompat.getColor(context, R.color.accent));
       }
       return instance;
}
 
Example 22
Project: OschinaMainFrameWorkWithToolBar   File: BaseActivity.java   View source code 5 votes vote down vote up
protected void setTranslucentStatus(boolean on) {
    Window win = getWindow();
    WindowManager.LayoutParams winParams = win.getAttributes();
    final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
    if (on) {
        winParams.flags |= bits;
    } else {
        winParams.flags &= ~bits;
    }
    win.setAttributes(winParams);
}
 
Example 23
Project: oschina-app   File: BaseActivity.java   View source code 5 votes vote down vote up
@TargetApi(19)
protected void setTranslucentStatus(boolean on) {
    Window win = getWindow();
    WindowManager.LayoutParams winParams = win.getAttributes();
    final int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
    if (on) {
        winParams.flags |= bits;
    } else {
        winParams.flags &= ~bits;
    }
    win.setAttributes(winParams);
}
 
Example 24
Project: BecauseWaterAndroid   File: HomeActivity.java   View source code 5 votes vote down vote up
public void restoreActionBar() {
    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    actionBar.setHomeButtonEnabled(true);
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setDisplayShowCustomEnabled(true);
    
    LayoutParams layout = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inflater.inflate(R.layout.action_bar_layout, null);
    actionBar.setCustomView(v, layout);
}
 
Example 25
Project: boohee_v5.6   File: ToolbarActionBar.java   View source code 4 votes vote down vote up
public void setCustomView(View view) {
    setCustomView(view, new LayoutParams(-2, -2));
}
 
Example 26
Project: boohee_v5.6   File: ToolbarActionBar.java   View source code 4 votes vote down vote up
public void setCustomView(View view, LayoutParams layoutParams) {
    if (view != null) {
        view.setLayoutParams(layoutParams);
    }
    this.mDecorToolbar.setCustomView(view);
}
 
Example 27
Project: boohee_v5.6   File: WindowDecorActionBar.java   View source code 4 votes vote down vote up
public void setCustomView(View view, LayoutParams layoutParams) {
    view.setLayoutParams(layoutParams);
    this.mDecorToolbar.setCustomView(view);
}
 
Example 28
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
protected static LayoutParams generateDefaultLayoutParams()
{
  return new LayoutParams();
}
 
Example 29
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
private int getChildTop(View paramView, int paramInt)
{
  LayoutParams localLayoutParams = (LayoutParams)paramView.getLayoutParams();
  int i = paramView.getMeasuredHeight();
  int j;
  int m;
  int n;
  int i1;
  int i2;
  if (paramInt > 0)
  {
    j = (i - paramInt) / 2;
    int k = 0x70 & localLayoutParams.gravity;
    switch (k)
    {
    default: 
      k = 0x70 & this.mGravity;
    }
    switch (k)
    {
    default: 
      m = getPaddingTop();
      n = getPaddingBottom();
      i1 = getHeight();
      i2 = (i1 - m - n - i) / 2;
      if (i2 < localLayoutParams.topMargin) {
        i2 = localLayoutParams.topMargin;
      }
      break;
    }
  }
  for (;;)
  {
    return m + i2;
    j = 0;
    break;
    return getPaddingTop() - j;
    return getHeight() - getPaddingBottom() - i - localLayoutParams.bottomMargin - j;
    int i3 = i1 - n - i - i2 - m;
    if (i3 < localLayoutParams.bottomMargin) {
      i2 = Math.max(0, i2 - (localLayoutParams.bottomMargin - i3));
    }
  }
}
 
Example 30
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
protected boolean checkLayoutParams(ViewGroup.LayoutParams paramLayoutParams)
{
  return (super.checkLayoutParams(paramLayoutParams)) && ((paramLayoutParams instanceof LayoutParams));
}
 
Example 31
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
public LayoutParams()
{
  super(-2);
  this.gravity = 8388627;
}
 
Example 32
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
public LayoutParams(byte paramByte)
{
  super(-2);
  this.gravity = 17;
}
 
Example 33
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
public LayoutParams(Context paramContext, AttributeSet paramAttributeSet)
{
  super(paramAttributeSet);
}
 
Example 34
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
public LayoutParams(ActionBar.LayoutParams paramLayoutParams)
{
  super();
}
 
Example 35
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
public LayoutParams(LayoutParams paramLayoutParams)
{
  super();
  this.mViewType = paramLayoutParams.mViewType;
}
 
Example 36
Project: FMTech   File: Toolbar.java   View source code 4 votes vote down vote up
public LayoutParams(ViewGroup.LayoutParams paramLayoutParams)
{
  super();
}
 
Example 37
Project: digitalocean-swimmer   File: RecordCreateDialogFragment.java   View source code 4 votes vote down vote up
@Override
public void onStart() {
	super.onStart();
	getDialog().getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}
 
Example 38
Project: digitalocean-swimmer   File: DropletDetailsDialogFragment.java   View source code 4 votes vote down vote up
@Override
public void onStart() {
	super.onStart();
	getDialog().getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}
 
Example 39
Project: digitalocean-swimmer   File: DropletResizeDialogFragment.java   View source code 4 votes vote down vote up
@Override
public void onStart() {
	super.onStart();
	getDialog().getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}
 
Example 40
Project: digitalocean-swimmer   File: DomainDetailsDialogFragment.java   View source code 4 votes vote down vote up
@Override
public void onStart() {
	super.onStart();
	getDialog().getWindow().setLayout(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
}