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


Java StateSet.stateSetMatches方法代码示例

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


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

示例1: setState

import android.util.StateSet; //导入方法依赖的package包/类
/**
   * Called by View
   */
void setState(int[] state) {
  Tuple match = null;
  final int count = mTuples.size();
  for (int i = 0; i < count; i++) {
    final Tuple tuple = mTuples.get(i);
    if (StateSet.stateSetMatches(tuple.mSpecs, state)) {
      match = tuple;
      break;
    }
  }
  if (match == mLastMatch) {
    return;
  }
  if (mLastMatch != null) {
    cancel();
  }

  mLastMatch = match;

  if (match != null) {
    start(match);
  }
}
 
开发者ID:commonsguy,项目名称:cwac-crossport,代码行数:27,代码来源:StateListAnimator.java

示例2: setState

import android.util.StateSet; //导入方法依赖的package包/类
void setState(int[] state) {
    Tuple match = null;
    int count = this.mTuples.size();
    for (int i = 0; i < count; i++) {
        Tuple tuple = (Tuple) this.mTuples.get(i);
        if (StateSet.stateSetMatches(tuple.mSpecs, state)) {
            match = tuple;
            break;
        }
    }
    if (match != this.mLastMatch) {
        if (this.mLastMatch != null) {
            cancel();
        }
        this.mLastMatch = match;
        View view = (View) this.mViewRef.get();
        if (match != null && view != null && view.getVisibility() == 0) {
            start(match);
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:22,代码来源:StateListAnimator.java

示例3: setState

import android.util.StateSet; //导入方法依赖的package包/类
/**
 * Called by View
 */
void setState(int[] state) {
    Tuple match = null;
    final int count = mTuples.size();
    for (int i = 0; i < count; i++) {
        final Tuple tuple = mTuples.get(i);
        if (StateSet.stateSetMatches(tuple.mSpecs, state)) {
            match = tuple;
            break;
        }
    }
    if (match == mLastMatch) {
        return;
    }
    if (mLastMatch != null) {
        cancel();
    }

    mLastMatch = match;

    View view = mViewRef.get();
    if (match != null && view != null && view.getVisibility() == View.VISIBLE ) {
        start(match);
    }
}
 
开发者ID:GigigoGreenLabs,项目名称:permissionsModule,代码行数:28,代码来源:StateListAnimator.java

示例4: setState

import android.util.StateSet; //导入方法依赖的package包/类
/** Called by View */
void setState(int[] state) {
  Tuple match = null;
  final int count = tuples.size();
  for (int i = 0; i < count; i++) {
    final Tuple tuple = tuples.get(i);
    if (StateSet.stateSetMatches(tuple.specs, state)) {
      match = tuple;
      break;
    }
  }
  if (match == lastMatch) {
    return;
  }
  if (lastMatch != null) {
    cancel();
  }

  lastMatch = match;

  if (match != null) {
    start(match);
  }
}
 
开发者ID:material-components,项目名称:material-components-android,代码行数:25,代码来源:StateListAnimator.java

示例5: onStateChange

import android.util.StateSet; //导入方法依赖的package包/类
@Override
		protected boolean onStateChange(int[] state) {
			boolean active = StateSet.stateSetMatches(STATE_SELECTED, state) | StateSet.stateSetMatches(STATE_PRESSED, state);
			if (active != mActive) {
				mActive = active;
//				Log.d("FolderTransitionDrawable", "onStateChange " + StateSet.dump(state) + " " + active);
				if (!active) {
					unscheduleSelf(this);
					if (mAlpha != 255) {
						startTransition(false);
					}
				} else {
					scheduleSelf(this, SystemClock.uptimeMillis() + 500);
				}
				return true;
			}
			return false;
		}
 
开发者ID:colesadam,项目名称:hill-lists,代码行数:19,代码来源:FolderPicker.java

示例6: setState

import android.util.StateSet; //导入方法依赖的package包/类
public void setState(int[] newState) {
    if (Arrays.equals(newState, currentState))
        return;
    if (currentState != null)
        cancel();

    for (final int[] state : states) {
        if (StateSet.stateSetMatches(state, newState)) {
            int firstColor = super.getColorForState(currentState, getDefaultColor());
            int secondColor = super.getColorForState(newState, getDefaultColor());
            colorAnimation.setIntValues(firstColor, secondColor);
            currentState = newState;
            animatedColor = firstColor;
            colorAnimation.start();
            return;
        }
    }

    currentState = newState;
}
 
开发者ID:ZieIony,项目名称:Carbon,代码行数:21,代码来源:AnimatedColorStateList.java

示例7: setState

import android.util.StateSet; //导入方法依赖的package包/类
/**
 * Called by View
 */
public void setState(int[] state) {
    Tuple match = null;
    final int count = mTuples.size();
    for (int i = 0; i < count; i++) {
        final Tuple tuple = mTuples.get(i);
        if (StateSet.stateSetMatches(tuple.mSpecs, state)) {
            match = tuple;
            break;
        }
    }
    if (match == lastMatch) {
        return;
    }
    if (lastMatch != null) {
        cancel();
    }

    lastMatch = match;

    View view = (View) viewRef.get();
    if (match != null && view != null && view.getVisibility() == View.VISIBLE) {
        start(match);
    }
}
 
开发者ID:ZieIony,项目名称:Carbon,代码行数:28,代码来源:StateAnimator.java

示例8: setState

import android.util.StateSet; //导入方法依赖的package包/类
/** Called by View */
void setState(int[] state) {
  Tuple match = null;
  final int count = mTuples.size();
  for (int i = 0; i < count; i++) {
    final Tuple tuple = mTuples.get(i);
    if (StateSet.stateSetMatches(tuple.mSpecs, state)) {
      match = tuple;
      break;
    }
  }
  if (match == mLastMatch) {
    return;
  }
  if (mLastMatch != null) {
    cancel();
  }

  mLastMatch = match;

  if (match != null) {
    start(match);
  }
}
 
开发者ID:google,项目名称:iosched,代码行数:25,代码来源:StateListAnimator.java

示例9: getThemeColorStateList

import android.util.StateSet; //导入方法依赖的package包/类
public static ColorStateList getThemeColorStateList(Context context, ColorStateList origin) {
    if (origin == null) return null;

    if (origin.isStateful()) {
        TintInfo tintInfo = parseColorStateList(origin);
        if (tintInfo == null || tintInfo.isInvalid()) {
            return origin;
        }

        int[] newColors;
        int[][] newStates;
        int index = 0;
        boolean hasDisableColor = StateSet.stateSetMatches(tintInfo.mTintStates[0], DISABLED_STATE_SET);
        if (!hasDisableColor) {
            newStates = new int[tintInfo.mTintStates.length + 1][];
            newColors = new int[tintInfo.mTintStates.length + 1];
            newStates[index] = DISABLED_STATE_SET;
            newColors[index] = getDisabledThemeAttrColor(context, R.attr.themeColorSecondary);
            index++;
        } else {
            newStates = new int[tintInfo.mTintStates.length][];
            newColors = new int[tintInfo.mTintStates.length];
        }

        for (int i = 0; i < tintInfo.mTintStates.length; i++) {
            newStates[index] = tintInfo.mTintStates[i];
            newColors[index] = replaceColor(context, tintInfo.mTintColors[i]);
            index++;
        }
        return new ColorStateList(newStates, newColors);
    }
    return ColorStateList.valueOf(replaceColor(context, origin.getDefaultColor()));
}
 
开发者ID:Pingsh,项目名称:Mix,代码行数:34,代码来源:ThemeUtils.java

示例10: onStateChange

import android.util.StateSet; //导入方法依赖的package包/类
@Override
protected boolean onStateChange(int[] state) {
    if (StateSet.stateSetMatches(state, View.FOCUS_DOWN)) {
        mColor = COLOR_FOCUS_DOWN;
        mPaint.setColor(mColor);
        mTextPaint.setColor(mColor);
        return true;
    } else if (StateSet.stateSetMatches(state, View.FOCUS_UP)) {
        mColor = COLOR_FOCUS_UP;
        mPaint.setColor(mColor);
        mTextPaint.setColor(mColor);
        return true;
    }
    return false;
}
 
开发者ID:tao7,项目名称:FunEditText-Android,代码行数:16,代码来源:FunDrawable.java

示例11: onStateChange

import android.util.StateSet; //导入方法依赖的package包/类
@Override
protected boolean onStateChange(int[] stateSet) {
    final boolean useAlt = StateSet.stateSetMatches(DrawableStateSet.ENABLED_PRESSED_STATE_SET, stateSet)
            || StateSet.stateSetMatches(DrawableStateSet.ENABLED_FOCUSED_STATE_SET, stateSet);
    setColorFilter(useAlt ? mAltCf : mNormalCf);
    return true;
}
 
开发者ID:paristote,项目名称:mobile-android-studio,代码行数:8,代码来源:ActionBarDrawable.java

示例12: getColorForState

import android.util.StateSet; //导入方法依赖的package包/类
@Override
public int getColorForState(int[] stateSet, int defaultColor) {
    final int setLength = mStateSpecs.length;
    for (int i = 0; i < setLength; i++) {
        final int[] stateSpec = mStateSpecs[i];
        if (StateSet.stateSetMatches(stateSpec, stateSet)) {
            if (mAlphaCodeColors[i] != null) {
                return mAlphaCodeColors[i].getColorForState(stateSet, defaultColor);
            } else {
                return mColors[i];
            }
        }
    }
    return defaultColor;
}
 
开发者ID:Leao,项目名称:CodeColors,代码行数:16,代码来源:CcColorStateListList.java

示例13: getColorForState

import android.util.StateSet; //导入方法依赖的package包/类
@Override
public Integer getColorForState(@Nullable int[] stateSet, Integer defaultColor) {
    for (StateIndexValue stateIndexValue : mStateIndexValueList) {
        if (StateSet.stateSetMatches(stateIndexValue.getState(), stateSet)) {
            return stateIndexValue.getColor();
        }
    }
    return defaultColor;
}
 
开发者ID:Leao,项目名称:CodeColors,代码行数:10,代码来源:ColorHandler.java

示例14: indexOfStateSet

import android.util.StateSet; //导入方法依赖的package包/类
private int indexOfStateSet(int[] stateSet) {
    final int[][] stateSets = mStateSets;
    final int N = getChildCount();
    for (int i = 0; i < N; i++) {
        if (StateSet.stateSetMatches(stateSets[i], stateSet)) {
            return i;
        }
    }
    return -1;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:11,代码来源:StateListDrawable.java

示例15: onStateChange

import android.util.StateSet; //导入方法依赖的package包/类
@Override
protected boolean onStateChange(int[] state) {
	mActive = StateSet.stateSetMatches(STATE_FOCUSED, state) | StateSet.stateSetMatches(STATE_PRESSED, state);
	invalidateSelf();
	return false;
}
 
开发者ID:gskbyte,项目名称:kora,代码行数:7,代码来源:ColorDialog.java


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