mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 15:30:31 +05:30
more details on full screen
This commit is contained in:
parent
3bc1663f71
commit
be894365b1
12
.idea/deploymentTargetDropDown.xml
generated
12
.idea/deploymentTargetDropDown.xml
generated
@ -1,18 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="3100ad43a3044300" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2021-12-14T10:15:55.771386Z" />
|
||||
<runningDeviceTargetsSelectedWithDialog>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
|
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -5,6 +5,7 @@
|
||||
<map>
|
||||
<entry key="app/src/main/res/drawable/ic_close.xml" value="0.17135416666666667" />
|
||||
<entry key="app/src/main/res/drawable/ic_play.xml" value="0.17135416666666667" />
|
||||
<entry key="app/src/main/res/layout-land/fragment_player.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/layout/activity_player.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/layout/exo_styled_player_control_view.xml" value="0.12" />
|
||||
@ -16,6 +17,7 @@
|
||||
<entry key="app/src/main/res/layout/styled_quality_list_item.xml" value="0.15520833333333334" />
|
||||
<entry key="app/src/main/res/layout/trending_row.xml" value="0.33" />
|
||||
<entry key="app/src/main/res/menu/bottom_menu.xml" value="0.15520833333333334" />
|
||||
<entry key="app/src/main/res/xml/network_security_config.xml" value="0.15520833333333334" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
|
@ -3,6 +3,7 @@
|
||||
package="xyz.btcland.libretube">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
@ -12,6 +13,7 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.LibreTube"
|
||||
android:name=".myApp"
|
||||
android:networkSecurityConfig="@xml/network_security_config"
|
||||
>
|
||||
<activity
|
||||
android:name=".Player"
|
||||
|
@ -83,7 +83,7 @@ class Home : Fragment() {
|
||||
|
||||
fun run() {
|
||||
val request = Request.Builder()
|
||||
.url("https://pipedapi.kavin.rocks/trending?region=US")
|
||||
.url("http://piped-api.alefvanoon.xyz/trending?region=US")
|
||||
.build()
|
||||
client.newCall(request).enqueue(object : Callback {
|
||||
override fun onFailure(call: Call, e: IOException) {
|
||||
|
@ -1,8 +1,10 @@
|
||||
package xyz.btcland.libretube
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.widget.FrameLayout
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView
|
||||
import androidx.navigation.findNavController
|
||||
@ -19,4 +21,18 @@ class MainActivity : AppCompatActivity() {
|
||||
bottomNavigationView.setupWithNavController(navController)
|
||||
|
||||
}
|
||||
|
||||
override fun onConfigurationChanged(newConfig: Configuration) {
|
||||
super.onConfigurationChanged(newConfig)
|
||||
val orientation = newConfig.orientation
|
||||
if (orientation == Configuration.ORIENTATION_PORTRAIT)
|
||||
{
|
||||
println("Portrait")
|
||||
//findViewById<MotionLayout>(R.id.playerMotionLayout).getTransition(R.id.yt_transition).isEnabled = true
|
||||
} else if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
println("Landscape")
|
||||
//findViewById<MotionLayout>(R.id.playerMotionLayout).getTransition(R.id.yt_transition).isEnabled = false
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -135,11 +135,13 @@ class PlayerFragment : Fragment() {
|
||||
view.findViewById<ImageButton>(R.id.close_imageButton).visibility =View.GONE
|
||||
view.findViewById<TextView>(R.id.quality_text).visibility =View.GONE
|
||||
mainMotionLayout.progress = 1.toFloat()
|
||||
mainActivity.supportActionBar?.show()
|
||||
}else if(currentId==sId){
|
||||
view.findViewById<ImageButton>(R.id.quality_select).visibility =View.VISIBLE
|
||||
view.findViewById<ImageButton>(R.id.close_imageButton).visibility =View.VISIBLE
|
||||
view.findViewById<TextView>(R.id.quality_text).visibility =View.VISIBLE
|
||||
mainMotionLayout.progress = 0.toFloat()
|
||||
mainActivity.supportActionBar?.hide()
|
||||
}
|
||||
|
||||
}
|
||||
@ -183,28 +185,27 @@ class PlayerFragment : Fragment() {
|
||||
}
|
||||
}
|
||||
view.findViewById<ImageButton>(R.id.fullscreen).setOnClickListener{
|
||||
//remember to hide everything when new shit added
|
||||
if (!isFullScreen){
|
||||
view.findViewById<ScrollView>(R.id.scrollView2).visibility = View.GONE
|
||||
view.findViewById<LinearLayout>(R.id.linLayout).visibility = View.GONE
|
||||
view.findViewById<TextView>(R.id.textTest).visibility = View.GONE
|
||||
view.findViewById<ConstraintLayout>(R.id.main_container).visibility = View.GONE
|
||||
//view.findViewById<ConstraintLayout>(R.id.main_container).visibility = View.GONE
|
||||
with(motionLayout) {
|
||||
getConstraintSet(R.id.start).constrainHeight(R.id.player, -1)
|
||||
enableTransition(R.xml.player_scene,false)
|
||||
//getTransition(R.id.yt_transition).isEnabled = false
|
||||
}
|
||||
(activity as MainActivity)?.supportActionBar?.hide()
|
||||
isFullScreen=true
|
||||
|
||||
}else{
|
||||
view.findViewById<ScrollView>(R.id.scrollView2).visibility = View.VISIBLE
|
||||
view.findViewById<LinearLayout>(R.id.linLayout).visibility = View.VISIBLE
|
||||
view.findViewById<TextView>(R.id.textTest).visibility = View.VISIBLE
|
||||
view.findViewById<ConstraintLayout>(R.id.main_container).visibility = View.VISIBLE
|
||||
//view.findViewById<ConstraintLayout>(R.id.main_container).visibility = View.VISIBLE
|
||||
with(motionLayout) {
|
||||
getConstraintSet(R.id.start).constrainHeight(R.id.player, 0)
|
||||
enableTransition(R.xml.player_scene,true)
|
||||
//getTransition(R.id.yt_transition).isEnabled = true
|
||||
}
|
||||
(activity as MainActivity)?.supportActionBar?.show()
|
||||
isFullScreen=false
|
||||
}
|
||||
|
||||
@ -247,7 +248,7 @@ class PlayerFragment : Fragment() {
|
||||
|
||||
fun run() {
|
||||
val request = Request.Builder()
|
||||
.url("https://pipedapi.kavin.rocks/streams/$videoId")
|
||||
.url("http://piped-api.alefvanoon.xyz/streams/$videoId")
|
||||
.build()
|
||||
client.newCall(request).enqueue(object : Callback {
|
||||
override fun onFailure(call: Call, e: IOException) {
|
||||
|
19
app/src/main/res/layout-land/fragment_player.xml
Normal file
19
app/src/main/res/layout-land/fragment_player.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".PlayerFragment"
|
||||
android:background="@android:color/transparent"
|
||||
>
|
||||
|
||||
<xyz.btcland.libretube.CustomExoPlayerView
|
||||
android:id="@+id/player"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
app:show_buffering="always"
|
||||
android:background="@color/black"
|
||||
/>
|
||||
</RelativeLayout>
|
@ -50,13 +50,11 @@
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<xyz.btcland.libretube.CustomExoPlayerView
|
||||
android:id="@+id/player"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="@id/main_container"
|
||||
app:layout_constraintStart_toStartOf="@id/main_container"
|
||||
|
4
app/src/main/res/xml/network_security_config.xml
Normal file
4
app/src/main/res/xml/network_security_config.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<network-security-config>
|
||||
<base-config cleartextTrafficPermitted="true" />
|
||||
</network-security-config>
|
@ -4,6 +4,7 @@
|
||||
xmlns:motion="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<Transition
|
||||
android:id="@+id/yt_transition"
|
||||
motion:constraintSetEnd="@+id/end"
|
||||
motion:constraintSetStart="@id/start"
|
||||
motion:duration="10"
|
||||
|
Loading…
x
Reference in New Issue
Block a user