Add ko [Korean] translations
Add partial translations for korean.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package org.oxycblt.auxio
|
||||
|
||||
import android.animation.LayoutTransition
|
||||
import android.content.res.ColorStateList
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
@@ -10,7 +9,6 @@ import android.view.ViewGroup
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.activityViewModels
|
||||
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavOptions
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
@@ -71,13 +69,6 @@ class MainFragment : Fragment() {
|
||||
|
||||
binding.lifecycleOwner = this
|
||||
|
||||
// Apply custom interpolation effects
|
||||
// The container layout types differ in the land/port layouts so it has to be cast to their parent instead.
|
||||
(binding.controlsContainer as ViewGroup).layoutTransition = LayoutTransition().apply {
|
||||
setInterpolator(LayoutTransition.APPEARING, FastOutSlowInInterpolator())
|
||||
setInterpolator(LayoutTransition.DISAPPEARING, FastOutSlowInInterpolator())
|
||||
}
|
||||
|
||||
binding.navBar.apply {
|
||||
itemIconTintList = navTints
|
||||
itemTextColor = navTints
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.oxycblt.auxio.music.BaseModel
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.recycler.DiffCallback
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.Highlightable
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.applyAccents
|
||||
@@ -107,7 +107,7 @@ class AlbumDetailAdapter(
|
||||
|
||||
inner class AlbumHeaderViewHolder(
|
||||
private val binding: ItemAlbumHeaderBinding
|
||||
) : BaseHolder<Album>(binding) {
|
||||
) : BaseViewHolder<Album>(binding) {
|
||||
|
||||
override fun onBind(data: Album) {
|
||||
binding.album = data
|
||||
@@ -126,7 +126,7 @@ class AlbumDetailAdapter(
|
||||
|
||||
inner class AlbumSongViewHolder(
|
||||
private val binding: ItemAlbumSongBinding,
|
||||
) : BaseHolder<Song>(binding, doOnClick, doOnLongClick), Highlightable {
|
||||
) : BaseViewHolder<Song>(binding, doOnClick, doOnLongClick), Highlightable {
|
||||
private val normalTextColor = binding.songName.currentTextColor
|
||||
private val inactiveTextColor = binding.songTrack.currentTextColor
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.oxycblt.auxio.music.Artist
|
||||
import org.oxycblt.auxio.music.BaseModel
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.recycler.DiffCallback
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.Highlightable
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.applyAccents
|
||||
@@ -106,7 +106,7 @@ class ArtistDetailAdapter(
|
||||
|
||||
inner class ArtistHeaderViewHolder(
|
||||
private val binding: ItemArtistHeaderBinding
|
||||
) : BaseHolder<Artist>(binding) {
|
||||
) : BaseViewHolder<Artist>(binding) {
|
||||
|
||||
override fun onBind(data: Artist) {
|
||||
binding.artist = data
|
||||
@@ -126,7 +126,7 @@ class ArtistDetailAdapter(
|
||||
// Generic ViewHolder for a detail album
|
||||
inner class ArtistAlbumViewHolder(
|
||||
private val binding: ItemArtistAlbumBinding,
|
||||
) : BaseHolder<Album>(binding, doOnClick, doOnLongClick), Highlightable {
|
||||
) : BaseViewHolder<Album>(binding, doOnClick, doOnLongClick), Highlightable {
|
||||
private val normalTextColor = binding.albumName.currentTextColor
|
||||
|
||||
override fun onBind(data: Album) {
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.oxycblt.auxio.music.Genre
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.recycler.DiffCallback
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.Highlightable
|
||||
import org.oxycblt.auxio.ui.Accent
|
||||
import org.oxycblt.auxio.ui.applyAccents
|
||||
@@ -108,7 +108,7 @@ class GenreDetailAdapter(
|
||||
|
||||
inner class GenreHeaderViewHolder(
|
||||
private val binding: ItemGenreHeaderBinding
|
||||
) : BaseHolder<Genre>(binding) {
|
||||
) : BaseViewHolder<Genre>(binding) {
|
||||
override fun onBind(data: Genre) {
|
||||
binding.genre = data
|
||||
binding.detailModel = detailModel
|
||||
@@ -126,7 +126,7 @@ class GenreDetailAdapter(
|
||||
|
||||
inner class GenreSongViewHolder(
|
||||
private val binding: ItemGenreSongBinding,
|
||||
) : BaseHolder<Song>(binding, doOnClick, doOnLongClick), Highlightable {
|
||||
) : BaseViewHolder<Song>(binding, doOnClick, doOnLongClick), Highlightable {
|
||||
private val normalTextColor = binding.songName.currentTextColor
|
||||
|
||||
override fun onBind(data: Song) {
|
||||
|
||||
@@ -16,8 +16,6 @@ import android.support.v4.media.MediaMetadataCompat
|
||||
import android.support.v4.media.session.MediaSessionCompat
|
||||
import android.view.KeyEvent
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.media2.session.MediaController
|
||||
import androidx.media2.session.MediaSession
|
||||
import com.google.android.exoplayer2.C
|
||||
import com.google.android.exoplayer2.ExoPlaybackException
|
||||
import com.google.android.exoplayer2.MediaItem
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.oxycblt.auxio.playback.queue
|
||||
import android.annotation.SuppressLint
|
||||
import android.view.MotionEvent
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.widget.TooltipCompat
|
||||
import androidx.recyclerview.widget.AsyncListDiffer
|
||||
import androidx.recyclerview.widget.ItemTouchHelper
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@@ -15,7 +16,7 @@ import org.oxycblt.auxio.music.Header
|
||||
import org.oxycblt.auxio.music.Song
|
||||
import org.oxycblt.auxio.playback.PlaybackViewModel
|
||||
import org.oxycblt.auxio.recycler.DiffCallback
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.BaseViewHolder
|
||||
import org.oxycblt.auxio.recycler.viewholders.HeaderViewHolder
|
||||
import org.oxycblt.auxio.ui.inflater
|
||||
|
||||
@@ -132,7 +133,7 @@ class QueueAdapter(
|
||||
*/
|
||||
inner class QueueSongViewHolder(
|
||||
private val binding: ItemQueueSongBinding,
|
||||
) : BaseHolder<Song>(binding) {
|
||||
) : BaseViewHolder<Song>(binding) {
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onBind(data: Song) {
|
||||
@@ -159,12 +160,13 @@ class QueueAdapter(
|
||||
*/
|
||||
inner class UserQueueHeaderViewHolder(
|
||||
private val binding: ItemActionHeaderBinding
|
||||
) : BaseHolder<Header>(binding) {
|
||||
) : BaseViewHolder<Header>(binding) {
|
||||
|
||||
init {
|
||||
binding.headerButton.contentDescription = binding.headerButton.context.getString(
|
||||
R.string.description_clear_user_queue
|
||||
)
|
||||
binding.headerButton.apply {
|
||||
contentDescription = context.getString(R.string.description_clear_user_queue)
|
||||
TooltipCompat.setTooltipText(this, contentDescription)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onBind(data: Header) {
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ import org.oxycblt.auxio.music.BaseModel
|
||||
* @param doOnLongClick (Optional, defaults to null) Functions that specifics what to do on a long click. Null if nothing should be done.
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
abstract class BaseHolder<T : BaseModel>(
|
||||
abstract class BaseViewHolder<T : BaseModel>(
|
||||
private val binding: ViewDataBinding,
|
||||
private val doOnClick: ((data: T) -> Unit)? = null,
|
||||
private val doOnLongClick: ((view: View, data: T) -> Unit)? = null
|
||||
@@ -52,7 +52,7 @@ abstract class BaseHolder<T : BaseModel>(
|
||||
|
||||
/**
|
||||
* Function that performs binding operations unique to the inheriting viewholder.
|
||||
* Add any specialized code to an override of this instead of [BaseHolder] itself.
|
||||
* Add any specialized code to an override of this instead of [BaseViewHolder] itself.
|
||||
*/
|
||||
protected abstract fun onBind(data: T)
|
||||
}
|
||||
@@ -38,7 +38,7 @@ class SongViewHolder private constructor(
|
||||
private val binding: ItemSongBinding,
|
||||
doOnClick: (data: Song) -> Unit,
|
||||
doOnLongClick: (view: View, data: Song) -> Unit
|
||||
) : BaseHolder<Song>(binding, doOnClick, doOnLongClick) {
|
||||
) : BaseViewHolder<Song>(binding, doOnClick, doOnLongClick) {
|
||||
|
||||
override fun onBind(data: Song) {
|
||||
binding.song = data
|
||||
@@ -73,7 +73,7 @@ class AlbumViewHolder private constructor(
|
||||
private val binding: ItemAlbumBinding,
|
||||
doOnClick: (data: Album) -> Unit,
|
||||
doOnLongClick: (view: View, data: Album) -> Unit
|
||||
) : BaseHolder<Album>(binding, doOnClick, doOnLongClick) {
|
||||
) : BaseViewHolder<Album>(binding, doOnClick, doOnLongClick) {
|
||||
|
||||
override fun onBind(data: Album) {
|
||||
binding.album = data
|
||||
@@ -106,7 +106,7 @@ class ArtistViewHolder private constructor(
|
||||
private val binding: ItemArtistBinding,
|
||||
doOnClick: (Artist) -> Unit,
|
||||
doOnLongClick: (view: View, data: Artist) -> Unit
|
||||
) : BaseHolder<Artist>(binding, doOnClick, doOnLongClick) {
|
||||
) : BaseViewHolder<Artist>(binding, doOnClick, doOnLongClick) {
|
||||
|
||||
override fun onBind(data: Artist) {
|
||||
binding.artist = data
|
||||
@@ -139,7 +139,7 @@ class GenreViewHolder private constructor(
|
||||
private val binding: ItemGenreBinding,
|
||||
doOnClick: (Genre) -> Unit,
|
||||
doOnLongClick: (view: View, data: Genre) -> Unit
|
||||
) : BaseHolder<Genre>(binding, doOnClick, doOnLongClick) {
|
||||
) : BaseViewHolder<Genre>(binding, doOnClick, doOnLongClick) {
|
||||
|
||||
override fun onBind(data: Genre) {
|
||||
binding.genre = data
|
||||
@@ -168,7 +168,7 @@ class GenreViewHolder private constructor(
|
||||
/**
|
||||
* The Shared ViewHolder for a [Header]. Instantiation should be done with [from]
|
||||
*/
|
||||
class HeaderViewHolder(private val binding: ItemHeaderBinding) : BaseHolder<Header>(binding) {
|
||||
class HeaderViewHolder(private val binding: ItemHeaderBinding) : BaseViewHolder<Header>(binding) {
|
||||
|
||||
override fun onBind(data: Header) {
|
||||
binding.header = data
|
||||
|
||||
@@ -1,18 +1,23 @@
|
||||
package org.oxycblt.auxio.ui
|
||||
|
||||
import android.animation.LayoutTransition
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
|
||||
import org.oxycblt.auxio.logD
|
||||
import org.oxycblt.auxio.logE
|
||||
import java.lang.reflect.Field
|
||||
|
||||
/**
|
||||
* Hack layout that fixes an issue where disappearing views would draw over non-disappearing
|
||||
* views when animated with a stock LayoutTransition. Adapted from this StackOverflow answer:
|
||||
* views when animated with a stock LayoutTransition. If something breaks on the playback controls
|
||||
* or nav bar, this is probably the culprit.
|
||||
*
|
||||
* Adapted from this StackOverflow answer:
|
||||
* https://stackoverflow.com/a/35087229
|
||||
*/
|
||||
class SlideLinearLayout @JvmOverloads constructor(
|
||||
@@ -35,8 +40,14 @@ class SlideLinearLayout @JvmOverloads constructor(
|
||||
private var doDrawingTrick: Boolean = false
|
||||
|
||||
init {
|
||||
// Apply custom interpolation for the slide animations
|
||||
layoutTransition.apply {
|
||||
setInterpolator(LayoutTransition.APPEARING, FastOutSlowInInterpolator())
|
||||
setInterpolator(LayoutTransition.DISAPPEARING, FastOutSlowInInterpolator())
|
||||
}
|
||||
|
||||
if (disappearingChildrenField != null) {
|
||||
// Create a junk view and add it, which makes all the magic happen [I think??].
|
||||
// Create a junk view and add it, which makes all the magic happen [I think].
|
||||
dumpView = View(context)
|
||||
addView(dumpView, 0, 0)
|
||||
}
|
||||
@@ -54,15 +65,14 @@ class SlideLinearLayout @JvmOverloads constructor(
|
||||
override fun drawChild(canvas: Canvas?, child: View?, drawingTime: Long): Boolean {
|
||||
val children = getDisappearingChildren()
|
||||
|
||||
// I have no idea what this code does.
|
||||
if (doDrawingTrick && children != null) {
|
||||
if (child == dumpView) {
|
||||
if (child == dumpView) { // Use the dump view as a marker for when to do the trick
|
||||
var more = false
|
||||
children.forEach {
|
||||
more = more or super.drawChild(canvas, it, drawingTime)
|
||||
more = more or super.drawChild(canvas, it, drawingTime) // What????
|
||||
}
|
||||
return more
|
||||
} else if (children.contains(child)) {
|
||||
} else if (children.contains(child)) { // Ignore the disappearing children
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -73,7 +83,9 @@ class SlideLinearLayout @JvmOverloads constructor(
|
||||
private fun beforeDispatchDraw(): Boolean {
|
||||
val children = getDisappearingChildren()
|
||||
|
||||
if (children == null || children.isEmpty() || childCount <= 1) { // Junk view included
|
||||
// Dont do trick if there are no disappearing children or if there arent any children other
|
||||
// than the dump view.
|
||||
if (children == null || children.isEmpty() || childCount <= 1) {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -86,10 +98,9 @@ class SlideLinearLayout @JvmOverloads constructor(
|
||||
return disappearingChildren
|
||||
}
|
||||
|
||||
// If there is no list of disappearing children yet, attempt to get it.
|
||||
try {
|
||||
disappearingChildren = disappearingChildrenField.get(this) as List<View>?
|
||||
} catch (e: IllegalAccessException) {
|
||||
} catch (e: Exception) {
|
||||
logD("Could not get list of disappearing children.")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user