mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-19 19:14:51 +00:00
AddSource by url support, submods
This commit is contained in:
parent
54d58df4b6
commit
7bd687331b
10 changed files with 106 additions and 75 deletions
|
@ -10,11 +10,13 @@ import androidx.appcompat.app.AppCompatActivity
|
|||
import com.futo.platformplayer.*
|
||||
import com.futo.platformplayer.states.StateApp
|
||||
import com.futo.platformplayer.views.buttons.BigButton
|
||||
import com.futo.platformplayer.views.overlays.slideup.SlideUpMenuTextInput
|
||||
import com.google.zxing.integration.android.IntentIntegrator
|
||||
|
||||
class AddSourceOptionsActivity : AppCompatActivity() {
|
||||
lateinit var _buttonBack: ImageButton;
|
||||
|
||||
lateinit var _overlayContainer: FrameLayout;
|
||||
lateinit var _buttonQR: BigButton;
|
||||
lateinit var _buttonBrowse: BigButton;
|
||||
lateinit var _buttonURL: BigButton;
|
||||
|
@ -54,6 +56,7 @@ class AddSourceOptionsActivity : AppCompatActivity() {
|
|||
setContentView(R.layout.activity_add_source_options);
|
||||
setNavigationBarColorAndIcons();
|
||||
|
||||
_overlayContainer = findViewById(R.id.overlay_container);
|
||||
_buttonBack = findViewById(R.id.button_back);
|
||||
|
||||
_buttonQR = findViewById(R.id.option_qr);
|
||||
|
@ -81,7 +84,25 @@ class AddSourceOptionsActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
_buttonURL.onClick.subscribe {
|
||||
UIDialogs.toast(this, getString(R.string.not_implemented_yet));
|
||||
val nameInput = SlideUpMenuTextInput(this, "ex. https://yourplugin.com/config.json");
|
||||
UISlideOverlays.showOverlay(_overlayContainer, "Enter your url", "Install", {
|
||||
|
||||
val content = nameInput.text;
|
||||
|
||||
val url = if (content.startsWith("https://")) {
|
||||
content
|
||||
} else if (content.startsWith("grayjay://plugin/")) {
|
||||
content.substring("grayjay://plugin/".length)
|
||||
} else {
|
||||
UIDialogs.toast(this, getString(R.string.not_a_plugin_url))
|
||||
return@showOverlay;
|
||||
}
|
||||
|
||||
val intent = Intent(this, AddSourceActivity::class.java).apply {
|
||||
data = Uri.parse(url);
|
||||
};
|
||||
startActivity(intent);
|
||||
}, nameInput)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout 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"
|
||||
|
@ -9,80 +9,90 @@
|
|||
android:paddingEnd="20dp"
|
||||
android:background="@color/black">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="15dp">
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/cd_button_back"
|
||||
android:paddingRight="20dp"
|
||||
app:srcCompat="@drawable/ic_back_thin_white_16dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="20dp"
|
||||
android:paddingBottom="15dp">
|
||||
|
||||
<TextView
|
||||
<ImageButton
|
||||
android:id="@+id/button_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:contentDescription="@string/cd_button_back"
|
||||
android:paddingRight="20dp"
|
||||
app:srcCompat="@drawable/ic_back_thin_white_16dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_source"
|
||||
android:textSize="24dp"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/inter_extra_light" />
|
||||
</FrameLayout>
|
||||
android:layout_weight="1">
|
||||
|
||||
<Space
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/add_source"
|
||||
android:textSize="24dp"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/inter_extra_light" />
|
||||
</FrameLayout>
|
||||
|
||||
<Space
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_qr"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:buttonText="@string/install_by_qr"
|
||||
app:buttonSubText="@string/install_a_plugin_by_scanning_a_qr_code"
|
||||
app:buttonIcon="@drawable/ic_qr" />
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_browse"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:buttonText="Browse Online Sources"
|
||||
app:buttonSubText="Install a plugin by browsing official plugins"
|
||||
app:buttonIcon="@drawable/ic_explore" />
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:buttonText="@string/install_by_url"
|
||||
app:buttonSubText="@string/enter_url_explain"
|
||||
app:buttonIcon="@drawable/ic_link" />
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_plugins"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.5"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
app:buttonText="Install by Store"
|
||||
app:buttonSubText="Browse plugins published through Polycentric."
|
||||
app:buttonIcon="@drawable/ic_sources" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_qr"
|
||||
<FrameLayout
|
||||
android:id="@+id/overlay_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:buttonText="@string/install_by_qr"
|
||||
app:buttonSubText="@string/install_a_plugin_by_scanning_a_qr_code"
|
||||
app:buttonIcon="@drawable/ic_qr" />
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_browse"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:buttonText="Browse Online Sources"
|
||||
app:buttonSubText="Install a plugin by browsing official plugins"
|
||||
app:buttonIcon="@drawable/ic_explore" />
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.5"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
app:buttonText="@string/install_by_url"
|
||||
app:buttonSubText="@string/enter_url_explain"
|
||||
app:buttonIcon="@drawable/ic_link" />
|
||||
<com.futo.platformplayer.views.buttons.BigButton
|
||||
android:id="@+id/option_plugins"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha="0.5"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
app:buttonText="Install by Store"
|
||||
app:buttonSubText="Browse plugins published through Polycentric."
|
||||
app:buttonIcon="@drawable/ic_sources" />
|
||||
</LinearLayout>
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="gone" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -1 +1 @@
|
|||
Subproject commit 2046944c18f48c15dfbea82f3f89d7ba6dce5e14
|
||||
Subproject commit 3a0efd1fc4db63c15334a190ab69a8fb4498ae23
|
|
@ -1 +1 @@
|
|||
Subproject commit ae47f2eaacaf2879405435358965c47eb3d48096
|
||||
Subproject commit bff981c3ce7abad363e79705214a4710fb347f7d
|
|
@ -1 +1 @@
|
|||
Subproject commit 9c36c457463fc2a452f76eb74465e9e234cdaf69
|
||||
Subproject commit 331dd929293614875af80e3ab4cb162dc6183410
|
|
@ -1 +1 @@
|
|||
Subproject commit 6e0fe9245143336a31954d678cdd22cbc3e0e115
|
||||
Subproject commit ae7b62f4d85cf398d9566a6ed07a6afc193f6b48
|
|
@ -1 +1 @@
|
|||
Subproject commit 2046944c18f48c15dfbea82f3f89d7ba6dce5e14
|
||||
Subproject commit 3a0efd1fc4db63c15334a190ab69a8fb4498ae23
|
|
@ -1 +1 @@
|
|||
Subproject commit ae47f2eaacaf2879405435358965c47eb3d48096
|
||||
Subproject commit bff981c3ce7abad363e79705214a4710fb347f7d
|
|
@ -1 +1 @@
|
|||
Subproject commit 9c36c457463fc2a452f76eb74465e9e234cdaf69
|
||||
Subproject commit 331dd929293614875af80e3ab4cb162dc6183410
|
|
@ -1 +1 @@
|
|||
Subproject commit 6e0fe9245143336a31954d678cdd22cbc3e0e115
|
||||
Subproject commit ae7b62f4d85cf398d9566a6ed07a6afc193f6b48
|
Loading…
Add table
Reference in a new issue