當前位置: 首頁>>代碼示例>>Java>>正文


Java FloatingActionButton.setTag方法代碼示例

本文整理匯總了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);

}
 
開發者ID:Krupen,項目名稱:FabulousFilter,代碼行數:11,代碼來源:AAH_FilterView.java

示例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));
        }
    }
}
 
開發者ID:DSM-GRAM,項目名稱:Artist,代碼行數:31,代碼來源:CanvasActivity.java


注:本文中的android.support.design.widget.FloatingActionButton.setTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。