use of me.drakeet.meizhi.util.PreferencesLoader in project Meizhi by drakeet.
the class MainActivity method initNotifiableItemState.
private void initNotifiableItemState(MenuItem item) {
PreferencesLoader loader = new PreferencesLoader(this);
item.setChecked(loader.getBoolean(R.string.action_notifiable, true));
}
use of me.drakeet.meizhi.util.PreferencesLoader in project Meizhi by drakeet.
the class MainActivity method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch(id) {
case R.id.action_trending:
openGitHubTrending();
return true;
case R.id.action_notifiable:
boolean isChecked = !item.isChecked();
item.setChecked(isChecked);
PreferencesLoader loader = new PreferencesLoader(this);
loader.saveBoolean(R.string.action_notifiable, isChecked);
Toasts.showShort(isChecked ? R.string.notifiable_on : R.string.notifiable_off);
return true;
}
return super.onOptionsItemSelected(item);
}
Aggregations