mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 13:50:30 +05:30
commit
9cc65a58dd
@ -19,6 +19,9 @@ import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.view.animation.RotateAnimation
|
||||
import android.widget.*
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
@ -204,8 +207,27 @@ class PlayerFragment : Fragment() {
|
||||
}
|
||||
|
||||
view.findViewById<RelativeLayout>(R.id.player_title_layout).setOnClickListener {
|
||||
playerDescription.visibility =
|
||||
if (playerDescription.isVisible) View.GONE else View.VISIBLE
|
||||
if (playerDescription.isVisible){
|
||||
val image = view.findViewById<ImageView>(R.id.player_description_arrow)
|
||||
image.clearAnimation()
|
||||
playerDescription.visibility = View.GONE
|
||||
} else {
|
||||
//toggle button
|
||||
val rotate = RotateAnimation(
|
||||
0F,
|
||||
180F,
|
||||
Animation.RELATIVE_TO_SELF,
|
||||
0.5f,
|
||||
Animation.RELATIVE_TO_SELF,
|
||||
0.5f
|
||||
)
|
||||
rotate.duration = 100
|
||||
rotate.interpolator = LinearInterpolator()
|
||||
rotate.fillAfter = true
|
||||
val image = view.findViewById<ImageView>(R.id.player_description_arrow)
|
||||
image.startAnimation(rotate)
|
||||
playerDescription.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
view.findViewById<com.google.android.material.card.MaterialCardView>(R.id.comments_toggle).setOnClickListener {
|
||||
|
@ -6,6 +6,9 @@ import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.LinearInterpolator
|
||||
import android.view.animation.RotateAnimation
|
||||
import android.widget.*
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.fragment.app.Fragment
|
||||
@ -16,9 +19,9 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
import com.github.libretube.adapters.SubscriptionAdapter
|
||||
import com.github.libretube.adapters.SubscriptionChannelAdapter
|
||||
import java.io.IOException
|
||||
import org.chromium.base.ThreadUtils.runOnUiThread
|
||||
import retrofit2.HttpException
|
||||
import java.io.IOException
|
||||
|
||||
|
||||
class Subscriptions : Fragment() {
|
||||
val TAG = "SubFragment"
|
||||
@ -78,9 +81,29 @@ class Subscriptions : Fragment() {
|
||||
}
|
||||
channelRecView.visibility = View.VISIBLE
|
||||
feedRecView.visibility = View.GONE
|
||||
|
||||
//toggle button
|
||||
val rotate = RotateAnimation(
|
||||
0F,
|
||||
180F,
|
||||
Animation.RELATIVE_TO_SELF,
|
||||
0.5f,
|
||||
Animation.RELATIVE_TO_SELF,
|
||||
0.5f
|
||||
)
|
||||
rotate.duration = 100
|
||||
rotate.interpolator = LinearInterpolator()
|
||||
rotate.fillAfter = true
|
||||
val image = view.findViewById<ImageView>(R.id.toggle)
|
||||
image.startAnimation(rotate)
|
||||
|
||||
} else {
|
||||
channelRecView.visibility = View.GONE
|
||||
feedRecView.visibility = View.VISIBLE
|
||||
|
||||
//toggle button
|
||||
val image = view.findViewById<ImageView>(R.id.toggle)
|
||||
image.clearAnimation()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:src="@drawable/ic_arrow_down" />
|
||||
|
||||
</RelativeLayout>
|
||||
@ -147,8 +147,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/download" />
|
||||
>
|
||||
android:text="@string/download"
|
||||
android:maxLines="1"/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -68,6 +68,7 @@
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
|
Loading…
Reference in New Issue
Block a user