mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Merge branch 'libre-tube:master' into add-ci
This commit is contained in:
commit
d2fe2f8046
@ -41,6 +41,7 @@ dependencies {
|
|||||||
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0'
|
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.0'
|
||||||
implementation 'androidx.navigation:navigation-ui-ktx:2.4.0'
|
implementation 'androidx.navigation:navigation-ui-ktx:2.4.0'
|
||||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||||
|
implementation("androidx.preference:preference-ktx:1.2.0")
|
||||||
|
|
||||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||||
|
@ -53,6 +53,19 @@ class ChannelFragment : Fragment() {
|
|||||||
recyclerView.layoutManager = LinearLayoutManager(context)
|
recyclerView.layoutManager = LinearLayoutManager(context)
|
||||||
|
|
||||||
fetchChannel(view)
|
fetchChannel(view)
|
||||||
|
val scrollView = view.findViewById<ScrollView>(R.id.channel_scrollView)
|
||||||
|
scrollView.viewTreeObserver
|
||||||
|
.addOnScrollChangedListener {
|
||||||
|
if (scrollView.getChildAt(0).bottom
|
||||||
|
== (scrollView.height + scrollView.scrollY)) {
|
||||||
|
//scroll view is at bottom
|
||||||
|
if(nextPage!=null && !isLoading){
|
||||||
|
isLoading=true
|
||||||
|
fetchNextPage()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,21 +94,7 @@ class ChannelFragment : Fragment() {
|
|||||||
Picasso.get().load(response.avatarUrl).into(channelImage)
|
Picasso.get().load(response.avatarUrl).into(channelImage)
|
||||||
channelAdapter = ChannelAdapter(response.relatedStreams!!.toMutableList())
|
channelAdapter = ChannelAdapter(response.relatedStreams!!.toMutableList())
|
||||||
view.findViewById<RecyclerView>(R.id.channel_recView).adapter = channelAdapter
|
view.findViewById<RecyclerView>(R.id.channel_recView).adapter = channelAdapter
|
||||||
val scrollView = view.findViewById<ScrollView>(R.id.channel_scrollView)
|
|
||||||
scrollView.viewTreeObserver
|
|
||||||
.addOnScrollChangedListener {
|
|
||||||
if (scrollView.getChildAt(0).bottom
|
|
||||||
== (scrollView.height + scrollView.scrollY)) {
|
|
||||||
//scroll view is at bottom
|
|
||||||
if(nextPage!=null && !isLoading){
|
|
||||||
isLoading=true
|
|
||||||
fetchNextPage()
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
//scroll view is not at bottom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ProgressBar
|
import android.widget.ProgressBar
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
|
||||||
@ -51,7 +52,8 @@ class Home : Fragment() {
|
|||||||
fun run() {
|
fun run() {
|
||||||
lifecycleScope.launchWhenCreated {
|
lifecycleScope.launchWhenCreated {
|
||||||
val response = try {
|
val response = try {
|
||||||
RetrofitInstance.api.getTrending("US")
|
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||||
|
RetrofitInstance.api.getTrending(sharedPreferences.getString("region", "US")!!)
|
||||||
}catch(e: IOException) {
|
}catch(e: IOException) {
|
||||||
println(e)
|
println(e)
|
||||||
Log.e(TAG, "IOException, you might not have internet connection")
|
Log.e(TAG, "IOException, you might not have internet connection")
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.github.libretube
|
package com.github.libretube
|
||||||
|
|
||||||
import android.app.Dialog
|
import android.app.Dialog
|
||||||
|
import android.content.Context
|
||||||
import android.content.DialogInterface
|
import android.content.DialogInterface
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
@ -11,6 +12,7 @@ import android.widget.Toast
|
|||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
import com.github.libretube.adapters.TrendingAdapter
|
import com.github.libretube.adapters.TrendingAdapter
|
||||||
import com.github.libretube.obj.Login
|
import com.github.libretube.obj.Login
|
||||||
import retrofit2.HttpException
|
import retrofit2.HttpException
|
||||||
@ -27,22 +29,35 @@ class LoginDialog : DialogFragment() {
|
|||||||
val builder = AlertDialog.Builder(it)
|
val builder = AlertDialog.Builder(it)
|
||||||
// Get the layout inflater
|
// Get the layout inflater
|
||||||
val inflater = requireActivity().layoutInflater;
|
val inflater = requireActivity().layoutInflater;
|
||||||
|
val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE)
|
||||||
// Inflate and set the layout for the dialog
|
val token = sharedPref?.getString("token","")
|
||||||
// Pass null as the parent view because its going in the dialog layout
|
var view: View
|
||||||
val view = inflater.inflate(R.layout.dialog_login, null)
|
Log.e("dafaq",token!!)
|
||||||
username=view.findViewById(R.id.username)
|
if(token!=""){
|
||||||
password=view.findViewById(R.id.password)
|
view = inflater.inflate(R.layout.dialog_logout, null)
|
||||||
view.findViewById<Button>(R.id.login).setOnClickListener {
|
view.findViewById<Button>(R.id.logout).setOnClickListener {
|
||||||
val login = Login(username.text.toString(),password.text.toString())
|
Toast.makeText(context,R.string.loggedout, Toast.LENGTH_SHORT).show()
|
||||||
login(login)
|
val sharedPref = context?.getSharedPreferences("token",Context.MODE_PRIVATE)
|
||||||
}
|
with (sharedPref!!.edit()) {
|
||||||
view.findViewById<Button>(R.id.register).setOnClickListener {
|
putString("token","")
|
||||||
val login = Login(username.text.toString(),password.text.toString())
|
apply()
|
||||||
register(login)
|
}
|
||||||
|
dialog?.dismiss()
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
view = inflater.inflate(R.layout.dialog_login, null)
|
||||||
|
username=view.findViewById(R.id.username)
|
||||||
|
password=view.findViewById(R.id.password)
|
||||||
|
view.findViewById<Button>(R.id.login).setOnClickListener {
|
||||||
|
val login = Login(username.text.toString(),password.text.toString())
|
||||||
|
login(login)
|
||||||
|
}
|
||||||
|
view.findViewById<Button>(R.id.register).setOnClickListener {
|
||||||
|
val login = Login(username.text.toString(),password.text.toString())
|
||||||
|
register(login)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
builder.setView(view)
|
builder.setView(view)
|
||||||
// Add action buttons
|
|
||||||
builder.create()
|
builder.create()
|
||||||
} ?: throw IllegalStateException("Activity cannot be null")
|
} ?: throw IllegalStateException("Activity cannot be null")
|
||||||
}
|
}
|
||||||
@ -64,8 +79,13 @@ class LoginDialog : DialogFragment() {
|
|||||||
}
|
}
|
||||||
if (response.error!= null){
|
if (response.error!= null){
|
||||||
Toast.makeText(context, response.error, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, response.error, Toast.LENGTH_SHORT).show()
|
||||||
}else{
|
}else if(response.token!=null){
|
||||||
Toast.makeText(context,R.string.loggedIn, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context,R.string.loggedIn, Toast.LENGTH_SHORT).show()
|
||||||
|
val sharedPref = context?.getSharedPreferences("token",Context.MODE_PRIVATE)
|
||||||
|
with (sharedPref!!.edit()) {
|
||||||
|
putString("token",response.token)
|
||||||
|
apply()
|
||||||
|
}
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,8 +111,13 @@ class LoginDialog : DialogFragment() {
|
|||||||
}
|
}
|
||||||
if (response.error!= null){
|
if (response.error!= null){
|
||||||
Toast.makeText(context, response.error, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context, response.error, Toast.LENGTH_SHORT).show()
|
||||||
}else{
|
}else if(response.token!=null){
|
||||||
Toast.makeText(context,R.string.registered, Toast.LENGTH_SHORT).show()
|
Toast.makeText(context,R.string.registered, Toast.LENGTH_SHORT).show()
|
||||||
|
val sharedPref = context?.getSharedPreferences("token",Context.MODE_PRIVATE)
|
||||||
|
with (sharedPref!!.edit()) {
|
||||||
|
putString("token",response.token)
|
||||||
|
apply()
|
||||||
|
}
|
||||||
dialog?.dismiss()
|
dialog?.dismiss()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import androidx.navigation.findNavController
|
|||||||
import androidx.navigation.ui.NavigationUI
|
import androidx.navigation.ui.NavigationUI
|
||||||
import androidx.navigation.ui.NavigationUI.onNavDestinationSelected
|
import androidx.navigation.ui.NavigationUI.onNavDestinationSelected
|
||||||
import androidx.navigation.ui.setupWithNavController
|
import androidx.navigation.ui.setupWithNavController
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
import com.google.android.exoplayer2.ExoPlayer
|
import com.google.android.exoplayer2.ExoPlayer
|
||||||
import com.google.android.material.color.DynamicColors
|
import com.google.android.material.color.DynamicColors
|
||||||
import java.lang.Exception
|
import java.lang.Exception
|
||||||
@ -28,10 +29,10 @@ class MainActivity : AppCompatActivity() {
|
|||||||
lateinit var bottomNavigationView: BottomNavigationView
|
lateinit var bottomNavigationView: BottomNavigationView
|
||||||
lateinit var toolbar: Toolbar
|
lateinit var toolbar: Toolbar
|
||||||
lateinit var navController : NavController
|
lateinit var navController : NavController
|
||||||
|
|
||||||
var f = false
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
|
RetrofitInstance.url=sharedPreferences.getString("instance", "https://pipedapi.kavin.rocks/")!!
|
||||||
|
|
||||||
DynamicColors.applyToActivitiesIfAvailable(application)
|
DynamicColors.applyToActivitiesIfAvailable(application)
|
||||||
|
|
||||||
@ -57,6 +58,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
toolbar.setNavigationOnClickListener{
|
toolbar.setNavigationOnClickListener{
|
||||||
//settings fragment stuff
|
//settings fragment stuff
|
||||||
|
navController.navigate(R.id.settings)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,18 @@
|
|||||||
package com.github.libretube
|
package com.github.libretube
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import retrofit2.Retrofit
|
import retrofit2.Retrofit
|
||||||
import retrofit2.converter.jackson.JacksonConverterFactory
|
import retrofit2.converter.jackson.JacksonConverterFactory
|
||||||
|
import kotlin.coroutines.coroutineContext
|
||||||
|
|
||||||
object RetrofitInstance {
|
object RetrofitInstance {
|
||||||
|
lateinit var url: String
|
||||||
val api: PipedApi by lazy {
|
val api: PipedApi by lazy {
|
||||||
Retrofit.Builder()
|
Retrofit.Builder()
|
||||||
.baseUrl("https://pipedapi.kavin.rocks/")
|
.baseUrl(url)
|
||||||
.addConverterFactory(JacksonConverterFactory.create())
|
.addConverterFactory(JacksonConverterFactory.create())
|
||||||
.build()
|
.build()
|
||||||
.create(PipedApi::class.java)
|
.create(PipedApi::class.java)
|
||||||
|
@ -96,7 +96,7 @@ class SearchFragment : Fragment() {
|
|||||||
RetrofitInstance.api.getSearchResults(query, "all")
|
RetrofitInstance.api.getSearchResults(query, "all")
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
println(e)
|
println(e)
|
||||||
Log.e(TAG, "IOException, you might not have internet connection")
|
Log.e(TAG, "IOException, you might not have internet connection "+e.toString())
|
||||||
return@launchWhenCreated
|
return@launchWhenCreated
|
||||||
} catch (e: HttpException) {
|
} catch (e: HttpException) {
|
||||||
Log.e(TAG, "HttpException, unexpected response")
|
Log.e(TAG, "HttpException, unexpected response")
|
||||||
|
26
app/src/main/java/com/github/libretube/Settings.kt
Normal file
26
app/src/main/java/com/github/libretube/Settings.kt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package com.github.libretube
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.util.Log
|
||||||
|
import androidx.preference.ListPreference
|
||||||
|
import androidx.preference.Preference
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import androidx.preference.SwitchPreferenceCompat
|
||||||
|
|
||||||
|
class Settings : PreferenceFragmentCompat() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.settings, rootKey)
|
||||||
|
val instance = findPreference<ListPreference>("instance")
|
||||||
|
instance?.setOnPreferenceChangeListener { preference, newValue ->
|
||||||
|
RetrofitInstance.url=newValue.toString()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
val login = findPreference<Preference>("login_register")
|
||||||
|
login?.setOnPreferenceClickListener {
|
||||||
|
val newFragment = LoginDialog()
|
||||||
|
newFragment.show(childFragmentManager,"fuck")
|
||||||
|
true
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,9 @@
|
|||||||
package com.github.libretube
|
package com.github.libretube
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
import android.media.Image
|
import android.media.Image
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.util.Log
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@ -41,11 +43,9 @@ class Subscriptions : Fragment() {
|
|||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
view.findViewById<ImageView>(R.id.boogh).setOnClickListener {
|
val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE)
|
||||||
val newFragment = LoginDialog()
|
Log.e("dafaq",sharedPref?.getString("token","")!!)
|
||||||
newFragment.show(childFragmentManager,"fuck")
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -4,6 +4,7 @@ data class SearchItem(
|
|||||||
var url: String?,
|
var url: String?,
|
||||||
var thumbnail: String?,
|
var thumbnail: String?,
|
||||||
var uploaderName: String?,
|
var uploaderName: String?,
|
||||||
|
var uploaded: String?,
|
||||||
//Video only attributes
|
//Video only attributes
|
||||||
var title: String?,
|
var title: String?,
|
||||||
var uploaderUrl: String?,
|
var uploaderUrl: String?,
|
||||||
@ -19,5 +20,5 @@ data class SearchItem(
|
|||||||
var videos: Long? = -1,
|
var videos: Long? = -1,
|
||||||
var verified: Boolean? = null
|
var verified: Boolean? = null
|
||||||
){
|
){
|
||||||
constructor() : this("","","","","","","",0,0,null)
|
constructor() : this("","","","","","","","",0,0,null)
|
||||||
}
|
}
|
||||||
|
30
app/src/main/res/layout/dialog_logout.xml
Normal file
30
app/src/main/res/layout/dialog_logout.xml
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
<ImageView
|
||||||
|
android:src="@drawable/ic_libretube_foreground"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:scaleType="center"
|
||||||
|
android:background="#CD5757"
|
||||||
|
android:contentDescription="@string/app_name" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/already_logged_in"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
android:id="@+id/logout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/logout"
|
||||||
|
android:padding="8dp"
|
||||||
|
android:layout_margin="8dp"
|
||||||
|
android:layout_gravity="center"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -54,4 +54,8 @@
|
|||||||
android:name="playlist_id"
|
android:name="playlist_id"
|
||||||
app:argType="string" />
|
app:argType="string" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/settings"
|
||||||
|
android:name="com.github.libretube.Settings"
|
||||||
|
android:label="Settings" />
|
||||||
</navigation>
|
</navigation>
|
401
app/src/main/res/values/array.xml
Normal file
401
app/src/main/res/values/array.xml
Normal file
@ -0,0 +1,401 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<string-array name="instances">
|
||||||
|
<item>piped.tokhmi.xyz</item>
|
||||||
|
<item>piped.kavin.rocks</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="instancesValue">
|
||||||
|
<item>https://pipedapi.tokhmi.xyz/</item>
|
||||||
|
<item>https://pipedapi.kavin.rocks/</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="regions">
|
||||||
|
<item>Afghanistan</item>
|
||||||
|
<item>Albania</item>
|
||||||
|
<item>Algeria</item>
|
||||||
|
<item>Andorra</item>
|
||||||
|
<item>Angola</item>
|
||||||
|
<item>Antigua and Barbuda</item>
|
||||||
|
<item>Argentina</item>
|
||||||
|
<item>Armenia</item>
|
||||||
|
<item>Australia</item>
|
||||||
|
<item>Austria</item>
|
||||||
|
<item>Azerbaijan</item>
|
||||||
|
<item>Bahamas</item>
|
||||||
|
<item>Bahrain</item>
|
||||||
|
<item>Bangladesh</item>
|
||||||
|
<item>Barbados</item>
|
||||||
|
<item>Belarus</item>
|
||||||
|
<item>Belgium</item>
|
||||||
|
<item>Belize</item>
|
||||||
|
<item>Benin</item>
|
||||||
|
<item>Bhutan</item>
|
||||||
|
<item>Bolivia (Plurinational State of)</item>
|
||||||
|
<item>Bosnia and Herzegovina</item>
|
||||||
|
<item>Botswana</item>
|
||||||
|
<item>Brazil</item>
|
||||||
|
<item>Brunei Darussalam</item>
|
||||||
|
<item>Bulgaria</item>
|
||||||
|
<item>Burkina Faso</item>
|
||||||
|
<item>Burundi</item>
|
||||||
|
<item>Cabo Verde</item>
|
||||||
|
<item>Cambodia</item>
|
||||||
|
<item>Cameroon</item>
|
||||||
|
<item>Canada</item>
|
||||||
|
<item>Central African Republic</item>
|
||||||
|
<item>Chad</item>
|
||||||
|
<item>Chile</item>
|
||||||
|
<item>China</item>
|
||||||
|
<item>Colombia</item>
|
||||||
|
<item>Comoros</item>
|
||||||
|
<item>Congo</item>
|
||||||
|
<item>Congo, Democratic Republic of the</item>
|
||||||
|
<item>Costa Rica</item>
|
||||||
|
<item>Côte d\'Ivoire</item>
|
||||||
|
<item>Croatia</item>
|
||||||
|
<item>Cuba</item>
|
||||||
|
<item>Cyprus</item>
|
||||||
|
<item>Czechia</item>
|
||||||
|
<item>Denmark</item>
|
||||||
|
<item>Djibouti</item>
|
||||||
|
<item>Dominica</item>
|
||||||
|
<item>Dominican Republic</item>
|
||||||
|
<item>Ecuador</item>
|
||||||
|
<item>Egypt</item>
|
||||||
|
<item>El Salvador</item>
|
||||||
|
<item>Equatorial Guinea</item>
|
||||||
|
<item>Eritrea</item>
|
||||||
|
<item>Estonia</item>
|
||||||
|
<item>Eswatini</item>
|
||||||
|
<item>Ethiopia</item>
|
||||||
|
<item>Fiji</item>
|
||||||
|
<item>Finland</item>
|
||||||
|
<item>France</item>
|
||||||
|
<item>Gabon</item>
|
||||||
|
<item>Gambia</item>
|
||||||
|
<item>Georgia</item>
|
||||||
|
<item>Germany</item>
|
||||||
|
<item>Ghana</item>
|
||||||
|
<item>Greece</item>
|
||||||
|
<item>Grenada</item>
|
||||||
|
<item>Guatemala</item>
|
||||||
|
<item>Guinea</item>
|
||||||
|
<item>Guinea-Bissau</item>
|
||||||
|
<item>Guyana</item>
|
||||||
|
<item>Haiti</item>
|
||||||
|
<item>Honduras</item>
|
||||||
|
<item>Hungary</item>
|
||||||
|
<item>Iceland</item>
|
||||||
|
<item>India</item>
|
||||||
|
<item>Indonesia</item>
|
||||||
|
<item>Iran (Islamic Republic of)</item>
|
||||||
|
<item>Iraq</item>
|
||||||
|
<item>Ireland</item>
|
||||||
|
<item>Israel</item>
|
||||||
|
<item>Italy</item>
|
||||||
|
<item>Jamaica</item>
|
||||||
|
<item>Japan</item>
|
||||||
|
<item>Jordan</item>
|
||||||
|
<item>Kazakhstan</item>
|
||||||
|
<item>Kenya</item>
|
||||||
|
<item>Kiribati</item>
|
||||||
|
<item>Korea (Democratic People\'s Republic of)</item>
|
||||||
|
<item>Korea, Republic of</item>
|
||||||
|
<item>Kuwait</item>
|
||||||
|
<item>Kyrgyzstan</item>
|
||||||
|
<item>Lao People\'s Democratic Republic</item>
|
||||||
|
<item>Latvia</item>
|
||||||
|
<item>Lebanon</item>
|
||||||
|
<item>Lesotho</item>
|
||||||
|
<item>Liberia</item>
|
||||||
|
<item>Libya</item>
|
||||||
|
<item>Liechtenstein</item>
|
||||||
|
<item>Lithuania</item>
|
||||||
|
<item>Luxembourg</item>
|
||||||
|
<item>Madagascar</item>
|
||||||
|
<item>Malawi</item>
|
||||||
|
<item>Malaysia</item>
|
||||||
|
<item>Maldives</item>
|
||||||
|
<item>Mali</item>
|
||||||
|
<item>Malta</item>
|
||||||
|
<item>Marshall Islands</item>
|
||||||
|
<item>Mauritania</item>
|
||||||
|
<item>Mauritius</item>
|
||||||
|
<item>Mexico</item>
|
||||||
|
<item>Micronesia (Federated States of)</item>
|
||||||
|
<item>Moldova, Republic of</item>
|
||||||
|
<item>Monaco</item>
|
||||||
|
<item>Mongolia</item>
|
||||||
|
<item>Montenegro</item>
|
||||||
|
<item>Morocco</item>
|
||||||
|
<item>Mozambique</item>
|
||||||
|
<item>Myanmar</item>
|
||||||
|
<item>Namibia</item>
|
||||||
|
<item>Nauru</item>
|
||||||
|
<item>Nepal</item>
|
||||||
|
<item>Netherlands</item>
|
||||||
|
<item>New Zealand</item>
|
||||||
|
<item>Nicaragua</item>
|
||||||
|
<item>Niger</item>
|
||||||
|
<item>Nigeria</item>
|
||||||
|
<item>North Macedonia</item>
|
||||||
|
<item>Norway</item>
|
||||||
|
<item>Oman</item>
|
||||||
|
<item>Pakistan</item>
|
||||||
|
<item>Palau</item>
|
||||||
|
<item>Panama</item>
|
||||||
|
<item>Papua New Guinea</item>
|
||||||
|
<item>Paraguay</item>
|
||||||
|
<item>Peru</item>
|
||||||
|
<item>Philippines</item>
|
||||||
|
<item>Poland</item>
|
||||||
|
<item>Portugal</item>
|
||||||
|
<item>Qatar</item>
|
||||||
|
<item>Romania</item>
|
||||||
|
<item>Russian Federation</item>
|
||||||
|
<item>Rwanda</item>
|
||||||
|
<item>Saint Kitts and Nevis</item>
|
||||||
|
<item>Saint Lucia</item>
|
||||||
|
<item>Saint Vincent and the Grenadines</item>
|
||||||
|
<item>Samoa</item>
|
||||||
|
<item>San Marino</item>
|
||||||
|
<item>Sao Tome and Principe</item>
|
||||||
|
<item>Saudi Arabia</item>
|
||||||
|
<item>Senegal</item>
|
||||||
|
<item>Serbia</item>
|
||||||
|
<item>Seychelles</item>
|
||||||
|
<item>Sierra Leone</item>
|
||||||
|
<item>Singapore</item>
|
||||||
|
<item>Slovakia</item>
|
||||||
|
<item>Slovenia</item>
|
||||||
|
<item>Solomon Islands</item>
|
||||||
|
<item>Somalia</item>
|
||||||
|
<item>South Africa</item>
|
||||||
|
<item>South Sudan</item>
|
||||||
|
<item>Spain</item>
|
||||||
|
<item>Sri Lanka</item>
|
||||||
|
<item>Sudan</item>
|
||||||
|
<item>Suriname</item>
|
||||||
|
<item>Sweden</item>
|
||||||
|
<item>Switzerland</item>
|
||||||
|
<item>Syrian Arab Republic</item>
|
||||||
|
<item>Tajikistan</item>
|
||||||
|
<item>Tanzania, United Republic of</item>
|
||||||
|
<item>Thailand</item>
|
||||||
|
<item>Timor-Leste</item>
|
||||||
|
<item>Togo</item>
|
||||||
|
<item>Tonga</item>
|
||||||
|
<item>Trinidad and Tobago</item>
|
||||||
|
<item>Tunisia</item>
|
||||||
|
<item>Turkey</item>
|
||||||
|
<item>Turkmenistan</item>
|
||||||
|
<item>Tuvalu</item>
|
||||||
|
<item>Uganda</item>
|
||||||
|
<item>Ukraine</item>
|
||||||
|
<item>United Arab Emirates</item>
|
||||||
|
<item>United Kingdom of Great Britain and Northern Ireland</item>
|
||||||
|
<item>United States of America</item>
|
||||||
|
<item>Uruguay</item>
|
||||||
|
<item>Uzbekistan</item>
|
||||||
|
<item>Vanuatu</item>
|
||||||
|
<item>Venezuela (Bolivarian Republic of)</item>
|
||||||
|
<item>Viet Nam</item>
|
||||||
|
<item>Yemen</item>
|
||||||
|
<item>Zambia</item>
|
||||||
|
<item>Zimbabwe</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="regionsValue">
|
||||||
|
<item>AF</item>
|
||||||
|
<item>AL</item>
|
||||||
|
<item>DZ</item>
|
||||||
|
<item>AD</item>
|
||||||
|
<item>AO</item>
|
||||||
|
<item>AG</item>
|
||||||
|
<item>AR</item>
|
||||||
|
<item>AM</item>
|
||||||
|
<item>AU</item>
|
||||||
|
<item>AT</item>
|
||||||
|
<item>AZ</item>
|
||||||
|
<item>BS</item>
|
||||||
|
<item>BH</item>
|
||||||
|
<item>BD</item>
|
||||||
|
<item>BB</item>
|
||||||
|
<item>BY</item>
|
||||||
|
<item>BE</item>
|
||||||
|
<item>BZ</item>
|
||||||
|
<item>BJ</item>
|
||||||
|
<item>BT</item>
|
||||||
|
<item>BO</item>
|
||||||
|
<item>BA</item>
|
||||||
|
<item>BW</item>
|
||||||
|
<item>BR</item>
|
||||||
|
<item>BN</item>
|
||||||
|
<item>BG</item>
|
||||||
|
<item>BF</item>
|
||||||
|
<item>BI</item>
|
||||||
|
<item>CV</item>
|
||||||
|
<item>KH</item>
|
||||||
|
<item>CM</item>
|
||||||
|
<item>CA</item>
|
||||||
|
<item>CF</item>
|
||||||
|
<item>TD</item>
|
||||||
|
<item>CL</item>
|
||||||
|
<item>CN</item>
|
||||||
|
<item>CO</item>
|
||||||
|
<item>KM</item>
|
||||||
|
<item>CG</item>
|
||||||
|
<item>CD</item>
|
||||||
|
<item>CR</item>
|
||||||
|
<item>CI</item>
|
||||||
|
<item>HR</item>
|
||||||
|
<item>CU</item>
|
||||||
|
<item>CY</item>
|
||||||
|
<item>CZ</item>
|
||||||
|
<item>DK</item>
|
||||||
|
<item>DJ</item>
|
||||||
|
<item>DM</item>
|
||||||
|
<item>DO</item>
|
||||||
|
<item>EC</item>
|
||||||
|
<item>EG</item>
|
||||||
|
<item>SV</item>
|
||||||
|
<item>GQ</item>
|
||||||
|
<item>ER</item>
|
||||||
|
<item>EE</item>
|
||||||
|
<item>SZ</item>
|
||||||
|
<item>ET</item>
|
||||||
|
<item>FJ</item>
|
||||||
|
<item>FI</item>
|
||||||
|
<item>FR</item>
|
||||||
|
<item>GA</item>
|
||||||
|
<item>GM</item>
|
||||||
|
<item>GE</item>
|
||||||
|
<item>DE</item>
|
||||||
|
<item>GH</item>
|
||||||
|
<item>GR</item>
|
||||||
|
<item>GD</item>
|
||||||
|
<item>GT</item>
|
||||||
|
<item>GN</item>
|
||||||
|
<item>GW</item>
|
||||||
|
<item>GY</item>
|
||||||
|
<item>HT</item>
|
||||||
|
<item>HN</item>
|
||||||
|
<item>HU</item>
|
||||||
|
<item>IS</item>
|
||||||
|
<item>IN</item>
|
||||||
|
<item>ID</item>
|
||||||
|
<item>IR</item>
|
||||||
|
<item>IQ</item>
|
||||||
|
<item>IE</item>
|
||||||
|
<item>IL</item>
|
||||||
|
<item>IT</item>
|
||||||
|
<item>JM</item>
|
||||||
|
<item>JP</item>
|
||||||
|
<item>JO</item>
|
||||||
|
<item>KZ</item>
|
||||||
|
<item>KE</item>
|
||||||
|
<item>KI</item>
|
||||||
|
<item>KP</item>
|
||||||
|
<item>KR</item>
|
||||||
|
<item>KW</item>
|
||||||
|
<item>KG</item>
|
||||||
|
<item>LA</item>
|
||||||
|
<item>LV</item>
|
||||||
|
<item>LB</item>
|
||||||
|
<item>LS</item>
|
||||||
|
<item>LR</item>
|
||||||
|
<item>LY</item>
|
||||||
|
<item>LI</item>
|
||||||
|
<item>LT</item>
|
||||||
|
<item>LU</item>
|
||||||
|
<item>MG</item>
|
||||||
|
<item>MW</item>
|
||||||
|
<item>MY</item>
|
||||||
|
<item>MV</item>
|
||||||
|
<item>ML</item>
|
||||||
|
<item>MT</item>
|
||||||
|
<item>MH</item>
|
||||||
|
<item>MR</item>
|
||||||
|
<item>MU</item>
|
||||||
|
<item>MX</item>
|
||||||
|
<item>FM</item>
|
||||||
|
<item>MD</item>
|
||||||
|
<item>MC</item>
|
||||||
|
<item>MN</item>
|
||||||
|
<item>ME</item>
|
||||||
|
<item>MA</item>
|
||||||
|
<item>MZ</item>
|
||||||
|
<item>MM</item>
|
||||||
|
<item>NA</item>
|
||||||
|
<item>NR</item>
|
||||||
|
<item>NP</item>
|
||||||
|
<item>NL</item>
|
||||||
|
<item>NZ</item>
|
||||||
|
<item>NI</item>
|
||||||
|
<item>NE</item>
|
||||||
|
<item>NG</item>
|
||||||
|
<item>MK</item>
|
||||||
|
<item>NO</item>
|
||||||
|
<item>OM</item>
|
||||||
|
<item>PK</item>
|
||||||
|
<item>PW</item>
|
||||||
|
<item>PA</item>
|
||||||
|
<item>PG</item>
|
||||||
|
<item>PY</item>
|
||||||
|
<item>PE</item>
|
||||||
|
<item>PH</item>
|
||||||
|
<item>PL</item>
|
||||||
|
<item>PT</item>
|
||||||
|
<item>QA</item>
|
||||||
|
<item>RO</item>
|
||||||
|
<item>RU</item>
|
||||||
|
<item>RW</item>
|
||||||
|
<item>KN</item>
|
||||||
|
<item>LC</item>
|
||||||
|
<item>VC</item>
|
||||||
|
<item>WS</item>
|
||||||
|
<item>SM</item>
|
||||||
|
<item>ST</item>
|
||||||
|
<item>SA</item>
|
||||||
|
<item>SN</item>
|
||||||
|
<item>RS</item>
|
||||||
|
<item>SC</item>
|
||||||
|
<item>SL</item>
|
||||||
|
<item>SG</item>
|
||||||
|
<item>SK</item>
|
||||||
|
<item>SI</item>
|
||||||
|
<item>SB</item>
|
||||||
|
<item>SO</item>
|
||||||
|
<item>ZA</item>
|
||||||
|
<item>SS</item>
|
||||||
|
<item>ES</item>
|
||||||
|
<item>LK</item>
|
||||||
|
<item>SD</item>
|
||||||
|
<item>SR</item>
|
||||||
|
<item>SE</item>
|
||||||
|
<item>CH</item>
|
||||||
|
<item>SY</item>
|
||||||
|
<item>TJ</item>
|
||||||
|
<item>TZ</item>
|
||||||
|
<item>TH</item>
|
||||||
|
<item>TL</item>
|
||||||
|
<item>TG</item>
|
||||||
|
<item>TO</item>
|
||||||
|
<item>TT</item>
|
||||||
|
<item>TN</item>
|
||||||
|
<item>TR</item>
|
||||||
|
<item>TM</item>
|
||||||
|
<item>TV</item>
|
||||||
|
<item>UG</item>
|
||||||
|
<item>UA</item>
|
||||||
|
<item>AE</item>
|
||||||
|
<item>GB</item>
|
||||||
|
<item>US</item>
|
||||||
|
<item>UY</item>
|
||||||
|
<item>UZ</item>
|
||||||
|
<item>VU</item>
|
||||||
|
<item>VE</item>
|
||||||
|
<item>VN</item>
|
||||||
|
<item>YE</item>
|
||||||
|
<item>ZM</item>
|
||||||
|
<item>ZW</item>
|
||||||
|
</string-array>
|
||||||
|
</resources>
|
@ -12,7 +12,14 @@
|
|||||||
<string name="password">Password</string>
|
<string name="password">Password</string>
|
||||||
<string name="login">Login</string>
|
<string name="login">Login</string>
|
||||||
<string name="register">Register</string>
|
<string name="register">Register</string>
|
||||||
|
<string name="logout">Logout</string>
|
||||||
<string name="cancel">Cancel</string>
|
<string name="cancel">Cancel</string>
|
||||||
<string name="loggedIn">Logged in successfully!</string>
|
<string name="loggedIn">Logged in successfully!</string>
|
||||||
|
<string name="loggedout">Logged out successfully!</string>
|
||||||
<string name="registered">Registered successfully! You may now subscribe to channels you want.</string>
|
<string name="registered">Registered successfully! You may now subscribe to channels you want.</string>
|
||||||
|
<string name="already_logged_in">You are already logged in, you may logout of your account.</string>
|
||||||
|
<string name="instances">Choose an instance</string>
|
||||||
|
<string name="customInstance">Add a custom instance</string>
|
||||||
|
<string name="region">Choose a region</string>
|
||||||
|
<string name="login_register">Login/Register</string>
|
||||||
</resources>
|
</resources>
|
33
app/src/main/res/xml/settings.xml
Normal file
33
app/src/main/res/xml/settings.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<androidx.preference.SwitchPreferenceCompat
|
||||||
|
app:key="darkMode"
|
||||||
|
app:title="Toggle dark mode"
|
||||||
|
app:isPreferenceVisible="false"/>
|
||||||
|
<ListPreference
|
||||||
|
app:key="region"
|
||||||
|
app:title="@string/region"
|
||||||
|
app:entries="@array/regions"
|
||||||
|
app:entryValues="@array/regionsValue"
|
||||||
|
app:defaultValue="US"
|
||||||
|
app:useSimpleSummaryProvider="true"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
app:key="instance"
|
||||||
|
app:title="@string/instances"
|
||||||
|
app:entries="@array/instances"
|
||||||
|
app:entryValues="@array/instancesValue"
|
||||||
|
app:defaultValue="https://pipedapi.kavin.rocks/"
|
||||||
|
app:useSimpleSummaryProvider="true"/>
|
||||||
|
<androidx.preference.EditTextPreference
|
||||||
|
app:key="customInstance"
|
||||||
|
app:title="@string/customInstance"
|
||||||
|
app:isPreferenceVisible="false"/>
|
||||||
|
<androidx.preference.Preference
|
||||||
|
app:key="login_register"
|
||||||
|
app:title="@string/login_register"
|
||||||
|
/>
|
||||||
|
</androidx.preference.PreferenceScreen>
|
Loading…
x
Reference in New Issue
Block a user