diff --git a/app/src/main/java/com/futo/platformplayer/activities/LoginActivity.kt b/app/src/main/java/com/futo/platformplayer/activities/LoginActivity.kt index 23040dad34df30fb38aa708e3b95a448312a82d9..d2bddb7a96548ab7eca4ce026adbaba424ac8f18 100644 --- a/app/src/main/java/com/futo/platformplayer/activities/LoginActivity.kt +++ b/app/src/main/java/com/futo/platformplayer/activities/LoginActivity.kt @@ -7,6 +7,8 @@ import android.webkit.ConsoleMessage import android.webkit.CookieManager import android.webkit.WebChromeClient import android.webkit.WebView +import android.widget.ImageButton +import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.lifecycle.lifecycleScope import com.futo.platformplayer.* @@ -23,6 +25,8 @@ import kotlinx.serialization.json.Json class LoginActivity : AppCompatActivity() { private lateinit var _webView: WebView; + private lateinit var _textUrl: TextView; + private lateinit var _buttonClose: ImageButton; override fun onCreate(savedInstanceState: Bundle?) { @@ -30,6 +34,13 @@ class LoginActivity : AppCompatActivity() { setContentView(R.layout.activity_login); setNavigationBarColorAndIcons(); + _textUrl = findViewById(R.id.text_url); + _buttonClose = findViewById(R.id.button_close); + _buttonClose.setOnClickListener { + finish(); + } + + _webView = findViewById(R.id.web_view); _webView.settings.javaScriptEnabled = true; CookieManager.getInstance().setAcceptCookie(true); @@ -60,6 +71,8 @@ class LoginActivity : AppCompatActivity() { }; var isFirstLoad = true; webViewClient.onPageLoaded.subscribe { view, url -> + _textUrl.setText(url ?: ""); + if(!isFirstLoad) return@subscribe; isFirstLoad = false; diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt index 4fbceb398c9e64b1f44b680ea4c757a1458e1ea6..b89d24eeafbf2556f1347803c3f1c6a4c0253422 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/main/VideoDetailView.kt @@ -1051,6 +1051,7 @@ class VideoDetailView : ConstraintLayout { } catch(ex: Throwable) { Logger.e(TAG, "Failed to get chapters", ex); + _player.setChapters(null); /*withContext(Dispatchers.Main) { UIDialogs.toast(context, "Failed to get chapters\n" + ex.message); diff --git a/app/src/main/java/com/futo/platformplayer/subscription/SubscriptionsTaskFetchAlgorithm.kt b/app/src/main/java/com/futo/platformplayer/subscription/SubscriptionsTaskFetchAlgorithm.kt index 88b6e4545d42809880f887a8b1d1ad846d472633..98d251d12e3c1831176e61160a4e09efe260b37f 100644 --- a/app/src/main/java/com/futo/platformplayer/subscription/SubscriptionsTaskFetchAlgorithm.kt +++ b/app/src/main/java/com/futo/platformplayer/subscription/SubscriptionsTaskFetchAlgorithm.kt @@ -79,7 +79,7 @@ abstract class SubscriptionsTaskFetchAlgorithm( if(result != null) { if(result.pager != null) taskResults.add(result); - else if(result.exception != null) { + if(result.exception != null) { val ex = result.exception; if(ex != null) { val nonRuntimeEx = findNonRuntimeException(ex); @@ -198,6 +198,7 @@ abstract class SubscriptionsTaskFetchAlgorithm( Logger.i(StateSubscriptions.TAG, "Channel ${task.sub.channel.name} failed, substituting with cache"); pager = ChannelContentCache.instance.getChannelCachePager(task.sub.channel.url); taskEx = ex; + return@submit SubscriptionTaskResult(task, pager, taskEx); } } return@submit SubscriptionTaskResult(task, null, taskEx); diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index 8bffe3663c3aa2449d07e683617cc30af4e9e786..fd35ed060dff1a0df1e6aeeca042ab7d337a136f 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -1,11 +1,43 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" + xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@color/black"> - + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/header" + android:background="#000000" + app:layout_constraintTop_toTopOf="parent" + android:layout_width="match_parent" + android:layout_height="50dp"> + <ImageButton + android:id="@+id/button_close" + android:layout_width="50dp" + android:layout_height="50dp" + android:scaleType="fitCenter" + android:padding="10dp" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" + android:src="@drawable/ic_close" /> + <TextView + android:id="@+id/text_url" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:textSize="10dp" + android:layout_marginLeft="10dp" + app:layout_constraintLeft_toRightOf="@id/button_close" + android:maxLines="3" + android:ellipsize="end" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> + </androidx.constraintlayout.widget.ConstraintLayout> <WebView android:id="@+id/web_view" android:layout_width="match_parent" - android:layout_height="match_parent" /> -</FrameLayout> \ No newline at end of file + android:layout_height="0dp" + app:layout_constraintTop_toBottomOf="@id/header" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintBottom_toBottomOf="parent"/> +</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file