Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Firebase 권한 규칙 수정 #133

Merged
merged 4 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
versionName "1.0"

buildConfigField "String", "BASE_URL", properties["base_url"]

buildConfigField "String", "FIREBASE_RULE_UID", properties["firebase_rule_uid"]
buildConfigField("String", "KAKAO_APP_KEY", "\"${properties.get('KAKAO_APP_KEY')}\"")
manifestPlaceholders = [KAKAO_APP_KEY: properties.get('KAKAO_APP_KEY')]

Expand Down
Binary file modified app/src/main/ic_motivoo-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
Expand Up @@ -12,9 +12,9 @@ import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.tasks.await
import sopt.motivoo.BuildConfig
import sopt.motivoo.di.IoDispatcher
import sopt.motivoo.domain.repository.FirebaseRepository
import sopt.motivoo.util.Constants.USERS
import javax.inject.Inject

class FirebaseRepositoryImpl @Inject constructor(
Expand All @@ -23,12 +23,12 @@ class FirebaseRepositoryImpl @Inject constructor(
) : FirebaseRepository {
override suspend fun getStepCount(id: Long): Long? {
return CoroutineScope(ioDispatcher).async {
(firebaseRealtimeDatabase.reference.child(USERS).child(id.toString()).get().await().value as? Long)
(firebaseRealtimeDatabase.reference.child(BuildConfig.FIREBASE_RULE_UID).child(id.toString()).get().await().value as? Long)
}.await()
}

override fun getUpdatedStepCount(otherId: Long): Flow<Int> = callbackFlow<Int> {
val ref = firebaseRealtimeDatabase.reference.child(USERS)
val ref = firebaseRealtimeDatabase.reference.child(BuildConfig.FIREBASE_RULE_UID)
val listener = ref.addValueEventListener(object : ValueEventListener {
override fun onDataChange(snapshot: DataSnapshot) {
trySend(snapshot.child(otherId.toString()).getValue(Int::class.java) ?: return)
Expand All @@ -46,7 +46,7 @@ class FirebaseRepositoryImpl @Inject constructor(
}

override fun setUserStepCount(userId: Long, myStepCount: Int) {
firebaseRealtimeDatabase.reference.child(USERS).child(userId.toString())
firebaseRealtimeDatabase.reference.child(BuildConfig.FIREBASE_RULE_UID).child(userId.toString())
.setValue(myStepCount)
}
}
49 changes: 34 additions & 15 deletions app/src/main/res/drawable/ic_motivoo_foreground.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,47 @@
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="410"
android:viewportHeight="410">
<group android:scaleX="0.67"
android:scaleY="0.67"
android:translateX="67.65"
android:translateY="67.65">
android:viewportWidth="183"
android:viewportHeight="116">
<group android:scaleX="0.45"
android:scaleY="0.2852459"
android:translateX="50.325"
android:translateY="41.455738">
<path
android:pathData="M0,0h410v410h-410z"
android:fillColor="#ffffff"/>
android:pathData="M13.5,67.03C13.5,94.69 29.29,106.97 38.76,106.97H182.89V1.79C182.89,1.04 182.34,0.44 181.66,0.44H78.6C77.92,0.44 77.37,1.04 77.37,1.79V25.28C77.37,26.27 76.64,27.07 75.73,27.07H48.96C28.79,27.07 13.5,44.96 13.5,67.02V67.03Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="63.82"
android:startY="-36.05"
android:endX="168.13"
android:endY="131.97"
android:type="linear">
<item android:offset="0" android:color="#FFFFA6A2"/>
<item android:offset="0.26" android:color="#FFFF756E"/>
<item android:offset="0.49" android:color="#FFFF6259"/>
<item android:offset="0.71" android:color="#FFFF473C"/>
<item android:offset="1" android:color="#FFF62E21"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M247.92,262.77L240.52,310.47C240.33,311.68 238.82,312.12 238.01,311.21L202.63,271.61C201.42,270.25 199.38,270.01 197.88,271.05L148.05,305.4C147,306.13 145.6,305.24 145.81,303.98L155.5,245.8C155.81,243.95 154.65,242.17 152.83,241.71L90.75,225.8C89.51,225.48 89.27,223.82 90.37,223.16L144.88,190.47C146.34,189.6 146.99,187.82 146.44,186.21L121.19,112.28C120.75,110.99 122.16,109.87 123.32,110.58L188.98,151.19C190.48,152.12 192.42,151.83 193.59,150.52L238.18,100.22C239.03,99.26 240.6,99.79 240.71,101.06L245.23,158.46C245.38,160.33 246.93,161.77 248.81,161.79L301.23,162.11C302.37,162.12 303.05,163.39 302.43,164.35L273.93,208.16C272.96,209.66 273.22,211.64 274.55,212.82L313.46,247.63C314.37,248.45 313.92,249.95 312.72,250.14L250.94,259.75C249.38,259.99 248.16,261.21 247.92,262.77L247.92,262.77Z">
android:pathData="M38.01,106.97V111.24C38.01,113.59 39.81,115.5 42.03,115.5H178.86C181.09,115.5 182.89,113.59 182.89,111.24V106.97H38.01Z">
<aapt:attr name="android:fillColor">
<gradient
android:startX="248.12"
android:startY="101.87"
android:endX="125.81"
android:endY="299.62"
android:startX="110.25"
android:startY="104.9"
android:endX="110.9"
android:endY="117.52"
android:type="linear">
<item android:offset="0" android:color="#FF1AC9FF"/>
<item android:offset="1" android:color="#C187E3FF"/>
<item android:offset="0" android:color="#FF000C73"/>
<item android:offset="0.97" android:color="#FF283186"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M9.66,35.54C11.92,34.5 14.38,34.1 16.89,34.16C18.04,28.3 21.47,22.98 27.21,20.44C32.5,18.09 38.72,18.46 44.56,20.11C45.62,17.83 47.23,15.77 49.5,14.12C52.8,11.71 57.14,10.41 61.23,10.74C66.24,11.15 70.25,13.59 73.27,17.53C74.22,18.76 73.45,20.71 72.24,21.44C70.77,22.31 69.25,21.63 68.31,20.41C65.1,16.23 59.29,15.39 54.67,17.65C52.53,18.71 51.02,20.24 50.04,22.06C51.83,22.82 53.52,23.66 55.08,24.54C59.37,26.97 63.38,30.15 66.43,34.03C69.23,37.58 71.89,42.6 70.28,47.21C68.56,52.11 63.46,52.64 59.14,51.09C54.36,49.37 50.67,45.96 47.72,41.92C44.35,37.33 42.48,31.25 43.06,25.62C40.75,24.99 38.4,24.62 36.1,24.62C32.74,24.61 29.51,25.09 26.91,27.34C24.57,29.36 23.17,32.08 22.51,35.03C27.15,36.29 31.61,38.75 34.97,41.39C38.47,44.14 41.22,47.7 42.83,51.84C44.65,56.5 44.08,62.37 38.34,63.74C33.4,64.92 28.22,61.79 24.89,58.42C21.59,55.07 19.42,50.84 17.81,46.47C17.03,44.36 16.59,42.1 16.48,39.82C15.88,39.8 15.3,39.82 14.73,39.9C7.31,40.91 5.08,49.22 8.04,55.17C9.68,58.45 4.73,61.35 3.09,58.05C-0.91,50.03 0.89,39.58 9.64,35.55L9.66,35.54ZM49.56,33.39C50.67,36.77 53.04,39.88 55.61,42.31C56.8,43.43 58.12,44.41 59.6,45.13C60.7,45.66 62.64,46.59 63.9,46.26C66.77,45.49 63.78,40.19 62.97,38.94C61.07,36.02 58.34,33.53 55.49,31.54C53.42,30.1 51.1,28.76 48.66,27.64C48.62,29.54 48.94,31.5 49.56,33.39ZM30.6,55.88C32.03,57.03 38.24,60.38 38.16,56.42C38.1,53.44 35.79,50.14 33.83,48.06C31.31,45.37 28.11,43.35 24.7,41.97C23.94,41.66 23.13,41.34 22.28,41.05C23.06,46.69 26.42,52.51 30.6,55.88H30.6Z"
android:strokeWidth="0.3"
android:fillColor="#000C73"
android:strokeColor="#000C73"/>
</group>
</vector>
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_motivoo.xml
Original file line number Diff line number Diff line change
@@ -1,5 +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_motivoo_background"/>
<background android:drawable="@color/ic_motivoo_background"/>
<foreground android:drawable="@drawable/ic_motivoo_foreground"/>
</adaptive-icon>
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_motivoo_round.xml
Original file line number Diff line number Diff line change
@@ -1,5 +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_motivoo_background"/>
<background android:drawable="@color/ic_motivoo_background"/>
<foreground android:drawable="@drawable/ic_motivoo_foreground"/>
</adaptive-icon>
Binary file modified app/src/main/res/mipmap-hdpi/ic_motivoo.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-hdpi/ic_motivoo_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_motivoo.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-mdpi/ic_motivoo_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_motivoo.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_motivoo_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_motivoo.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_motivoo_round.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_motivoo.webp
Binary file not shown.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_motivoo_round.webp
Binary file not shown.
4 changes: 4 additions & 0 deletions app/src/main/res/values/ic_motivoo_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_motivoo_background">#FFFFFF</color>
</resources>
Loading