Fix circlar UI and lyrics
This commit is contained in:
commit
c5aa167c1c
10 changed files with 148 additions and 98 deletions
|
@ -150,8 +150,13 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
|
|||
private fun showSyncedLyrics() {
|
||||
var content = ""
|
||||
try {
|
||||
content = LyricUtil.getStringFromFile(song.title, song.artistName)
|
||||
content = LyricUtil.getStringFromFile(song.data, song.artistName)
|
||||
} catch (e: Exception) {
|
||||
try {
|
||||
content = LyricUtil.getStringFromFile(song.title, song.artistName)
|
||||
} catch (e2: Exception) {
|
||||
|
||||
}
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
|
@ -161,7 +166,7 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
|
|||
input(hint = getString(R.string.paste_lyrics_here),
|
||||
prefill = content,
|
||||
inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE) { _, input ->
|
||||
LyricUtil.writeLrcToLoc(song.title, song.artistName, input.toString())
|
||||
LyricUtil.writeLrcToLoc(song.data, song.artistName, input.toString())
|
||||
}
|
||||
positiveButton(android.R.string.ok) {
|
||||
updateSong()
|
||||
|
@ -215,7 +220,7 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
|
|||
return baseUrl
|
||||
}
|
||||
|
||||
class PagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
|
||||
class PagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {
|
||||
class Tabs(@StringRes val title: Int,
|
||||
val fragment: Fragment)
|
||||
|
||||
|
@ -364,8 +369,12 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
|
|||
|
||||
private fun loadLRCLyrics() {
|
||||
val song = MusicPlayerRemote.currentSong
|
||||
if (LyricUtil.isLrcFileExist(song.title, song.artistName)) {
|
||||
showLyricsLocal(LyricUtil.getLocalLyricFile(song.title, song.artistName))
|
||||
if (LyricUtil.isLrcFile2Exist(song.data, song.artistName)) {
|
||||
showLyricsLocal(LyricUtil.getLocalLyricFile(song.data, song.artistName))
|
||||
} else {
|
||||
if (LyricUtil.isLrcFileExist(song.title, song.artistName)) {
|
||||
showLyricsLocal(LyricUtil.getLocalLyricFile(song.title, song.artistName))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -375,4 +384,4 @@ class LyricsActivity : AbsMusicServiceActivity(), View.OnClickListener, ViewPage
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue