use of android.widget.ImageButton in project AntennaPod by AntennaPod.
the class PlaybackController method updatePlayButtonAppearance.
private void updatePlayButtonAppearance(int resource, CharSequence contentDescription) {
ImageButton butPlay = getPlayButton();
if (butPlay != null) {
butPlay.setImageResource(resource);
butPlay.setContentDescription(contentDescription);
}
}
use of android.widget.ImageButton in project android_frameworks_base by DirtyUnicorns.
the class ManualActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.manual_layout);
onCreateCommon(mRunnable);
mSoftwareView = (MainView) findViewById(R.id.software_view);
mSoftwareView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
mSoftwareView.setBackgroundColor(Color.WHITE);
mSoftwareView.addDrawCallback(mDrawCallback);
mCompareImageView = (ImageView) findViewById(R.id.compare_image_view);
int width = getResources().getDimensionPixelSize(R.dimen.layer_width);
int height = getResources().getDimensionPixelSize(R.dimen.layer_height);
mCompareBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
mErrorTextView = (TextView) findViewById(R.id.current_error);
((ImageButton) findViewById(R.id.next)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DisplayModifier.step();
updateSpinners();
redrawViews();
}
});
((ImageButton) findViewById(R.id.previous)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
DisplayModifier.stepBack();
updateSpinners();
redrawViews();
}
});
((Button) findViewById(R.id.show_hardware_version)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_HARDWARE;
mHandler.post(mRunnable);
}
});
((Button) findViewById(R.id.show_software_version)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_SOFTWARE;
mHandler.post(mRunnable);
}
});
((Button) findViewById(R.id.show_error_heatmap)).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mCompareImageViewState = COMPARE_VIEW_HEATMAP;
mHandler.post(mRunnable);
}
});
buildSpinnerLayout();
}
use of android.widget.ImageButton in project Etar-Calendar by Etar-Group.
the class AttendeesView method updateAttendeeView.
/**
* Set up each element in {@link AttendeeItem#mView} using the latest information. View
* object is reused.
*/
private View updateAttendeeView(AttendeeItem item) {
final Attendee attendee = item.mAttendee;
final View view = item.mView;
final TextView nameView = (TextView) view.findViewById(R.id.name);
nameView.setText(TextUtils.isEmpty(attendee.mName) ? attendee.mEmail : attendee.mName);
if (item.mRemoved) {
nameView.setPaintFlags(Paint.STRIKE_THRU_TEXT_FLAG | nameView.getPaintFlags());
} else {
nameView.setPaintFlags((~Paint.STRIKE_THRU_TEXT_FLAG) & nameView.getPaintFlags());
}
// Set up the Image button even if the view is disabled
// Everything will be ready when the view is enabled later
final ImageButton button = (ImageButton) view.findViewById(R.id.contact_remove);
button.setVisibility(isEnabled() ? View.VISIBLE : View.GONE);
button.setTag(item);
if (item.mRemoved) {
button.setImageResource(R.drawable.ic_menu_add_field_holo_light);
button.setContentDescription(mContext.getString(R.string.accessibility_add_attendee));
} else {
button.setImageResource(R.drawable.ic_menu_remove_field_holo_light);
button.setContentDescription(mContext.getString(R.string.accessibility_remove_attendee));
}
button.setOnClickListener(this);
final QuickContactBadge badgeView = (QuickContactBadge) view.findViewById(R.id.badge);
Drawable badge = null;
// Search for photo in recycled photos
if (mRecycledPhotos != null) {
badge = mRecycledPhotos.get(item.mAttendee.mEmail);
}
if (badge != null) {
item.mBadge = badge;
}
badgeView.setImageDrawable(item.mBadge);
if (item.mAttendee.mStatus == Attendees.ATTENDEE_STATUS_NONE) {
item.mBadge.setAlpha(mNoResponsePhotoAlpha);
} else {
item.mBadge.setAlpha(mDefaultPhotoAlpha);
}
if (item.mAttendee.mStatus == Attendees.ATTENDEE_STATUS_DECLINED) {
item.mBadge.setColorFilter(mGrayscaleFilter);
} else {
item.mBadge.setColorFilter(null);
}
// the lookup uri (yet), we can set Email and QuickContact will lookup once tapped.
if (item.mContactLookupUri != null) {
badgeView.assignContactUri(item.mContactLookupUri);
} else {
badgeView.assignContactFromEmail(item.mAttendee.mEmail, true);
}
badgeView.setMaxHeight(60);
return view;
}
use of android.widget.ImageButton in project Etar-Calendar by Etar-Group.
the class EventViewUtils method addReminder.
/**
* Adds a reminder to the displayed list of reminders. The values/labels
* arrays must not change after calling here, or the spinners we created
* might index into the wrong entry. Returns true if successfully added
* reminder, false if no reminders can be added.
*
* onItemSelected allows a listener to be set for any changes to the
* spinners in the reminder. If a listener is set it will store the
* initial position of the spinner into the spinner's tag for comparison
* with any new position setting.
*/
public static boolean addReminder(Activity activity, View view, View.OnClickListener listener, ArrayList<LinearLayout> items, ArrayList<Integer> minuteValues, ArrayList<String> minuteLabels, ArrayList<Integer> methodValues, ArrayList<String> methodLabels, ReminderEntry newReminder, int maxReminders, OnItemSelectedListener onItemSelected) {
if (items.size() >= maxReminders) {
return false;
}
LayoutInflater inflater = activity.getLayoutInflater();
LinearLayout parent = (LinearLayout) view.findViewById(R.id.reminder_items_container);
LinearLayout reminderItem = (LinearLayout) inflater.inflate(R.layout.edit_reminder_item, null);
parent.addView(reminderItem);
ImageButton reminderRemoveButton;
reminderRemoveButton = (ImageButton) reminderItem.findViewById(R.id.reminder_remove);
reminderRemoveButton.setOnClickListener(listener);
/*
* The spinner has the default set of labels from the string resource file, but we
* want to drop in our custom set of labels because it may have additional entries.
*/
Spinner spinner = (Spinner) reminderItem.findViewById(R.id.reminder_minutes_value);
setReminderSpinnerLabels(activity, spinner, minuteLabels);
int index = findMinutesInReminderList(minuteValues, newReminder.getMinutes());
spinner.setSelection(index);
if (onItemSelected != null) {
spinner.setTag(index);
spinner.setOnItemSelectedListener(onItemSelected);
}
/*
* Configure the alert-method spinner. Methods not supported by the current Calendar
* will not be shown.
*/
spinner = (Spinner) reminderItem.findViewById(R.id.reminder_method_value);
setReminderSpinnerLabels(activity, spinner, methodLabels);
index = findMethodInReminderList(methodValues, newReminder.getMethod());
spinner.setSelection(index);
if (onItemSelected != null) {
spinner.setTag(index);
spinner.setOnItemSelectedListener(onItemSelected);
}
items.add(reminderItem);
return true;
}
use of android.widget.ImageButton in project android_frameworks_base by DirtyUnicorns.
the class SimplePlayer method set.
public void set(Context context, int playPausebuttonId, ImageView playPausebutton, int stopButtonId, ImageView stopButton, TextView sessionText, int stream, int session) {
mContext = context;
mPlayPauseButtonId = playPausebuttonId;
mStopButtonId = stopButtonId;
mPlayPauseButton = (ImageButton) playPausebutton;
ImageButton stop = (ImageButton) stopButton;
mPlayPauseButton.setOnClickListener(this);
mPlayPauseButton.requestFocus();
stop.setOnClickListener(this);
mPlayImageResource = android.R.drawable.ic_media_play;
mPauseImageResource = android.R.drawable.ic_media_pause;
mStreamType = stream;
mSession = session;
mSessionText = sessionText;
}
Aggregations