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


Java TintTypedArray.getInt方法代码示例

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


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

示例1: setCollapsedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setCollapsedTextAppearance(int resId) {
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId, R.styleable.QMUITextAppearance);
    if (a.hasValue(R.styleable.QMUITextAppearance_android_textColor)) {
        mCollapsedTextColor = a.getColorStateList(R.styleable.QMUITextAppearance_android_textColor);
    }
    if (a.hasValue(R.styleable.QMUITextAppearance_android_textSize)) {
        mCollapsedTextSize = a.getDimensionPixelSize(R.styleable.QMUITextAppearance_android_textSize,
                (int) mCollapsedTextSize);
    }
    mCollapsedShadowColor = a.getInt(R.styleable.QMUITextAppearance_android_shadowColor, 0);
    mCollapsedShadowDx = a.getFloat(R.styleable.QMUITextAppearance_android_shadowDx, 0);
    mCollapsedShadowDy = a.getFloat(R.styleable.QMUITextAppearance_android_shadowDy, 0);
    mCollapsedShadowRadius = a.getFloat(R.styleable.QMUITextAppearance_android_shadowRadius, 0);
    a.recycle();

    if (Build.VERSION.SDK_INT >= 16) {
        mCollapsedTypeface = readFontFamilyTypeface(resId);
    }

    recalculate();
}
 
开发者ID:coopese,项目名称:qmui,代码行数:22,代码来源:QMUICollapsingTextHelper.java

示例2: setExpandedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setExpandedTextAppearance(int resId) {
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId, R.styleable.QMUITextAppearance);
    if (a.hasValue(R.styleable.QMUITextAppearance_android_textColor)) {
        mExpandedTextColor = a.getColorStateList(R.styleable.QMUITextAppearance_android_textColor);
    }
    if (a.hasValue(R.styleable.QMUITextAppearance_android_textSize)) {
        mExpandedTextSize = a.getDimensionPixelSize(R.styleable.QMUITextAppearance_android_textSize,
                (int) mExpandedTextSize);
    }
    mExpandedShadowColor = a.getInt(
            R.styleable.QMUITextAppearance_android_shadowColor, 0);
    mExpandedShadowDx = a.getFloat(
            R.styleable.QMUITextAppearance_android_shadowDx, 0);
    mExpandedShadowDy = a.getFloat(
            R.styleable.QMUITextAppearance_android_shadowDy, 0);
    mExpandedShadowRadius = a.getFloat(
            R.styleable.QMUITextAppearance_android_shadowRadius, 0);
    a.recycle();

    if (Build.VERSION.SDK_INT >= 16) {
        mExpandedTypeface = readFontFamilyTypeface(resId);
    }

    recalculate();
}
 
开发者ID:coopese,项目名称:qmui,代码行数:26,代码来源:QMUICollapsingTextHelper.java

示例3: setCollapsedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setCollapsedTextAppearance(int resId) {
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId,
            android.support.v7.appcompat.R.styleable.TextAppearance);
    if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
        mCollapsedTextColor = a.getColorStateList(
                android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
    }
    if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
        mCollapsedTextSize = a.getDimensionPixelSize(
                android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
                (int) mCollapsedTextSize);
    }
    mCollapsedShadowColor = a.getInt(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
    mCollapsedShadowDx = a.getFloat(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
    mCollapsedShadowDy = a.getFloat(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
    mCollapsedShadowRadius = a.getFloat(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
    a.recycle();
    if (Build.VERSION.SDK_INT >= 16) {
        mCollapsedTypeface = readFontFamilyTypeface(resId);
    }
    recalculate();
}
 
开发者ID:bufferapp,项目名称:BufferTextInputLayout,代码行数:27,代码来源:CollapsingTextHelper.java

示例4: setExpandedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
public void setExpandedTextAppearance(int resId) {
    TintTypedArray a = TintTypedArray.obtainStyledAttributes(mView.getContext(), resId,
            android.support.v7.appcompat.R.styleable.TextAppearance);
    if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
        mExpandedTextColor = a.getColorStateList(
                android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
    }
    if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
        mExpandedTextSize = a.getDimensionPixelSize(
                android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
                (int) mExpandedTextSize);
    }
    mExpandedShadowColor = a.getInt(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
    mExpandedShadowDx = a.getFloat(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
    mExpandedShadowDy = a.getFloat(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
    mExpandedShadowRadius = a.getFloat(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
    a.recycle();
    if (Build.VERSION.SDK_INT >= 16) {
        mExpandedTypeface = readFontFamilyTypeface(resId);
    }
    recalculate();
}
 
开发者ID:bufferapp,项目名称:BufferTextInputLayout,代码行数:27,代码来源:CollapsingTextHelper.java

示例5: setCollapsedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setCollapsedTextAppearance(int resId) {
  TintTypedArray a =
      TintTypedArray.obtainStyledAttributes(
          view.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
    collapsedTextColor =
        a.getColorStateList(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
  }
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
    collapsedTextSize =
        a.getDimensionPixelSize(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
            (int) collapsedTextSize);
  }
  collapsedShadowColor =
      a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
  collapsedShadowDx =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
  collapsedShadowDy =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
  collapsedShadowRadius =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
  a.recycle();

  if (Build.VERSION.SDK_INT >= 16) {
    collapsedTypeface = readFontFamilyTypeface(resId);
  }

  recalculate();
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:32,代码来源:CollapsingTextHelper.java

示例6: setExpandedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setExpandedTextAppearance(int resId) {
  TintTypedArray a =
      TintTypedArray.obtainStyledAttributes(
          view.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
    expandedTextColor =
        a.getColorStateList(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
  }
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
    expandedTextSize =
        a.getDimensionPixelSize(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
            (int) expandedTextSize);
  }
  expandedShadowColor =
      a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
  expandedShadowDx =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
  expandedShadowDy =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
  expandedShadowRadius =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
  a.recycle();

  if (Build.VERSION.SDK_INT >= 16) {
    expandedTypeface = readFontFamilyTypeface(resId);
  }

  recalculate();
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:32,代码来源:CollapsingTextHelper.java

示例7: setCollapsedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setCollapsedTextAppearance(int resId) {
  TintTypedArray a =
      TintTypedArray.obtainStyledAttributes(
          mView.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
    mCollapsedTextColor =
        a.getColorStateList(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
  }
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
    mCollapsedTextSize =
        a.getDimensionPixelSize(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
            (int) mCollapsedTextSize);
  }
  mCollapsedShadowColor =
      a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
  mCollapsedShadowDx =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
  mCollapsedShadowDy =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
  mCollapsedShadowRadius =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
  a.recycle();

  if (Build.VERSION.SDK_INT >= 16) {
    mCollapsedTypeface = readFontFamilyTypeface(resId);
  }

  recalculate();
}
 
开发者ID:google,项目名称:iosched,代码行数:32,代码来源:CollapsingTextHelper.java

示例8: setExpandedTextAppearance

import android.support.v7.widget.TintTypedArray; //导入方法依赖的package包/类
void setExpandedTextAppearance(int resId) {
  TintTypedArray a =
      TintTypedArray.obtainStyledAttributes(
          mView.getContext(), resId, android.support.v7.appcompat.R.styleable.TextAppearance);
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor)) {
    mExpandedTextColor =
        a.getColorStateList(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textColor);
  }
  if (a.hasValue(android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize)) {
    mExpandedTextSize =
        a.getDimensionPixelSize(
            android.support.v7.appcompat.R.styleable.TextAppearance_android_textSize,
            (int) mExpandedTextSize);
  }
  mExpandedShadowColor =
      a.getInt(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowColor, 0);
  mExpandedShadowDx =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDx, 0);
  mExpandedShadowDy =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowDy, 0);
  mExpandedShadowRadius =
      a.getFloat(android.support.v7.appcompat.R.styleable.TextAppearance_android_shadowRadius, 0);
  a.recycle();

  if (Build.VERSION.SDK_INT >= 16) {
    mExpandedTypeface = readFontFamilyTypeface(resId);
  }

  recalculate();
}
 
开发者ID:google,项目名称:iosched,代码行数:32,代码来源:CollapsingTextHelper.java

示例9: NumberAddSubView

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

    //把布局和当前类形成整体
    View.inflate(context, R.layout.number_add_sub_layout, this);
    btn_sub = (ImageView) findViewById(R.id.btn_sub);
    btn_add = (ImageView) findViewById(R.id.btn_add);
    tv_count = (TextView) findViewById(R.id.tv_count);

    getValue();

    //设置点击事件
    btn_add.setOnClickListener(this);
    btn_sub.setOnClickListener(this);

    if (attrs != null) {
        //取出属性
        TintTypedArray tintTypedArray = TintTypedArray.obtainStyledAttributes(context, attrs, R.styleable.NumberAddSubView);
        int value = tintTypedArray.getInt(R.styleable.NumberAddSubView_value, 0);
        if (value > 0) {
            setValue(value);
        }
        int minValue = tintTypedArray.getInt(R.styleable.NumberAddSubView_minValue, 0);
        if (value > 0) {
            setMinValue(minValue);
        }
        int maxValue = tintTypedArray.getInt(R.styleable.NumberAddSubView_maxValue, 0);
        if (value > 0) {
            setMaxValue(maxValue);
        }
        Drawable addDrawable = tintTypedArray.getDrawable(R.styleable.NumberAddSubView_numberAddBackground);
        if (addDrawable != null) {
            btn_add.setImageDrawable(addDrawable);
        }
        Drawable subDrawable = tintTypedArray.getDrawable(R.styleable.NumberAddSubView_numberSubBackground);
        if (subDrawable != null) {
            btn_sub.setImageDrawable(subDrawable);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:42,代码来源:NumberAddSubView.java

示例10: NumberAddSubView

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

    mInflater = LayoutInflater.from(context);
    initView();

    if (attrs != null) {

        final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
                R.styleable.NumberAddSubView, defStyleAttr, 0);


        int val = a.getInt(R.styleable.NumberAddSubView_value, 0);
        setValue(val);

        int maxVal = a.getInt(R.styleable.NumberAddSubView_maxValue, 0);
        if (maxVal != 0)
            setMaxValue(maxVal);

        int minVal = a.getInt(R.styleable.NumberAddSubView_minValue, 0);
        setMinValue(minVal);

        Drawable etBackground = a.getDrawable(R.styleable.NumberAddSubView_editBackground);
        if (etBackground != null)
            setEditTextBackground(etBackground);


        Drawable buttonAddBackground = a.getDrawable(R.styleable
                .NumberAddSubView_buttonAddBackgroud);
        if (buttonAddBackground != null)
            setButtonAddBackgroud(buttonAddBackground);

        Drawable buttonSubBackground = a.getDrawable(R.styleable
                .NumberAddSubView_buttonSubBackgroud);
        if (buttonSubBackground != null)
            setButtonSubBackgroud(buttonSubBackground);


        a.recycle();
    }
}
 
开发者ID:gaolhjy,项目名称:cniao5,代码行数:42,代码来源:NumberAddSubView.java

示例11: 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

示例12: NumberAddSubView

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

    mInflater = LayoutInflater.from(context);
    initView();

    if(attrs !=null){

        final TintTypedArray a = TintTypedArray.obtainStyledAttributes(getContext(), attrs,
                R.styleable.NumberAddSubView, defStyleAttr, 0);


        int val =  a.getInt(R.styleable.NumberAddSubView_value,0);
        setValue(val);

        int maxVal = a.getInt(R.styleable.NumberAddSubView_maxValue,0);
        if(maxVal!=0)
            setMaxValue(maxVal);

        int minVal = a.getInt(R.styleable.NumberAddSubView_minValue,0);
        setMinValue(minVal);

        Drawable etBackground = a.getDrawable(R.styleable.NumberAddSubView_editBackground);
        if(etBackground!=null)
            setEditTextBackground(etBackground);


         Drawable buttonAddBackground = a.getDrawable(R.styleable.NumberAddSubView_buttonAddBackgroud);
         if(buttonAddBackground!=null)
             setButtonAddBackgroud(buttonAddBackground);

        Drawable buttonSubBackground = a.getDrawable(R.styleable.NumberAddSubView_buttonSubBackgroud);
        if(buttonSubBackground!=null)
            setButtonSubBackgroud(buttonSubBackground);




        a.recycle();
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:42,代码来源:NumberAddSubView.java


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