-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Fix a bug that appContext has not been initialized (#23)
- Loading branch information
Showing
10 changed files
with
61 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
package com.skyd.rays.config | ||
|
||
import com.skyd.rays.appContext | ||
import android.content.Context | ||
import java.io.File | ||
|
||
val STICKER_DIR: String = File(appContext.filesDir.path, "Sticker").path | ||
// https://github.com/SkyD666/Rays-Android/issues/23 | ||
val Context.STICKER_DIR: String | ||
get() = File(filesDir.path, "Sticker") | ||
.apply { if (!exists()) mkdirs() } | ||
.path | ||
|
||
val TEMP_STICKER_DIR: File = File(appContext.cacheDir, "TempSticker") | ||
val PROVIDER_THUMBNAIL_DIR: File = File(TEMP_STICKER_DIR, "Provider/Thumbnail") | ||
val Context.TEMP_STICKER_DIR: File | ||
get() = File(cacheDir, "TempSticker") | ||
.apply { if (!exists()) mkdirs() } | ||
val Context.PROVIDER_THUMBNAIL_DIR: File | ||
get() = File(TEMP_STICKER_DIR, "Provider/Thumbnail") | ||
.apply { if (!exists()) mkdirs() } | ||
|
||
val IMPORT_FILES_DIR: File = File(appContext.cacheDir, "ImportFiles") | ||
val EXPORT_FILES_DIR: File = File(appContext.cacheDir, "ExportFiles") | ||
val Context.IMPORT_FILES_DIR: File | ||
get() = File(cacheDir, "ImportFiles") | ||
.apply { if (!exists()) mkdirs() } | ||
val Context.EXPORT_FILES_DIR: File | ||
get() = File(cacheDir, "ExportFiles") | ||
.apply { if (!exists()) mkdirs() } |
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
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