add a few more strings to the translations
This commit is contained in:
parent
248dabfa92
commit
eb3421bff6
5 changed files with 14 additions and 36 deletions
|
|
@ -81,10 +81,7 @@ public class AlbumAdapter extends AbsMultiSelectAdapter<AlbumAdapter.ViewHolder,
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getAlbumText(Album album) {
|
protected String getAlbumText(Album album) {
|
||||||
return MusicUtil.buildInfoString(
|
return MusicUtil.getAlbumInfoString(activity, album);
|
||||||
album.getArtistName(),
|
|
||||||
MusicUtil.getSongCountString(activity, album.songs.size())
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,11 @@ public class HorizontalAlbumAdapter extends AlbumAdapter {
|
||||||
CardView card=(CardView)holder.itemView;
|
CardView card=(CardView)holder.itemView;
|
||||||
card.setCardBackgroundColor(color);
|
card.setCardBackgroundColor(color);
|
||||||
if (holder.title != null) {
|
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) {
|
if (holder.text != null) {
|
||||||
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
holder.text.setTextColor(MaterialValueHelper.getSecondaryTextColor(activity, ColorUtil.isColorLight(color)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,18 @@
|
||||||
package com.kabouzeid.gramophone.util;
|
package com.kabouzeid.gramophone.util;
|
||||||
|
|
||||||
import android.content.ContentResolver;
|
|
||||||
import android.content.ContentUris;
|
|
||||||
import android.content.ContentValues;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Environment;
|
|
||||||
import android.provider.BaseColumns;
|
|
||||||
import android.provider.MediaStore;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.kabouzeid.gramophone.App;
|
import com.kabouzeid.gramophone.App;
|
||||||
import com.kabouzeid.gramophone.R;
|
import com.kabouzeid.gramophone.R;
|
||||||
import com.kabouzeid.gramophone.helper.MusicPlayerRemote;
|
|
||||||
import com.kabouzeid.gramophone.loader.PlaylistLoader;
|
import com.kabouzeid.gramophone.loader.PlaylistLoader;
|
||||||
import com.kabouzeid.gramophone.loader.SongLoader;
|
|
||||||
import com.kabouzeid.gramophone.model.Album;
|
import com.kabouzeid.gramophone.model.Album;
|
||||||
import com.kabouzeid.gramophone.model.Artist;
|
import com.kabouzeid.gramophone.model.Artist;
|
||||||
import com.kabouzeid.gramophone.model.Genre;
|
import com.kabouzeid.gramophone.model.Genre;
|
||||||
|
|
@ -30,7 +20,6 @@ import com.kabouzeid.gramophone.model.Playlist;
|
||||||
import com.kabouzeid.gramophone.model.Song;
|
import com.kabouzeid.gramophone.model.Song;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
|
@ -43,14 +32,13 @@ public class MusicUtil {
|
||||||
public static Intent createShareSongFileIntent(@NonNull final Song song, Context context) {
|
public static Intent createShareSongFileIntent(@NonNull final Song song, Context context) {
|
||||||
try {
|
try {
|
||||||
return new Intent()
|
return new Intent()
|
||||||
.setAction(Intent.ACTION_SEND)
|
.setAction(Intent.ACTION_SEND)
|
||||||
.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName(), new File(song.data)))
|
.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(context, context.getApplicationContext().getPackageName(), new File(song.data)))
|
||||||
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||||
.setType("audio/*");
|
.setType("audio/*");
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
// TODO the path is most likely not like /storage/emulated/0/... but something like /storage/28C7-75B0/...
|
|
||||||
e.printStackTrace();
|
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();
|
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
|
@NonNull
|
||||||
public static String getSectionName(@Nullable String musicMediaTitle) {
|
public static String getSectionName(@Nullable String musicMediaTitle) {
|
||||||
if (TextUtils.isEmpty(musicMediaTitle)) return "";
|
if (TextUtils.isEmpty(musicMediaTitle)) return "";
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@
|
||||||
<string name="github" translatable="false">GitHub</string>
|
<string name="github" translatable="false">GitHub</string>
|
||||||
<string name="twitter" translatable="false">Twitter</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">
|
<string-array name="donation_ids" translatable="false">
|
||||||
<item>donation_1</item>
|
<item>donation_1</item>
|
||||||
<item>donation_2</item>
|
<item>donation_2</item>
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,8 @@
|
||||||
<string name="pref_title_app_shortcuts">Colored app shortcuts</string>
|
<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_album_art_on_lockscreen">Show album cover</string>
|
||||||
<string name="pref_title_blurred_album_art">Blur 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_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_gapless_playback">Gapless playback</string>
|
||||||
<string name="pref_title_audio_ducking">Reduce volume on focus loss</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>
|
<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="x_selected">%1$d selected</string>
|
||||||
<string name="primary_color">Primary color</string>
|
<string name="primary_color">Primary color</string>
|
||||||
<string name="accent_color">Accent color</string>
|
<string name="accent_color">Accent color</string>
|
||||||
<string name="primary_color_desc">The primary theme color, defaults to indigo.</string>
|
<string name="card">Card</string>
|
||||||
<string name="accent_color_desc">The accent theme color, defaults to pink.</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="playlist_empty_text">Empty playlist</string>
|
||||||
<string name="no_playlists">No playlists</string>
|
<string name="no_playlists">No playlists</string>
|
||||||
<string name="no_albums">No albums</string>
|
<string name="no_albums">No albums</string>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue