From e2de6973bc8e14b64f0cd191ffa9a743fc495799 Mon Sep 17 00:00:00 2001 From: GKF Date: Wed, 22 May 2019 14:25:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/App.kt | 9 ++++++++- app/src/main/java/io/legado/app/constant/AppConst.kt | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/io/legado/app/constant/AppConst.kt diff --git a/app/src/main/java/io/legado/app/App.kt b/app/src/main/java/io/legado/app/App.kt index 85bca3c93..90f01213b 100644 --- a/app/src/main/java/io/legado/app/App.kt +++ b/app/src/main/java/io/legado/app/App.kt @@ -1,12 +1,19 @@ package io.legado.app import android.app.Application +import android.content.SharedPreferences class App : Application() { - + companion object{ + lateinit var instance:App + lateinit var configPreferences:SharedPreferences + } override fun onCreate() { super.onCreate() + instance = this + configPreferences = getSharedPreferences("CONFIG", 0) + } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/constant/AppConst.kt b/app/src/main/java/io/legado/app/constant/AppConst.kt new file mode 100644 index 000000000..6f9e7b6b9 --- /dev/null +++ b/app/src/main/java/io/legado/app/constant/AppConst.kt @@ -0,0 +1,7 @@ +package io.legado.app.constant + +object AppConst { + const val channelIdDownload = "channel_download" + const val channelIdReadAloud = "channel_read_aloud" + const val channelIdWeb = "channel_web" +} \ No newline at end of file