add a few more strings to the translations

This commit is contained in:
dkanada 2020-04-29 17:32:27 +09:00
commit eb3421bff6
5 changed files with 14 additions and 36 deletions

View file

@ -81,10 +81,7 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
}
protected String getAlbumText(Album album) {
return MusicUtil.buildInfoString(
album.getArtistName(),
MusicUtil.getSongCountString(activity, album.songs.size())
);
return MusicUtil.getAlbumInfoString(activity, album);
}
@Override

View file

@ -38,11 +38,11 @@ public class HorizontalAlbumAdapter extends AlbumAdapter {
CardView card=(CardView)holder.itemView;
card.setCardBackgroundColor(color);
if (holder.title != null) {
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
holder.title.setTextColor(MaterialValueHelper.getPrimaryTextColor(activity, ColorUtil.isColorLight(color)));
}
if (holder.text != null) {
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
}
}
}

View file

@ -1,28 +1,18 @@
package com.kabouzeid.gramophone.util;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Environment;
import android.provider.BaseColumns;
import android.provider.MediaStore;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.FileProvider;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
import com.kabouzeid.gramophone.App;
import com.kabouzeid.gramophone.R;
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
import com.kabouzeid.gramophone.loader.PlaylistLoader;
import com.kabouzeid.gramophone.loader.SongLoader;
import com.kabouzeid.gramophone.model.Album;
import com.kabouzeid.gramophone.model.Artist;
import com.kabouzeid.gramophone.model.Genre;
@ -30,7 +20,6 @@ import com.kabouzeid.gramophone.model.Playlist;
import com.kabouzeid.gramophone.model.Song;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
@ -43,14 +32,13 @@ public class MusicUtil {
public static Intent createShareSongFileIntent(@NonNull final Song song, Context context) {
try {
return new Intent()
.setAction(Intent.ACTION_SEND)
.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName(), new File(song.data)))
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.setType("audio/*");
.setAction(Intent.ACTION_SEND)
.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName(), new File(song.data)))
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
.setType("audio/*");
} catch (IllegalArgumentException e) {
// TODO the path is most likely not like /storage/emulated/0/... but something like /storage/28C7-75B0/...
e.printStackTrace();
Toast.makeText(context, "Could not share this file, I'm aware of the issue.", Toast.LENGTH_SHORT).show();
Toast.makeText(context, R.string.error_share_file, Toast.LENGTH_SHORT).show();
return new Intent();
}
}
@ -184,13 +172,6 @@ public class MusicUtil {
}
}
public static boolean isArtistNameUnknown(@Nullable String artistName) {
if (TextUtils.isEmpty(artistName)) return false;
if (artistName.equals(Artist.UNKNOWN_ARTIST_DISPLAY_NAME)) return true;
artistName = artistName.trim().toLowerCase();
return artistName.equals("unknown") || artistName.equals("<unknown>");
}
@NonNull
public static String getSectionName(@Nullable String musicMediaTitle) {
if (TextUtils.isEmpty(musicMediaTitle)) return "";

View file

@ -16,9 +16,6 @@
<string name="github" translatable="false">GitHub</string>
<string name="twitter" translatable="false">Twitter</string>
<string name="card" translatable="false">Card</string>
<string name="flat" translatable="false">Flat</string>
<string-array name="donation_ids" translatable="false">
<item>donation_1</item>
<item>donation_2</item>

View file

@ -98,8 +98,8 @@
<string name="pref_title_app_shortcuts">Colored app shortcuts</string>
<string name="pref_title_album_art_on_lockscreen">Show album cover</string>
<string name="pref_title_blurred_album_art">Blur album cover</string>
<string name="pref_title_classic_notification">Classic design</string>
<string name="pref_title_colored_notification">Colored notification</string>
<string name="pref_title_classic_notification">Classic notification design</string>
<string name="pref_title_gapless_playback">Gapless playback</string>
<string name="pref_title_audio_ducking">Reduce volume on focus loss</string>
<string name="pref_title_last_added_interval">Last added playlist interval</string>
@ -114,8 +114,11 @@
<string name="x_selected">%1$d selected</string>
<string name="primary_color">Primary color</string>
<string name="accent_color">Accent color</string>
<string name="primary_color_desc">The primary theme color, defaults to indigo.</string>
<string name="accent_color_desc">The accent theme color, defaults to pink.</string>
<string name="card">Card</string>
<string name="flat">Flat</string>
<string name="primary_color_desc">The primary theme color for control elements.</string>
<string name="accent_color_desc">An alternate color used to accent elements.</string>
<string name="error_share_file">There was an error sharing the file.</string>
<string name="playlist_empty_text">Empty playlist</string>
<string name="no_playlists">No playlists</string>
<string name="no_albums">No albums</string>