Compare commits
4 Commits
v172201007
...
3b47a4a2f0
Author | SHA1 | Date | |
---|---|---|---|
3b47a4a2f0 | |||
9693dec807 | |||
ca5186d20a | |||
78d5744139 |
@ -44,6 +44,8 @@
|
|||||||
|
|
||||||
- Closing #236. New sources can be added in Selfoss 2.19.
|
- Closing #236. New sources can be added in Selfoss 2.19.
|
||||||
|
|
||||||
|
- Closing #397 and #355. Tag and Sources filters are now exclusive.
|
||||||
|
|
||||||
- Dropped support for android 4, the last version supporting it is v1721030811
|
- Dropped support for android 4, the last version supporting it is v1721030811
|
||||||
|
|
||||||
**1.6.x**
|
**1.6.x**
|
||||||
|
@ -104,18 +104,18 @@ dependencies {
|
|||||||
// Espresso-intents for validation and stubbing of Intents
|
// Espresso-intents for validation and stubbing of Intents
|
||||||
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0-alpha02'
|
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0-alpha02'
|
||||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
|
||||||
// Android Support
|
// Android Support
|
||||||
implementation "androidx.appcompat:appcompat:1.4.0-beta01"
|
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||||
implementation 'com.google.android.material:material:1.5.0-alpha04'
|
implementation 'com.google.android.material:material:1.5.0'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.3.0-alpha01'
|
implementation 'androidx.recyclerview:recyclerview:1.3.0-alpha01'
|
||||||
implementation "androidx.legacy:legacy-support-v4:$android_version"
|
implementation "androidx.legacy:legacy-support-v4:$android_version"
|
||||||
implementation 'androidx.vectordrawable:vectordrawable:1.2.0-alpha02'
|
implementation 'androidx.vectordrawable:vectordrawable:1.2.0-alpha02'
|
||||||
implementation "androidx.browser:browser:1.3.0"
|
implementation 'androidx.browser:browser:1.4.0'
|
||||||
implementation "androidx.cardview:cardview:$android_version"
|
implementation "androidx.cardview:cardview:$android_version"
|
||||||
implementation "androidx.annotation:annotation:1.2.0"
|
implementation 'androidx.annotation:annotation:1.3.0'
|
||||||
implementation 'androidx.work:work-runtime-ktx:2.7.0'
|
implementation 'androidx.work:work-runtime-ktx:2.7.1'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||||
implementation 'org.jsoup:jsoup:1.14.3'
|
implementation 'org.jsoup:jsoup:1.14.3'
|
||||||
|
|
||||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
|
||||||
@ -129,11 +129,11 @@ dependencies {
|
|||||||
implementation "com.mikepenz:aboutlibraries-definitions:8.9.4"
|
implementation "com.mikepenz:aboutlibraries-definitions:8.9.4"
|
||||||
|
|
||||||
// Async
|
// Async
|
||||||
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2'
|
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'
|
||||||
|
|
||||||
// Retrofit + http logging + okhttp
|
// Retrofit + http logging + okhttp
|
||||||
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
|
||||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.1'
|
implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.3'
|
||||||
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
implementation 'com.burgstaller:okhttp-digest:2.5'
|
implementation 'com.burgstaller:okhttp-digest:2.5'
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ dependencies {
|
|||||||
implementation 'com.github.bumptech.glide:okhttp3-integration:4.1.1'
|
implementation 'com.github.bumptech.glide:okhttp3-integration:4.1.1'
|
||||||
|
|
||||||
// Drawer
|
// Drawer
|
||||||
implementation 'com.mikepenz:materialdrawer:8.4.4'
|
implementation 'com.mikepenz:materialdrawer:8.4.5'
|
||||||
|
|
||||||
// Themes
|
// Themes
|
||||||
implementation 'com.52inc:scoops:1.0.0'
|
implementation 'com.52inc:scoops:1.0.0'
|
||||||
@ -160,10 +160,10 @@ dependencies {
|
|||||||
//PhotoView
|
//PhotoView
|
||||||
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
|
||||||
|
|
||||||
implementation 'androidx.core:core-ktx:1.7.0-rc01'
|
implementation 'androidx.core:core-ktx:1.7.0'
|
||||||
|
|
||||||
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.4.0-rc01"
|
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
|
||||||
implementation "androidx.lifecycle:lifecycle-common-java8:2.4.0-rc01"
|
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.0'
|
||||||
|
|
||||||
implementation "androidx.room:room-ktx:2.4.0-beta01"
|
implementation "androidx.room:room-ktx:2.4.0-beta01"
|
||||||
kapt "androidx.room:room-compiler:2.4.0-beta01"
|
kapt "androidx.room:room-compiler:2.4.0-beta01"
|
||||||
|
@ -100,10 +100,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
private var displayAllCount = false
|
private var displayAllCount = false
|
||||||
private var fullHeightCards: Boolean = false
|
private var fullHeightCards: Boolean = false
|
||||||
private var itemsNumber: Int = 200
|
private var itemsNumber: Int = 200
|
||||||
private var elementsShown: Int = 0
|
private var elementsShown: Int = 1
|
||||||
private var maybeTagFilter: Tag? = null
|
|
||||||
private var maybeSourceFilter: Source? = null
|
|
||||||
private var maybeSearchFilter: String? = null
|
|
||||||
private var userIdentifier: String = ""
|
private var userIdentifier: String = ""
|
||||||
private var displayAccountHeader: Boolean = false
|
private var displayAccountHeader: Boolean = false
|
||||||
private var infiniteScroll: Boolean = false
|
private var infiniteScroll: Boolean = false
|
||||||
@ -563,8 +560,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
color = ColorHolder.fromColor(appColors.colorAccent) }
|
color = ColorHolder.fromColor(appColors.colorAccent) }
|
||||||
onDrawerItemClickListener = { _,_,_ ->
|
onDrawerItemClickListener = { _,_,_ ->
|
||||||
allItems = ArrayList()
|
allItems = ArrayList()
|
||||||
maybeTagFilter = it
|
|
||||||
SharedItems.tagFilter = it.tag
|
SharedItems.tagFilter = it.tag
|
||||||
|
SharedItems.sourceFilter = null
|
||||||
|
SharedItems.sourceIDFilter = null
|
||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
fetchOnEmptyList()
|
fetchOnEmptyList()
|
||||||
false
|
false
|
||||||
@ -615,8 +613,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
color = ColorHolder.fromColor(appColors.colorAccent) }
|
color = ColorHolder.fromColor(appColors.colorAccent) }
|
||||||
onDrawerItemClickListener = { _,_,_ ->
|
onDrawerItemClickListener = { _,_,_ ->
|
||||||
allItems = ArrayList()
|
allItems = ArrayList()
|
||||||
maybeTagFilter = it
|
|
||||||
SharedItems.tagFilter = it.tag
|
SharedItems.tagFilter = it.tag
|
||||||
|
SharedItems.sourceFilter = null
|
||||||
|
SharedItems.sourceIDFilter = null
|
||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
fetchOnEmptyList()
|
fetchOnEmptyList()
|
||||||
false
|
false
|
||||||
@ -650,9 +649,9 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
iconUrl = source.getIcon(this@HomeActivity)
|
iconUrl = source.getIcon(this@HomeActivity)
|
||||||
onDrawerItemClickListener = { _,_,_ ->
|
onDrawerItemClickListener = { _,_,_ ->
|
||||||
allItems = ArrayList()
|
allItems = ArrayList()
|
||||||
maybeSourceFilter = source
|
|
||||||
SharedItems.sourceIDFilter = source.id.toLong()
|
SharedItems.sourceIDFilter = source.id.toLong()
|
||||||
SharedItems.sourceFilter = source.title
|
SharedItems.sourceFilter = source.title
|
||||||
|
SharedItems.tagFilter = null
|
||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
fetchOnEmptyList()
|
fetchOnEmptyList()
|
||||||
false
|
false
|
||||||
@ -673,11 +672,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
badgeRes = R.string.drawer_action_clear
|
badgeRes = R.string.drawer_action_clear
|
||||||
onDrawerItemClickListener = { _,_,_ ->
|
onDrawerItemClickListener = { _,_,_ ->
|
||||||
allItems = ArrayList()
|
allItems = ArrayList()
|
||||||
maybeSourceFilter = null
|
|
||||||
SharedItems.sourceFilter = null
|
SharedItems.sourceFilter = null
|
||||||
SharedItems.sourceIDFilter = null
|
SharedItems.sourceIDFilter = null
|
||||||
maybeTagFilter = null
|
|
||||||
SharedItems.tagFilter = null
|
SharedItems.tagFilter = null
|
||||||
|
binding.mainDrawer.setSelectionAtPosition(-1)
|
||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
fetchOnEmptyList()
|
fetchOnEmptyList()
|
||||||
false
|
false
|
||||||
@ -1122,7 +1120,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
|
|
||||||
override fun onQueryTextChange(p0: String?): Boolean {
|
override fun onQueryTextChange(p0: String?): Boolean {
|
||||||
if (p0.isNullOrBlank()) {
|
if (p0.isNullOrBlank()) {
|
||||||
maybeSearchFilter = null
|
|
||||||
SharedItems.searchFilter = null
|
SharedItems.searchFilter = null
|
||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
fetchOnEmptyList()
|
fetchOnEmptyList()
|
||||||
@ -1131,7 +1128,6 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onQueryTextSubmit(p0: String?): Boolean {
|
override fun onQueryTextSubmit(p0: String?): Boolean {
|
||||||
maybeSearchFilter = p0
|
|
||||||
SharedItems.searchFilter = p0
|
SharedItems.searchFilter = p0
|
||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
fetchOnEmptyList()
|
fetchOnEmptyList()
|
||||||
|
@ -14,11 +14,11 @@ import android.view.MenuItem
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.EditorInfo
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
||||||
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
||||||
import apps.amine.bou.readerforselfoss.databinding.ActivityLoginBinding
|
import apps.amine.bou.readerforselfoss.databinding.ActivityLoginBinding
|
||||||
import apps.amine.bou.readerforselfoss.themes.AppColors
|
import apps.amine.bou.readerforselfoss.themes.AppColors
|
||||||
import apps.amine.bou.readerforselfoss.utils.Config
|
|
||||||
import apps.amine.bou.readerforselfoss.utils.isBaseUrlValid
|
import apps.amine.bou.readerforselfoss.utils.isBaseUrlValid
|
||||||
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
||||||
import com.mikepenz.aboutlibraries.LibsBuilder
|
import com.mikepenz.aboutlibraries.LibsBuilder
|
||||||
@ -52,7 +52,7 @@ class LoginActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
handleBaseUrlFail()
|
handleBaseUrlFail()
|
||||||
|
|
||||||
settings = getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
settings = PreferenceManager.getDefaultSharedPreferences(applicationContext)
|
||||||
userIdentifier = settings.getString("unique_id", "")!!
|
userIdentifier = settings.getString("unique_id", "")!!
|
||||||
|
|
||||||
editor = settings.edit()
|
editor = settings.edit()
|
||||||
|
@ -4,11 +4,12 @@ import android.app.Activity
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
import apps.amine.bou.readerforselfoss.LoginActivity
|
import apps.amine.bou.readerforselfoss.LoginActivity
|
||||||
|
|
||||||
class Config(c: Context) {
|
class Config(c: Context) {
|
||||||
|
|
||||||
val settings: SharedPreferences = c.getSharedPreferences(settingsName, Context.MODE_PRIVATE)
|
val settings: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(c)
|
||||||
|
|
||||||
val baseUrl: String
|
val baseUrl: String
|
||||||
get() = settings.getString("url", "")!!
|
get() = settings.getString("url", "")!!
|
||||||
@ -42,17 +43,15 @@ class Config(c: Context) {
|
|||||||
|
|
||||||
var apiVersion = 0
|
var apiVersion = 0
|
||||||
|
|
||||||
|
/* Execute logout and clear all settings to default */
|
||||||
fun logoutAndRedirect(
|
fun logoutAndRedirect(
|
||||||
c: Context,
|
c: Context,
|
||||||
callingActivity: Activity,
|
callingActivity: Activity,
|
||||||
editor: SharedPreferences.Editor,
|
editor: SharedPreferences.Editor,
|
||||||
baseUrlFail: Boolean = false
|
baseUrlFail: Boolean = false
|
||||||
): Boolean {
|
): Boolean {
|
||||||
editor.remove("url")
|
val settings = PreferenceManager.getDefaultSharedPreferences(c)
|
||||||
editor.remove("login")
|
settings.edit().clear().commit()
|
||||||
editor.remove("password")
|
|
||||||
editor.remove("apiVersionMajor")
|
|
||||||
editor.apply()
|
|
||||||
val intent = Intent(c, LoginActivity::class.java)
|
val intent = Intent(c, LoginActivity::class.java)
|
||||||
if (baseUrlFail) {
|
if (baseUrlFail) {
|
||||||
intent.putExtra("baseUrlFail", baseUrlFail)
|
intent.putExtra("baseUrlFail", baseUrlFail)
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
kotlin_version = '1.5.31'
|
kotlin_version = '1.6.10'
|
||||||
android_version = '1.0.0'
|
android_version = '1.0.0'
|
||||||
androidx_version = '1.1.0-alpha05'
|
androidx_version = '1.1.0-alpha05'
|
||||||
lifecycle_version = '2.2.0-alpha01'
|
lifecycle_version = '2.2.0-alpha01'
|
||||||
@ -15,7 +15,7 @@ buildscript {
|
|||||||
maven { url "https://www.jitpack.io" }
|
maven { url "https://www.jitpack.io" }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.3'
|
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,9 +23,9 @@ buildscript {
|
|||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
|
mavenCentral()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url "https://www.jitpack.io" }
|
maven { url "https://www.jitpack.io" }
|
||||||
mavenCentral()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user