Skip to content

Commit

Permalink
Merge pull request #241 from mash-up-kr/develop
Browse files Browse the repository at this point in the history
1.0.0 개발 완료
  • Loading branch information
SEO-J17 authored Aug 19, 2024
2 parents ab5c9b0 + 6e8dc99 commit 8b2c06a
Show file tree
Hide file tree
Showing 340 changed files with 13,882 additions and 271 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[{*.kt,*.kts}]
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
58 changes: 58 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Android CI

on:
pull_request:
branches: [ "develop" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
# 레포지토리에 접근할 수 있도록 checkout
- uses: actions/checkout@v4

# 빌드를 위한 기본 세팅
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

# gradle 빌드 캐싱
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
restore-keys: |
${{ runner.os }}-gradle-
# gradle 권한 부여
- name: Grant execute permission for gradlew
run: chmod +x gradlew

# ci 빌드를 위한 secrets 세팅
- name: Access github actions secrets
env:
KAKAO_NATIVE_APP_KEY: ${{ secrets.KAKAO_NATIVE_APP_KEY }}
run: |
echo kakao_native_app_key="$KAKAO_NATIVE_APP_KEY" > ./local.properties
# firebase위한 google-services.json 파일 생성
- name: Create google-services.json
env:
GOOGLE_SERVICE_JSON: ${{ secrets.GOOGLE_SERVICE_JSON }}
run: echo "$GOOGLE_SERVICE_JSON" > app/google-services.json

# ktlint
- name: Check ktlint
run: ./gradlew ktlintCheck

# 최종 빌드
- name: Build with Gradle
run: ./gradlew build
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# gabbangzip-Android
가자빵집으로 Android Repository

### Shortcuts
- [Code Convention](https://github.com/mash-up-kr/gabbangzip-Android/wiki/Code-Convention)
27 changes: 19 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,35 +1,43 @@
import com.mashup.gabbangzip.buildsrc.AppConfig
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties
import com.mashup.gabbangzip.sharedalbum.buildsrc.AppConfig

plugins {
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.hilt)
alias(libs.plugins.google.gms.google.services)
}

android {
namespace = AppConfig.appNameSpace
compileSdk = AppConfig.compileSdk

defaultConfig {
applicationId = AppConfig.applicationId
minSdk = AppConfig.minSdk
targetSdk = AppConfig.targetSdk
versionCode = AppConfig.appVersionCode
versionName = AppConfig.appVersionName


buildConfigField(
type = "String",
name = "KAKAO_NATIVE_APP_KEY",
value = "\"${gradleLocalProperties(rootDir, providers).getProperty("kakao_native_app_key")}\"",
)

testInstrumentationRunner = AppConfig.testRunner
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
}
Expand All @@ -51,14 +59,17 @@ dependencies {
implementation(project(":data"))
implementation(project(":domain"))
implementation(project(":presentation"))

implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.firebase.messaging)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))

implementation(libs.hilt)
kapt(libs.hilt.compiler)
}
implementation(libs.kakao.login)
implementation(libs.androidx.security.crypto)
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.mashup.gabbangzip.shared_album
package com.mashup.gabbangzip.sharedalbum

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand All @@ -21,4 +19,4 @@ class ExampleInstrumentedTest {
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.mashup.gabbangzip.shared_album", appContext.packageName)
}
}
}
28 changes: 25 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,38 @@
<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.POST_NOTIFICATIONS" />

<application
android:allowBackup="true"
android:name=".MainApplication"
android:allowBackup="false"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/Theme.SharedAlbum"
android:usesCleartextTraffic="true"
tools:targetApi="31">

<service
android:name=".service.PicMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>

<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/ic_launcher" />
<meta-data
android:name="firebase_messaging_auto_init_enabled"
android:value="false" />
<meta-data
android:name="firebase_analytics_collection_enabled"
android:value="false" />
</application>

</manifest>
</manifest>
Binary file added app/src/main/assets/lottie_login_fit.lottie
Binary file not shown.
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.mashup.gabbangzip.sharedalbum

import android.app.Application
import com.kakao.sdk.common.KakaoSdk
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
KakaoSdk.init(this, BuildConfig.KAKAO_NATIVE_APP_KEY)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package com.mashup.gabbangzip.sharedalbum.service

import android.app.NotificationChannel
import android.app.NotificationManager
import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.media.RingtoneManager
import android.util.Log
import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import com.mashup.gabbangzip.sharedalbum.R
import com.mashup.gabbangzip.sharedalbum.presentation.ui.splash.SplashActivity
import com.mashup.gabbangzip.sharedalbum.utils.NotificationUtil

class PicMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)

with(remoteMessage) {
notification?.let {
sendNotification(it.title, it.body)
}
}
}

private fun sendNotification(title: String?, body: String?) {
if (!title.isNullOrBlank() && !body.isNullOrBlank()) {
val intent = Intent(this, SplashActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
}

val requestCode = 0
val pendingIntent = PendingIntent.getActivity(
this,
requestCode,
intent,
PendingIntent.FLAG_IMMUTABLE,
)

val defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
val notificationBuilder = NotificationCompat.Builder(this, CHANNEL_ID)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(title)
.setContentText(body)
.setAutoCancel(true)
.setSound(defaultSoundUri)
.setContentIntent(pendingIntent)
.build()

val notificationManager =
getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val channel = NotificationChannel(
CHANNEL_ID,
CHANEL_NAME,
NotificationManager.IMPORTANCE_HIGH,
)

notificationManager.createNotificationChannel(channel)
notificationManager.notify(NotificationUtil.getNotificationId(), notificationBuilder)
} else {
Log.d("PicMessagingService", "sendNotification: title or body is null")
}
}

override fun onNewToken(token: String) {
super.onNewToken(token)
Log.d("PicMessagingService", "newToken: $token")
}

companion object {
private const val CHANNEL_ID = "PIC"
private const val CHANEL_NAME = "PIC 알람"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.mashup.gabbangzip.sharedalbum.utils

import java.security.SecureRandom

object NotificationUtil {
private val usedIdSet: HashSet<Int> = HashSet()
private val random: SecureRandom = SecureRandom()

fun getNotificationId(): Int {
return if (usedIdSet.size >= Integer.MAX_VALUE) {
usedIdSet.clear()
usedIdSet.add(0)
0
} else {
generateSequence { random.nextInt(Integer.MAX_VALUE) }
.first { it !in usedIdSet }
.also { usedIdSet.add(it) }
}
}
}
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="520"
android:viewportHeight="520">

<path android:fillColor="#333333" android:pathData="M4,0h512v512h-512z"/>

</vector>
20 changes: 20 additions & 0 deletions app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="320"
android:viewportHeight="320">
<group android:scaleX="0.41"
android:scaleY="0.41"
android:translateX="94.4"
android:translateY="94.4">

<path android:fillColor="#A880FE" android:fillType="evenOdd" android:pathData="M107.81,150C94.56,150 82.73,143.89 75,134.33C67.27,143.89 55.44,150 42.19,150C18.89,150 0,131.11 0,107.81C0,94.56 6.11,82.73 15.67,75C6.11,67.27 0,55.44 0,42.19C0,18.89 18.89,0 42.19,0C55.44,0 67.27,6.11 75,15.67C82.73,6.11 94.56,0 107.81,0C131.11,0 150,18.89 150,42.19C150,55.44 143.89,67.27 134.33,75C143.89,82.73 150,94.56 150,107.81C150,131.11 131.11,150 107.81,150Z"/>

<path android:fillColor="#FE9DD7" android:pathData="M170,75C170,33.58 203.58,0 245,0V0C286.42,0 320,33.58 320,75V149.4C320,149.73 319.73,150 319.4,150H170.6C170.27,150 170,149.73 170,149.4V75Z"/>

<path android:fillColor="#A5E63A" android:fillType="evenOdd" android:pathData="M41.67,170C18.65,170 0,188.65 0,211.67C0,225.3 6.54,237.4 16.66,245C6.54,252.6 0,264.7 0,278.33C0,301.35 18.65,320 41.67,320H108.33C131.35,320 150,301.35 150,278.33C150,264.7 143.46,252.6 133.34,245C143.46,237.4 150,225.3 150,211.67C150,188.65 131.35,170 108.33,170H41.67Z"/>

<path android:fillColor="#6F93FF" android:fillType="evenOdd" android:pathData="M293.91,280.55C293.9,280.56 293.9,280.57 293.89,280.57C293.93,280.59 293.96,280.61 294,280.63C293.97,280.61 293.94,280.58 293.91,280.55ZM225.16,301.14C225.15,301.13 225.13,301.12 225.11,301.12C225.1,301.18 225.09,301.25 225.08,301.31C225.11,301.25 225.13,301.2 225.16,301.14ZM264.43,305.69C264.43,305.5 264.42,305.31 264.41,305.13C264.83,306 265.36,306.82 266.02,307.58C271.29,313.63 282.42,313 290.87,306.17C299.32,299.34 301.89,288.89 296.62,282.84C296.26,282.42 295.86,282.03 295.45,281.68C296.4,282.27 297.45,282.71 298.57,283C306.49,285.05 315.25,278.31 318.13,267.95C321.01,257.6 316.93,247.55 309.02,245.49C309.8,245.39 310.57,245.21 311.33,244.94C319.03,242.24 322.19,231.88 318.39,221.8C314.62,211.83 305.44,205.87 297.78,208.36C298.18,207.97 298.54,207.54 298.87,207.09C303.58,200.61 300,190.38 290.88,184.23C281.77,178.07 270.56,178.34 265.86,184.81C265.69,185.04 265.53,185.28 265.38,185.52C265.43,185.12 265.45,184.72 265.45,184.31C265.45,176.41 256.43,170 245.3,170C234.17,170 225.15,176.41 225.15,184.31C225.15,184.45 225.15,184.58 225.15,184.72C225.01,184.49 224.86,184.26 224.7,184.04C219.99,177.57 208.79,177.31 199.67,183.46C190.55,189.61 186.98,199.85 191.68,206.32C191.89,206.61 192.11,206.88 192.35,207.15C184.66,204.54 175.4,210.51 171.61,220.54C167.81,230.62 170.97,240.98 178.68,243.68C179.35,243.92 180.04,244.09 180.73,244.2C172.82,246.26 168.75,256.3 171.63,266.65C174.51,277.02 183.26,283.76 191.18,281.71C191.52,281.62 191.85,281.52 192.17,281.41C191.98,281.59 191.81,281.78 191.64,281.98C186.36,288.03 189,298.53 197.53,305.42C206.06,312.31 217.24,312.99 222.51,306.94C223.22,306.13 223.79,305.23 224.22,304.27C224.15,304.74 224.12,305.21 224.12,305.69C224.12,313.59 233.14,320 244.27,320C255.4,320 264.43,313.59 264.43,305.69Z"/>

</group>
</vector>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
<background android:drawable="@drawable/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Binary file not shown.
4 changes: 2 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Shared-Album</string>
</resources>
<string name="app_name">PIC</string>
</resources>
Loading

0 comments on commit 8b2c06a

Please sign in to comment.