small fixes

This commit is contained in:
LagradOst 2021-12-04 23:40:24 +01:00
parent 1a58734b7d
commit 64ce14e290
6 changed files with 50 additions and 20 deletions

View File

@ -88,7 +88,7 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0-beta02'
@ -118,9 +118,9 @@ dependencies {
// implementation "androidx.leanback:leanback-paging:1.1.0-alpha09"
// Exoplayer
implementation 'com.google.android.exoplayer:exoplayer:2.15.1'
implementation 'com.google.android.exoplayer:extension-cast:2.15.1'
implementation "com.google.android.exoplayer:extension-mediasession:2.15.1"
implementation 'com.google.android.exoplayer:exoplayer:2.16.1'
implementation 'com.google.android.exoplayer:extension-cast:2.16.1'
implementation "com.google.android.exoplayer:extension-mediasession:2.16.1"
//implementation "com.google.android.exoplayer:extension-leanback:2.14.0"
// Bug reports

View File

@ -49,6 +49,7 @@
<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="https" android:host="gogoanime.vc" android:pathPrefix="/"/>
<data android:scheme="https" android:host="allanime.site" android:pathPrefix="/"/>
<data android:scheme="https" android:host="animeflick.net" android:pathPrefix="/"/>
<data android:scheme="https" android:host="kawaiifu.com" android:pathPrefix="/"/>
<data android:scheme="https" android:host="tenshi.moe" android:pathPrefix="/"/>
@ -57,11 +58,16 @@
<data android:scheme="https" android:host="hdm.to" android:pathPrefix="/"/>
<data android:scheme="https" android:host="www.vmovee.watch" android:pathPrefix="/"/>
<data android:scheme="https" android:host="www.wcostream.com" android:pathPrefix="/"/>
<data android:scheme="https" android:host="allmoviesforyou.co" android:pathPrefix="/"/>
<data android:scheme="https" android:host="asiaflix.app" android:pathPrefix="/"/>
<data android:scheme="https" android:host="www.thenos.org" android:pathPrefix="/"/>
<data android:scheme="https" android:host="allmoviesforyou.net" android:pathPrefix="/"/>
<data android:scheme="https" android:host="vidembed.cc" android:pathPrefix="/"/>
<data android:scheme="https" android:host="vf-film.me" android:pathPrefix="/"/>
<data android:scheme="https" android:host="vf-serie.org" android:pathPrefix="/"/>
<data android:scheme="https" android:host="asianembed.io" android:pathPrefix="/"/>
<data android:scheme="https" android:host="sflix.to" android:pathPrefix="/"/>
<data android:scheme="https" android:host="dopebox.to" android:pathPrefix="/"/>
<data android:scheme="https" android:host="trailers.to" android:pathPrefix="/"/>
<data android:scheme="https" android:host="zoro.to" android:pathPrefix="/"/>
<data android:scheme="https" android:host="asiaflix.app" android:pathPrefix="/"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>

View File

@ -221,8 +221,8 @@ class HomeFragment : Fragment() {
) { callback ->
handleSearchClickCallback(activity, callback)
}
home_main_poster_recyclerview.post {
(home_main_poster_recyclerview.layoutManager as CenterZoomLayoutManager?)?.let { manager ->
home_main_poster_recyclerview?.post {
(home_main_poster_recyclerview?.layoutManager as CenterZoomLayoutManager?)?.let { manager ->
manager.updateSize(forceUpdate = true)
if (randomSize > 2) {
manager.scrollToPosition(randomSize / 2)
@ -409,7 +409,7 @@ class HomeFragment : Fragment() {
LinearSnapHelper().attachToRecyclerView(home_main_poster_recyclerview) // snap
val centerLayoutManager = CenterZoomLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
centerLayoutManager.setOnSizeListener { index ->
(home_main_poster_recyclerview.adapter as HomeChildItemAdapter?)?.cardList?.get(index)?.let { random ->
(home_main_poster_recyclerview?.adapter as HomeChildItemAdapter?)?.cardList?.get(index)?.let { random ->
home_main_play.setOnClickListener {
activity.loadSearchResult(random, START_ACTION_RESUME_LATEST)
}
@ -423,7 +423,7 @@ class HomeFragment : Fragment() {
} else ""
}
}
home_main_poster_recyclerview.layoutManager = centerLayoutManager // scale
home_main_poster_recyclerview?.layoutManager = centerLayoutManager // scale
reloadStored()
val apiName = context?.getKey<String>(HOMEPAGE_API)

View File

@ -119,6 +119,7 @@ const val EXTRA_CONTROL_TYPE = "control_type"
const val PLAYBACK_SPEED = "playback_speed"
const val RESIZE_MODE_KEY = "resize_mode" // Last used resize mode
const val PLAYBACK_SPEED_KEY = "playback_speed" // Last used playback speed
const val PREFERRED_SUBS_KEY = "preferred_subtitles" // Last used resize mode
const val OPENING_PERCENTAGE = 50
const val AUTOLOAD_NEXT_EPISODE_PERCENTAGE = 80
@ -1428,6 +1429,10 @@ class PlayerFragment : Fragment() {
playbackPosition = it
}
arguments?.getString(PREFERRED_SUBS_KEY)?.let {
setPreferredSubLanguage(it)
}
sources_btt.visibility =
if (isDownloadedFile)
if (context?.getSubs()?.isNullOrEmpty() != false)
@ -1443,11 +1448,17 @@ class PlayerFragment : Fragment() {
isFullscreen = savedInstanceState.getBoolean(STATE_PLAYER_FULLSCREEN)
isPlayerPlaying = savedInstanceState.getBoolean(STATE_PLAYER_PLAYING)
resizeMode = savedInstanceState.getInt(RESIZE_MODE_KEY)
savedInstanceState.getString(PREFERRED_SUBS_KEY)?.let {
setPreferredSubLanguage(it)
}
savedInstanceState.getString("data")?.let {
playerData = mapper.readValue(it)
}
playbackSpeed = savedInstanceState.getFloat(PLAYBACK_SPEED)
}
resizeMode = requireContext().getKey(RESIZE_MODE_KEY, 0)!!
playbackSpeed = requireContext().getKey(PLAYBACK_SPEED_KEY, 1f)!!
resizeMode = context?.getKey(RESIZE_MODE_KEY, 0) ?: 0
playbackSpeed = context?.getKey(PLAYBACK_SPEED_KEY, 1f) ?: 1f
activity?.let {
it.contentResolver?.registerContentObserver(
@ -1666,7 +1677,7 @@ class PlayerFragment : Fragment() {
changeSkip()
// initPlayer()
initPlayer()
}
private fun getCurrentUrl(): ExtractorLink? {
@ -1741,7 +1752,7 @@ class PlayerFragment : Fragment() {
if (item.getId() == id) {
if (sorted.size > i + 1) {
setMirrorId(sorted[i + 1].getId())
initPlayer()
initPlayer(getCurrentUrl())
}
}
}
@ -1769,7 +1780,13 @@ class PlayerFragment : Fragment() {
override fun onStart() {
super.onStart()
if (!isCurrentlyPlaying) {
initPlayer()
if (isDownloadedFile) {
initPlayer(null, uriData.uri)
} else {
getCurrentUrl()?.let {
initPlayer(it)
}
}
}
if (player_view != null) player_view?.onResume()
}
@ -1790,7 +1807,13 @@ class PlayerFragment : Fragment() {
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
if (Util.SDK_INT <= 23) {
if (!isCurrentlyPlaying) {
initPlayer()
if (isDownloadedFile) {
initPlayer(null, uriData.uri)
} else {
getCurrentUrl()?.let {
initPlayer(it)
}
}
}
if (player_view != null) player_view?.onResume()
}
@ -1864,6 +1887,7 @@ class PlayerFragment : Fragment() {
arguments?.putBoolean(STATE_PLAYER_FULLSCREEN, isFullscreen)
arguments?.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying)
arguments?.putInt(RESIZE_MODE_KEY, resizeMode)
arguments?.putString(PREFERRED_SUBS_KEY, preferredSubtitles)
arguments?.putFloat(PLAYBACK_SPEED, playbackSpeed)
if (!isDownloadedFile && this::playerData.isInitialized) {
arguments?.putString("data", mapper.writeValueAsString(playerData))
@ -1880,6 +1904,7 @@ class PlayerFragment : Fragment() {
outState.putBoolean(STATE_PLAYER_FULLSCREEN, isFullscreen)
outState.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying)
outState.putInt(RESIZE_MODE_KEY, resizeMode)
outState.putString(PREFERRED_SUBS_KEY, preferredSubtitles)
outState.putFloat(PLAYBACK_SPEED, playbackSpeed)
if (!isDownloadedFile && this::playerData.isInitialized) {
outState.putString("data", mapper.writeValueAsString(playerData))

View File

@ -81,7 +81,6 @@ class CenterZoomLayoutManager : LinearLayoutManager {
if(waitForSnap != null) {
this.getChildAt(snapChild ?: 1)?.let { view ->
LinearSnapHelper().calculateDistanceToFinalSnap(this,view)?.get(0)?.let { dx ->
println("DX: $dx")
waitForSnap?.invoke(dx)
waitForSnap = null
}

View File

@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.4.32"
ext.kotlin_version = "1.5.21"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath "com.android.tools.build:gradle:4.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong