@@ -359,9 +359,8 @@ class Utils {
359
359
}
360
360
361
361
suspend fun generatePlaceholder (call : TileDao , value : Int ) {
362
- val size = value
363
362
val startFrom = call.getTilesList().size
364
- val end = startFrom + size
363
+ val end = startFrom + value
365
364
for (i in startFrom.. end) {
366
365
val placeholder = Tile (
367
366
i, (i + 1 ).toLong(), - 1 , - 1 ,
@@ -392,8 +391,12 @@ class Utils {
392
391
}
393
392
}
394
393
395
- fun getCustomFont (): Typeface ? {
396
- val path = PREFS .customFontPath
394
+ fun getCustomFont (fontType : Int ): Typeface ? {
395
+ val path = when (fontType) {
396
+ 1 -> PREFS .customLightFontPath
397
+ 2 -> PREFS .customBoldFontPath
398
+ else -> PREFS .customFontPath
399
+ }
397
400
if (! PREFS .customFontInstalled || path == null ) return null
398
401
return path.let {
399
402
val fontFile = File (it)
@@ -408,39 +411,6 @@ class Utils {
408
411
}
409
412
}
410
413
}
411
-
412
- fun getCustomLightFont (): Typeface ? {
413
- val path = PREFS .customLightFontPath
414
- if (! PREFS .customFontInstalled || path == null ) return null
415
- return path.let {
416
- val fontFile = File (it)
417
- if (fontFile.exists()) {
418
- val typeface = Typeface .createFromFile(fontFile)
419
- typeface
420
- } else {
421
- PREFS .customLightFontPath = null
422
- PREFS .customLightFontName = null
423
- null
424
- }
425
- }
426
- }
427
-
428
- fun getCustomBoldFont (): Typeface ? {
429
- val path = PREFS .customBoldFontPath
430
- if (! PREFS .customFontInstalled || path == null ) return null
431
- return path.let {
432
- val fontFile = File (it)
433
- if (fontFile.exists()) {
434
- val typeface = Typeface .createFromFile(fontFile)
435
- typeface
436
- } else {
437
- PREFS .customBoldFontPath = null
438
- PREFS .customBoldFontName = null
439
- null
440
- }
441
- }
442
- }
443
-
444
414
fun getDefaultLocale (): Locale {
445
415
return Locale .getDefault()
446
416
}
0 commit comments