Code refactor
Added new lyrics view and code refactor
This commit is contained in:
parent
e5407592c5
commit
8a2b803286
22 changed files with 1151 additions and 1065 deletions
|
@ -72,6 +72,11 @@ public class LyricUtil {
|
|||
return file.exists();
|
||||
}
|
||||
|
||||
public static boolean isLrcOriginalFileExist(@NonNull String path) {
|
||||
File file = new File(getLrcOriginalPath(path));
|
||||
return file.exists();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static File getLocalLyricFile(@NonNull String title, @NonNull String artist) {
|
||||
File file = new File(getLrcPath(title, artist));
|
||||
|
@ -82,10 +87,24 @@ public class LyricUtil {
|
|||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static File getLocalLyricOriginalFile(@NonNull String path) {
|
||||
File file = new File(getLrcOriginalPath(path));
|
||||
if (file.exists()) {
|
||||
return file;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static String getLrcPath(String title, String artist) {
|
||||
return lrcRootPath + title + " - " + artist + ".lrc";
|
||||
}
|
||||
|
||||
private static String getLrcOriginalPath(String filePath) {
|
||||
return filePath.replace(filePath.substring(filePath.lastIndexOf(".") + 1, filePath.length()), "lrc");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String decryptBASE64(@NonNull String str) {
|
||||
if (str == null || str.length() == 0) {
|
||||
|
|
|
@ -29,8 +29,6 @@ import org.jetbrains.annotations.NotNull;
|
|||
|
||||
import code.name.monkey.retromusic.R;
|
||||
import code.name.monkey.retromusic.activities.AboutActivity;
|
||||
import code.name.monkey.retromusic.activities.albums.AlbumDetailsActivity;
|
||||
import code.name.monkey.retromusic.activities.artists.ArtistDetailActivity;
|
||||
import code.name.monkey.retromusic.activities.DriveModeActivity;
|
||||
import code.name.monkey.retromusic.activities.GenreDetailsActivity;
|
||||
import code.name.monkey.retromusic.activities.LicenseActivity;
|
||||
|
@ -43,6 +41,8 @@ import code.name.monkey.retromusic.activities.SettingsActivity;
|
|||
import code.name.monkey.retromusic.activities.SupportDevelopmentActivity;
|
||||
import code.name.monkey.retromusic.activities.UserInfoActivity;
|
||||
import code.name.monkey.retromusic.activities.WhatsNewActivity;
|
||||
import code.name.monkey.retromusic.activities.albums.AlbumDetailsActivity;
|
||||
import code.name.monkey.retromusic.activities.artists.ArtistDetailActivity;
|
||||
import code.name.monkey.retromusic.activities.bugreport.BugReportActivity;
|
||||
import code.name.monkey.retromusic.helper.MusicPlayerRemote;
|
||||
import code.name.monkey.retromusic.model.Genre;
|
||||
|
|
|
@ -96,7 +96,10 @@ object PreferenceUtil {
|
|||
val languageCode get() = sharedPreferences.getString(LANGUAGE_NAME, "auto")
|
||||
|
||||
var userName
|
||||
get() = sharedPreferences.getString(USER_NAME, "User Name")
|
||||
get() = sharedPreferences.getString(
|
||||
USER_NAME,
|
||||
App.getContext().getString(R.string.user_name)
|
||||
)
|
||||
set(value) = sharedPreferences.edit {
|
||||
putString(USER_NAME, value)
|
||||
}
|
||||
|
@ -420,7 +423,7 @@ object PreferenceUtil {
|
|||
var songGridSize
|
||||
get() = sharedPreferences.getInt(
|
||||
SONG_GRID_SIZE,
|
||||
App.getContext().getIntRes(R.integer.default_grid_columns)
|
||||
App.getContext().getIntRes(R.integer.default_list_columns)
|
||||
)
|
||||
set(value) = sharedPreferences.edit {
|
||||
putInt(SONG_GRID_SIZE, value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue