build: Task 22 완료 - :feature:feature-wallpaper 모듈 분리 및 LocationUpdateService/R.font 디커플링

- feature/feature-wallpaper 모듈 신규 생성 (namespace: bums.lunatic.launcher.feature.wallpaper):
  * MyWallpaperService.kt, NativeRenderer.kt를 :app에서 :feature:feature-wallpaper로 이동
- MyWallpaperService.kt 디커플링:
  * LocationUpdateService.lastWeather 직접 참조 -> weatherSummaryProvider 람다 주입으로 분리
  * R.font.* 직접 참조 -> symbolFontResId, wallpaperFontResIds 주입 및 randomFontOrDefault() 폴백 처리
  * LunaticLauncher.onCreate()에서 날씨 프로바이더 및 폰트 리소스 ID 목록 바인딩
- settings.gradle.kts, app/build.gradle.kts, ARCHITECTURE.md, TODO.md(6-2 완료) 갱신
- 검증: ./gradlew :app:compileDebugKotlin 빌드 성공 확인 (12s, 97 actionable tasks)
This commit is contained in:
2026-11-16 13:24:56 +09:00
parent 2ca69a685e
commit ce1854d3ca
9 changed files with 77 additions and 67 deletions
+1
View File
@@ -15,6 +15,7 @@
| `:core:core-database` | Realm Kotlin 모델(`model/*`, `TokizModels`, `RecentCall`), `WorkersDb`, `CustMigration` | `io.realm.kotlin` api 노출 |
| `:core:core-network` | 공용 `OkHttpClient` 싱글톤(`NetworkClient`) | OkHttp3 커넥션 풀 공유 |
| `:feature:feature-torrent` | `TorrentService`/`TorrentTask` 및 `jlibtorrent` JAR 격리 모듈 | `:core:core-common` 의존 |
| `:feature:feature-wallpaper` | `MyWallpaperService`/`NativeRenderer` 라이브 월페이퍼 모듈 | `:core:core-common`, `:core:core-database` 의존 |
| `:gdrive` | Google Drive `appDataFolder` 기반 로그인 및 백업 모듈 | `:app`에서 `implementation(project(":gdrive"))`로 참조 |
| `:lun_launcher` | Wear OS 컴패니언 앱 (`bums.lunatic.launcher`, `minSdk 30`, `compileSdk 36`) | Compose for Wear OS, Tile, Complication, 제스처 전송(`MessageClient`) |
+1 -1
View File
@@ -183,6 +183,6 @@ lunar_launcher/
#### 단계별 모듈화 실행 순서
- [x] **6-1. `:core:common`, `:core:network`, `:core:database` 분리** (`:core:core-common`, `:core:core-database`, `:core:core-network` 모두 분리 완료)
- [x] **6-2. 독립 기능 우선 분리 (`:feature:torrent`, `:feature:wallpaper`)** (`:feature:feature-torrent` 분리 및 `jlibtorrent` JAR 격리 완료; `:feature:wallpaper`는 후속 진행)
- [x] **6-2. 독립 기능 우선 분리 (`:feature:torrent`, `:feature:wallpaper`)** (`:feature:feature-torrent`, `:feature:feature-wallpaper` 모두 분리 완료)
- [ ] **6-3. 뷰어/리더 분리 (`:feature:player`, `:feature:reader`)**: `PlayerActivity`/`NativePlayer`(+ `PlayerEngine.cpp`)와 `DocumentViewerActivity`/`ImageViewerActivity`, `TokiFragment`/`WebReaderActivity`를 분리.
- [ ] **6-4. 피드/수집기 분리 (`:feature:feeds`)**: `RssHome`, `NeoRssActivity`, `TaskAggregator`, `*Getter`군을 분리하고 `:app`은 런처 홈과 서비스 진입점만 유지.
+1
View File
@@ -139,6 +139,7 @@ dependencies {
implementation(project(":core:core-database"))
implementation(project(":core:core-network"))
implementation(project(":feature:feature-torrent"))
implementation(project(":feature:feature-wallpaper"))
implementation(project(":gdrive"))
implementation("com.google.android.gms:play-services-wearable:19.0.0")
val kotlinVersion: String? by extra
@@ -118,6 +118,27 @@ prefs:
PrefHelper.initialize(this)
bums.lunatic.launcher.model.RssDataType.enabledChecker = { key -> PrefHelper.getBoolean(key, false) }
bums.lunatic.launcher.workers.WorkersDb.schemaVersion = BuildConfig.BuildDateTime
bums.lunatic.launcher.wall.MyWallpaperService.weatherSummaryProvider = {
bums.lunatic.launcher.workers.LocationUpdateService.lastWeather
}
bums.lunatic.launcher.wall.MyWallpaperService.symbolFontResId = R.font.material_symbols
bums.lunatic.launcher.wall.MyWallpaperService.wallpaperFontResIds = listOf(
R.font.cafe24ohsquareair, R.font.cafe24oneprettynight, R.font.cafe24ssukssukregular,
R.font.dovemayo, R.font.ebs_r, R.font.gabia_solmee, R.font.godomaum,
R.font.jsarirang_hon, R.font.jsarirang_ppuri, R.font.jsdongkang_regular,
R.font.kcc_kimhoon, R.font.kcc_sonkeechung, R.font.kccahnjunggeun,
R.font.kotra_bold, R.font.kotra_songeulssi, R.font.kyobo_handwriting_2019,
R.font.kyobo_handwriting_2021sjy, R.font.kyobohandwriting2024psw,
R.font.mapoagape, R.font.mapobackpacking, R.font.mapodacapo, R.font.mapodpp,
R.font.mapodpp_2, R.font.mapoflowerisland, R.font.mapogoldenpier, R.font.mapomaponaru,
R.font.mapopeacefull, R.font.material_symbols, R.font.nnsgc_brhp, R.font.nnsgc_gd_an_gd,
R.font.nnsgc_md, R.font.nnsgc_wsjidyp, R.font.nnsgc_yjc, R.font.on_jsuhl, R.font.on_jsuhr,
R.font.on_sbsjl, R.font.on_sbsjr, R.font.on_treeususimgul, R.font.on_treeususimgul_r,
R.font.on_wibsr, R.font.on_wisbl, R.font.on_ychyuhl, R.font.on_ychyuhr,
R.font.ssshinb7, R.font.taebaek_milkyway, R.font.taefont_tsthlml,
R.font.tvn_jguiyg_light, R.font.tvn_jguiyg_medium, R.font.wandohoper,
R.font.ylee_mortal_heart_immortal_memory
)
Base64ImageCache.init(this)
val dir = try {
val externalDir = File("/storage/emulated/0/bums_ob/BUM'S PACED /scraped/logs")
@@ -0,0 +1,30 @@
plugins {
id("com.android.library")
id("kotlin-android")
}
android {
namespace = "bums.lunatic.launcher.feature.wallpaper"
compileSdk = 35
defaultConfig {
minSdk = 26
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation(project(":core:core-common"))
implementation(project(":core:core-database"))
implementation("androidx.core:core-ktx:1.15.0")
implementation("com.google.code.gson:gson:2.13.1")
implementation("com.google.guava:guava:33.2.1-jre")
}
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
@@ -36,12 +36,10 @@ import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.graphics.alpha
import bums.lunatic.launcher.R
import bums.lunatic.launcher.model.QuoteItem
import bums.lunatic.launcher.model.Translation
import bums.lunatic.launcher.model.WallContentGroup
import bums.lunatic.launcher.utils.Blog
import bums.lunatic.launcher.workers.LocationUpdateService
import bums.lunatic.launcher.workers.WorkersDb
import com.google.common.reflect.TypeToken
import com.google.gson.Gson
@@ -52,7 +50,11 @@ import java.util.Locale
class MyWallpaperService : WallpaperService() {
companion object {
var weatherSummaryProvider: () -> List<String> = { emptyList() }
var symbolFontResId: Int = 0
var wallpaperFontResIds: List<Int> = emptyList()
}
private val TAG = "MyWallpaperService"
@@ -416,7 +418,7 @@ class MyWallpaperService : WallpaperService() {
}
private val materialIconFont: Typeface by lazy {
resources.getFont(R.font.material_symbols)
if (symbolFontResId != 0) resources.getFont(symbolFontResId) else Typeface.DEFAULT
}
// 날씨 텍스트를 분석하여 Material Symbol 아이콘 문자열로 변환하는 함수
@@ -488,63 +490,15 @@ class MyWallpaperService : WallpaperService() {
else -> condition
}
}
val fontz = arrayListOf<Int>(
R.font.cafe24ohsquareair,
R.font.cafe24oneprettynight,
R.font.cafe24ssukssukregular,
R.font.dovemayo,
R.font.ebs_r,
R.font.gabia_solmee,
R.font.godomaum,
R.font.jsarirang_hon,
R.font.jsarirang_ppuri,
R.font.jsdongkang_regular,
R.font.kcc_kimhoon,
R.font.kcc_sonkeechung,
R.font.kccahnjunggeun,
R.font.kotra_bold,
R.font.kotra_songeulssi,
R.font.kyobo_handwriting_2019,
R.font.kyobo_handwriting_2021sjy,
R.font.kyobohandwriting2024psw,
R.font.mapoagape,
R.font.mapobackpacking,
R.font.mapodacapo,
R.font.mapodpp,
R.font.mapodpp_2,
R.font.mapoflowerisland,
R.font.mapogoldenpier,
R.font.mapomaponaru,
R.font.mapopeacefull,
R.font.material_symbols,
R.font.nnsgc_brhp,
R.font.nnsgc_gd_an_gd,
R.font.nnsgc_md,
R.font.nnsgc_wsjidyp,
R.font.nnsgc_yjc,
R.font.on_jsuhl,
R.font.on_jsuhr,
R.font.on_sbsjl,
R.font.on_sbsjr,
R.font.on_treeususimgul,
R.font.on_treeususimgul_r,
R.font.on_wibsr,
R.font.on_wisbl,
R.font.on_ychyuhl,
R.font.on_ychyuhr,
R.font.ssshinb7,
R.font.taebaek_milkyway,
R.font.taefont_tsthlml,
R.font.tvn_jguiyg_light,
R.font.tvn_jguiyg_medium,
R.font.wandohoper,
R.font.ylee_mortal_heart_immortal_memory,
)
private fun randomFontOrDefault(): Typeface {
val id = wallpaperFontResIds.randomOrNull() ?: return Typeface.DEFAULT
return try { resources.getFont(id) } catch (_: Exception) { Typeface.DEFAULT }
}
var monoBold = resources.getFont(fontz.random())
var quote = resources.getFont(fontz.random())
var local = resources.getFont(fontz.random())
var numbers = resources.getFont(fontz.random())
var monoBold = randomFontOrDefault()
var quote = randomFontOrDefault()
var local = randomFontOrDefault()
var numbers = randomFontOrDefault()
private fun drawBitmapFromText(weatherLines: List<String>, isCharging: Boolean = false): Bitmap? {
// 💡 1. 원의 크기와 내부 여백 계산
@@ -759,7 +713,7 @@ class MyWallpaperService : WallpaperService() {
}
// 비트맵 생성 및 전달
val weather = LocationUpdateService.lastWeather
val weather = weatherSummaryProvider()
val bitmap = drawBitmapFromText(weather,isCharging)
bitmap?.let {
nativeRenderer?.setWeatherBitmap(it)
@@ -794,10 +748,10 @@ class MyWallpaperService : WallpaperService() {
val realm = WorkersDb.getRealm()
val quotes = realm.query<QuoteItem>(QuoteItem::class).find().shuffled()
randomQuote = if (quotes.isNotEmpty()) quotes.random() else null
monoBold = resources.getFont(fontz.random())
quote = resources.getFont(fontz.random())
local = resources.getFont(fontz.random())
numbers = resources.getFont(fontz.random())
monoBold = randomFontOrDefault()
quote = randomFontOrDefault()
local = randomFontOrDefault()
numbers = randomFontOrDefault()
getFdFromPath(nextFile.absolutePath)?.let { fd ->
nativeRenderer?.startNextPreload(fd)
@@ -808,7 +762,7 @@ class MyWallpaperService : WallpaperService() {
val (batteryLevel, isCharging) = getBatteryStatus()
if (batteryLevel >= 70 || isCharging) {
val bitmap = drawBitmapFromText(LocationUpdateService.lastWeather)
val bitmap = drawBitmapFromText(weatherSummaryProvider())
bitmap?.let { nativeRenderer?.setWeatherBitmap(it) }
nativeRenderer?.setImageRenderFrame(55)
Log.d(TAG, "Battery Low: Weather updated only on media change.")
+1
View File
@@ -27,5 +27,6 @@ include(":core:core-common")
include(":core:core-database")
include(":core:core-network")
include(":feature:feature-torrent")
include(":feature:feature-wallpaper")
include(":gdrive")
include(":lun_launcher")