本文整理汇总了Java中android.widget.ImageButton.setColorFilter方法的典型用法代码示例。如果您正苦于以下问题:Java ImageButton.setColorFilter方法的具体用法?Java ImageButton.setColorFilter怎么用?Java ImageButton.setColorFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.ImageButton
的用法示例。
在下文中一共展示了ImageButton.setColorFilter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onClickSettings
import android.widget.ImageButton; //导入方法依赖的package包/类
/**
* onClickSettings toggles showing and hiding the Line Width, Smoothing, and Debug View toggle
*/
public void onClickSettings(View button) {
ImageButton settingsButton = findViewById(R.id.settingsButton);
if (mSettingsUI.getVisibility() == View.GONE) {
mSettingsUI.setVisibility(View.VISIBLE);
mLineDistanceScaleBar = findViewById(R.id.distanceScale);
mLineWidthBar = findViewById(R.id.lineWidth);
settingsButton.setColorFilter(getResources().getColor(R.color.active));
} else {
mSettingsUI.setVisibility(View.GONE);
settingsButton.setColorFilter(getResources().getColor(R.color.gray));
}
}
示例2: updateGenderIconFilter
import android.widget.ImageButton; //导入方法依赖的package包/类
private void updateGenderIconFilter(ImageButton button) {
if (button.isSelected()) {
button.setColorFilter(null);
} else {
button.setColorFilter(Color.GRAY, Mode.MULTIPLY);
}
}
示例3: setImageButtonColorAttr
import android.widget.ImageButton; //导入方法依赖的package包/类
/**
* Procedure sets ImageButton color given by attribute ID
*/
public static void setImageButtonColorAttr(Context context, ImageButton b, @AttrRes int resId)
{
final int c = CompatUtils.getThemeColorAttr(context, resId);
b.clearColorFilter();
b.setColorFilter(c, PorterDuff.Mode.SRC_ATOP);
}
示例4: settingAfterCreate
import android.widget.ImageButton; //导入方法依赖的package包/类
@Override
public void settingAfterCreate(boolean isSelected, final ImageButton imageViewButton) {
if (enableAutoSet) {
if (isSelected) {
imageViewButton.setColorFilter(getTheme().getAccentColor(), PorterDuff.Mode.SRC_IN);
} else {
imageViewButton.setColorFilter(getTheme().getNormalColor(), PorterDuff.Mode.SRC_IN);
}
}else {
imageViewButton.setColorFilter(getTheme().getNormalColor(), PorterDuff.Mode.SRC_IN);
}
}
示例5: setButtonEnabled
import android.widget.ImageButton; //导入方法依赖的package包/类
public void setButtonEnabled(ImageButton button, boolean enabled) {
button.setEnabled(enabled);
button.setAlpha(enabled ? 1.0f : 0.5f);
button.setColorFilter(enabled ? getButtonColor() : Color.GRAY, Mode.MULTIPLY);
}
示例6: initCaptionButtons
import android.widget.ImageButton; //导入方法依赖的package包/类
private void initCaptionButtons() {
final ImageButton buttonTextSettings = findViewById(R.id.settings_caption);
final ImageButton buttonOk = findViewById(R.id.done_caption);
buttonTextSettings.setColorFilter(R.color.black);
buttonOk.setColorFilter(R.color.black);
}
示例7: setButtonEnabled
import android.widget.ImageButton; //导入方法依赖的package包/类
private void setButtonEnabled(ImageButton button, boolean enabled) {
button.setEnabled(enabled);
button.setColorFilter(enabled ? Color.argb(255, 255, 255, 255) : Color.argb(255, 128, 128, 128));
}