mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-16 04:52:39 +02:00
PlatformUrl support
This commit is contained in:
@@ -41,6 +41,7 @@ class SourcePluginConfig(
|
||||
val constants: HashMap<String, String> = hashMapOf(),
|
||||
|
||||
//TODO: These should be vals...but prob for serialization reasons cannot be changed.
|
||||
var platformUrl: String? = null,
|
||||
var subscriptionRateLimit: Int? = null,
|
||||
var enableInSearch: Boolean = true,
|
||||
var enableInHome: Boolean = true,
|
||||
|
||||
@@ -21,10 +21,13 @@ class SourceHeaderView : LinearLayout {
|
||||
private val _sourceDescription: TextView;
|
||||
|
||||
private val _sourceVersion: TextView;
|
||||
private val _sourcePlatformUrl: TextView;
|
||||
private val _sourceRepositoryUrl: TextView;
|
||||
private val _sourceScriptUrl: TextView;
|
||||
private val _sourceSignature: TextView;
|
||||
|
||||
private val _sourcePlatformUrlContainer: LinearLayout;
|
||||
|
||||
private var _config : SourcePluginConfig? = null;
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet? = null) : super(context, attrs) {
|
||||
@@ -38,6 +41,8 @@ class SourceHeaderView : LinearLayout {
|
||||
|
||||
_sourceVersion = findViewById(R.id.source_version);
|
||||
_sourceRepositoryUrl = findViewById(R.id.source_repo);
|
||||
_sourcePlatformUrl = findViewById(R.id.source_platform);
|
||||
_sourcePlatformUrlContainer = findViewById(R.id.source_platform_container);
|
||||
_sourceScriptUrl = findViewById(R.id.source_script);
|
||||
_sourceSignature = findViewById(R.id.source_signature);
|
||||
|
||||
@@ -53,6 +58,10 @@ class SourceHeaderView : LinearLayout {
|
||||
if(!_config?.absoluteScriptUrl.isNullOrEmpty())
|
||||
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(_config?.absoluteScriptUrl)));
|
||||
};
|
||||
_sourcePlatformUrl.setOnClickListener {
|
||||
if(!_config?.platformUrl.isNullOrEmpty())
|
||||
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(_config?.platformUrl)));
|
||||
};
|
||||
}
|
||||
|
||||
fun loadConfig(config: SourcePluginConfig, script: String?) {
|
||||
@@ -74,6 +83,12 @@ class SourceHeaderView : LinearLayout {
|
||||
_sourceRepositoryUrl.text = config.repositoryUrl;
|
||||
_sourceAuthorID.text = "";
|
||||
|
||||
_sourcePlatformUrl.text = config.platformUrl ?: "";
|
||||
if(!config.platformUrl.isNullOrEmpty())
|
||||
_sourcePlatformUrlContainer.visibility = VISIBLE;
|
||||
else
|
||||
_sourcePlatformUrlContainer.visibility = GONE;
|
||||
|
||||
if(!config.authorUrl.isNullOrEmpty())
|
||||
_sourceBy.setTextColor(resources.getColor(R.color.colorPrimary));
|
||||
else
|
||||
@@ -105,5 +120,7 @@ class SourceHeaderView : LinearLayout {
|
||||
_sourceScriptUrl.text = "";
|
||||
_sourceRepositoryUrl.text = "";
|
||||
_sourceAuthorID.text = "";
|
||||
_sourcePlatformUrl.text = "";
|
||||
_sourcePlatformUrlContainer.visibility = GONE;
|
||||
}
|
||||
}
|
||||
@@ -100,6 +100,30 @@
|
||||
tools:text="3" />
|
||||
</LinearLayout>
|
||||
|
||||
<!--Platform Url-->
|
||||
<LinearLayout
|
||||
android:id="@+id/source_platform_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14dp"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginTop="10dp"
|
||||
android:fontFamily="@font/inter_light"
|
||||
android:text="@string/platform_url" />
|
||||
<TextView
|
||||
android:id="@+id/source_platform"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="14dp"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:fontFamily="@font/inter_extra_light"
|
||||
tools:text="https://some.platform.url" />
|
||||
</LinearLayout>
|
||||
|
||||
<!--Repo Url-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
<string name="are_you_sure_delete_historical">Are you sure you want to remove these historical entries?</string>
|
||||
<string name="removed">removed</string>
|
||||
<string name="add_source">Add Source</string>
|
||||
<string name="platform_url">Platform URL</string>
|
||||
<string name="repository_url">Repository URL</string>
|
||||
<string name="script_url">Script URL</string>
|
||||
<string name="source_permissions_explanation">These are the permissions the plugin requires to function</string>
|
||||
|
||||
Submodule app/src/stable/assets/sources/kick updated: 82aa06b98e...63790c2dc8
Submodule app/src/stable/assets/sources/nebula updated: 8ea9393634...dcc004d722
Submodule app/src/stable/assets/sources/odysee updated: cbde0c9e9c...948835fa68
Submodule app/src/stable/assets/sources/patreon updated: 6037691859...ecf4988b3f
Submodule app/src/stable/assets/sources/rumble updated: 4b5d9f12a7...1b70c84e30
Submodule app/src/stable/assets/sources/soundcloud updated: eff8285222...af99093027
Submodule app/src/stable/assets/sources/twitch updated: eb198a3d20...1d3c8b7955
Submodule app/src/stable/assets/sources/youtube updated: ce7d9d0bc7...ae803c9295
Submodule app/src/unstable/assets/sources/kick updated: 82aa06b98e...63790c2dc8
Submodule app/src/unstable/assets/sources/nebula updated: 8ea9393634...dcc004d722
Submodule app/src/unstable/assets/sources/odysee updated: cbde0c9e9c...948835fa68
Submodule app/src/unstable/assets/sources/patreon updated: 6037691859...ecf4988b3f
Submodule app/src/unstable/assets/sources/rumble updated: 4b5d9f12a7...1b70c84e30
Submodule app/src/unstable/assets/sources/soundcloud updated: eff8285222...af99093027
Submodule app/src/unstable/assets/sources/twitch updated: eb198a3d20...1d3c8b7955
Submodule app/src/unstable/assets/sources/youtube updated: ce7d9d0bc7...ae803c9295
Reference in New Issue
Block a user