Skip to content

Commit

Permalink
Merge pull request #3 from mutkuensert/develop
Browse files Browse the repository at this point in the history
v2.0.0
  • Loading branch information
mutkuensert authored Dec 26, 2024
2 parents 10620dc + 02bd51c commit 926e574
Show file tree
Hide file tree
Showing 61 changed files with 1,351 additions and 870 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ build/

# Local configuration file (sdk path, etc)
local.properties
keystore.properties
keystore.jks

# Log Files
*.log
Expand Down
71 changes: 0 additions & 71 deletions app/build.gradle

This file was deleted.

96 changes: 96 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import java.io.FileInputStream
import java.util.Properties

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.dagger.hilt.android)
alias(libs.plugins.kotlin.ksp)
alias(libs.plugins.compose.compiler.plugin)
alias(libs.plugins.kotlin.serialization)
}

android {
namespace = "com.mutkuensert.highlightandnote"
compileSdk = 35

defaultConfig {
applicationId = "com.mutkuensert.highlightandnote"
minSdk = 23
targetSdk = 35
versionCode = 7
versionName = "2.0.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

val keystorePropertiesFile = rootProject.file("keystore.properties")
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(keystorePropertiesFile))

signingConfigs {
create("release") {
keyAlias = keystoreProperties["KEY_ALIAS"] as String
keyPassword = keystoreProperties["KEY_PASSWORD"] as String
storeFile = file(keystoreProperties["STORE_FILE"] as String)
storePassword = keystoreProperties["STORE_PASSWORD"] as String
}
}

buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true

proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)

signingConfig = signingConfigs.getByName("release")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}

buildFeatures {
viewBinding = true
compose = true
}
}

dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity.compose)

implementation(platform(libs.compose.bom))
implementation(libs.compose.material3)
implementation(libs.compose.material.icons)
implementation(libs.compose.preview)
implementation(libs.compose.hilt.navigation)
implementation(libs.compose.navigation)
implementation(libs.compose.view.model)

implementation(libs.androidx.activity)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)

implementation(libs.dagger.hilt)
debugImplementation(libs.androidx.ui.tooling)
ksp(libs.dagger.hilt.compiler)

implementation(libs.navigation.ui)

implementation(libs.kotlin.serialization)

implementation(libs.room)
implementation(libs.room.ktx)
ksp(libs.room.compiler)
}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".HighlightAndNoteApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.HighlightAndNote">
<activity
android:name=".view.MainActivity"
android:name=".main.MainActivity"
android:exported="true"
android:screenOrientation="user">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.mutkuensert.highlightandnote

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class HighlightAndNoteApp : Application()

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.mutkuensert.highlightandnote.core

import androidx.navigation.NavHostController
import com.mutkuensert.highlightandnote.main.MainActivity
import javax.inject.Inject

class Navigator @Inject constructor() {
lateinit var controller: NavHostController
private set
private lateinit var activity: MainActivity

fun setNavHostController(controller: NavHostController) {
this.controller = controller
}

fun setActivity(activity: MainActivity) {
this.activity = activity
}

fun closeApp() {
activity.finish()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.mutkuensert.highlightandnote.core.compose

import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.repeatOnLifecycle
import kotlinx.coroutines.CoroutineScope

@Composable
fun RepeatOnLifecycleEffect(
vararg keys: Any?,
state: Lifecycle.State = Lifecycle.State.RESUMED,
action: CoroutineScope.() -> Unit
) {
val lifecycle = LocalLifecycleOwner.current

LaunchedEffect(keys) {
lifecycle.repeatOnLifecycle(state, block = action)
}
}
Loading

0 comments on commit 926e574

Please sign in to comment.