本文整理汇总了Java中android.support.v7.app.ActionBar.LayoutParams类的典型用法代码示例。如果您正苦于以下问题:Java LayoutParams类的具体用法?Java LayoutParams怎么用?Java LayoutParams使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutParams类属于android.support.v7.app.ActionBar包,在下文中一共展示了LayoutParams类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initToolsBar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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();
}
});
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:DietSportCalendarActivity.java
示例2: initActionbar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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;
}
}
});
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:GoodsDetailActivity.java
示例3: ensureMenuView
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:19,代码来源:Toolbar.java
示例4: initView
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:FriendShipActivity.java
示例5: initToolsBar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:SearchSportActivity.java
示例6: initToolsBar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:CookSearchActivity.java
示例7: initToolsBar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:SearchFoodActivity.java
示例8: initActionbar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:8,代码来源:DietChartActivity.java
示例9: initToolsBar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:10,代码来源:CopyRecordActivity.java
示例10: initView
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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();
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:WeightRecordActivity.java
示例11: initToolsBar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:DimensionRecordActivity.java
示例12: initToolsBar
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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));
}
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:9,代码来源:PeriodCalendarActivity.java
示例13: onCreate
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
@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);
}
开发者ID:KevinLiddle,项目名称:crockpod,代码行数:11,代码来源:CrockpodActivity.java
示例14: addCustomViewsWithGravity
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
}
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:34,代码来源:Toolbar.java
示例15: ensureNavButtonView
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:11,代码来源:Toolbar.java
示例16: generateLayoutParams
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:14,代码来源:Toolbar.java
示例17: layoutChildLeft
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:12,代码来源:Toolbar.java
示例18: layoutChildRight
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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);
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:12,代码来源:Toolbar.java
示例19: if
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
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;
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:34,代码来源:Toolbar.java
示例20: LayoutParams
import android.support.v7.app.ActionBar.LayoutParams; //导入依赖的package包/类
public LayoutParams(ViewGroup.MarginLayoutParams paramMarginLayoutParams)
{
super();
this.leftMargin = paramMarginLayoutParams.leftMargin;
this.topMargin = paramMarginLayoutParams.topMargin;
this.rightMargin = paramMarginLayoutParams.rightMargin;
this.bottomMargin = paramMarginLayoutParams.bottomMargin;
}
开发者ID:ChiangC,项目名称:FMTech,代码行数:9,代码来源:Toolbar.java
注:本文中的android.support.v7.app.ActionBar.LayoutParams类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论