fixed subs

This commit is contained in:
LagradOst 2021-08-14 22:28:04 +02:00
parent 3290fceb47
commit d12a8894ae
6 changed files with 33 additions and 15 deletions

View File

@ -13,8 +13,8 @@ android {
applicationId "com.lagradost.cloudstream3"
minSdkVersion 21
targetSdkVersion 30
versionCode 13
versionName "1.2.2"
versionCode 14
versionName "1.2.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -12,7 +12,6 @@ import android.content.pm.ActivityInfo
import android.content.res.Resources
import android.database.ContentObserver
import android.graphics.Color
import android.graphics.Typeface
import android.graphics.drawable.Icon
import android.media.AudioManager
import android.net.Uri
@ -45,7 +44,6 @@ import com.google.android.exoplayer2.C.TIME_UNSET
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout
import com.google.android.exoplayer2.ui.CaptionStyleCompat
import com.google.android.exoplayer2.ui.SubtitleView
import com.google.android.exoplayer2.upstream.DataSource
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
@ -57,8 +55,8 @@ import com.google.android.gms.cast.framework.CastContext
import com.google.android.gms.cast.framework.CastState
import com.google.android.material.button.MaterialButton
import com.lagradost.cloudstream3.*
import com.lagradost.cloudstream3.MainActivity.Companion.isInPIPMode
import com.lagradost.cloudstream3.MainActivity.Companion.canEnterPipMode
import com.lagradost.cloudstream3.MainActivity.Companion.isInPIPMode
import com.lagradost.cloudstream3.R
import com.lagradost.cloudstream3.mvvm.Resource
import com.lagradost.cloudstream3.mvvm.observe
@ -281,6 +279,14 @@ class PlayerFragment : Fragment() {
fadeAnimation.duration = 100
fadeAnimation.fillAfter = true
subView?.let { sView ->
val move = if (isShowing) -((bottom_player_bar?.height?.toFloat() ?: 0f) + 10.toPx) else -subStyle.elevation.toPx.toFloat()
ObjectAnimator.ofFloat(sView, "translationY", move).apply {
duration = 200
start()
}
}
if (!isLocked) {
shadow_overlay?.startAnimation(fadeAnimation)
}
@ -809,6 +815,11 @@ class PlayerFragment : Fragment() {
super.onViewCreated(view, savedInstanceState)
subView = player_view.findViewById(R.id.exo_subtitles)
subView?.let { sView ->
(sView.parent as ViewGroup?) ?.removeView(sView)
subtitle_holder.addView(sView)
}
subStyle = context?.getCurrentSavedStyle()!!
onSubStyleChanged(subStyle)
SubtitlesFragment.applyStyleEvent += ::onSubStyleChanged
@ -1549,7 +1560,7 @@ class PlayerFragment : Fragment() {
"\"Chromium\";v=\"91\", \" Not;A Brand\";v=\"99\""
)
dataSource.setRequestProperty("sec-ch-ua-mobile", "?0")
// dataSource.setRequestProperty("Sec-Fetch-Site", "none") //same-site
// dataSource.setRequestProperty("Sec-Fetch-Site", "none") //same-site
dataSource.setRequestProperty("Sec-Fetch-User", "?1")
dataSource.setRequestProperty("Sec-Fetch-Mode", "navigate")
dataSource.setRequestProperty("Sec-Fetch-Dest", "document")

View File

@ -120,8 +120,6 @@ class SearchFragment : Fragment() {
val cancelButton = dialog.findViewById<TextView>(R.id.cancel_btt)!!
// val applyHolder = dialog.findViewById<LinearLayout>(R.id.apply_btt_holder)!!
toggle.text = getString(R.string.search_provider_text)
val arrayAdapter = ArrayAdapter<String>(view.context, R.layout.sort_bottom_single_choice)
arrayAdapter.addAll(apiNames)
@ -169,6 +167,9 @@ class SearchFragment : Fragment() {
}
fun toggleSearch(isOn: Boolean) {
toggle.text =
getString(if (isOn) R.string.search_provider_text_types else R.string.search_provider_text_providers)
if (isOn) {
listView2?.visibility = View.VISIBLE
listView?.visibility = View.GONE

View File

@ -29,7 +29,6 @@
app:controller_layout_id="@layout/player_custom_layout"
/>
<FrameLayout
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View File

@ -9,12 +9,18 @@
android:screenOrientation="landscape"
tools:orientation="vertical"
>
<View
<FrameLayout
android:id="@+id/subtitle_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/shadow_overlay"
android:background="@color/black_overlay"
/>
android:layout_height="match_parent">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/shadow_overlay"
android:background="@color/black_overlay"
/>
</FrameLayout>
<!--
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"

View File

@ -81,5 +81,6 @@
<string name="subs_default_reset_toast">Reset to default value</string>
<string name="preview_background">Preview Background</string>
<string name="subs_font">Font</string>
<string name="search_provider_text">Search Providers</string>
<string name="search_provider_text_providers">Search using providers</string>
<string name="search_provider_text_types">Search using types</string>
</resources>