layout improvements

This commit is contained in:
Bnyro 2022-07-15 10:36:33 +02:00
parent 3f6da4102e
commit 8cfe4e613a
4 changed files with 48 additions and 52 deletions

View File

@ -72,7 +72,6 @@ class SubscriptionsFragment : Fragment() {
var loadedSubbedChannels = false var loadedSubbedChannels = false
binding.toggleSubs.setOnClickListener { binding.toggleSubs.setOnClickListener {
binding.toggle.animate().rotationBy(180F).setDuration(100).start()
if (!binding.subChannels.isVisible) { if (!binding.subChannels.isVisible) {
if (!loadedSubbedChannels) { if (!loadedSubbedChannels) {
binding.subChannels.layoutManager = LinearLayoutManager(context) binding.subChannels.layoutManager = LinearLayoutManager(context)

View File

@ -16,7 +16,6 @@ import com.github.libretube.R
import com.github.libretube.WEBSITE_URL import com.github.libretube.WEBSITE_URL
import com.github.libretube.activities.SettingsActivity import com.github.libretube.activities.SettingsActivity
import com.github.libretube.databinding.FragmentAboutBinding import com.github.libretube.databinding.FragmentAboutBinding
import com.github.libretube.util.ThemeHelper.getThemeColor
import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.snackbar.Snackbar import com.google.android.material.snackbar.Snackbar
@ -94,10 +93,6 @@ class AboutFragment : Fragment() {
val snackBar = Snackbar val snackBar = Snackbar
.make(binding.root, text, Snackbar.LENGTH_LONG) .make(binding.root, text, Snackbar.LENGTH_LONG)
// set snackBar color
snackBar.setBackgroundTint(getThemeColor(requireContext(), R.attr.colorSurface))
snackBar.setTextColor(getThemeColor(requireContext(), R.attr.colorPrimary))
// prevent the text from being partially hidden // prevent the text from being partially hidden
snackBar.setTextMaxLines(3) snackBar.setTextMaxLines(3)

View File

@ -265,7 +265,7 @@
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="" android:text=""
android:textSize="15dp" /> android:textSize="15sp" />
<com.google.android.material.button.MaterialButton <com.google.android.material.button.MaterialButton
@ -301,7 +301,7 @@
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
app:cardCornerRadius="18dp"> app:cardCornerRadius="18dp">
<androidx.constraintlayout.widget.ConstraintLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_margin="8dp" android:layout_margin="8dp"
@ -309,25 +309,22 @@
<TextView <TextView
android:id="@+id/commentsToggle_textView" android:id="@+id/commentsToggle_textView"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_weight="1"
android:text="@string/comments" android:text="@string/comments"
android:textSize="17sp" android:textSize="17sp" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView <ImageView
android:id="@+id/commentsToggle_imageView" android:id="@+id/commentsToggle_imageView"
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_marginEnd="3dp" android:layout_marginEnd="3dp"
android:src="@drawable/ic_arrow_up_down" android:src="@drawable/ic_arrow_up_down" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout> </LinearLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -53,33 +54,44 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:animateLayoutChanges="true"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <com.google.android.material.card.MaterialCardView
android:id="@+id/toggle_subs" android:id="@+id/toggle_subs"
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="12dp" android:layout_marginStart="16dp"
android:visibility="gone"> android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:visibility="gone"
app:cardCornerRadius="18dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/subscriptions" /> android:layout_marginStart="8dp"
android:layout_weight="1"
android:text="@string/subscriptions"
android:textSize="17sp" />
<ImageView <ImageView
android:id="@+id/toggle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_gravity="center"
android:src="@drawable/ic_arrow_down" /> android:layout_marginEnd="3dp"
android:src="@drawable/ic_arrow_up_down" />
</RelativeLayout> </LinearLayout>
<RelativeLayout </com.google.android.material.card.MaterialCardView>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/sub_channels" android:id="@+id/sub_channels"
@ -87,19 +99,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/sub_feed" android:id="@+id/sub_feed"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" /> android:nestedScrollingEnabled="false" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</com.github.libretube.views.CustomSwipeToRefresh> </com.github.libretube.views.CustomSwipeToRefresh>