Use context.getString() shorthand instead of context.getResources().getString()

Cherry-picked from #12949 / 4360c1b8735c073b95a162324b2814cc5a5b4ecd
This commit is contained in:
Yevhen Babiichuk (DustDFG) 2025-12-26 14:15:33 +02:00 committed by TobiGr
parent c3c353f1b7
commit c2f526d5b3
3 changed files with 8 additions and 8 deletions

View File

@ -141,11 +141,11 @@ public final class PlayerHelper {
@ResizeMode final int resizeMode) {
switch (resizeMode) {
case AspectRatioFrameLayout.RESIZE_MODE_FIT:
return context.getResources().getString(R.string.resize_fit);
return context.getString(R.string.resize_fit);
case AspectRatioFrameLayout.RESIZE_MODE_FILL:
return context.getResources().getString(R.string.resize_fill);
return context.getString(R.string.resize_fill);
case AspectRatioFrameLayout.RESIZE_MODE_ZOOM:
return context.getResources().getString(R.string.resize_zoom);
return context.getString(R.string.resize_zoom);
case AspectRatioFrameLayout.RESIZE_MODE_FIXED_HEIGHT:
case AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH:
default:

View File

@ -153,9 +153,9 @@ public final class Localization {
case (int) ListExtractor.ITEM_COUNT_UNKNOWN:
return "";
case (int) ListExtractor.ITEM_COUNT_INFINITE:
return context.getResources().getString(R.string.infinite_videos);
return context.getString(R.string.infinite_videos);
case (int) ListExtractor.ITEM_COUNT_MORE_THAN_100:
return context.getResources().getString(R.string.more_than_100_videos);
return context.getString(R.string.more_than_100_videos);
default:
return getQuantity(context, R.plurals.videos, R.string.no_videos, streamCount,
localizeNumber(streamCount));
@ -168,9 +168,9 @@ public final class Localization {
case (int) ListExtractor.ITEM_COUNT_UNKNOWN:
return "";
case (int) ListExtractor.ITEM_COUNT_INFINITE:
return context.getResources().getString(R.string.infinite_videos_mini);
return context.getString(R.string.infinite_videos_mini);
case (int) ListExtractor.ITEM_COUNT_MORE_THAN_100:
return context.getResources().getString(R.string.more_than_100_videos_mini);
return context.getString(R.string.more_than_100_videos_mini);
default:
return String.valueOf(streamCount);
}

View File

@ -263,7 +263,7 @@ public final class ThemeHelper {
private static String getSelectedThemeKey(final Context context) {
final String themeKey = context.getString(R.string.theme_key);
final String defaultTheme = context.getResources().getString(R.string.default_theme_value);
final String defaultTheme = context.getString(R.string.default_theme_value);
return PreferenceManager.getDefaultSharedPreferences(context)
.getString(themeKey, defaultTheme);
}