mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
style: various player UI improvements, fix navigation bar color
This commit is contained in:
parent
21482545eb
commit
a7cbced326
@ -27,6 +27,7 @@ import com.github.libretube.compat.PictureInPictureCompat
|
|||||||
import com.github.libretube.constants.IntentData
|
import com.github.libretube.constants.IntentData
|
||||||
import com.github.libretube.constants.PreferenceKeys
|
import com.github.libretube.constants.PreferenceKeys
|
||||||
import com.github.libretube.databinding.ActivityMainBinding
|
import com.github.libretube.databinding.ActivityMainBinding
|
||||||
|
import com.github.libretube.extensions.dpToPx
|
||||||
import com.github.libretube.extensions.toID
|
import com.github.libretube.extensions.toID
|
||||||
import com.github.libretube.helpers.NavBarHelper
|
import com.github.libretube.helpers.NavBarHelper
|
||||||
import com.github.libretube.helpers.NavigationHelper
|
import com.github.libretube.helpers.NavigationHelper
|
||||||
@ -96,7 +97,7 @@ class MainActivity : BaseActivity() {
|
|||||||
|
|
||||||
// sets the navigation bar color to the previously calculated color
|
// sets the navigation bar color to the previously calculated color
|
||||||
window.navigationBarColor = if (binding.bottomNav.menu.size() > 0) {
|
window.navigationBarColor = if (binding.bottomNav.menu.size() > 0) {
|
||||||
SurfaceColors.getColorForElevation(this, binding.bottomNav.elevation)
|
ThemeHelper.getThemeColor(this, com.google.android.material.R.attr.colorSurfaceContainer)
|
||||||
} else {
|
} else {
|
||||||
ThemeHelper.getThemeColor(this, android.R.attr.colorBackground)
|
ThemeHelper.getThemeColor(this, android.R.attr.colorBackground)
|
||||||
}
|
}
|
||||||
|
@ -420,10 +420,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
mainActivity.binding.container.isVisible = true
|
mainActivity.binding.container.isVisible = true
|
||||||
val mainMotionLayout = mainActivity.binding.mainMotionLayout
|
val mainMotionLayout = mainActivity.binding.mainMotionLayout
|
||||||
|
|
||||||
// add some elevation to the color to make it easier to distinguish
|
|
||||||
val surfaceColor = SurfaceColors.getColorForElevation(requireContext(), 3f)
|
|
||||||
binding.mainContainer.setBackgroundColor(surfaceColor)
|
|
||||||
|
|
||||||
binding.playerMotionLayout.addTransitionListener(object : TransitionAdapter() {
|
binding.playerMotionLayout.addTransitionListener(object : TransitionAdapter() {
|
||||||
override fun onTransitionChange(
|
override fun onTransitionChange(
|
||||||
motionLayout: MotionLayout?,
|
motionLayout: MotionLayout?,
|
||||||
|
@ -325,7 +325,7 @@ class SubscriptionsFragment : Fragment() {
|
|||||||
showAllAtOnce = false
|
showAllAtOnce = false
|
||||||
)
|
)
|
||||||
binding.subFeed.adapter = feedAdapter
|
binding.subFeed.adapter = feedAdapter
|
||||||
binding.toggleSubsText.text = getString(R.string.subscriptions)
|
binding.toggleSubs.text = getString(R.string.subscriptions)
|
||||||
|
|
||||||
PreferenceHelper.updateLastFeedWatchedTime()
|
PreferenceHelper.updateLastFeedWatchedTime()
|
||||||
}
|
}
|
||||||
@ -363,6 +363,6 @@ class SubscriptionsFragment : Fragment() {
|
|||||||
binding.emptyFeed.isVisible = notLoaded
|
binding.emptyFeed.isVisible = notLoaded
|
||||||
|
|
||||||
val subCount = subscriptions.size.toLong().formatShort()
|
val subCount = subscriptions.size.toLong().formatShort()
|
||||||
binding.toggleSubsText.text = "${getString(R.string.subscriptions)} ($subCount)"
|
binding.toggleSubs.text = "${getString(R.string.subscriptions)} ($subCount)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
android:id="@+id/player_scrollView"
|
android:id="@+id/player_scrollView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="?android:attr/colorBackground"
|
android:background="?colorSurfaceContainerLow"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintHorizontal_bias="0.5"
|
||||||
@ -40,8 +40,8 @@
|
|||||||
android:id="@+id/optionsLL"
|
android:id="@+id/optionsLL"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingHorizontal="2dp"
|
android:orientation="horizontal"
|
||||||
android:orientation="horizontal">
|
android:paddingHorizontal="2dp">
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/relPlayer_share"
|
android:id="@+id/relPlayer_share"
|
||||||
@ -126,25 +126,18 @@
|
|||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/comments_toggle"
|
android:id="@+id/comments_toggle"
|
||||||
style="@style/Widget.Material3.CardView.Elevated"
|
style="@style/PlayerActionsButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="6dp"
|
android:layout_marginHorizontal="20dp"
|
||||||
android:layout_marginVertical="16dp"
|
|
||||||
app:cardCornerRadius="20dp">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="16dp"
|
|
||||||
android:layout_marginVertical="10dp"
|
android:layout_marginVertical="10dp"
|
||||||
android:text="@string/comments"
|
android:text="@string/comments"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
app:drawableEndCompat="@drawable/ic_arrow_up_down" />
|
android:textColor="?colorPrimary"
|
||||||
|
app:drawableEndCompat="@drawable/ic_arrow_up_down"
|
||||||
</com.google.android.material.card.MaterialCardView>
|
app:drawableTint="?colorPrimary" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/related_rec_view"
|
android:id="@+id/related_rec_view"
|
||||||
@ -159,7 +152,7 @@
|
|||||||
android:id="@+id/main_container"
|
android:id="@+id/main_container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="?attr/colorSurface"
|
android:background="?attr/colorSurfaceContainerLow"
|
||||||
app:layout_constraintDimensionRatio="16:9"
|
app:layout_constraintDimensionRatio="16:9"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
@ -55,29 +55,19 @@
|
|||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.button.MaterialButton
|
||||||
android:id="@+id/toggle_subs"
|
android:id="@+id/toggle_subs"
|
||||||
style="@style/Widget.Material3.CardView.Elevated"
|
style="@style/PlayerActionsButton"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="14dp"
|
android:layout_marginHorizontal="14dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:layout_marginEnd="14dp"
|
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="12dp"
|
||||||
app:cardCornerRadius="18dp"
|
|
||||||
app:cardElevation="10dp">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatTextView
|
|
||||||
android:id="@+id/toggle_subs_text"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_margin="8dp"
|
|
||||||
android:paddingHorizontal="8dp"
|
|
||||||
android:text="@string/subscriptions"
|
android:text="@string/subscriptions"
|
||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
app:drawableEndCompat="@drawable/ic_arrow_up_down" />
|
android:textColor="?colorPrimary"
|
||||||
|
app:drawableEndCompat="@drawable/ic_arrow_up_down"
|
||||||
</com.google.android.material.card.MaterialCardView>
|
app:drawableTint="?colorPrimary" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/sub_channels_container"
|
android:id="@+id/sub_channels_container"
|
||||||
@ -107,7 +97,6 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/filterTV"
|
android:id="@+id/filterTV"
|
||||||
android:tooltipText="@string/tooltip_filter"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
@ -116,11 +105,11 @@
|
|||||||
android:paddingHorizontal="10dp"
|
android:paddingHorizontal="10dp"
|
||||||
android:text="@string/all"
|
android:text="@string/all"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
|
android:tooltipText="@string/tooltip_filter"
|
||||||
app:drawableEndCompat="@drawable/ic_filter" />
|
app:drawableEndCompat="@drawable/ic_filter" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sortTV"
|
android:id="@+id/sortTV"
|
||||||
android:tooltipText="@string/tooltip_sort"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
@ -129,6 +118,7 @@
|
|||||||
android:paddingHorizontal="10dp"
|
android:paddingHorizontal="10dp"
|
||||||
android:text="@string/most_recent"
|
android:text="@string/most_recent"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
|
android:tooltipText="@string/tooltip_sort"
|
||||||
app:drawableEndCompat="@drawable/ic_sort" />
|
app:drawableEndCompat="@drawable/ic_sort" />
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@ -146,14 +136,14 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/edit_groups"
|
android:id="@+id/edit_groups"
|
||||||
android:tooltipText="@string/tooltip_edit_groups"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:layout_marginStart="12dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:background="?attr/selectableItemBackgroundBorderless"
|
android:background="?attr/selectableItemBackgroundBorderless"
|
||||||
android:src="@drawable/ic_edit" />
|
android:src="@drawable/ic_edit"
|
||||||
|
android:tooltipText="@string/tooltip_edit_groups" />
|
||||||
|
|
||||||
<com.google.android.material.chip.ChipGroup
|
<com.google.android.material.chip.ChipGroup
|
||||||
android:id="@+id/channel_groups"
|
android:id="@+id/channel_groups"
|
||||||
|
@ -89,6 +89,8 @@
|
|||||||
<item name="android:layout_marginStart">4dp</item>
|
<item name="android:layout_marginStart">4dp</item>
|
||||||
<item name="android:layout_marginEnd">4dp</item>
|
<item name="android:layout_marginEnd">4dp</item>
|
||||||
<item name="iconGravity">textStart</item>
|
<item name="iconGravity">textStart</item>
|
||||||
|
<item name="android:textColor">?colorPrimary</item>
|
||||||
|
<item name="iconTint">?colorPrimary</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user