Compare commits
2 Commits
v172201007
...
updates
Author | SHA1 | Date | |
---|---|---|---|
f0b073e74d | |||
ca5186d20a |
@ -104,18 +104,18 @@ dependencies {
|
||||
// Espresso-intents for validation and stubbing of Intents
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.4.0-alpha02'
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
||||
// Android Support
|
||||
implementation "androidx.appcompat:appcompat:1.4.0-beta01"
|
||||
implementation 'com.google.android.material:material:1.5.0-alpha04'
|
||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
||||
implementation 'com.google.android.material:material:1.5.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.3.0-alpha01'
|
||||
implementation "androidx.legacy:legacy-support-v4:$android_version"
|
||||
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.annotation:annotation:1.2.0"
|
||||
implementation 'androidx.work:work-runtime-ktx:2.7.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
|
||||
implementation 'androidx.annotation:annotation:1.3.0'
|
||||
implementation 'androidx.work:work-runtime-ktx:2.7.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
|
||||
implementation 'org.jsoup:jsoup:1.14.3'
|
||||
|
||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
|
||||
@ -129,11 +129,11 @@ dependencies {
|
||||
implementation "com.mikepenz:aboutlibraries-definitions:8.9.4"
|
||||
|
||||
// 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
|
||||
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.burgstaller:okhttp-digest:2.5'
|
||||
|
||||
@ -146,7 +146,7 @@ dependencies {
|
||||
implementation 'com.github.bumptech.glide:okhttp3-integration:4.1.1'
|
||||
|
||||
// Drawer
|
||||
implementation 'com.mikepenz:materialdrawer:8.4.4'
|
||||
implementation 'com.mikepenz:materialdrawer:8.4.5'
|
||||
|
||||
// Themes
|
||||
implementation 'com.52inc:scoops:1.0.0'
|
||||
@ -160,10 +160,10 @@ dependencies {
|
||||
//PhotoView
|
||||
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-common-java8:2.4.0-rc01"
|
||||
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.0'
|
||||
|
||||
implementation "androidx.room:room-ktx:2.4.0-beta01"
|
||||
kapt "androidx.room:room-compiler:2.4.0-beta01"
|
||||
|
@ -14,11 +14,11 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.widget.TextView
|
||||
import androidx.preference.PreferenceManager
|
||||
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
||||
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
||||
import apps.amine.bou.readerforselfoss.databinding.ActivityLoginBinding
|
||||
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.network.isNetworkAccessible
|
||||
import com.mikepenz.aboutlibraries.LibsBuilder
|
||||
@ -52,7 +52,7 @@ class LoginActivity : AppCompatActivity() {
|
||||
|
||||
handleBaseUrlFail()
|
||||
|
||||
settings = getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
||||
settings = PreferenceManager.getDefaultSharedPreferences(applicationContext)
|
||||
userIdentifier = settings.getString("unique_id", "")!!
|
||||
|
||||
editor = settings.edit()
|
||||
|
@ -4,11 +4,12 @@ import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
import androidx.preference.PreferenceManager
|
||||
import apps.amine.bou.readerforselfoss.LoginActivity
|
||||
|
||||
class Config(c: Context) {
|
||||
|
||||
val settings: SharedPreferences = c.getSharedPreferences(settingsName, Context.MODE_PRIVATE)
|
||||
val settings: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(c)
|
||||
|
||||
val baseUrl: String
|
||||
get() = settings.getString("url", "")!!
|
||||
@ -42,17 +43,15 @@ class Config(c: Context) {
|
||||
|
||||
var apiVersion = 0
|
||||
|
||||
/* Execute logout and clear all settings to default */
|
||||
fun logoutAndRedirect(
|
||||
c: Context,
|
||||
callingActivity: Activity,
|
||||
editor: SharedPreferences.Editor,
|
||||
baseUrlFail: Boolean = false
|
||||
): Boolean {
|
||||
editor.remove("url")
|
||||
editor.remove("login")
|
||||
editor.remove("password")
|
||||
editor.remove("apiVersionMajor")
|
||||
editor.apply()
|
||||
val settings = PreferenceManager.getDefaultSharedPreferences(c)
|
||||
settings.edit().clear().commit()
|
||||
val intent = Intent(c, LoginActivity::class.java)
|
||||
if (baseUrlFail) {
|
||||
intent.putExtra("baseUrlFail", baseUrlFail)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
buildscript {
|
||||
ext {
|
||||
kotlin_version = '1.5.31'
|
||||
kotlin_version = '1.6.10'
|
||||
android_version = '1.0.0'
|
||||
androidx_version = '1.1.0-alpha05'
|
||||
lifecycle_version = '2.2.0-alpha01'
|
||||
@ -15,7 +15,7 @@ buildscript {
|
||||
maven { url "https://www.jitpack.io" }
|
||||
}
|
||||
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"
|
||||
}
|
||||
}
|
||||
@ -23,9 +23,9 @@ buildscript {
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
jcenter()
|
||||
maven { url "https://www.jitpack.io" }
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user