本文整理汇总了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);
}
}
示例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);
}
}
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}