mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
commit
0c332c9e71
@ -24,13 +24,15 @@
|
||||
<activity
|
||||
android:name=".util.Player"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:exported="false"
|
||||
android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".SettingsActivity"
|
||||
android:name=".activities.NoInternetActivity"
|
||||
android:label="@string/noInternet"/>
|
||||
<activity
|
||||
android:name=".activities.SettingsActivity"
|
||||
android:label="@string/settings" />
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:name=".activities.MainActivity"
|
||||
android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
|
||||
android:exported="true"
|
||||
android:hardwareAccelerated="true"
|
||||
@ -53,7 +55,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_gradient_round"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -70,7 +72,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_fire_round"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -87,7 +89,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_flame_round"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -104,7 +106,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_shaped_round"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -121,7 +123,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_torch_round"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -138,7 +140,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_legacy_round"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -155,7 +157,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_bird_round"
|
||||
android:supportsPictureInPicture="true"
|
||||
android:targetActivity=".MainActivity">
|
||||
android:targetActivity=".activities.MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@ -163,7 +165,7 @@
|
||||
</activity-alias>
|
||||
|
||||
<activity
|
||||
android:name=".RouterActivity"
|
||||
android:name=".activities.RouterActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleInstance">
|
||||
<intent-filter>
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.github.libretube
|
||||
package com.github.libretube.activities
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
@ -19,11 +19,8 @@ import android.view.WindowInsets
|
||||
import android.view.WindowInsetsController
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Button
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.os.bundleOf
|
||||
@ -32,6 +29,7 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.findNavController
|
||||
import androidx.navigation.ui.setupWithNavController
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.databinding.ActivityMainBinding
|
||||
import com.github.libretube.fragments.PlayerFragment
|
||||
import com.github.libretube.fragments.isFullScreen
|
||||
@ -50,7 +48,6 @@ class MainActivity : AppCompatActivity() {
|
||||
lateinit var binding: ActivityMainBinding
|
||||
|
||||
private lateinit var bottomNavigationView: BottomNavigationView
|
||||
private lateinit var toolbar: Toolbar
|
||||
lateinit var navController: NavController
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -70,14 +67,8 @@ class MainActivity : AppCompatActivity() {
|
||||
|
||||
// show noInternet Activity if no internet available on app startup
|
||||
if (!isNetworkAvailable(this)) {
|
||||
setContentView(R.layout.activity_nointernet)
|
||||
findViewById<Button>(R.id.retry_button).setOnClickListener {
|
||||
recreate()
|
||||
}
|
||||
findViewById<ImageView>(R.id.noInternet_settingsImageView).setOnClickListener {
|
||||
val intent = Intent(this, SettingsActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
val noInternetIntent = Intent(this, NoInternetActivity::class.java)
|
||||
startActivity(noInternetIntent)
|
||||
} else {
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
@ -286,7 +277,6 @@ class MainActivity : AppCompatActivity() {
|
||||
navController.popBackStack()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
// try catch to prevent nointernet activity to crash
|
||||
try {
|
||||
navController.popBackStack()
|
||||
moveTaskToBack(true)
|
||||
@ -364,10 +354,6 @@ fun Fragment.hideKeyboard() {
|
||||
view?.let { activity?.hideKeyboard(it) }
|
||||
}
|
||||
|
||||
fun Activity.hideKeyboard() {
|
||||
hideKeyboard(currentFocus ?: View(this))
|
||||
}
|
||||
|
||||
fun Context.hideKeyboard(view: View) {
|
||||
val inputMethodManager = getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.hideSoftInputFromWindow(view.windowToken, 0)
|
@ -0,0 +1,31 @@
|
||||
package com.github.libretube.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.github.libretube.databinding.ActivityNointernetBinding
|
||||
import com.github.libretube.util.ThemeHelper
|
||||
import com.google.android.material.color.DynamicColors
|
||||
|
||||
class NoInternetActivity : AppCompatActivity() {
|
||||
private lateinit var binding: ActivityNointernetBinding
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
DynamicColors.applyToActivityIfAvailable(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityNointernetBinding.inflate(layoutInflater)
|
||||
binding.retryButton.setOnClickListener {
|
||||
ThemeHelper.restartMainActivity(this)
|
||||
}
|
||||
binding.noInternetSettingsImageView.setOnClickListener {
|
||||
val intent = Intent(this, SettingsActivity::class.java)
|
||||
startActivity(intent)
|
||||
}
|
||||
setContentView(binding.root)
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
finishAffinity()
|
||||
super.onBackPressed()
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.github.libretube
|
||||
package com.github.libretube.activities
|
||||
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
@ -6,6 +6,7 @@ import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.util.ThemeHelper
|
||||
|
||||
class RouterActivity : AppCompatActivity() {
|
@ -1,10 +1,11 @@
|
||||
package com.github.libretube
|
||||
package com.github.libretube.activities
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.app.ActivityCompat
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.databinding.ActivitySettingsBinding
|
||||
import com.github.libretube.preferences.MainSettings
|
||||
import com.github.libretube.util.ThemeHelper
|
@ -9,8 +9,8 @@ import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.CommentsRowBinding
|
||||
import com.github.libretube.obj.Comment
|
||||
import com.github.libretube.obj.CommentsPage
|
||||
|
@ -7,8 +7,8 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.PlaylistsRowBinding
|
||||
import com.github.libretube.obj.PlaylistId
|
||||
import com.github.libretube.obj.Playlists
|
||||
|
@ -6,8 +6,8 @@ import android.view.ViewGroup
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.RepliesRowBinding
|
||||
import com.github.libretube.obj.Comment
|
||||
import com.github.libretube.util.formatShort
|
||||
|
@ -11,8 +11,11 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.ChannelSearchRowBinding
|
||||
import com.github.libretube.databinding.PlaylistSearchRowBinding
|
||||
import com.github.libretube.databinding.VideoSearchRowBinding
|
||||
import com.github.libretube.dialogs.PlaylistOptionsDialog
|
||||
import com.github.libretube.dialogs.VideoOptionsDialog
|
||||
import com.github.libretube.fragments.PlayerFragment
|
||||
@ -37,15 +40,15 @@ class SearchAdapter(
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SearchViewHolder {
|
||||
val layout = when (viewType) {
|
||||
0 -> R.layout.video_search_row
|
||||
1 -> R.layout.channel_search_row
|
||||
2 -> R.layout.playlist_search_row
|
||||
val layoutInflater = LayoutInflater.from(parent.context)
|
||||
|
||||
val binding = when (viewType) {
|
||||
0 -> VideoSearchRowBinding.inflate(layoutInflater, parent, false)
|
||||
1 -> ChannelSearchRowBinding.inflate(layoutInflater, parent, false)
|
||||
2 -> PlaylistSearchRowBinding.inflate(layoutInflater, parent, false)
|
||||
else -> throw IllegalArgumentException("Invalid type")
|
||||
}
|
||||
val layoutInflater = LayoutInflater.from(parent.context)
|
||||
val cell = layoutInflater.inflate(layout, parent, false)
|
||||
return SearchViewHolder(cell, childFragmentManager)
|
||||
return SearchViewHolder(binding.root, childFragmentManager)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: SearchViewHolder, position: Int) {
|
||||
|
@ -10,8 +10,8 @@ import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.TrendingRowBinding
|
||||
import com.github.libretube.dialogs.VideoOptionsDialog
|
||||
import com.github.libretube.fragments.PlayerFragment
|
||||
|
@ -7,8 +7,8 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.ChannelSubscriptionRowBinding
|
||||
import com.github.libretube.obj.Subscribe
|
||||
import com.github.libretube.obj.Subscription
|
||||
|
@ -10,8 +10,8 @@ import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.TrendingRowBinding
|
||||
import com.github.libretube.dialogs.VideoOptionsDialog
|
||||
import com.github.libretube.fragments.PlayerFragment
|
||||
|
@ -9,9 +9,9 @@ import androidx.core.text.HtmlCompat
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.requireMainActivityRestart
|
||||
import com.github.libretube.databinding.DialogDeleteAccountBinding
|
||||
import com.github.libretube.obj.DeleteUserRequest
|
||||
import com.github.libretube.requireMainActivityRestart
|
||||
import com.github.libretube.util.PreferenceHelper
|
||||
import com.github.libretube.util.RetrofitInstance
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
@ -13,8 +13,8 @@ import android.widget.ArrayAdapter
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.text.HtmlCompat
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.databinding.DialogDownloadBinding
|
||||
import com.github.libretube.obj.Streams
|
||||
import com.github.libretube.services.DownloadService
|
||||
|
@ -6,8 +6,8 @@ import android.os.Bundle
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.github.libretube.BackgroundMode
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.util.BackgroundMode
|
||||
import com.github.libretube.util.PreferenceHelper
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
||||
|
@ -19,11 +19,6 @@ import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Button
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ImageButton
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.net.toUri
|
||||
@ -33,8 +28,9 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.github.libretube.activities.hideKeyboard
|
||||
import com.github.libretube.adapters.ChaptersAdapter
|
||||
import com.github.libretube.adapters.CommentsAdapter
|
||||
import com.github.libretube.adapters.TrendingAdapter
|
||||
@ -42,7 +38,6 @@ import com.github.libretube.databinding.FragmentPlayerBinding
|
||||
import com.github.libretube.dialogs.AddtoPlaylistDialog
|
||||
import com.github.libretube.dialogs.DownloadDialog
|
||||
import com.github.libretube.dialogs.ShareDialog
|
||||
import com.github.libretube.hideKeyboard
|
||||
import com.github.libretube.obj.ChapterSegment
|
||||
import com.github.libretube.obj.PipedStream
|
||||
import com.github.libretube.obj.Playlist
|
||||
@ -80,7 +75,6 @@ import com.google.android.exoplayer2.upstream.DefaultDataSource
|
||||
import com.google.android.exoplayer2.upstream.DefaultHttpDataSource
|
||||
import com.google.android.exoplayer2.util.RepeatModeUtil
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.card.MaterialCardView
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import com.squareup.picasso.Picasso
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@ -233,7 +227,7 @@ class PlayerFragment : Fragment() {
|
||||
.remove(this)
|
||||
.commit()
|
||||
}
|
||||
view.findViewById<ImageButton>(R.id.close_imageButton).setOnClickListener {
|
||||
binding.player.binding.closeImageButton.setOnClickListener {
|
||||
isMiniPlayerVisible = false
|
||||
binding.playerMotionLayout.transitionToEnd()
|
||||
val mainActivity = activity as MainActivity
|
||||
@ -261,13 +255,12 @@ class PlayerFragment : Fragment() {
|
||||
if (binding.descLinLayout.isVisible) View.GONE else View.VISIBLE
|
||||
}
|
||||
|
||||
view.findViewById<MaterialCardView>(R.id.comments_toggle)
|
||||
.setOnClickListener {
|
||||
toggleComments()
|
||||
}
|
||||
binding.commentsToggle.setOnClickListener {
|
||||
toggleComments()
|
||||
}
|
||||
|
||||
val fullScreenButton = view.findViewById<ImageButton>(R.id.fullscreen)
|
||||
val exoTitle = view.findViewById<TextView>(R.id.exo_title)
|
||||
val fullScreenButton = binding.player.binding.fullscreen
|
||||
val exoTitle = binding.player.binding.exoTitle
|
||||
|
||||
// FullScreen button trigger
|
||||
fullScreenButton.setOnClickListener {
|
||||
@ -303,7 +296,8 @@ class PlayerFragment : Fragment() {
|
||||
}
|
||||
|
||||
// switching between original aspect ratio (black bars) and zoomed to fill device screen
|
||||
view.findViewById<ImageButton>(R.id.aspect_ratio_button).setOnClickListener {
|
||||
val aspectRatioButton = binding.player.binding.aspectRatioButton
|
||||
aspectRatioButton.setOnClickListener {
|
||||
if (isZoomed) {
|
||||
exoPlayerView.resizeMode = AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||
isZoomed = false
|
||||
@ -314,7 +308,7 @@ class PlayerFragment : Fragment() {
|
||||
}
|
||||
|
||||
// lock and unlock the player
|
||||
val lockPlayerButton = view.findViewById<ImageButton>(R.id.lock_player)
|
||||
val lockPlayerButton = binding.player.binding.lockPlayer
|
||||
lockPlayerButton.setOnClickListener {
|
||||
// change the locked/unlocked icon
|
||||
if (!isPlayerLocked) {
|
||||
@ -630,7 +624,7 @@ class PlayerFragment : Fragment() {
|
||||
binding.playerTitle.text = response.title
|
||||
binding.playerDescription.text = response.description
|
||||
|
||||
view.findViewById<TextView>(R.id.exo_title).text = response.title
|
||||
binding.player.binding.exoTitle.text = response.title
|
||||
|
||||
// Listener for play and pause icon change
|
||||
exoPlayer.addListener(object : Player.Listener {
|
||||
@ -802,8 +796,8 @@ class PlayerFragment : Fragment() {
|
||||
PreferenceHelper.getString(requireContext(), "player_video_format", "WEBM")
|
||||
val defres = PreferenceHelper.getString(requireContext(), "default_res", "")!!
|
||||
|
||||
val qualityText = view.findViewById<TextView>(R.id.quality_text)
|
||||
val qualitySelect = view.findViewById<LinearLayout>(R.id.quality_linLayout)
|
||||
val qualityText = binding.player.binding.qualityText
|
||||
val qualitySelect = binding.player.binding.qualitySelect
|
||||
|
||||
var videosNameArray: Array<CharSequence> = arrayOf()
|
||||
var videosUrlArray: Array<Uri> = arrayOf()
|
||||
@ -987,12 +981,12 @@ class PlayerFragment : Fragment() {
|
||||
|
||||
private fun lockPlayer(isLocked: Boolean) {
|
||||
val visibility = if (isLocked) View.VISIBLE else View.INVISIBLE
|
||||
exoPlayerView.findViewById<LinearLayout>(R.id.exo_top_bar_right).visibility = visibility
|
||||
exoPlayerView.findViewById<ImageButton>(R.id.exo_play_pause).visibility = visibility
|
||||
exoPlayerView.findViewById<Button>(R.id.exo_ffwd_with_amount).visibility = visibility
|
||||
exoPlayerView.findViewById<Button>(R.id.exo_rew_with_amount).visibility = visibility
|
||||
exoPlayerView.findViewById<FrameLayout>(R.id.exo_bottom_bar).visibility = visibility
|
||||
exoPlayerView.findViewById<TextView>(R.id.exo_title).visibility =
|
||||
binding.player.binding.exoTopBarRight.visibility = visibility
|
||||
binding.player.binding.exoPlayPause.visibility = visibility
|
||||
binding.player.binding.exoFfwdWithAmount.visibility = visibility
|
||||
binding.player.binding.exoRewWithAmount.visibility = visibility
|
||||
binding.player.binding.exoBottomBar.visibility = visibility
|
||||
binding.player.binding.exoTitle.visibility =
|
||||
if (isLocked && isFullScreen) View.VISIBLE else View.INVISIBLE
|
||||
}
|
||||
|
||||
@ -1154,7 +1148,7 @@ class PlayerFragment : Fragment() {
|
||||
enableTransition(R.id.yt_transition, false)
|
||||
}
|
||||
binding.mainContainer.isClickable = true
|
||||
view?.findViewById<LinearLayout>(R.id.exo_top_bar)?.visibility = View.GONE
|
||||
binding.player.binding.exoTopBar.visibility = View.GONE
|
||||
val mainActivity = activity as MainActivity
|
||||
mainActivity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT
|
||||
isFullScreen = false
|
||||
@ -1166,7 +1160,7 @@ class PlayerFragment : Fragment() {
|
||||
exoPlayerView.showController()
|
||||
exoPlayerView.useController = true
|
||||
binding.mainContainer.isClickable = false
|
||||
view?.findViewById<LinearLayout>(R.id.exo_top_bar)?.visibility = View.VISIBLE
|
||||
binding.player.binding.exoTopBar.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,11 +20,11 @@ import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.activities.hideKeyboard
|
||||
import com.github.libretube.adapters.SearchAdapter
|
||||
import com.github.libretube.adapters.SearchHistoryAdapter
|
||||
import com.github.libretube.adapters.SearchSuggestionsAdapter
|
||||
import com.github.libretube.databinding.FragmentSearchBinding
|
||||
import com.github.libretube.hideKeyboard
|
||||
import com.github.libretube.util.PreferenceHelper
|
||||
import com.github.libretube.util.RetrofitInstance
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
@ -9,14 +9,14 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.github.libretube.AUTHORS_URL
|
||||
import com.github.libretube.CONTRIBUTING_URL
|
||||
import com.github.libretube.DONATE_URL
|
||||
import com.github.libretube.PIPED_GITHUB_URL
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.SettingsActivity
|
||||
import com.github.libretube.WEBSITE_URL
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
import com.github.libretube.databinding.FragmentAboutBinding
|
||||
import com.github.libretube.util.AUTHORS_URL
|
||||
import com.github.libretube.util.CONTRIBUTING_URL
|
||||
import com.github.libretube.util.DONATE_URL
|
||||
import com.github.libretube.util.PIPED_GITHUB_URL
|
||||
import com.github.libretube.util.WEBSITE_URL
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
||||
class AboutFragment : Fragment() {
|
||||
|
@ -4,8 +4,8 @@ import android.os.Bundle
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.SettingsActivity
|
||||
import com.github.libretube.requireMainActivityRestart
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
import com.github.libretube.activities.requireMainActivityRestart
|
||||
import com.github.libretube.util.PreferenceHelper
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
|
||||
|
@ -6,8 +6,8 @@ import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.SwitchPreference
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.SettingsActivity
|
||||
import com.github.libretube.requireMainActivityRestart
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
import com.github.libretube.activities.requireMainActivityRestart
|
||||
import com.github.libretube.util.ThemeHelper
|
||||
|
||||
class AppearanceSettings : PreferenceFragmentCompat() {
|
||||
|
@ -18,12 +18,12 @@ import androidx.preference.ListPreference
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.SettingsActivity
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
import com.github.libretube.activities.requireMainActivityRestart
|
||||
import com.github.libretube.dialogs.CustomInstanceDialog
|
||||
import com.github.libretube.dialogs.DeleteAccountDialog
|
||||
import com.github.libretube.dialogs.LoginDialog
|
||||
import com.github.libretube.dialogs.LogoutDialog
|
||||
import com.github.libretube.requireMainActivityRestart
|
||||
import com.github.libretube.util.PreferenceHelper
|
||||
import com.github.libretube.util.RetrofitInstance
|
||||
import org.json.JSONObject
|
||||
|
@ -8,8 +8,8 @@ import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.github.libretube.BuildConfig
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.isCurrentViewMainSettings
|
||||
import com.github.libretube.requireMainActivityRestart
|
||||
import com.github.libretube.activities.isCurrentViewMainSettings
|
||||
import com.github.libretube.activities.requireMainActivityRestart
|
||||
import com.github.libretube.util.ThemeHelper
|
||||
import com.github.libretube.util.checkUpdate
|
||||
|
||||
|
@ -3,7 +3,7 @@ package com.github.libretube.preferences
|
||||
import android.os.Bundle
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.SettingsActivity
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
|
||||
class PlayerSettings : PreferenceFragmentCompat() {
|
||||
val TAG = "PlayerSettings"
|
||||
|
@ -3,7 +3,7 @@ package com.github.libretube.preferences
|
||||
import android.os.Bundle
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.SettingsActivity
|
||||
import com.github.libretube.activities.SettingsActivity
|
||||
|
||||
class SponsorBlockSettings : PreferenceFragmentCompat() {
|
||||
private val TAG = "SponsorBlockSettings"
|
||||
|
@ -1,12 +1,9 @@
|
||||
package com.github.libretube
|
||||
package com.github.libretube.util
|
||||
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.support.v4.media.session.MediaSessionCompat
|
||||
import com.github.libretube.obj.Streams
|
||||
import com.github.libretube.util.DescriptionAdapter
|
||||
import com.github.libretube.util.PreferenceHelper
|
||||
import com.github.libretube.util.RetrofitInstance
|
||||
import com.google.android.exoplayer2.C
|
||||
import com.google.android.exoplayer2.ExoPlayer
|
||||
import com.google.android.exoplayer2.MediaItem
|
@ -1,4 +1,4 @@
|
||||
package com.github.libretube
|
||||
package com.github.libretube.util
|
||||
|
||||
const val GITHUB_API_URL = "https://api.github.com/repos/libre-tube/LibreTube/releases/latest"
|
||||
const val WEBSITE_URL = "https://libre-tube.github.io/"
|
@ -4,12 +4,14 @@ import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.MotionEvent
|
||||
import com.github.libretube.databinding.ExoStyledPlayerControlViewBinding
|
||||
import com.google.android.exoplayer2.ui.StyledPlayerView
|
||||
|
||||
internal class CustomExoPlayerView(
|
||||
context: Context,
|
||||
attributeSet: AttributeSet? = null
|
||||
) : StyledPlayerView(context, attributeSet) {
|
||||
val binding: ExoStyledPlayerControlViewBinding = ExoStyledPlayerControlViewBinding.bind(this)
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
|
@ -5,7 +5,7 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.activities.MainActivity
|
||||
import com.google.android.exoplayer2.Player
|
||||
import com.google.android.exoplayer2.ui.PlayerNotificationManager
|
||||
import java.net.URL
|
||||
|
@ -3,7 +3,6 @@ package com.github.libretube.util
|
||||
import android.util.Log
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import com.github.libretube.BuildConfig
|
||||
import com.github.libretube.GITHUB_API_URL
|
||||
import com.github.libretube.dialogs.NoUpdateAvailableDialog
|
||||
import com.github.libretube.dialogs.UpdateAvailableDialog
|
||||
import com.github.libretube.obj.UpdateInfo
|
||||
|
@ -6,10 +6,12 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/noInternet_settingsImageView"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:padding="3dp"
|
||||
android:layout_width="33dp"
|
||||
android:layout_height="33dp"
|
||||
android:layout_margin="16dp"
|
||||
android:src="@drawable/ic_settings"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user