This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
610be95
commit 8ef90db
Showing
10 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/src/main/java/de/markhaehnel/rbtv/rocketbeanstv/ui/preferences/PreferencesFragment.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package de.markhaehnel.rbtv.rocketbeanstv.ui.preferences | ||
|
||
import android.annotation.SuppressLint | ||
import android.os.Bundle | ||
import android.webkit.WebView | ||
import android.webkit.WebViewClient | ||
import androidx.appcompat.app.AlertDialog | ||
import androidx.preference.Preference | ||
import androidx.preference.PreferenceFragmentCompat | ||
import de.markhaehnel.rbtv.rocketbeanstv.R | ||
|
||
|
||
class PreferencesFragment : PreferenceFragmentCompat() { | ||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { | ||
setPreferencesFromResource(R.xml.preferences, rootKey) | ||
|
||
setPrivacyPolicyClickListener() | ||
} | ||
|
||
private fun setPrivacyPolicyClickListener() { | ||
val privacyPolicyPreference: Preference? = findPreference("privacypolicy") | ||
privacyPolicyPreference?.setOnPreferenceClickListener { | ||
val alert = AlertDialog.Builder(requireContext()) | ||
|
||
val wv = WebView(context).apply { | ||
loadUrl("https://sites.google.com/view/rbtv-firetv-privacy-policy") | ||
settings.apply { | ||
@SuppressLint("SetJavaScriptEnabled") | ||
//javaScriptEnabled = true | ||
useWideViewPort = true | ||
} | ||
webViewClient = object : WebViewClient() { | ||
override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean { | ||
return true | ||
} | ||
|
||
override fun onPageFinished(view: WebView?, url: String?) { | ||
super.onPageFinished(view, url) | ||
view?.scrollTo(0, 0) | ||
} | ||
} | ||
} | ||
|
||
alert.apply { | ||
setView(wv) | ||
show() | ||
} | ||
|
||
true | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<vector android:height="24dp" android:tint="#E6E6E6" | ||
android:viewportHeight="24" android:viewportWidth="24" | ||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<path android:fillColor="#FF000000" android:pathData="M19.1,12.9a2.8,2.8 0,0 0,0.1 -0.9,2.8 2.8,0 0,0 -0.1,-0.9l2.1,-1.6a0.7,0.7 0,0 0,0.1 -0.6L19.4,5.5a0.7,0.7 0,0 0,-0.6 -0.2l-2.4,1a6.5,6.5 0,0 0,-1.6 -0.9l-0.4,-2.6a0.5,0.5 0,0 0,-0.5 -0.4H10.1a0.5,0.5 0,0 0,-0.5 0.4L9.3,5.4a5.6,5.6 0,0 0,-1.7 0.9l-2.4,-1a0.4,0.4 0,0 0,-0.5 0.2l-2,3.4c-0.1,0.2 0,0.4 0.2,0.6l2,1.6a2.8,2.8 0,0 0,-0.1 0.9,2.8 2.8,0 0,0 0.1,0.9L2.8,14.5a0.7,0.7 0,0 0,-0.1 0.6l1.9,3.4a0.7,0.7 0,0 0,0.6 0.2l2.4,-1a6.5,6.5 0,0 0,1.6 0.9l0.4,2.6a0.5,0.5 0,0 0,0.5 0.4h3.8a0.5,0.5 0,0 0,0.5 -0.4l0.3,-2.6a5.6,5.6 0,0 0,1.7 -0.9l2.4,1a0.4,0.4 0,0 0,0.5 -0.2l2,-3.4c0.1,-0.2 0,-0.4 -0.2,-0.6ZM12,15.6A3.6,3.6 0,1 1,15.6 12,3.6 3.6,0 0,1 12,15.6Z"/> | ||
</vector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<PreferenceScreen | ||
xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
<PreferenceCategory | ||
app:key="general_category" | ||
app:title="@string/general"> | ||
<SwitchPreference | ||
app:key="showChatOnLaunch" | ||
app:title="@string/showChatOnLaunch" | ||
app:defaultValue="false" /> | ||
</PreferenceCategory> | ||
|
||
<PreferenceCategory | ||
app:key="about_category" | ||
app:title="@string/aboutapp"> | ||
<Preference | ||
app:title="@string/developer" | ||
app:summary="@string/developer_details"/> | ||
<Preference | ||
app:title="@string/contact" | ||
app:summary="@string/contact_details"/> | ||
<Preference | ||
app:key="privacypolicy" | ||
app:title="@string/privacypolicy" /> | ||
</PreferenceCategory> | ||
|
||
|
||
</PreferenceScreen> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters