Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
tsynik committed Apr 19, 2024
1 parent 4de5ef5 commit 0c584a5
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import android.widget.Button
import android.widget.LinearLayout
import androidx.appcompat.content.res.AppCompatResources
import androidx.appcompat.view.ContextThemeWrapper
import androidx.core.content.ContextCompat
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
Expand All @@ -41,7 +40,6 @@ import ru.yourok.torrserve.ui.fragments.TSFragment
import ru.yourok.torrserve.ui.fragments.rutor.TorrentsAdapter
import ru.yourok.torrserve.utils.Format
import ru.yourok.torrserve.utils.ThemeUtil
import ru.yourok.torrserve.utils.ThemeUtil.Companion.getColorFromAttr
import ru.yourok.torrserve.utils.TorrentHelper

class AddFragment : TSFragment() {
Expand Down Expand Up @@ -305,26 +303,16 @@ class AddFragment : TSFragment() {
private fun setupSortFab() { // Sort Fab
val fab: FloatingActionButton? = requireActivity().findViewById(R.id.sortFab)
val themedContext = ContextThemeWrapper(App.context, ThemeUtil.selectedTheme)
val selectedColor = getColorFromAttr(themedContext, R.attr.colorPrimary)
val defaultColor = ContextCompat.getColor(themedContext, R.color.gray)
val accentColor = ThemeUtil.getColorFromAttr(themedContext, R.attr.colorAccent)
val actionsColor = ThemeUtil.getColorFromAttr(themedContext, R.attr.colorMainMenu)

fab?.apply {
setImageDrawable(AppCompatResources.getDrawable(this.context, R.drawable.round_sort_24))
customSize = Format.dp2px(32f)
setMaxImageSize(Format.dp2px(24f))
rippleColor = selectedColor
backgroundTintList = ColorStateList(
arrayOf(
intArrayOf(android.R.attr.state_focused), // Focused
intArrayOf(android.R.attr.state_enabled), // Enabled
intArrayOf() // Normal
),
intArrayOf(
selectedColor, // color for the Focused state
defaultColor,
defaultColor
)
)
setColorFilter(accentColor)
setRippleColor(ColorStateList.valueOf(accentColor))
backgroundTintList = ColorStateList.valueOf(actionsColor)
isFocusable = true
isClickable = true
setOnClickListener {
Expand Down Expand Up @@ -357,7 +345,7 @@ class AddFragment : TSFragment() {
// https://github.com/YouROK/NUMParser/blob/be9eb56f1b4b53ff251d84f75186f162019ddac4/db/models/torrentDetails.go#L9
private fun String.normalize(): String {
return when {
this.contains("movie", true) -> "movie"
this.contains("movie", true) -> "movie"
this.contains("series", true) -> "tv"
this.equals("tvshow", true) -> "tv"
else -> this.lowercase()
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/round_live_tv_24.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:scaleX="0.9"
android:scaleY="0.9"
android:scaleX="0.8"
android:scaleY="0.8"
android:pivotX="12"
android:pivotY="1">
android:pivotY="10">
<path
android:fillColor="@android:color/white"
android:pathData="M10.5,17.15l3.98,-2.28c0.67,-0.38 0.67,-1.35 0,-1.74l-3.98,-2.28c-0.67,-0.38 -1.5,0.11 -1.5,0.87v4.55c0,0.77 0.83,1.26 1.5,0.88zM21,6h-7.59l2.94,-2.94c0.2,-0.2 0.2,-0.51 0,-0.71s-0.51,-0.2 -0.71,0L12,5.99 8.36,2.35c-0.2,-0.2 -0.51,-0.2 -0.71,0s-0.2,0.51 0,0.71L10.59,6L3,6c-1.1,0 -2,0.89 -2,2v12c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,8c0,-1.11 -0.9,-2 -2,-2zM20,20L4,20c-0.55,0 -1,-0.45 -1,-1L3,9c0,-0.55 0.45,-1 1,-1h16c0.55,0 1,0.45 1,1v10c0,0.55 -0.45,1 -1,1z" />
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/drawable/round_more_horiz_24.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
android:tint="?attr/colorBright"
android:viewportWidth="24"
android:viewportHeight="24">

<group
android:scaleX="0.9"
android:scaleY="0.9"
android:pivotX="12"
android:pivotY="24">
<path
android:fillColor="@android:color/white"
android:pathData="M6,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" />

</group>
</vector>
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/round_movie_24.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
android:viewportWidth="24"
android:viewportHeight="24">
<group
android:scaleX="0.9"
android:scaleY="0.9"
android:scaleX="0.82"
android:scaleY="0.82"
android:pivotX="12"
android:pivotY="11">
android:pivotY="17">
<path
android:fillColor="@android:color/white"
android:pathData="M18,4l1.82,3.64c0.08,0.16 -0.04,0.36 -0.22,0.36h-1.98c-0.38,0 -0.73,-0.21 -0.89,-0.55L15,4h-2l1.82,3.64c0.08,0.16 -0.04,0.36 -0.22,0.36h-1.98c-0.38,0 -0.73,-0.21 -0.89,-0.55L10,4H8l1.82,3.64c0.08,0.16 -0.04,0.36 -0.22,0.36H7.62c-0.38,0 -0.73,-0.21 -0.9,-0.55L5,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V5c0,-0.55 -0.45,-1 -1,-1h-3z" />
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/drawable/round_music_note_24.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
android:tint="?attr/colorBright"
android:viewportWidth="24"
android:viewportHeight="24">

<group
android:scaleX="0.9"
android:scaleY="0.9"
android:pivotX="12"
android:pivotY="17">
<path
android:fillColor="@android:color/white"
android:pathData="M12,3v10.55c-0.59,-0.34 -1.27,-0.55 -2,-0.55 -2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4V7h4V3h-6z" />

</group>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/round_sort_24.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:tint="@color/tv_white"
android:tint="?attr/colorBright"
android:viewportWidth="24"
android:viewportHeight="24">
<path
Expand Down
8 changes: 6 additions & 2 deletions app/src/main/res/drawable/round_sort_by_alpha_24.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@
android:tint="?attr/colorBright"
android:viewportWidth="24"
android:viewportHeight="24">

<group
android:scaleX="0.9"
android:scaleY="0.9"
android:pivotX="12"
android:pivotY="12">
<path
android:fillColor="@android:color/white"
android:pathData="M12.93,2.65c-0.2,-0.2 -0.51,-0.2 -0.71,0l-2.01,2.01h4.72l-2,-2.01zM12.23,21.35c0.2,0.2 0.51,0.2 0.71,0l1.98,-1.98h-4.66l1.97,1.98zM10.98,17.73c0.6,0 1.01,-0.6 0.79,-1.16L8.04,7.03c-0.18,-0.46 -0.63,-0.76 -1.12,-0.76 -0.49,0 -0.94,0.3 -1.12,0.76l-3.74,9.53c-0.22,0.56 0.19,1.16 0.79,1.16 0.35,0 0.67,-0.22 0.8,-0.55l0.71,-1.9h5.11l0.71,1.9c0.13,0.34 0.45,0.56 0.8,0.56zM4.97,13.64l1.94,-5.18 1.94,5.18L4.97,13.64zM21.05,16.14h-5.33l5.72,-8.29c0.46,-0.66 -0.02,-1.57 -0.82,-1.57h-6.48c-0.44,0 -0.79,0.36 -0.79,0.8v0.01c0,0.44 0.36,0.8 0.79,0.8h5.09l-5.73,8.28c-0.46,0.66 0.02,1.57 0.82,1.57h6.72c0.44,0 0.79,-0.36 0.79,-0.79 0.02,-0.45 -0.34,-0.81 -0.78,-0.81z" />

</group>
</vector>

0 comments on commit 0c584a5

Please sign in to comment.