chore: Some more effort moving widget to its own module

This commit is contained in:
Ahmad Ansori Palembani 2024-06-17 13:21:27 +07:00
parent 79b5494307
commit 4a9a7813e0
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
34 changed files with 205 additions and 64 deletions

View file

@ -0,0 +1,17 @@
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}
android {
namespace = "yokai.presentation.core"
defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
}
dependencies {
api(libs.material)
}

View file

21
presentation/core/proguard-rules.pro vendored Normal file
View file

@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />

View file

@ -0,0 +1,12 @@
package yokai.presentation.core
object Constants {
const val MAIN_ACTIVITY = "eu.kanade.tachiyomi.ui.main.MainActivity"
const val SEARCH_ACTIVITY = "eu.kanade.tachiyomi.ui.main.SearchActivity"
const val SHORTCUT_RECENTS = "eu.kanade.tachiyomi.SHOW_RECENTS"
const val SHORTCUT_MANGA = "eu.kanade.tachiyomi.SHOW_MANGA"
const val SHORTCUT_MANGA_BACK = "eu.kanade.tachiyomi.SHOW_MANGA_BACK"
const val MANGA_EXTRA = "manga"
}

View file

@ -0,0 +1,14 @@
package yokai.presentation.core.util
import android.content.Context
import android.content.Intent
import yokai.presentation.core.Constants
object IntentCommon {
fun openManga(context: Context, id: Long?, canReturnToMain: Boolean = false) =
Intent(context, Class.forName(Constants.SEARCH_ACTIVITY))
.apply {
action = if (canReturnToMain) Constants.SHORTCUT_MANGA_BACK else Constants.SHORTCUT_MANGA
putExtra(Constants.MANGA_EXTRA, id)
}
}

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="cover_placeholder">#1F888888</color>
</resources>