Example usage for android.widget RadioGroup equals

List of usage examples for android.widget RadioGroup equals

Introduction

In this page you can find the example usage for android.widget RadioGroup equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:in.blogspot.anselmbros.torchie.ui.fragment.SettingsFragment.java

@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
    if (group.equals(rg_screen_off_options)) {
        if (checkedId == R.id.rb_settings_screen_off_indefinite) {
            prefEditor.putBoolean(TorchieConstants.PREF_FUNC_SCREEN_OFF_INDEFINITE, true).commit();
        } else if (checkedId == R.id.rb_settings_screen_off_timeout) {
            prefEditor.putBoolean(TorchieConstants.PREF_FUNC_SCREEN_OFF_INDEFINITE, false).commit();
        }//www .  j a v  a2s  . c om
    } else if (group.equals(rg_flash_source)) {
        if (checkedId == R.id.rb_settings_flash_camera) {
            prefEditor.putInt(TorchieConstants.PREF_FLASH_SOURCE, TorchieConstants.SOURCE_FLASH_CAMERA)
                    .commit();
        } else if (checkedId == R.id.rb_settings_flash_screen) {
            prefEditor.putInt(TorchieConstants.PREF_FLASH_SOURCE, TorchieConstants.SOURCE_FLASH_SCREEN)
                    .commit();
        }
    } else if (group.equals(rg_flash_time_options)) {
        if (checkedId == R.id.rb_flash_off_time_indefinite) {
            prefEditor.putBoolean(TorchieConstants.PREF_FUNC_FLASH_OFF_INDEFINITE, true).commit();
        } else if (checkedId == R.id.rb_flash_off_time) {
            prefEditor.putBoolean(TorchieConstants.PREF_FUNC_FLASH_OFF_INDEFINITE, false).commit();
        }
    }
}

From source file:com.boostcamp.hyeon.wallpaper.setting.view.SettingFragment.java

@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
    RadioButton radioButton = (RadioButton) group.findViewById(checkedId);
    if (radioButton == null)
        return;/*from   w ww .  ja v  a 2 s.c o  m*/
    if (group.equals(mChangeRepeatCycleRadioGroup) && radioButton.isChecked()) {
        String value = radioButton.getText().toString();
        int minute = value.indexOf(getString(R.string.label_minute));
        int hour = value.indexOf(getString(R.string.label_hour));

        if (minute != -1 && hour == -1) {
            mChangeCycle = Integer.valueOf(value.substring(0, minute));
            mChangeCycle *= Define.MINUTE_CONVERT_TO_MILLIS;
        } else if (minute == -1 && hour != -1) {
            mChangeCycle = Integer.valueOf(value.substring(0, hour));
            mChangeCycle *= Define.HOUR_CONVERT_TO_MILLIS;
        } else {
            mChangeCycle = Define.CHANGE_CYCLE_SCREEN_OFF;
        }
        Log.d(TAG, "change cycle: " + mChangeCycle);
    }
}