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


Java Button.getVisibility方法代碼示例

本文整理匯總了Java中android.widget.Button.getVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java Button.getVisibility方法的具體用法?Java Button.getVisibility怎麽用?Java Button.getVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.Button的用法示例。


在下文中一共展示了Button.getVisibility方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: show

import android.widget.Button; //導入方法依賴的package包/類
public void show() {
    super.show();

    int i = 0;
    Button btn = null;
    Iterator<Button> iterator = mButtons.iterator();
    while (iterator.hasNext()) {
        Button button = iterator.next();
        if(button.getVisibility() != View.VISIBLE) {
            continue;
        }
        ++i;
        btn = button;
    }
    if (i == 1) {
        btn.setBackgroundResource(R.drawable.btn_dialog_single);
    }
    if (i == 2) {
        btn.setSelected(true);
        ((ViewGroup.MarginLayoutParams)(this.mButtons.get(0)).getLayoutParams()).rightMargin = 1;
    }
    if (i == 3)  {
        btn.setSelected(true);
        ((ViewGroup.MarginLayoutParams)(this.mButtons.get(2)).getLayoutParams()).leftMargin = 1;
        ((ViewGroup.MarginLayoutParams)(this.mButtons.get(0)).getLayoutParams()).rightMargin = 1;
    }

}
 
開發者ID:NewCasino,項目名稱:browser,代碼行數:29,代碼來源:ECAlertDialog.java

示例2: onCreateView

import android.widget.Button; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.activity_tillcodefrag,container,false);
    //ImageView image1 = (ImageView)v.findViewById(R.id.bannerfrag2);
    //image1.setImageResource(getArguments().getInt("imageID"));
    //set the text for textview extract the arguments
    TextView heading1 = (TextView)v.findViewById(R.id.headingfrag2);
    heading1.setText(getArguments().getString("headingValue"));

    TextView content1 = (TextView)v.findViewById(R.id.articlefrag2);
    String var = getArguments().getString("contentValue");
    //noinspection deprecation
    content1.setText(Html.fromHtml(var));

    TextView code1 = (TextView)v.findViewById(R.id.codefrag2);
    String codev = getArguments().getString("codeValue");
    //noinspection deprecation
    code1.setText(Html.fromHtml(codev));

    TextView subcontent = (TextView)v.findViewById(R.id.subarticlefrag2);
    String var1 = getArguments().getString("subarticle");
    //noinspection deprecation
    subcontent.setText(Html.fromHtml(var1));

    Button next = (Button)v.findViewById(R.id.nextpage2);
    LinearLayout slider = (LinearLayout)v.findViewById(R.id.slidenextcodefrag);

    int decide = getArguments().getInt("yup");
    int casetitle = getArguments().getInt("caseno");

    if(decide == 1)
    {
        slider.setVisibility(View.GONE);
        next.setVisibility(View.VISIBLE);
    }
    //do next visibility check then onclicklistner

    if(next.getVisibility()==View.VISIBLE)
    {
        switch (casetitle)
        {
            case 11:
                next.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Intent intent = new Intent(view.getContext(),TutorialsFinishedActivity.class);
                        intent.putExtra("title",'j'); //exception handling
                        startActivity(intent);
                    }
                });
                break;
        }
    }

    return v;
}
 
開發者ID:akarshsingh9,項目名稱:CodeInPython,代碼行數:58,代碼來源:tillcodefragActivity.java


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