android.widget.ImageButton# setColorFilter ( ) 源码实例Demo

下面列出了android.widget.ImageButton# setColorFilter ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: PowerFileExplorer   文件: ZipAdapter.java

public ViewHolder(final View convertView) {
	super(convertView);
	name = (TextView) convertView.findViewById(R.id.name);
	size = (TextView) convertView.findViewById(R.id.items);
	attr = (TextView) convertView.findViewById(R.id.attr);
	lastModified = (TextView) convertView.findViewById(R.id.lastModified);
	type = (TextView) convertView.findViewById(R.id.type);
	cbx = (ImageButton) convertView.findViewById(R.id.cbx);
	image = (ImageView)convertView.findViewById(R.id.icon);
	more = (ImageButton)convertView.findViewById(R.id.more);

	more.setColorFilter(Constants.TEXT_COLOR);

	name.setTextColor(Constants.DIR_COLOR);
	size.setTextColor(Constants.TEXT_COLOR);
	//attr.setTextColor(Constants.TEXT_COLOR);
	lastModified.setTextColor(Constants.TEXT_COLOR);
	if (type != null) {
		type.setTextColor(Constants.TEXT_COLOR);
	}
	image.setScaleType(ImageView.ScaleType.FIT_CENTER);
	convertView.setTag(this);
	this.convertedView = convertView;
}
 

/**
 * Ensure that the chrome, control, and text colors displayed on the screen are correct.
 */
public void updateColors() {
  currentTime.setTextColor(textColor);
  endTime.setTextColor(textColor);
  videoTitleView.setTextColor(textColor);

  fullscreenButton.setColorFilter(controlColor);
  pausePlayButton.setColorFilter(controlColor);
  seekBar.getProgressDrawable().setColorFilter(seekbarColor, PorterDuff.Mode.SRC_ATOP);
  seekBar.getThumb().setColorFilter(seekbarColor, PorterDuff.Mode.SRC_ATOP);

  // Hide the thumb drawable if the SeekBar is disabled
  if (canSeek) {
    seekBar.getThumb().mutate().setAlpha(255);
  } else {
    seekBar.getThumb().mutate().setAlpha(0);
  }

  for (ImageButton imageButton : actionButtons) {
    imageButton.setColorFilter(controlColor);
  }

  topChrome.setBackgroundColor(chromeColor);
  bottomChrome.setBackgroundColor(chromeColor);
}
 

private void addIconTabWithCounter(final int position, int resId)
{
    ImageButton tab = new ImageButton(getContext());
    tab.setImageResource(resId);
    tab.setColorFilter(position == pager.getCurrentItem() ? tabTextIconSelectedColor : tabTextIconUnselectedColor, PorterDuff.Mode.SRC_IN);
    tab.setScaleType(ImageView.ScaleType.CENTER);
    addTabWithCounter(position, tab);
}
 
源代码4 项目: Androzic   文件: SuitableMapsList.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
	View view = inflater.inflate(R.layout.dlg_suitable_maps_list, container, false);
	listView = (ListView) view.findViewById(android.R.id.list);
	View infoButton = view.findViewById(R.id.information_button);
	infoButton.setOnClickListener(onMapInformation);
	ImageButton editButton = (ImageButton) view.findViewById(R.id.edit_button);
	editButton.setColorFilter(disable);
	editButton.setOnClickListener(onMapEdit);
	openButton = view.findViewById(R.id.open_button);
	openButton.setOnClickListener(onMapOpen);
	return view;
}
 
源代码5 项目: PowerFileExplorer   文件: HiddenAdapter.java

ViewHolder(final View view) {
          super(view);

          txtTitle = (TextView) view.findViewById(R.id.text1);
          image = (ImageButton) view.findViewById(R.id.delete_button);
          txtDesc = (TextView) view.findViewById(R.id.text2);
          row = (LinearLayout) view.findViewById(R.id.bookmarkrow);
	image.setColorFilter(Constants.TEXT_COLOR);
	txtDesc.setTextColor(Constants.TEXT_COLOR);
}
 
源代码6 项目: PowerFileExplorer   文件: AppsFragment.java

private ViewHolder(View convertView) {
	super(convertView);
	name = (TextView) convertView.findViewById(R.id.name);
	items = (TextView) convertView.findViewById(R.id.items);
	attr = (TextView) convertView.findViewById(R.id.attr);
	lastModified = (TextView) convertView.findViewById(R.id.lastModified);
	type = (TextView) convertView.findViewById(R.id.type);
	cbx = (ImageButton) convertView.findViewById(R.id.cbx);
	image = (ImageView) convertView.findViewById(R.id.icon);
	more = (ImageButton) convertView.findViewById(R.id.more);
	ll = convertView;

	ll.setTag(this);
	ll.setOnClickListener(AppsAdapter.this);
	cbx.setOnClickListener(AppsAdapter.this);

	ll.setOnLongClickListener(AppsAdapter.this);
	cbx.setOnLongClickListener(AppsAdapter.this);
	more.setOnClickListener(AppsAdapter.this);

	more.setColorFilter(Constants.TEXT_COLOR);
	name.setTextColor(Constants.DIR_COLOR);
	items.setTextColor(Constants.TEXT_COLOR);
	attr.setTextColor(Constants.TEXT_COLOR);
	lastModified.setTextColor(Constants.TEXT_COLOR);
	type.setTextColor(Constants.TEXT_COLOR);
}
 
源代码7 项目: Birdays   文件: MonthFragmentAdapter.java

private void disableButton(ImageButton button) {
    if (nightMode()) {
        button.setColorFilter(Color.rgb(112, 112, 112));
    } else {
        button.setColorFilter(Color.rgb(224, 224, 224));
    }
    button.setClickable(false);
}
 

private void addIconTabWithCounter(final int position, int resId)
{
    ImageButton tab = new ImageButton(getContext());
    tab.setImageResource(resId);
    tab.setColorFilter(position == pager.getCurrentItem() ? tabTextIconSelectedColor : tabTextIconUnselectedColor, PorterDuff.Mode.SRC_IN);
    tab.setScaleType(ImageView.ScaleType.CENTER);
    addTabWithCounter(position, tab);
}
 
源代码9 项目: ar-drawing-java   文件: DrawAR.java

/**
 * 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));
    }
}
 
源代码10 项目: Emoji   文件: EmojiView.java

private ImageButton inflateButton(final Context context, @DrawableRes final int icon, @StringRes final int categoryName, final ViewGroup parent) {
  final ImageButton button = (ImageButton) LayoutInflater.from(context).inflate(R.layout.emoji_view_category, parent, false);

  button.setImageDrawable(AppCompatResources.getDrawable(context, icon));
  button.setColorFilter(themeIconColor, PorterDuff.Mode.SRC_IN);
  button.setContentDescription(context.getString(categoryName));

  parent.addView(button);

  return button;
}
 
源代码11 项目: mupdf-android   文件: MuPDFActivity.java

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));
}
 
源代码12 项目: PowerFileExplorer   文件: PDFFragment.java

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));
}
 

private void setActionOff(ImageButton view){
	view.setBackgroundResource(0);
	view.setColorFilter(App.CONTEXT.getResources().getColor(R.color.md_blue_grey_300));
}
 
源代码14 项目: Mupdf   文件: DocumentActivity.java

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));
}
 

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));
}
 
源代码16 项目: AndroidMuPDF   文件: DocumentActivity.java

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));
}
 
源代码17 项目: financisto   文件: FilterState.java

static void updateFilterColor(Context context, WhereFilter filter, ImageButton button) {
    int color = filter.isEmpty() ? context.getResources().getColor(R.color.bottom_bar_tint) : context.getResources().getColor(R.color.holo_blue_dark);
    button.setColorFilter(color);
}
 
源代码18 项目: mupdf-android   文件: MuPDFFragment.java

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));
}
 

private void setActionOn(ImageButton view){
	view.setBackgroundResource(R.drawable.background_rich_edit_action_on);
	view.setColorFilter(App.CONTEXT.getResources().getColor(R.color.md_blue_grey_500));
}
 
源代码20 项目: GithubApp   文件: AppIntro.java

/**
 * Override next button arrow color
 *
 * @param color your color
 */
public void setNextArrowColor(@ColorInt final int color) {
    ImageButton nextButton = (ImageButton) findViewById(R.id.next);
    nextButton.setColorFilter(color);
}