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

The following are Jave code examples for showing how to use isSelected() of the android.widget.ImageView class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: Weekdays-Selector   File: WeekdaysPicker.java   Source Code and License Vote up 6 votes
private void toggleSelection(View v) {
    ImageView day = (ImageView) v;
    if (day.isSelected()) {
        setDaySelected(day, false);
    } else {
        setDaySelected(day, true);
    }

    if (changeListener != null) {
        changeListener.onChange(this, (int) day.getTag(), getSelectedDays());
    }
}
 
Example 2
Project: Agora-Video-Source-Android   File: VideoChatViewActivity.java   Source Code and License Vote up 6 votes
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());
}
 
Example 3
Project: Agora-Video-Source-Android   File: VideoChatViewActivity.java   Source Code and License Vote up 6 votes
public void onLocalViewHidden(View view) {
    ImageView iv = (ImageView) view;
    if (iv.isSelected()) {
        iv.setSelected(false);
        iv.clearColorFilter();
        mCustomizedCameraRenderer.setViewHiddenStatus(false);
    } else {
        iv.setSelected(true);
        iv.setColorFilter(getResources().getColor(R.color.colorPrimary), PorterDuff.Mode.MULTIPLY);
        mCustomizedCameraRenderer.setViewHiddenStatus(true);
    }
}
 
Example 4
Project: Agora-Android-Voice-Tutorial-1to1   File: VoiceChatViewActivity.java   Source Code and License Vote up 6 votes
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());
}
 
Example 5
Project: Agora-Android-Voice-Tutorial-1to1   File: VoiceChatViewActivity.java   Source Code and License Vote up 6 votes
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());
}