Java Code Examples for android.widget.ImageView#isSelected()

The following examples show how to use android.widget.ImageView#isSelected() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StarShowActivity.java    From ShadowLayout with MIT License 5 votes vote down vote up
public boolean select(ImageView imageView) {
    if (imageView.isSelected()) {
        imageView.setSelected(false);
        return false;
    } else {
        imageView.setSelected(true);
        return true;
    }
}
 
Example 2
Source File: WeekdaysPicker.java    From Weekdays-Selector with MIT License 5 votes vote down vote up
private void toggleSelection(View v) {
    ImageView day = (ImageView) v;
    boolean selected = !day.isSelected();
    if (mSeceletOnlyOne) {
        unselectAllDays();
    }
    setDaySelected(day, selected);

    if (changeListener != null) {
        changeListener.onChange(this, (int) day.getTag(), getSelectedDays());
    }
}