Skip to content

Commit

Permalink
Merge branch 'feat/usagestatusmanager' of https://github.com/Team-HMH…
Browse files Browse the repository at this point in the history
…/HMH-Android into feat/usagestatusmanager
  • Loading branch information
jihyun0v0 committed Jan 4, 2024
2 parents dc27355 + f3e4b47 commit eb7f2ed
Show file tree
Hide file tree
Showing 36 changed files with 735 additions and 89 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/develop_PR_builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ jobs:
- name: Change gradlew permissions
run: chmod +x ./gradlew

- name: Add Local Properties
env:
KAKAO_API_KEY: ${{ secrets.KAKAO_API_KEY }}
run: |
echo kakaoApiKey=$KAKAO_API_KEY >> ./local.properties
- name: Access Firebase Service
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > ./app/google-services.json

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ render.experimental.xml

# Keystore files
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json
Expand Down
112 changes: 111 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,111 @@
# HMH Android
# 하면함 Android

## 스마트폰 중독 탈출, 너도 하면함!
<br/>
<div align="center">
<p align="center">
<img src="https://img.shields.io/badge/Kotlin-1.9.20-7F52FF?style=for-the-badge&logo=Kotlin&logoColor=white"/>
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<img src="https://img.shields.io/badge/all_contributors-3-orange.svg?style=for-the-badge"/>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
</p>
<br />
</div>

<h2>Tech Stack</h2>

- [Android App Architecture](https://developer.android.com/topic/architecture)
- [Dagger-Hilt](https://developer.android.com/training/dependency-injection/hilt-android)
- [Kotlin Coroutines](https://kotlinlang.org/docs/coroutines-overview.html), [Flow](https://kotlinlang.org/docs/flow.html)
- [Jetpack Compose](https://developer.android.com/jetpack/compose)
- [Material 3](https://m3.material.io/)
- [Gradle Version Catalog](https://docs.gradle.org/current/userguide/platforms.html)
and [Custom Convention Plugins](https://docs.gradle.org/current/samples/sample_convention_plugins.html)

<h2>Activity Graph</h2>

![Alt](https://repobeats.axiom.co/api/embed/d2c401ae723c367a03ed9fb81ea6e6e7cfbee2ea.svg "Repobeats analytics image")

## Contributors ✨

하면한다는 Android 개발자

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/KwakEuiJin"><img src="https://avatars.githubusercontent.com/u/93872496?v=4?s=100" width="100px;" alt="Kwak EuiJin"/><br/><sub><b>KwakEuiJin</b></sub></a><br /><a href="https://github.com/Team-HMH/HMH-Android/commits?author=KwakEuiJin" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kangyuri1114"><img src="https://avatars.githubusercontent.com/u/83583757?v=4?s=100" width="100px;" alt="Kang Yuri"/><br/><sub><b>KangYuri</b></sub></a><br /><a href="https://github.com/Team-HMH/HMH-Android/commits?author=kangyuri1114" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/memoryBangwool"><img src="https://avatars.githubusercontent.com/u/84266681?v=4?s=100" width="100px;" alt="Kyoung JiHyun"/><br /><sub><b>JiHyun Kyoung</b></sub></a><br/><a href="https://github.com/Team-HMH/HMH-Android/commits?author=memoryBangwool" title="Code">💻</a></td>
</tr>
</tbody>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## Folder Tree 📁

- 📁 app
- 📁 build
- 📄 build.gradle.kts
- 📄 google-services.json
- 📁 libs
- 📄 proguard-rules.pro
- 📁 src
- 📁 build-logic
- 📁 convention
- 📁 gradle
- 📄 gradle.properties
- 📄 settings.gradle.kts
- 📄 build.gradle.kts
- 📁 buildSrc
- 📁 build
- 📄 build.gradle.kts
- 📄 gradle.properties
- 📄 settings.gradle.kts
- 📁 src
- 📁 core
- 📁 common
- 📁 database
- 📁 data
- 📁 usagestats
- 📁 domain
- 📁 usagestats
- 📁 feature
- 📁 login
- 📁 main
- 📁 onboarding
- 📁 statistics
- 📁 gradle
- 📄 libs.versions.toml
- 📁 wrapper
- 📄 gradle.properties
- 📄 gradlew
- 📄 gradlew.bat
- 📄 local.properties
- 📄 settings.gradle.kts

## Progress Board 📋
- [Team-HMH-Android](https://github.com/orgs/Team-HMH/projects/1)


## Code Convention 💻
- [Kotlin Code Convention](https://www.notion.so/msmmx/Kotlin-Convention-5ab4410e68c949c287804d2380c51af4)
- [XML Convention](https://www.notion.so/msmmx/XML-Convention-b11209ba2b404df08f251383c7d3c316)
- [name convention](https://www.notion.so/msmmx/name-convention-ca8bab7da7314b30b2a962755854b11e)
- [GitHub Convention](https://www.notion.so/msmmx/b75d3559813e478f9f6d73e9c818834b?pvs=4#bc0bf41e7df9421391dc1000d25a17c6)


This project follows the all-contributors specification. Contributions of any kind welcome!
32 changes: 22 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@ android {
versionName = libs.versions.appVersion.get()
}

signingConfigs {
getByName("debug") {
keyAlias = "android_debug_key"
keyPassword = "android"
storeFile = File("${project.rootDir.absolutePath}/keystore/debug.keystore")
storePassword = "android"
}
}

buildTypes {
debug {
isDebuggable = true
signingConfig = signingConfigs.getByName("debug")
}
release {
isMinifyEnabled = false
isDebuggable = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
Expand All @@ -28,16 +42,6 @@ android {
}

dependencies {
// Feature
implementation(projects.feature.onboarding)

// Core
implementation(projects.core.common)
implementation(projects.core.database)

// Feature
implementation(projects.feature.onboarding)
implementation(projects.feature.main)

// Feature
implementation(projects.feature.statistics)
Expand All @@ -57,4 +61,12 @@ dependencies {

// Splash
implementation(libs.splash.screen)

// Features
implementation(projects.feature.login)
implementation(projects.feature.onboarding)
implementation(projects.feature.main)

// kakao
implementation(libs.kakao.login)
}
23 changes: 20 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET" />

<uses-permission
android:name="android.permission.PACKAGE_USAGE_STATS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />


<application
android:name=".HMHApplication"
android:allowBackup="true"
Expand All @@ -25,10 +29,23 @@
android:theme="@style/Theme.App.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

<activity
android:name="com.kakao.sdk.auth.AuthCodeHandlerActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="oauth"
android:scheme="kakao${kakaoApiKey}" />
</intent-filter>
</activity>
</application>
</manifest>
24 changes: 9 additions & 15 deletions app/src/main/java/com/hmh/hamyeonham/SampleActivity.kt
Original file line number Diff line number Diff line change
@@ -1,45 +1,39 @@
package com.hmh.hamyeonham

import android.content.Intent
import android.os.Bundle
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import com.hmh.hamyeonham.common.view.viewBinding
import com.hmh.hamyeonham.databinding.ActivitySampleBinding
import com.hmh.hamyeonham.statistics.StaticsActivity
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class SampleActivity : AppCompatActivity() {
private lateinit var binding: ActivitySampleBinding
private val binding by viewBinding(ActivitySampleBinding::inflate)

override fun onCreate(savedInstanceState: Bundle?) {
binding = ActivitySampleBinding.inflate(layoutInflater)
super.onCreate(savedInstanceState)
val splashScreen = installSplashScreen()
initSplashAnimation(splashScreen)
setContentView(binding.root)
Intent(this, StaticsActivity::class.java).let(::startActivity)
}

private fun initSplashAnimation(splashScreen: SplashScreen) {
splashScreen.setOnExitAnimationListener { splashScreenViewProvider ->
val splashScreenView = splashScreenViewProvider.view
val fadeOut = AnimationUtils.loadAnimation(this, R.anim.fade_out)

fadeOut.setAnimationListener(
object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {}
fadeOut.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {}
override fun onAnimationEnd(animation: Animation) {
splashScreenViewProvider.remove()
}

override fun onAnimationEnd(animation: Animation) {
splashScreenViewProvider.remove()
}

override fun onAnimationRepeat(animation: Animation) {}
},
)
override fun onAnimationRepeat(animation: Animation) {}
})
splashScreenView.startAnimation(fadeOut)
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_sample.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black">
android:background="@color/white">

</androidx.constraintlayout.widget.ConstraintLayout>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import java.util.Properties

internal fun Project.configureAndroidCommonPlugin() {

val properties = Properties().apply {
load(rootProject.file("local.properties").inputStream())
}

apply<AndroidKotlinPlugin>()
apply<KotlinSerializationPlugin>()
with(plugins) {
Expand All @@ -18,7 +22,13 @@ internal fun Project.configureAndroidCommonPlugin() {
apply<AndroidHiltPlugin>()

extensions.getByType<BaseExtension>().apply {
defaultConfig {}
defaultConfig {
val kakaoApiKey = properties["kakaoApiKey"] as? String ?: ""

manifestPlaceholders["kakaoApiKey"] = properties["kakaoApiKey"] as String

buildConfigField("String", "KAKAO_API_KEY", "\"${kakaoApiKey}\"")
}
buildFeatures.apply {
viewBinding = true
buildConfig = true
Expand Down
1 change: 1 addition & 0 deletions feature/login/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
22 changes: 22 additions & 0 deletions feature/login/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
plugins {
hmh("feature")
alias(libs.plugins.kotlin.android)
}

android {
namespace = "com.hmh.hamyeonham.feature.login"
}

dependencies {
implementation(projects.core.common)
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.constraintlayout)

// kakao
implementation(libs.kakao.login)

implementation(libs.dot.indicator)
implementation(libs.coil.core)
}
Empty file.
21 changes: 21 additions & 0 deletions feature/login/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions feature/login/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity
android:name=".UserInfoActivity"
android:exported="false" />
<activity
android:name=".LoginActivity"
android:exported="false" />
</application>

</manifest>
Loading

0 comments on commit eb7f2ed

Please sign in to comment.