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