mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-07 03:07:26 +01:00
Fix a minor string issue.
This commit is contained in:
parent
68b1c6a7f4
commit
29b6c66ae2
@ -676,46 +676,35 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
||||
@Override
|
||||
public void onMenuClick(int stringId) {
|
||||
Intent intent = null;
|
||||
switch (stringId) {
|
||||
case R.string.profile:
|
||||
if (stringId == R.string.profile) {
|
||||
intent = new Intent(MainActivity.this, ViewUserDetailActivity.class);
|
||||
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, mAccountName);
|
||||
break;
|
||||
case R.string.subscriptions:
|
||||
} else if (stringId == R.string.subscriptions) {
|
||||
intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class);
|
||||
break;
|
||||
case R.string.multi_reddit:
|
||||
} else if (stringId == R.string.multi_reddit) {
|
||||
intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class);
|
||||
intent.putExtra(SubscribedThingListingActivity.EXTRA_SHOW_MULTIREDDITS, true);
|
||||
break;
|
||||
case R.string.inbox:
|
||||
} else if (stringId == R.string.inbox) {
|
||||
intent = new Intent(MainActivity.this, InboxActivity.class);
|
||||
break;
|
||||
case R.string.upvoted:
|
||||
} else if (stringId == R.string.upvoted) {
|
||||
intent = new Intent(MainActivity.this, AccountPostsActivity.class);
|
||||
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_UPVOTED);
|
||||
break;
|
||||
case R.string.downvoted:
|
||||
} else if (stringId == R.string.downvoted) {
|
||||
intent = new Intent(MainActivity.this, AccountPostsActivity.class);
|
||||
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_DOWNVOTED);
|
||||
break;
|
||||
case R.string.hidden:
|
||||
} else if (stringId == R.string.hidden) {
|
||||
intent = new Intent(MainActivity.this, AccountPostsActivity.class);
|
||||
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_HIDDEN);
|
||||
break;
|
||||
case R.string.saved:
|
||||
} else if (stringId == R.string.account_saved_thing_activity_label) {
|
||||
intent = new Intent(MainActivity.this, AccountSavedThingActivity.class);
|
||||
break;
|
||||
case R.string.gilded:
|
||||
} else if (stringId == R.string.gilded) {
|
||||
intent = new Intent(MainActivity.this, AccountPostsActivity.class);
|
||||
intent.putExtra(AccountPostsActivity.EXTRA_USER_WHERE, PostDataSource.USER_WHERE_GILDED);
|
||||
break;
|
||||
case R.string.light_theme:
|
||||
} else if (stringId == R.string.light_theme) {
|
||||
mSharedPreferences.edit().putString(SharedPreferencesUtils.THEME_KEY, "0").apply();
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_NO);
|
||||
mCustomThemeWrapper.setThemeType(CustomThemeSharedPreferencesUtils.LIGHT);
|
||||
break;
|
||||
case R.string.dark_theme:
|
||||
} else if (stringId == R.string.dark_theme) {
|
||||
mSharedPreferences.edit().putString(SharedPreferencesUtils.THEME_KEY, "1").apply();
|
||||
AppCompatDelegate.setDefaultNightMode(MODE_NIGHT_YES);
|
||||
if (mSharedPreferences.getBoolean(SharedPreferencesUtils.AMOLED_DARK_KEY, false)) {
|
||||
@ -723,42 +712,35 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb
|
||||
} else {
|
||||
mCustomThemeWrapper.setThemeType(CustomThemeSharedPreferencesUtils.DARK);
|
||||
}
|
||||
break;
|
||||
case R.string.enable_nsfw:
|
||||
} else if (stringId == R.string.enable_nsfw) {
|
||||
if (sectionsPagerAdapter != null) {
|
||||
mNsfwAndSpoilerSharedPreferences.edit().putBoolean((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.NSFW_BASE, true).apply();
|
||||
sectionsPagerAdapter.changeNSFW(true);
|
||||
}
|
||||
break;
|
||||
case R.string.disable_nsfw:
|
||||
} else if (stringId == R.string.disable_nsfw) {
|
||||
if (sectionsPagerAdapter != null) {
|
||||
mNsfwAndSpoilerSharedPreferences.edit().putBoolean((mAccountName == null ? "" : mAccountName) + SharedPreferencesUtils.NSFW_BASE, false).apply();
|
||||
sectionsPagerAdapter.changeNSFW(false);
|
||||
}
|
||||
break;
|
||||
case R.string.settings:
|
||||
} else if (stringId == R.string.settings) {
|
||||
intent = new Intent(MainActivity.this, SettingsActivity.class);
|
||||
break;
|
||||
case R.string.add_account:
|
||||
} else if (stringId == R.string.add_account) {
|
||||
Intent addAccountIntent = new Intent(MainActivity.this, LoginActivity.class);
|
||||
startActivityForResult(addAccountIntent, LOGIN_ACTIVITY_REQUEST_CODE);
|
||||
break;
|
||||
case R.string.anonymous_account:
|
||||
} else if (stringId == R.string.anonymous_account) {
|
||||
new SwitchToAnonymousAccountAsyncTask(mRedditDataRoomDatabase, false,
|
||||
() -> {
|
||||
Intent anonymousIntent = new Intent(MainActivity.this, MainActivity.class);
|
||||
startActivity(anonymousIntent);
|
||||
finish();
|
||||
}).execute();
|
||||
break;
|
||||
case R.string.log_out:
|
||||
} else if (stringId == R.string.log_out) {
|
||||
new SwitchToAnonymousAccountAsyncTask(mRedditDataRoomDatabase, true,
|
||||
() -> {
|
||||
Intent logOutIntent = new Intent(MainActivity.this, MainActivity.class);
|
||||
startActivity(logOutIntent);
|
||||
finish();
|
||||
}).execute();
|
||||
|
||||
}
|
||||
if (intent != null) {
|
||||
startActivity(intent);
|
||||
|
@ -293,7 +293,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re
|
||||
drawableId = R.drawable.ic_outline_lock_24dp;
|
||||
break;
|
||||
case 10:
|
||||
stringId = R.string.saved;
|
||||
stringId = R.string.account_saved_thing_activity_label;
|
||||
drawableId = R.drawable.ic_outline_bookmarks_24dp;
|
||||
break;
|
||||
case 11:
|
||||
|
Loading…
Reference in New Issue
Block a user