当前位置: 首页>>代码示例>>Java>>正文


Java TintTypedArray.getBoolean方法代码示例

本文整理汇总了Java中android.support.v7.widget.TintTypedArray.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java TintTypedArray.getBoolean方法的具体用法?Java TintTypedArray.getBoolean怎么用?Java TintTypedArray.getBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.support.v7.widget.TintTypedArray的用法示例。


在下文中一共展示了TintTypedArray.getBoolean方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MyToolBar

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public MyToolBar(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    initview();
    if (attrs != null) {

        final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
                R.styleable.MyToolBar, defStyleAttr, 0);
        showSearchView = a.getBoolean(R.styleable.MyToolBar_showSearchView, false);
        left_button_icon = a.getDrawable(R.styleable.MyToolBar_leftButtonIcon);
        right_button_icon = a.getDrawable(R.styleable.MyToolBar_rightButtonIcon);
        title = a.getString(R.styleable.MyToolBar_myTitle);
        a.recycle();
    }

    isShouw();

    setContentInsetsRelative(10, 10);

    initListener();

}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:22,代码来源:MyToolBar.java

示例2: KyToolBar

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public KyToolBar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
  super(context, attrs, defStyleAttr);

  initView();
  final TintTypedArray a =
      TintTypedArray.obtainStyledAttributes(getContext(), attrs, R.styleable.KyToolbar,
          defStyleAttr, 0);
  final boolean enableKyNavigationIcon =
      a.getBoolean(R.styleable.KyToolbar_enableKyNavigationIcon, true);
  final boolean enableKySearch = a.getBoolean(R.styleable.KyToolbar_enableKySearch, false);
  final Drawable navIcon = a.getDrawable(R.styleable.KyToolbar_KyNavigationIcon);
  final Drawable rightButtonIcon = a.getDrawable(R.styleable.KyToolbar_setRightButton);
  final String rightText = a.getString(R.styleable.KyToolbar_setRightText);

  setNavigationIcon(navIcon);
  setRightButtonIcon(rightButtonIcon);
  enableKyNavigation(enableKyNavigationIcon);
  setRightTextView(rightText);
  setEnabledSearch(enableKySearch);
  a.recycle();
}
 
开发者ID:bitkylin,项目名称:BitkyShop,代码行数:22,代码来源:KyToolBar.java

示例3: CNiaoToolBar

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public CNiaoToolBar(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);

    initView();
    setContentInsetsRelative(10,10);

    if(attrs !=null) {
        final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
                R.styleable.CNiaoToolBar, defStyleAttr, 0);

        final Drawable rightIcon = a.getDrawable(R.styleable.CNiaoToolBar_rightButtonIcon);
        if (rightIcon != null) {
            setRightButtonIcon(rightIcon);
        }


        boolean isShowSearchView = a.getBoolean(R.styleable.CNiaoToolBar_isShowSearchView,false);

        if(isShowSearchView){
            showSearchView();
            hideTitleView();
        }

        CharSequence rightButtonText = a.getText(R.styleable.CNiaoToolBar_rightButtonText);
        if(rightButtonText !=null){
            setRightButtonText(rightButtonText);
        }

        a.recycle();
    }

}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:33,代码来源:CNiaoToolBar.java

示例4: BufferTextInputLayout

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public BufferTextInputLayout(Context context, AttributeSet attrs, int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    ThemeUtils.checkAppCompatTheme(context);
    setOrientation(VERTICAL);
    setWillNotDraw(false);
    setAddStatesFromChildren(true);
    inputFrame = new FrameLayout(context);
    inputFrame.setAddStatesFromChildren(true);
    addView(inputFrame);
    collapsingTextHelper.setTextSizeInterpolator(AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR);
    collapsingTextHelper.setPositionInterpolator(new AccelerateInterpolator());
    collapsingTextHelper.setCollapsedTextGravity(Gravity.TOP | GravityCompat.START);
    isHintExpanded = collapsingTextHelper.getExpansionFraction() == 1f;
    final TintTypedArray a = TintTypedArray.obtainStyledAttributes(context, attrs,
            R.styleable.BufferTextInputLayout, defStyleAttr, R.style.BufferTextInputLayout);
    isHintEnabled = a.getBoolean(R.styleable.BufferTextInputLayout_hintEnabled, true);
    setHint(a.getText(R.styleable.BufferTextInputLayout_android_hint));
    hintAnimationEnabled = a.getBoolean(
            R.styleable.BufferTextInputLayout_hintAnimationEnabled, true);
    if (a.hasValue(R.styleable.BufferTextInputLayout_android_textColorHint)) {
        defaultTextColor = focusedTextColor =
                a.getColorStateList(R.styleable.BufferTextInputLayout_android_textColorHint);
    }
    final int hintAppearance = a.getResourceId(
            R.styleable.BufferTextInputLayout_hintTextAppearance, -1);
    if (hintAppearance != -1) {
        setHintTextAppearance(
                a.getResourceId(R.styleable.BufferTextInputLayout_hintTextAppearance, 0));
    }
    errorTextAppearance = a.getResourceId(
            R.styleable.BufferTextInputLayout_errorTextAppearance, 0);
    final boolean errorEnabled = a.getBoolean(R.styleable.BufferTextInputLayout_errorEnabled,
            false);
    final boolean counterEnabled = a.getBoolean(
            R.styleable.BufferTextInputLayout_counterEnabled, false);
    setCounterMaxLength(
            a.getInt(R.styleable.BufferTextInputLayout_counterMaxLength, INVALID_MAX_LENGTH));
    counterTextAppearance = a.getResourceId(
            R.styleable.BufferTextInputLayout_counterTextAppearance, 0);
    counterOverflowTextAppearance = a.getResourceId(
            R.styleable.BufferTextInputLayout_counterOverflowTextAppearance, 0);
    counterVisible = counterEnabled;

    counterMode = CounterMode.fromId(
            a.getInt(R.styleable.BufferTextInputLayout_counterMode, 2));

    charactersRemainingUntilCounterDisplay = a.getInt(
            R.styleable.BufferTextInputLayout_displayFromCount, getCounterMaxLength());

    a.recycle();
    setErrorEnabled(errorEnabled);
    setCounterEnabled(counterEnabled);
    setCounterVisible(counterVisible &&
            (charactersRemainingUntilCounterDisplay == getCounterMaxLength()));
    applyPasswordToggleTint();
    if (ViewCompat.getImportantForAccessibility(this)
            == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
        // Make sure we're important for accessibility if we haven't been explicitly not
        ViewCompat.setImportantForAccessibility(this,
                ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
    }
    ViewCompat.setAccessibilityDelegate(this, new TextInputAccessibilityDelegate());
}
 
开发者ID:bufferapp,项目名称:BufferTextInputLayout,代码行数:64,代码来源:BufferTextInputLayout.java

示例5: TextInputLayout

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public TextInputLayout(Context context, AttributeSet attrs, int defStyleAttr) {
  // Can't call through to super(Context, AttributeSet, int) since it doesn't exist on API 10
  super(context, attrs);

  ThemeUtils.checkAppCompatTheme(context);

  setOrientation(VERTICAL);
  setWillNotDraw(false);
  setAddStatesFromChildren(true);

  mInputFrame = new FrameLayout(context);
  mInputFrame.setAddStatesFromChildren(true);
  addView(mInputFrame);

  mCollapsingTextHelper.setTextSizeInterpolator(AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR);
  mCollapsingTextHelper.setPositionInterpolator(new AccelerateInterpolator());
  mCollapsingTextHelper.setCollapsedTextGravity(Gravity.TOP | GravityCompat.START);

  final TintTypedArray a =
      TintTypedArray.obtainStyledAttributes(
          context,
          attrs,
          R.styleable.TextInputLayout,
          defStyleAttr,
          R.style.Widget_Design_TextInputLayout);
  mHintEnabled = a.getBoolean(R.styleable.TextInputLayout_hintEnabled, true);
  setHint(a.getText(R.styleable.TextInputLayout_android_hint));
  mHintAnimationEnabled = a.getBoolean(R.styleable.TextInputLayout_hintAnimationEnabled, true);

  if (a.hasValue(R.styleable.TextInputLayout_android_textColorHint)) {
    mDefaultTextColor =
        mFocusedTextColor =
            a.getColorStateList(R.styleable.TextInputLayout_android_textColorHint);
  }

  final int hintAppearance = a.getResourceId(R.styleable.TextInputLayout_hintTextAppearance, -1);
  if (hintAppearance != -1) {
    setHintTextAppearance(a.getResourceId(R.styleable.TextInputLayout_hintTextAppearance, 0));
  }

  mErrorTextAppearance = a.getResourceId(R.styleable.TextInputLayout_errorTextAppearance, 0);
  final boolean errorEnabled = a.getBoolean(R.styleable.TextInputLayout_errorEnabled, false);

  final boolean counterEnabled = a.getBoolean(R.styleable.TextInputLayout_counterEnabled, false);
  setCounterMaxLength(a.getInt(R.styleable.TextInputLayout_counterMaxLength, INVALID_MAX_LENGTH));
  mCounterTextAppearance = a.getResourceId(R.styleable.TextInputLayout_counterTextAppearance, 0);
  mCounterOverflowTextAppearance =
      a.getResourceId(R.styleable.TextInputLayout_counterOverflowTextAppearance, 0);

  mPasswordToggleEnabled = a.getBoolean(R.styleable.TextInputLayout_passwordToggleEnabled, false);
  mPasswordToggleDrawable = a.getDrawable(R.styleable.TextInputLayout_passwordToggleDrawable);
  mPasswordToggleContentDesc =
      a.getText(R.styleable.TextInputLayout_passwordToggleContentDescription);
  if (a.hasValue(R.styleable.TextInputLayout_passwordToggleTint)) {
    mHasPasswordToggleTintList = true;
    mPasswordToggleTintList = a.getColorStateList(R.styleable.TextInputLayout_passwordToggleTint);
  }
  if (a.hasValue(R.styleable.TextInputLayout_passwordToggleTintMode)) {
    mHasPasswordToggleTintMode = true;
    mPasswordToggleTintMode =
        ViewUtils.parseTintMode(
            a.getInt(R.styleable.TextInputLayout_passwordToggleTintMode, -1), null);
  }

  a.recycle();

  setErrorEnabled(errorEnabled);
  setCounterEnabled(counterEnabled);
  applyPasswordToggleTint();

  if (ViewCompat.getImportantForAccessibility(this)
      == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
    // Make sure we're important for accessibility if we haven't been explicitly not
    ViewCompat.setImportantForAccessibility(this, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES);
  }

  ViewCompat.setAccessibilityDelegate(this, new TextInputAccessibilityDelegate());
}
 
开发者ID:google,项目名称:iosched,代码行数:79,代码来源:TextInputLayout.java

示例6: PVToolBar

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public PVToolBar(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);



        initView();
        setContentInsetsRelative(10,10);




        if(attrs !=null) {
            final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
                    R.styleable.PVToolBar, defStyleAttr, 0);


            final Drawable rightIcon = a.getDrawable(R.styleable.PVToolBar_rightButtonIcon);
            if (rightIcon != null) {
                //setNavigationIcon(navIcon);
                setRightButtonIcon(rightIcon);
            }
//            int titleColor=a.getColor(R.styleable.PVToolBar_titleColor,-1);
//            if(titleColor!=-1)
//                mTextTitle.setTextColor(ContextCompat.getColor(context,titleColor));


            boolean isShowSearchView = a.getBoolean(R.styleable.PVToolBar_isShowSearchView,false);

            if(isShowSearchView){

                showSearchView();
                hideTitleView();

            }



            CharSequence rightButtonText = a.getText(R.styleable.PVToolBar_rightButtonText);
            if(rightButtonText !=null){
                setRightButtonText(rightButtonText);
            }



            a.recycle();
        }

    }
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:49,代码来源:PVToolBar.java


注:本文中的android.support.v7.widget.TintTypedArray.getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。