mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 00:10:32 +05:30
better description layout
This commit is contained in:
parent
f81446095d
commit
81b176b4d6
@ -54,6 +54,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
DynamicColors.applyToActivityIfAvailable(this)
|
DynamicColors.applyToActivityIfAvailable(this)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
// start service that gets called on closure
|
||||||
startService(Intent(this, ClosingService::class.java))
|
startService(Intent(this, ClosingService::class.java))
|
||||||
|
|
||||||
CronetHelper.initCronet(this.applicationContext)
|
CronetHelper.initCronet(this.applicationContext)
|
||||||
|
@ -252,14 +252,12 @@ class PlayerFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// video description and chapters toggle
|
||||||
|
val descLinLayout = view.findViewById<LinearLayout>(R.id.desc_linLayout)
|
||||||
view.findViewById<RelativeLayout>(R.id.player_title_layout).setOnClickListener {
|
view.findViewById<RelativeLayout>(R.id.player_title_layout).setOnClickListener {
|
||||||
val arrowImageView = view.findViewById<ImageView>(R.id.player_description_arrow)
|
val arrowImageView = view.findViewById<ImageView>(R.id.player_description_arrow)
|
||||||
arrowImageView.animate().rotationBy(180F).setDuration(100).start()
|
arrowImageView.animate().rotationBy(180F).setDuration(100).start()
|
||||||
if (playerDescription.isVisible) {
|
descLinLayout.visibility = if (descLinLayout.isVisible) View.GONE else View.VISIBLE
|
||||||
playerDescription.visibility = View.GONE
|
|
||||||
} else {
|
|
||||||
playerDescription.visibility = View.VISIBLE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
view.findViewById<MaterialCardView>(R.id.comments_toggle)
|
view.findViewById<MaterialCardView>(R.id.comments_toggle)
|
||||||
@ -723,6 +721,7 @@ class PlayerFragment : Fragment() {
|
|||||||
chaptersRecView?.layoutManager =
|
chaptersRecView?.layoutManager =
|
||||||
LinearLayoutManager(this.context, LinearLayoutManager.HORIZONTAL, false)
|
LinearLayoutManager(this.context, LinearLayoutManager.HORIZONTAL, false)
|
||||||
chaptersRecView?.adapter = ChaptersAdapter(chapters, exoPlayer)
|
chaptersRecView?.adapter = ChaptersAdapter(chapters, exoPlayer)
|
||||||
|
chaptersRecView?.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,16 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="80dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="10dp"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_marginHorizontal="5dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<ImageView
|
<com.google.android.material.imageview.ShapeableImageView
|
||||||
|
app:shapeAppearanceOverlay="@style/roundedImageViewRounded"
|
||||||
android:id="@+id/chapter_image"
|
android:id="@+id/chapter_image"
|
||||||
android:layout_width="80dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="45dp"
|
android:layout_height="55dp"
|
||||||
android:src="@mipmap/ic_launcher" />
|
android:src="@mipmap/ic_launcher" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
android:id="@+id/linLayout"
|
android:id="@+id/linLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical"
|
||||||
|
android:animateLayoutChanges="true" >
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/player_title_layout"
|
android:id="@+id/player_title_layout"
|
||||||
@ -55,78 +56,84 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="10dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_views_info"
|
||||||
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="10dp"
|
android:layout_weight="1"
|
||||||
android:orientation="horizontal">
|
android:text="10M views 2 days ago " />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="3dp"
|
||||||
|
android:layout_marginTop="2dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="12dp"
|
||||||
|
android:layout_height="12dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:src="@drawable/ic_like" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/player_views_info"
|
android:id="@+id/textLike"
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="10M views 2 days ago " />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="3dp"
|
android:layout_marginHorizontal="5dp"
|
||||||
android:layout_marginTop="2dp">
|
android:text="4.2K" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:layout_gravity="center"
|
android:layout_width="12dp"
|
||||||
android:layout_width="12dp"
|
android:layout_height="12dp"
|
||||||
android:layout_height="12dp"
|
android:layout_gravity="center"
|
||||||
android:src="@drawable/ic_like" />
|
android:layout_marginLeft="5dp"
|
||||||
|
android:rotation="180"
|
||||||
|
android:src="@drawable/ic_like" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textLike"
|
android:id="@+id/textDislike"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="5dp"
|
android:layout_marginHorizontal="5dp"
|
||||||
android:text="4.2K" />
|
android:text="1.3K" />
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:layout_width="12dp"
|
|
||||||
android:layout_height="12dp"
|
|
||||||
android:layout_marginLeft="5dp"
|
|
||||||
android:src="@drawable/ic_like"
|
|
||||||
android:rotation="180"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/textDislike"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginHorizontal="5dp"
|
|
||||||
android:text="1.3K" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
</LinearLayout>
|
||||||
android:id="@+id/chapters_recView"
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/desc_linLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/comments_toggle"
|
android:orientation="vertical"
|
||||||
android:layout_marginLeft="10dp"
|
android:visibility="gone">
|
||||||
android:layout_marginTop="20dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:nestedScrollingEnabled="false"
|
|
||||||
android:visibility="gone" />
|
|
||||||
|
|
||||||
<TextView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/player_description"
|
android:id="@+id/chapters_recView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autoLink="web"
|
android:layout_below="@id/comments_toggle"
|
||||||
android:padding="8dp"
|
android:layout_marginHorizontal="3dp"
|
||||||
android:textIsSelectable="true"
|
android:layout_marginTop="20dp"
|
||||||
android:textSize="14sp"
|
android:nestedScrollingEnabled="false"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/player_description"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:autoLink="web"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
style="@style/Widget.Material3.CardView.Elevated"
|
style="@style/Widget.Material3.CardView.Elevated"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user