mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-06-11 00:49:33 +00:00
remove the / at the end of layout folders
because apparently android 7 asset manager does not understand it fixes #1393
This commit is contained in:
parent
ee33140106
commit
43f5dd555b
3 changed files with 5 additions and 4 deletions
|
@ -5,6 +5,7 @@ import helium314.keyboard.latin.R
|
|||
import helium314.keyboard.latin.settings.Defaults.default
|
||||
import helium314.keyboard.latin.utils.LayoutType.Companion.folder
|
||||
import helium314.keyboard.latin.utils.ScriptUtils.script
|
||||
import java.io.File
|
||||
import java.util.Locale
|
||||
|
||||
// for layouts provided by the app
|
||||
|
@ -28,8 +29,8 @@ object LayoutUtils {
|
|||
fun getContent(layoutType: LayoutType, layoutName: String, context: Context): String {
|
||||
val layouts = context.assets.list(layoutType.folder)!!
|
||||
layouts.firstOrNull { it.startsWith("$layoutName.") }
|
||||
?.let { return context.assets.open(layoutType.folder + it).reader().readText() }
|
||||
?.let { return context.assets.open(layoutType.folder + File.separator + it).reader().readText() }
|
||||
val fallback = layouts.first { it.startsWith(layoutType.default) } // must exist!
|
||||
return context.assets.open(layoutType.folder + fallback).reader().readText()
|
||||
return context.assets.open(layoutType.folder + File.separator + fallback).reader().readText()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue