当前位置: 首页>>代码示例>>Java>>正文


Java LinearLayoutCompat.LayoutParams方法代码示例

本文整理汇总了Java中android.support.v7.widget.LinearLayoutCompat.LayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java LinearLayoutCompat.LayoutParams方法的具体用法?Java LinearLayoutCompat.LayoutParams怎么用?Java LinearLayoutCompat.LayoutParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.widget.LinearLayoutCompat的用法示例。


在下文中一共展示了LinearLayoutCompat.LayoutParams方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initMenuItems

import android.support.v7.widget.LinearLayoutCompat; //导入方法依赖的package包/类
private void initMenuItems()
{
    for (int i = 0; i < getChildCount() - 1; i++)
    {
        View item = getChildAt(i);
        item.setOnClickListener(new OnClickListener()
        {
            @Override
            public void onClick(View view)
            {
                if(null !=mOnMenuItemClickListener)
                {
                    mOnMenuItemClickListener.onMenuItemClick((FloatingActionButton) view,view.getId());
                }
                collapse();
            }
        });
        LayoutParams params = (LinearLayoutCompat.LayoutParams) item.getLayoutParams();
        params.topMargin = getResources().getDimensionPixelSize(R.dimen.fab_margin);
    }
}
 
开发者ID:lynnchurch,项目名称:FloatingActionButtonMenu,代码行数:22,代码来源:FloatingActionButtonMenu.java

示例2: init

import android.support.v7.widget.LinearLayoutCompat; //导入方法依赖的package包/类
private void init(Context context, int childCount) {
    LinearLayoutCompat.LayoutParams layoutParams = new LinearLayoutCompat.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
    layoutParams.gravity = Gravity.CENTER_VERTICAL;
    this.setLayoutParams(layoutParams);

    this.childCount = childCount;
    this.setOrientation(LinearLayoutCompat.VERTICAL);

    if (this.childCount > 0) {
        LinearLayout.LayoutParams childParams = new LinearLayout.LayoutParams((CircleAppConstants.viewHeight)/ 5, (CircleAppConstants.viewHeight) / 5);
        childParams.gravity = Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL;
        for(int i = 0; i< this.childCount; i++){
            ChildCircleContainer childCircleContainer = new ChildCircleContainer(getContext(), (CircleAppConstants.viewHeight),onChildClick);
            childCircleContainer.setPadding(10,10,10,10);
            childCircleContainer.setLayoutParams(childParams);
            this.addView(childCircleContainer);
        }

    }
}
 
开发者ID:learnNcode,项目名称:CustomTabletUI,代码行数:21,代码来源:CircleVerticalContainer.java

示例3: init

import android.support.v7.widget.LinearLayoutCompat; //导入方法依赖的package包/类
private void init(Context context, AttributeSet attrs) {
    TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.BackgroundProgress);
    try {
        showTxt = typedArray.getString(R.styleable.BackgroundProgress_showTxt);
        isGradient = typedArray.getBoolean(R.styleable.BackgroundProgress_isGradient, true);
    } catch (Exception e) {
        showTxt = null;
        isGradient = true;
    }

    typedArray.recycle();

    View view = LayoutInflater.from(context).inflate(R.layout.bp, null);

    backgroundProgressView = (BackgroundProgressView) view.findViewById(R.id.progress);
    tv = (TextView) view.findViewById(R.id.tv);

    if (TextUtils.isEmpty(showTxt)) {
        tv.setVisibility(GONE);
    } else {
        tv.setText(showTxt);
    }

    backgroundProgressView.set_isGradient(isGradient);


    ViewGroup.LayoutParams layoutParams = new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    addView(view, layoutParams);
}
 
开发者ID:linheimx,项目名称:BackgroundProgress,代码行数:30,代码来源:BackgroundProgress.java

示例4: onChage

import android.support.v7.widget.LinearLayoutCompat; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") private void onChage() {
  removeAllViews();

  for (int i = 0; i < mTAdapter.getCount(); ++i) {
    View tabView = mTAdapter.getView(i, this, mTAdapter.getItem(i));

    LinearLayoutCompat.LayoutParams layoutParams = new LayoutParams(0, -1);
    layoutParams.weight = 1;

    addView(tabView, i, layoutParams);
  }

  invalidate();
}
 
开发者ID:BoBoMEe,项目名称:Tab_Navigator,代码行数:15,代码来源:TabContainer.java

示例5: onCreateViewHolder

import android.support.v7.widget.LinearLayoutCompat; //导入方法依赖的package包/类
/**
 * Called to create the ViewHolder at the given position.
 *
 * @param parent   parent to assign the newly created view to
 * @param viewType ignored
 */
@Override
public StatisticViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View v;
    int layout;

    Context parentContext = parent.getContext();

    if (viewType == StatisticViewHolder.TYPE_LARGE) {
        layout = R.layout.list_item_statistic_most_played;

    } else if (viewType == StatisticViewHolder.TYPE_SMALL) {
        layout = R.layout.list_item_statistic_pie_chart;
    } else {
        throw new RuntimeException("Invalid view type!");
    }

    v = LayoutInflater.from(parentContext).inflate(layout, parent, false);

    LinearLayoutCompat.LayoutParams layoutParams = new LinearLayoutCompat.LayoutParams(
            LinearLayoutCompat.LayoutParams.MATCH_PARENT,
            LinearLayoutCompat.LayoutParams.WRAP_CONTENT);

    v.setLayoutParams(layoutParams);

    return new StatisticViewHolder(v, mUserLogicFactory, mChallengeDataSource, mApplication,
            mUser, mCategoryId);
}
 
开发者ID:Kamshak,项目名称:BrainPhaser,代码行数:34,代码来源:StatisticsAdapter.java

示例6: FooterViewHolder

import android.support.v7.widget.LinearLayoutCompat; //导入方法依赖的package包/类
public FooterViewHolder(View itemView) {
    super(itemView);
    ButterKnife.bind(this, itemView);
    LinearLayoutCompat.LayoutParams params =
            new LinearLayoutCompat.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ScreenUtil.instance(mContext).dip2px(40));
    itemView.setLayoutParams(params);
}
 
开发者ID:wlt2017,项目名称:zhizhihuhu,代码行数:8,代码来源:ZhihuListAdapter.java

示例7: init

import android.support.v7.widget.LinearLayoutCompat; //导入方法依赖的package包/类
private void init(Context context, int width) {

        LinearLayoutCompat.LayoutParams layoutParams = new LinearLayoutCompat.LayoutParams((int)(width) , (int)(width));
        layoutParams.gravity = Gravity.CENTER_VERTICAL| Gravity.CENTER_HORIZONTAL;
        this.setLayoutParams(layoutParams);

        LeftOuterCircleView leftOuterCircleView1 = new LeftOuterCircleView(context, width , false);
        LeftOuterCircleView leftOuterCircleView2 = new LeftOuterCircleView(context, (width - 40 ), true);

        circleTitleView = new CircleTitleView(context, (int) (width));
        circleTitleView.setTextColor(getContext().getResources().getColor(android.R.color.white));
        circleTitleView.setTextSize(20);
        circleTitleView.setTypeface(Typeface.DEFAULT, Typeface.BOLD_ITALIC);
        circleTitleView.setText("App Name");

        this.addView(leftOuterCircleView1);
        this.addView(leftOuterCircleView2);
        addCircle(1, width - 78, (float) 0.0, 0.85);
        addCircle(2,width - 150, (float) 0.0, 0.97);
        addCircle(3, width - 170, (float) 0.0, 0.97);
        addCircle(4, width - 190, (float) 0.0, 0.98);
        addCircle(5, width - 210, (float) 0.0, 0.98);
        addCircle(6, width - 230, (float) 0.0, 0.85);
        addCircle(7, width - 280, (float) 0.0, 0.85);
        addCircle(0,width - 35, (float) 0.0, 0.9);
        addCircle(0,width - 92, (float)0.1, 0.9);

        this.addView(circleTitleView);

        animateClockWise(leftOuterCircleView1);

        animateAntiClockWise(leftOuterCircleView2);

    }
 
开发者ID:learnNcode,项目名称:CustomTabletUI,代码行数:35,代码来源:LeftCircleContainer.java


注:本文中的android.support.v7.widget.LinearLayoutCompat.LayoutParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。