本文整理汇总了Java中android.support.design.widget.FloatingActionButton.setTag方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.setTag方法的具体用法?Java FloatingActionButton.setTag怎么用?Java FloatingActionButton.setTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.design.widget.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.setTag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
public void init() {
fl = new FrameLayout(getContext());
fl.setTag("aah_fl");
fab = new FloatingActionButton(getContext());
fab.setTag("aah_fab");
fab.setCompatElevation(0);
fl.addView(fab);
this.addView(fl);
}
示例2: addColorButton
import android.support.design.widget.FloatingActionButton; //导入方法依赖的package包/类
private void addColorButton(){
for(int i=0;i<12;i++){
FloatingActionButton floatingActionButton = new FloatingActionButton(CanvasActivity.this);
floatingActionButton.setBackgroundTintList(ColorStateList.valueOf(Color.parseColor(colorArr[i])));
floatingActionButton.setCompatElevation(0);
floatingActionButton.setTag("button");
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(108,108);
params.setMargins(32,0,32,0);
final RelativeLayout relativeLayout = new RelativeLayout(CanvasActivity.this);
relativeLayout.addView(floatingActionButton, params);
relativeLayout.setOnClickListener(this);
if(i == 11){
relativeLayout.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View view) {
setDialog((FloatingActionButton) view.findViewWithTag("button"));
relativeLayout.callOnClick();
return true;
}
});
}
if(i > 5){
colorSelectLayout2.addView(relativeLayout, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT));
}else{
colorSelectLayout1.addView(relativeLayout, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT));
}
}
}