Better sort of string resources

This commit is contained in:
CappielloAntonio 2021-09-04 19:20:52 +02:00
parent b28c230f5a
commit 35eb29fdde
6 changed files with 156 additions and 165 deletions

View file

@ -85,7 +85,7 @@ public class MultiPlayer implements Playback {
@Override
public void onPlayerError(ExoPlaybackException error) {
Log.i(TAG, String.format("onPlayerError: %s", error.getMessage()));
Toast.makeText(context, context.getResources().getString(R.string.unplayable_file), Toast.LENGTH_SHORT).show();
Toast.makeText(context, context.getResources().getString(R.string.exo_info_unplayable_file), Toast.LENGTH_SHORT).show();
exoPlayer.clearMediaItems();
exoPlayer.prepare();

View file

@ -183,10 +183,10 @@ public class MusicService extends Service implements Playback.PlaybackCallbacks
if (!playlistSongs.isEmpty()) {
openQueue(playlistSongs, 0, true);
} else {
Toast.makeText(getApplicationContext(), R.string.playlist_is_empty, Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), R.string.exo_info_empty_playlist, Toast.LENGTH_LONG).show();
}
} else {
Toast.makeText(getApplicationContext(), R.string.playlist_is_empty, Toast.LENGTH_LONG).show();
Toast.makeText(getApplicationContext(), R.string.exo_info_empty_playlist, Toast.LENGTH_LONG).show();
}
break;
case ACTION_REWIND:

View file

@ -114,10 +114,10 @@ public class BaseActivity extends AppCompatActivity implements MusicServiceEvent
private void showBatteryOptimizationDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.battery_optimizations_message)
.setTitle(R.string.battery_optimizations_title)
.setNegativeButton(R.string.ignore, null)
.setPositiveButton(R.string.disable, (dialog, id) -> openPowerSettings())
builder.setMessage(R.string.activity_battery_optimizations_summary)
.setTitle(R.string.activity_battery_optimizations_title)
.setNegativeButton(R.string.activity_negative_button, null)
.setPositiveButton(R.string.activity_neutral_button, (dialog, id) -> openPowerSettings())
.show();
}

View file

@ -90,9 +90,9 @@ public class PlayingNotification {
bitmap = BitmapFactory.decodeResource(service.getResources(), R.drawable.default_album_art);
}
NotificationCompat.Action playPauseAction = new NotificationCompat.Action(playButtonResId, service.getString(R.string.action_play_pause), retrievePlaybackAction(ACTION_TOGGLE));
NotificationCompat.Action previousAction = new NotificationCompat.Action(R.drawable.ic_skip_previous_white_24dp, service.getString(R.string.action_previous), retrievePlaybackAction(ACTION_REWIND));
NotificationCompat.Action nextAction = new NotificationCompat.Action(R.drawable.ic_skip_next_white_24dp, service.getString(R.string.action_next), retrievePlaybackAction(ACTION_SKIP));
NotificationCompat.Action playPauseAction = new NotificationCompat.Action(playButtonResId, service.getString(R.string.exo_action_play_pause), retrievePlaybackAction(ACTION_TOGGLE));
NotificationCompat.Action previousAction = new NotificationCompat.Action(R.drawable.ic_skip_previous_white_24dp, service.getString(R.string.exo_action_previous), retrievePlaybackAction(ACTION_REWIND));
NotificationCompat.Action nextAction = new NotificationCompat.Action(R.drawable.ic_skip_next_white_24dp, service.getString(R.string.exo_action_next), retrievePlaybackAction(ACTION_SKIP));
NotificationCompat.Builder builder = new NotificationCompat.Builder(service, NOTIFICATION_CHANNEL_ID)
.setSmallIcon(R.drawable.ic_notification)