LibreTube/app/src/main/res/layout/fragment_home.xml
RafaRamos e31943f5ab
feat: Improve new user experience + adjust home load (#5491)
* Added necessary translations

* Added support for redirecting directly to IntentSettings

* Create HomeViewModel

* Used HomeViewModel

* Update app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>

* Update app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>

* Update app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>

* Swap elvis operator for if statement for improved readability.

* Move runSafely to separate file

* Change when statement by if statement

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>

* Format if statement

* * Remove LiveData properties;
* Change buttons style for consistency;
* Move updateIfChanged to a separate file;

---------

Co-authored-by: Bnyro <82752168+Bnyro@users.noreply.github.com>
2024-01-19 16:03:17 +01:00

152 lines
5.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<ProgressBar
android:id="@+id/progress"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center" />
<com.github.libretube.ui.views.CustomSwipeToRefresh
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp">
<TextView
android:id="@+id/featuredTV"
style="@style/HomeCategoryTitle"
android:text="@string/featured" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/featuredRV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="10dp"
android:clipToPadding="false"
android:nestedScrollingEnabled="false"
android:visibility="gone" />
<TextView
android:id="@+id/watchingTV"
style="@style/HomeCategoryTitle"
android:text="@string/continue_watching" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/watchingRV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="10dp"
android:clipToPadding="false"
android:nestedScrollingEnabled="false"
android:visibility="gone" />
<TextView
android:id="@+id/trendingTV"
style="@style/HomeCategoryTitle"
android:text="@string/trending" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/trendingRV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="10dp"
android:nestedScrollingEnabled="false"
android:visibility="gone" />
</RelativeLayout>
<TextView
android:id="@+id/bookmarksTV"
style="@style/HomeCategoryTitle"
android:text="@string/bookmarks" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/bookmarksRV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:visibility="gone" />
<TextView
android:id="@+id/playlistsTV"
style="@style/HomeCategoryTitle"
android:text="@string/playlists" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/playlistsRV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:visibility="gone" />
</LinearLayout>
</ScrollView>
</com.github.libretube.ui.views.CustomSwipeToRefresh>
<LinearLayout
android:id="@+id/nothing_here"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="@+id/listIV"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:src="@drawable/ic_list" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/emptyList"
android:textSize="20sp"
android:textStyle="bold" />
<com.google.android.material.button.MaterialButton
android:id="@+id/refresh_button"
style="@style/Widget.Material3.Button.ElevatedButton"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:textSize="12sp"
android:text="@string/retry"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/change_instance"
style="@style/Widget.Material3.Button.ElevatedButton"
android:layout_width="150dp"
android:layout_height="50dp"
android:layout_gravity="center"
android:layout_marginTop="5dp"
android:textSize="12sp"
android:text="@string/change_instance"/>
</LinearLayout>
</FrameLayout>