本文整理汇总了Java中android.widget.ImageView.clearColorFilter方法的典型用法代码示例。如果您正苦于以下问题:Java ImageView.clearColorFilter方法的具体用法?Java ImageView.clearColorFilter怎么用?Java ImageView.clearColorFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ImageView
的用法示例。
在下文中一共展示了ImageView.clearColorFilter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onTouch
import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public boolean onTouch(View view, MotionEvent event) {
if (view instanceof ImageView) {
ImageView imageView = (ImageView) view;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
rect = new Rect(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
imageView.setColorFilter(FILTERED_GREY, PorterDuff.Mode.SRC_ATOP);
view.invalidate();
break;
}
case MotionEvent.ACTION_MOVE:
// if move inside button do nothing, otherwise clear filter
if(rect.contains(view.getLeft() + (int) event.getX(), view.getTop() + (int) event.getY()))
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL: // Action call when button is inside scrollable view
imageView.clearColorFilter();
view.invalidate();
}
}
return false;
}
示例2: onVoiceMuteClicked
import android.widget.ImageView; //导入方法依赖的package包/类
public void onVoiceMuteClicked(View view) {
log.info("onVoiceMuteClicked " + view + " " + mUidsList.size() + " video_status: " + mVideoMuted + " audio_status: " + mAudioMuted);
if (mUidsList.size() == 0) {
return;
}
RtcEngine rtcEngine = rtcEngine();
rtcEngine.muteLocalAudioStream(mAudioMuted = !mAudioMuted);
ImageView iv = (ImageView) view;
if (mAudioMuted) {
iv.setColorFilter(getResources().getColor(R.color.agora_blue), PorterDuff.Mode.MULTIPLY);
} else {
iv.clearColorFilter();
}
}
示例3: onBtnNClicked
import android.widget.ImageView; //导入方法依赖的package包/类
public void onBtnNClicked(View view) {
if (mVideoPreProcessing == null) {
mVideoPreProcessing = new VideoPreProcessing();
}
ImageView iv = (ImageView) view;
Object showing = view.getTag();
if (showing != null && (Boolean) showing) {
mVideoPreProcessing.enablePreProcessing(false);
iv.setTag(null);
iv.clearColorFilter();
} else {
mVideoPreProcessing.enablePreProcessing(true);
iv.setTag(true);
iv.setColorFilter(getResources().getColor(R.color.agora_blue), PorterDuff.Mode.MULTIPLY);
}
}
示例4: updateSettingsButton
import android.widget.ImageView; //导入方法依赖的package包/类
private static void updateSettingsButton() {
if (mPhoneStatusBar == null || SysUiManagers.IconManager == null) return;
try {
Object header = XposedHelpers.getObjectField(mPhoneStatusBar, "mHeader");
ImageView settingsButton = (ImageView) XposedHelpers.getObjectField(
header, Utils.isSamsungRom() ? "mSettingButton" : "mSettingsButton");
if (SysUiManagers.IconManager.isColoringEnabled()) {
settingsButton.setColorFilter(SysUiManagers.IconManager.getIconColor(),
PorterDuff.Mode.SRC_IN);
} else {
settingsButton.clearColorFilter();
}
} catch (Throwable t) {
XposedBridge.log(t);
}
}
示例5: onVoiceMuteClicked
import android.widget.ImageView; //导入方法依赖的package包/类
public void onVoiceMuteClicked(View view) {
log.info("onVoiceMuteClicked " + view + " audio_status: " + mAudioMuted);
RtcEngine rtcEngine = rtcEngine();
rtcEngine.muteLocalAudioStream(mAudioMuted = !mAudioMuted);
ImageView iv = (ImageView) view;
if (mAudioMuted) {
iv.setColorFilter(getResources().getColor(R.color.agora_blue), PorterDuff.Mode.MULTIPLY);
} else {
iv.clearColorFilter();
}
}
示例6: notifyHeadsetPlugged
import android.widget.ImageView; //导入方法依赖的package包/类
public void notifyHeadsetPlugged(final int routing) {
log.info("notifyHeadsetPlugged " + routing);
mAudioRouting = routing;
ImageView iv = (ImageView) findViewById(R.id.switch_speaker_id);
if (mAudioRouting == 3) { // Speakerphone
iv.setColorFilter(getResources().getColor(R.color.agora_blue), PorterDuff.Mode.MULTIPLY);
} else {
iv.clearColorFilter();
}
}
示例7: onLocalAudioMuteClicked
import android.widget.ImageView; //导入方法依赖的package包/类
public void onLocalAudioMuteClicked(View view) {
ImageView iv = (ImageView) view;
if (iv.isSelected()) {
iv.setSelected(false);
iv.clearColorFilter();
} else {
iv.setSelected(true);
iv.setColorFilter(getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY);
}
mRtcEngine.muteLocalAudioStream(iv.isSelected());
}
示例8: resetToVideoEnabledUI
import android.widget.ImageView; //导入方法依赖的package包/类
private void resetToVideoEnabledUI() {
ImageView iv = (ImageView) findViewById(R.id.customized_function_id);
iv.setImageResource(R.drawable.btn_switch_camera);
iv.clearColorFilter();
notifyHeadsetPlugged(mAudioRouting);
}
示例9: resetToVideoDisabledUI
import android.widget.ImageView; //导入方法依赖的package包/类
private void resetToVideoDisabledUI() {
ImageView iv = (ImageView) findViewById(R.id.customized_function_id);
iv.setImageResource(R.drawable.btn_speaker);
iv.clearColorFilter();
notifyHeadsetPlugged(mAudioRouting);
}
示例10: setImageViewColor
import android.widget.ImageView; //导入方法依赖的package包/类
private void setImageViewColor(ImageView view, int color) {
if (color == ORIGIN_COLOR) {
view.clearColorFilter();
} else {
view.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
}
}
示例11: setKeyColorRecursive
import android.widget.ImageView; //导入方法依赖的package包/类
private static void setKeyColorRecursive(ViewGroup vg) {
if (vg == null) return;
final int childCount = vg.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = vg.getChildAt(i);
if (child instanceof ViewGroup) {
setKeyColorRecursive((ViewGroup) child);
} else if (child instanceof ImageView) {
ImageView imgv = (ImageView) vg.getChildAt(i);
if (mNavbarColorsEnabled) {
imgv.setColorFilter(mKeyColor, PorterDuff.Mode.SRC_ATOP);
} else {
imgv.clearColorFilter();
}
if (imgv.getClass().getName().equals(CLASS_KEY_BUTTON_VIEW) &&
!mNavbarColorsEnabled) {
Drawable ripple = imgv.getBackground();
if (ripple != null &&
ripple.getClass().getName().equals(CLASS_KEY_BUTTON_RIPPLE)) {
Paint paint = (Paint) XposedHelpers.getObjectField(ripple, "mRipplePaint");
if (paint != null) {
paint.setColor(0xffffffff);
}
}
} else if (imgv instanceof KeyButtonView) {
((KeyButtonView) imgv).setGlowColor(mNavbarColorsEnabled ?
mKeyGlowColor : mKeyDefaultGlowColor);
}
}
}
}
示例12: onSwitchSpeakerphoneClicked
import android.widget.ImageView; //导入方法依赖的package包/类
public void onSwitchSpeakerphoneClicked(View view) {
ImageView iv = (ImageView) view;
if (iv.isSelected()) {
iv.setSelected(false);
iv.clearColorFilter();
} else {
iv.setSelected(true);
iv.setColorFilter(getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY);
}
mRtcEngine.setEnableSpeakerphone(view.isSelected());
}
示例13: setImage
import android.widget.ImageView; //导入方法依赖的package包/类
public void setImage(final ImageView image, int res, int color)
{
image.setVisibility(View.VISIBLE);
image.setImageResource(res);
image.clearColorFilter();
image.setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
}
示例14: setResult
import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void setResult(ImageView imageView, LoadTaskItem taskItem) {
if (DBG) Log.d(TAG, "setResult : " + taskItem.result.bitmap);
imageView.setImageBitmap(taskItem.result.bitmap);
imageView.clearColorFilter();
}
示例15: setResult
import android.widget.ImageView; //导入方法依赖的package包/类
@Override
public void setResult(ImageView imageView, LoadTaskItem taskItem) {
imageView.setImageBitmap(taskItem.result.bitmap);
imageView.clearColorFilter();
}