-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from mash-up-kr/develop
1.0.0 개발 완료
- Loading branch information
Showing
340 changed files
with
13,882 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions
13
app/src/main/java/com/mashup/gabbangzip/sharedalbum/MainApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
76 changes: 76 additions & 0 deletions
76
app/src/main/java/com/mashup/gabbangzip/sharedalbum/service/PicMessagingService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 알람" | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/mashup/gabbangzip/sharedalbum/utils/NotificationUtil.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
7 changes: 3 additions & 4 deletions
7
...rc/main/res/mipmap-anydpi/ic_launcher.xml → ...ain/res/mipmap-anydpi-v26/ic_launcher.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
7 changes: 3 additions & 4 deletions
7
...n/res/mipmap-anydpi/ic_launcher_round.xml → ...s/mipmap-anydpi-v26/ic_launcher_round.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.