android.widget.Button.setStateListAnimator()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(250)

本文整理了Java中android.widget.Button.setStateListAnimator()方法的一些代码示例,展示了Button.setStateListAnimator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.setStateListAnimator()方法的具体详情如下:
包路径:android.widget.Button
类名称:Button
方法名:setStateListAnimator

Button.setStateListAnimator介绍

暂无

代码示例

代码示例来源:origin: huangfangyi/YiChat

private View getBottomView(final int index, int drawableRes) {
  View view = getLayoutInflater().inflate(R.layout.widget_main_button, null);
  Button button = (Button) view.findViewById(R.id.button);
  button.setCompoundDrawablesWithIntrinsicBounds(0, drawableRes, 0, 0);
  //  button.setCompoundDrawables(null, dr, null, null);
  button.setText(mTitles[index]);
  button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      if (tabs[index] != null) {
        tabs[index].select();
      }
    }
  });
  if (isCompatible(Build.VERSION_CODES.LOLLIPOP)) {
    button.setStateListAnimator(null);
  }
  TextView textView = (TextView) view.findViewById(R.id.unread_msg_number);
  if (index == 0) {
    unreadLabel = textView;
  } else if (index == 1) {
    unreadInvitionLable = textView;
  }else if(index == 2){
    unreadFriendLable= textView;
  }
  return view;
}

代码示例来源:origin: YiChat/android_YiChat_Lite

private View getBottomView(final int index, int drawableRes) {
  View view = getLayoutInflater().inflate(R.layout.widget_main_button, null);
  Button button = (Button) view.findViewById(R.id.button);
  button.setCompoundDrawablesWithIntrinsicBounds(0, drawableRes, 0, 0);
  //  button.setCompoundDrawables(null, dr, null, null);
  button.setText(mTitles[index]);
  button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      if (tabs[index] != null) {
        tabs[index].select();
      }
    }
  });
  if (isCompatible(Build.VERSION_CODES.LOLLIPOP)) {
    button.setStateListAnimator(null);
  }
  TextView textView = (TextView) view.findViewById(R.id.unread_msg_number);
  if (index == 0) {
    unreadLabel = textView;
  } else if (index == 1) {
    unreadInvitionLable = textView;
  }
  return view;
}

代码示例来源:origin: derry/delion

/**
 * DataReductionPromoScreen constructor.
 *
 * @param context An Android context.
 */
public DataReductionPromoScreen(Context context) {
  super(context, R.style.DataReductionPromoScreenDialog);
  setContentView(getContentView(context), new LinearLayout.LayoutParams(
      LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
  // Remove the shadow from the enable button.
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    Button enableButton = (Button) findViewById(R.id.enable_button);
    enableButton.setStateListAnimator(null);
  }
}

相关文章

Button类方法