mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-11-10 20:57:25 +01:00
Use discard instead of yes in several dialogs.
This commit is contained in:
parent
9870c592eb
commit
6b874cc25d
@ -265,7 +265,7 @@ public class EditCommentActivity extends BaseActivity implements UploadImageEnab
|
||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||
.setTitle(titleResId)
|
||||
.setMessage(messageResId)
|
||||
.setPositiveButton(R.string.yes, (dialogInterface, i)
|
||||
.setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i)
|
||||
-> finish())
|
||||
.setNegativeButton(R.string.no, null)
|
||||
.show();
|
||||
|
@ -293,7 +293,7 @@ public class EditPostActivity extends BaseActivity implements UploadImageEnabled
|
||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||
.setTitle(titleResId)
|
||||
.setMessage(messageResId)
|
||||
.setPositiveButton(R.string.yes, (dialogInterface, i)
|
||||
.setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i)
|
||||
-> finish())
|
||||
.setNegativeButton(R.string.no, null)
|
||||
.show();
|
||||
|
@ -361,81 +361,81 @@ public class FilteredPostsActivity extends BaseActivity implements SortTypeSelec
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
return true;
|
||||
case R.id.action_sort_filtered_thing_activity:
|
||||
switch (postType) {
|
||||
case PostDataSource.TYPE_FRONT_PAGE:
|
||||
SortTypeBottomSheetFragment bestSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle bestBundle = new Bundle();
|
||||
bestBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, false);
|
||||
bestSortTypeBottomSheetFragment.setArguments(bestBundle);
|
||||
bestSortTypeBottomSheetFragment.show(getSupportFragmentManager(), bestSortTypeBottomSheetFragment.getTag());
|
||||
break;
|
||||
case PostDataSource.TYPE_SEARCH:
|
||||
SearchPostSortTypeBottomSheetFragment searchPostSortTypeBottomSheetFragment = new SearchPostSortTypeBottomSheetFragment();
|
||||
Bundle searchBundle = new Bundle();
|
||||
searchPostSortTypeBottomSheetFragment.setArguments(searchBundle);
|
||||
searchPostSortTypeBottomSheetFragment.show(getSupportFragmentManager(), searchPostSortTypeBottomSheetFragment.getTag());
|
||||
break;
|
||||
case PostDataSource.TYPE_SUBREDDIT:
|
||||
if (name.equals("popular") || name.equals("all")) {
|
||||
SortTypeBottomSheetFragment popularAndAllSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle popularBundle = new Bundle();
|
||||
popularBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true);
|
||||
popularAndAllSortTypeBottomSheetFragment.setArguments(popularBundle);
|
||||
popularAndAllSortTypeBottomSheetFragment.show(getSupportFragmentManager(), popularAndAllSortTypeBottomSheetFragment.getTag());
|
||||
} else {
|
||||
SortTypeBottomSheetFragment subredditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle subredditSheetBundle = new Bundle();
|
||||
subredditSheetBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true);
|
||||
subredditSortTypeBottomSheetFragment.setArguments(subredditSheetBundle);
|
||||
subredditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), subredditSortTypeBottomSheetFragment.getTag());
|
||||
}
|
||||
break;
|
||||
case PostDataSource.TYPE_MULTI_REDDIT:
|
||||
SortTypeBottomSheetFragment multiRedditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle multiRedditBundle = new Bundle();
|
||||
multiRedditBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true);
|
||||
multiRedditSortTypeBottomSheetFragment.setArguments(multiRedditBundle);
|
||||
multiRedditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), multiRedditSortTypeBottomSheetFragment.getTag());
|
||||
break;
|
||||
case PostDataSource.TYPE_USER:
|
||||
UserThingSortTypeBottomSheetFragment userThingSortTypeBottomSheetFragment = new UserThingSortTypeBottomSheetFragment();
|
||||
userThingSortTypeBottomSheetFragment.show(getSupportFragmentManager(), userThingSortTypeBottomSheetFragment.getTag());
|
||||
}
|
||||
return true;
|
||||
case R.id.action_refresh_filtered_thing_activity:
|
||||
if (mMenu != null) {
|
||||
mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity).setTitle(R.string.action_start_lazy_mode);
|
||||
}
|
||||
if (mFragment instanceof FragmentCommunicator) {
|
||||
((FragmentCommunicator) mFragment).refresh();
|
||||
}
|
||||
return true;
|
||||
case R.id.action_lazy_mode_filtered_thing_activity:
|
||||
MenuItem lazyModeItem = mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity);
|
||||
if (isInLazyMode) {
|
||||
((FragmentCommunicator) mFragment).stopLazyMode();
|
||||
isInLazyMode = false;
|
||||
lazyModeItem.setTitle(R.string.action_start_lazy_mode);
|
||||
params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS);
|
||||
collapsingToolbarLayout.setLayoutParams(params);
|
||||
} else {
|
||||
if (((FragmentCommunicator) mFragment).startLazyMode()) {
|
||||
isInLazyMode = true;
|
||||
lazyModeItem.setTitle(R.string.action_stop_lazy_mode);
|
||||
params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL);
|
||||
collapsingToolbarLayout.setLayoutParams(params);
|
||||
int itemId = item.getItemId();
|
||||
if (itemId == android.R.id.home) {
|
||||
finish();
|
||||
return true;
|
||||
} else if (itemId == R.id.action_sort_filtered_thing_activity) {
|
||||
switch (postType) {
|
||||
case PostDataSource.TYPE_FRONT_PAGE:
|
||||
SortTypeBottomSheetFragment bestSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle bestBundle = new Bundle();
|
||||
bestBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, false);
|
||||
bestSortTypeBottomSheetFragment.setArguments(bestBundle);
|
||||
bestSortTypeBottomSheetFragment.show(getSupportFragmentManager(), bestSortTypeBottomSheetFragment.getTag());
|
||||
break;
|
||||
case PostDataSource.TYPE_SEARCH:
|
||||
SearchPostSortTypeBottomSheetFragment searchPostSortTypeBottomSheetFragment = new SearchPostSortTypeBottomSheetFragment();
|
||||
Bundle searchBundle = new Bundle();
|
||||
searchPostSortTypeBottomSheetFragment.setArguments(searchBundle);
|
||||
searchPostSortTypeBottomSheetFragment.show(getSupportFragmentManager(), searchPostSortTypeBottomSheetFragment.getTag());
|
||||
break;
|
||||
case PostDataSource.TYPE_SUBREDDIT:
|
||||
if (name.equals("popular") || name.equals("all")) {
|
||||
SortTypeBottomSheetFragment popularAndAllSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle popularBundle = new Bundle();
|
||||
popularBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true);
|
||||
popularAndAllSortTypeBottomSheetFragment.setArguments(popularBundle);
|
||||
popularAndAllSortTypeBottomSheetFragment.show(getSupportFragmentManager(), popularAndAllSortTypeBottomSheetFragment.getTag());
|
||||
} else {
|
||||
SortTypeBottomSheetFragment subredditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle subredditSheetBundle = new Bundle();
|
||||
subredditSheetBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true);
|
||||
subredditSortTypeBottomSheetFragment.setArguments(subredditSheetBundle);
|
||||
subredditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), subredditSortTypeBottomSheetFragment.getTag());
|
||||
}
|
||||
break;
|
||||
case PostDataSource.TYPE_MULTI_REDDIT:
|
||||
SortTypeBottomSheetFragment multiRedditSortTypeBottomSheetFragment = new SortTypeBottomSheetFragment();
|
||||
Bundle multiRedditBundle = new Bundle();
|
||||
multiRedditBundle.putBoolean(SortTypeBottomSheetFragment.EXTRA_NO_BEST_TYPE, true);
|
||||
multiRedditSortTypeBottomSheetFragment.setArguments(multiRedditBundle);
|
||||
multiRedditSortTypeBottomSheetFragment.show(getSupportFragmentManager(), multiRedditSortTypeBottomSheetFragment.getTag());
|
||||
break;
|
||||
case PostDataSource.TYPE_USER:
|
||||
UserThingSortTypeBottomSheetFragment userThingSortTypeBottomSheetFragment = new UserThingSortTypeBottomSheetFragment();
|
||||
userThingSortTypeBottomSheetFragment.show(getSupportFragmentManager(), userThingSortTypeBottomSheetFragment.getTag());
|
||||
}
|
||||
return true;
|
||||
} else if (itemId == R.id.action_refresh_filtered_thing_activity) {
|
||||
if (mMenu != null) {
|
||||
mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity).setTitle(R.string.action_start_lazy_mode);
|
||||
}
|
||||
if (mFragment != null) {
|
||||
((FragmentCommunicator) mFragment).refresh();
|
||||
}
|
||||
return true;
|
||||
} else if (itemId == R.id.action_lazy_mode_filtered_thing_activity) {
|
||||
MenuItem lazyModeItem = mMenu.findItem(R.id.action_lazy_mode_filtered_thing_activity);
|
||||
if (isInLazyMode) {
|
||||
((FragmentCommunicator) mFragment).stopLazyMode();
|
||||
isInLazyMode = false;
|
||||
lazyModeItem.setTitle(R.string.action_start_lazy_mode);
|
||||
params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL | AppBarLayout.LayoutParams.SCROLL_FLAG_ENTER_ALWAYS);
|
||||
collapsingToolbarLayout.setLayoutParams(params);
|
||||
} else {
|
||||
if (((FragmentCommunicator) mFragment).startLazyMode()) {
|
||||
isInLazyMode = true;
|
||||
lazyModeItem.setTitle(R.string.action_stop_lazy_mode);
|
||||
params.setScrollFlags(AppBarLayout.LayoutParams.SCROLL_FLAG_NO_SCROLL);
|
||||
collapsingToolbarLayout.setLayoutParams(params);
|
||||
}
|
||||
return true;
|
||||
case R.id.action_change_post_layout_filtered_post_activity:
|
||||
PostLayoutBottomSheetFragment postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment();
|
||||
postLayoutBottomSheetFragment.show(getSupportFragmentManager(), postLayoutBottomSheetFragment.getTag());
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
} else if (itemId == R.id.action_change_post_layout_filtered_post_activity) {
|
||||
PostLayoutBottomSheetFragment postLayoutBottomSheetFragment = new PostLayoutBottomSheetFragment();
|
||||
postLayoutBottomSheetFragment.show(getSupportFragmentManager(), postLayoutBottomSheetFragment.getTag());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ public class PostGalleryActivity extends BaseActivity implements FlairBottomShee
|
||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||
.setTitle(titleResId)
|
||||
.setMessage(messageResId)
|
||||
.setPositiveButton(R.string.yes, (dialogInterface, i)
|
||||
.setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i)
|
||||
-> finish())
|
||||
.setNegativeButton(R.string.no, null)
|
||||
.show();
|
||||
|
@ -449,7 +449,7 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF
|
||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||
.setTitle(titleResId)
|
||||
.setMessage(messageResId)
|
||||
.setPositiveButton(R.string.yes, (dialogInterface, i)
|
||||
.setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i)
|
||||
-> finish())
|
||||
.setNegativeButton(R.string.no, null)
|
||||
.show();
|
||||
|
@ -418,7 +418,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr
|
||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||
.setTitle(titleResId)
|
||||
.setMessage(messageResId)
|
||||
.setPositiveButton(R.string.yes, (dialogInterface, i) -> finish())
|
||||
.setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish())
|
||||
.setNegativeButton(R.string.no, null)
|
||||
.show();
|
||||
}
|
||||
|
@ -439,7 +439,7 @@ public class PostTextActivity extends BaseActivity implements FlairBottomSheetFr
|
||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||
.setTitle(titleResId)
|
||||
.setMessage(messageResId)
|
||||
.setPositiveButton(R.string.discard, (dialogInterface, i)
|
||||
.setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i)
|
||||
-> finish())
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.show();
|
||||
|
@ -459,7 +459,7 @@ public class PostVideoActivity extends BaseActivity implements FlairBottomSheetF
|
||||
new MaterialAlertDialogBuilder(this, R.style.MaterialAlertDialogTheme)
|
||||
.setTitle(titleResId)
|
||||
.setMessage(messageResId)
|
||||
.setPositiveButton(R.string.yes, (dialogInterface, i) -> finish())
|
||||
.setPositiveButton(R.string.discard_dialog_button, (dialogInterface, i) -> finish())
|
||||
.setNegativeButton(R.string.no, null)
|
||||
.show();
|
||||
}
|
||||
|
@ -607,6 +607,7 @@
|
||||
<string name="discard_detail">All the draft will NOT be saved.</string>
|
||||
<string name="yes">Yes</string>
|
||||
<string name="no">No</string>
|
||||
<string name="discard_dialog_button">Discard</string>
|
||||
|
||||
<string name="no_data_received">No data received</string>
|
||||
<string name="no_image_path_received">No image path received</string>
|
||||
|
Loading…
Reference in New Issue
Block a user