use of com.quran.labs.androidquran.ui.fragment.JumpFragment in project quran_android by quran.
the class PagerActivity method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final int itemId = item.getItemId();
if (itemId == R.id.favorite_item) {
int page = getCurrentPage();
toggleBookmark(null, null, page);
return true;
} else if (itemId == R.id.goto_quran) {
switchToQuran();
return true;
} else if (itemId == R.id.goto_translation) {
switchToTranslation();
return true;
} else if (itemId == R.id.night_mode) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
SharedPreferences.Editor prefsEditor = prefs.edit();
final boolean isNightMode = !item.isChecked();
prefsEditor.putBoolean(Constants.PREF_NIGHT_MODE, isNightMode).apply();
item.setIcon(isNightMode ? R.drawable.ic_night_mode : R.drawable.ic_day_mode);
item.setChecked(isNightMode);
refreshQuranPages();
return true;
} else if (itemId == R.id.settings) {
Intent i = new Intent(this, QuranPreferenceActivity.class);
startActivity(i);
return true;
} else if (itemId == R.id.help) {
Intent i = new Intent(this, HelpActivity.class);
startActivity(i);
return true;
} else if (itemId == android.R.id.home) {
finish();
return true;
} else if (itemId == R.id.jump) {
FragmentManager fm = getSupportFragmentManager();
JumpFragment jumpDialog = new JumpFragment();
jumpDialog.show(fm, JumpFragment.TAG);
return true;
}
return super.onOptionsItemSelected(item);
}
use of com.quran.labs.androidquran.ui.fragment.JumpFragment in project quran_android by quran.
the class QuranActivity method gotoPageDialog.
private void gotoPageDialog() {
if (!isPaused) {
FragmentManager fm = getSupportFragmentManager();
JumpFragment jumpDialog = new JumpFragment();
jumpDialog.show(fm, JumpFragment.TAG);
}
}
Aggregations