-
Notifications
You must be signed in to change notification settings - Fork 30
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
부산대 Android_김주송_6주차 과제 (STEP2) #75
Open
jooiss
wants to merge
120
commits into
kakao-tech-campus-2nd-step2:jooiss
Choose a base branch
from
jooiss:jooiss-step2
base: jooiss
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
120 commits
Select commit
Hold shift + click to select a range
04c907f
Initial commit
MyStoryG 8b097b3
Initial commit
MyStoryG eeebf44
docs: Update README.md
jooiss c032344
feat: Design search layout
jooiss f011ead
feat: Add place database
jooiss a289932
fix: Add trigger to prevent storing duplicate data
jooiss 121176b
feat: Design search recyclerView and place recyclerView
jooiss 05af938
feat: Set the layout to be displayed
jooiss 166b988
docs: Update README.md
jooiss 34627be
feat: Add search function of place list
jooiss ca0170c
refactor: change place list item
jooiss 400b36f
refactor: resize search list item layout
jooiss cf1cfe3
feat: Add storing function of record list
jooiss bbf77e9
Initial commit
MyStoryG e0916b7
fix: Resolve conflict
jooiss df4cb5e
fix: Exclude kakao map dependency
jooiss c86d1d0
docs: Update README.md
jooiss 3242db7
feat: Add database insert function
jooiss fd929f2
fix: Resolve screen-off feature
jooiss d50c57e
feat: Set API key value for kakao API integration
jooiss 93f3d31
feat: Add data transfer object file
jooiss 3b25cb4
feat: Add retrofit interface
jooiss 0ae951c
refactor: Combine data activity and place activity
jooiss 3d9c0a1
feat: Add retrofit object
jooiss 55aef9e
feat: Update network security configuration
jooiss 7381db6
feat: Add database insertion function
jooiss e52f182
refactor: Extract string to file
jooiss bf0301d
refactor: Change the search item design
jooiss ac3b1a5
feat: Reset the data at first
jooiss 67f2174
feat: Change to category search
jooiss bb02709
docs: Update README.md
jooiss 381d789
feat: Add kakao native app key
jooiss 160ca07
feat: Add dependency about kakao map SDK
jooiss 75e407a
feat: Design map layout
jooiss 311395a
feat: Add map view function using the kakao map API
jooiss 6ef3184
fix: Resolve file redundancy
jooiss ff3d529
fix: set text to be written in one line
jooiss f1e692d
refactor: Change DTO file name
jooiss 4cf9b86
fix: Make API key resource not be saved
jooiss 68f9aa8
fix: Call MapView method in time for activity
jooiss 51f84de
fix: Change lifecycle function about kakao map API
jooiss 36b98d5
fix: Change CategoryGroup finding method
jooiss 17351fa
refactor: Separate the Retrofit network-related function
jooiss 858022d
fix: Resolve conflict
jooiss f1c101f
부산대 Android_김주송_4주차 과제 (STEP0) (#19)
jooiss 1b66d98
docs: Update README.md
jooiss 37bad8f
refactor: Delete unnecessary files
jooiss 34e1c44
feat: Change search method by keyword
jooiss 4f84a78
feat: Display search result on selecting a saved search record
jooiss 305453d
Initial commit
MyStoryG 4ef142d
feat: Display modal when clicking on place list
jooiss 7cd48c3
feat: Show error message when onMapError
jooiss 23e8fb5
feat: Resume from last position on restart
jooiss 072cae8
test: Add UI test code for PlaceActivity
jooiss caeef42
test: Add UI test code for MapActivity
jooiss fa1b72e
test: Add unit test code for MapActivity
jooiss 96d0b32
test: Add unit test code for PlaceActivity
jooiss 32efd23
Merge branch 'jooiss' into jooiss-step2
jooiss 262badf
fix: Update UI test code for PlaceActivity
jooiss b45160d
docs: Update README.md
jooiss fa6d396
부산대 Android_김주송_4주차 과제 (STEP1) (#71)
jooiss ce86697
Merge branch 'jooiss' into jooiss-step2
LeeOhHyung b031b03
fix: Resolve merge conflict
jooiss 7b7d977
refactor: Reorganize files according to data/domain/UI layer
jooiss 13d54b7
chore: Rename application file name
jooiss df99297
부산대 Android_김주송_5주차 과제 (STEP0) (#13)
jooiss 9c1cc33
refactor: Reorganize files according to clean architecture
jooiss 07ca11a
refactor: Apply DataBinding in MapActivity and PlaceActivity
jooiss 3d3422f
docs: Update README.md
jooiss 3da6e0a
feat: Add Place entity
jooiss 1952a0c
feat: Add DAO interface
jooiss a4735b4
feat: Add Database
jooiss 527049c
feat: Implement DBClient for managing Room database instance
jooiss 0ce0756
refactor: Integrate Room database for data storage
jooiss 732c846
test: Update test code for modified code
jooiss dea3346
refactor: Add dependency injection for Retrofit
jooiss 0ea2c12
chore: Change Retrofit repository file name
jooiss 7467bda
refactor: Add dependency injection for Database
jooiss 545c937
refactor: Add dependency injection for SharedPreferences
jooiss cca9f1a
Merge branch 'jooiss' into jooiss-step1
jooiss 820f7ce
fix: Resolve conflict
jooiss 62b775e
refactor: Separate Domain and Data layers for Place representation
jooiss 11b2476
feat: Handle duplicate entries to maintain data integrity
jooiss 3cf9a2d
refactor: Remove unnecessary code
jooiss 99d66d9
feat: Add indices on 'name' and 'address' columns in PlaceEntity
jooiss 7a16ce0
refactor: Add dependency injection for latitude and longitude
jooiss 6830125
부산대 Android_김주송_5주차 과제 (STEP1) (#27)
jooiss 8af347a
docs: Update README.md
jooiss 370283c
chore: Rename place layout file
jooiss 81cfd65
refactor: Inject PlaceDao directly into PlaceRepository
jooiss 36a37b2
refactor: Implement ViewModel and LiveData for PlaceActivity
jooiss 1a2f184
refactor: Implement ViewModel and LiveData for MapActivity
jooiss 82a42c4
refactor: Apply DataBinding for PlaceRecyclerViewAdapter
jooiss 07fa517
refactor: Apply DataBinding for SearchRecyclerViewAdapter
jooiss 3d492f3
refactor: Add notifyDataSetChanged in RecyclerViewAdapter
jooiss 3d22b95
refactor: Apply DataBinding for map error situation
jooiss 6894e95
refactor: Remove unnecessary code
jooiss 8e6a69c
fix: Resolve conflict
jooiss 26e3138
refactor: Replace startActivity with registerForActivityResult
jooiss 938bbd7
refactor: Change LayoutManager configuration to XML
jooiss ccf29f9
refactor: Use coroutines for asynchronous network calls with Retrofit
jooiss 8be1e46
refactor: Consolidate Place-related LiveData into PlaceUiModel data c…
jooiss f91ae8d
fix: Resolve conflict
jooiss 90015ce
refactor: Remove unnecessary import
jooiss 5a9603e
docs: Update README.md
jooiss 83c7fc6
feat: Configure Firebase for development
jooiss 0a733fe
feat: Add initial screen setup based on Firebase parameter value
jooiss dc3720b
chore: Remove unnecessary layout file
jooiss 102d87f
chore: Change Splash activity and layout
jooiss cf7de19
refactor: Manage Remote config data using DI and ViewModel
jooiss 9d326ac
docs: Update README.md
jooiss a0a778b
feat: Enable background notifications for FCM
jooiss 3eb770e
feat: Enable foreground notifications for FCM
jooiss 147ddf9
chore: Change foreground notification function name
jooiss 314d5a4
Merge branch 'jooiss' into jooiss-step2
jooiss 4792787
refactor: Change file package structure
jooiss ab1e21b
refactor: Devide serviceMessage livedata observer
jooiss 6225a67
fix: Handle serviceMessage errors correctly
jooiss 33cfdd6
refactor: Move Remote config initialization to Application class
jooiss efbaa88
refactor: Handle notification channel creation during notification re…
jooiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
35 changes: 34 additions & 1 deletion
35
app/src/main/java/campus/tech/kakao/map/KakaoMapApplication.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 |
---|---|---|
@@ -1,14 +1,47 @@ | ||
package campus.tech.kakao.map | ||
|
||
import android.app.Application | ||
import campus.tech.kakao.map.BuildConfig | ||
import android.util.Log | ||
import com.google.firebase.remoteconfig.FirebaseRemoteConfig | ||
import com.google.firebase.remoteconfig.remoteConfigSettings | ||
import com.kakao.vectormap.KakaoMapSdk | ||
import dagger.hilt.android.HiltAndroidApp | ||
|
||
|
||
@HiltAndroidApp | ||
class KakaoMapApplication : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
initRemoteConfig() | ||
fetchRemoteConfig() | ||
KakaoMapSdk.init(this, BuildConfig.KAKAO_API_KEY) | ||
} | ||
|
||
private fun initRemoteConfig() { | ||
remoteConfig = FirebaseRemoteConfig.getInstance() | ||
val configSettings = remoteConfigSettings { | ||
minimumFetchIntervalInSeconds = 0 | ||
} | ||
remoteConfig.setConfigSettingsAsync(configSettings) | ||
} | ||
|
||
private fun fetchRemoteConfig() { | ||
remoteConfig.fetchAndActivate().addOnCompleteListener { task -> | ||
if (task.isSuccessful) { | ||
val serviceState = remoteConfig.getString("serviceState") | ||
val serviceMessage = remoteConfig.getString("serviceMessage") | ||
Log.d("RemoteConfig", "Service State: $serviceState, Service Message: $serviceMessage") | ||
} | ||
else { | ||
val serviceMessage = remoteConfig.getString("serviceMessage") | ||
val e = task.exception | ||
Log.e("RemoteConfig", "Fetch and activate failed", e) | ||
} | ||
} | ||
} | ||
|
||
companion object { | ||
lateinit var remoteConfig: FirebaseRemoteConfig | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
app/src/main/java/campus/tech/kakao/map/MapFirebaseMessagingService.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,65 @@ | ||
package campus.tech.kakao.map | ||
|
||
import android.app.NotificationChannel | ||
import android.app.NotificationManager | ||
import android.app.PendingIntent | ||
import android.content.Context | ||
import android.content.Intent | ||
import android.util.Log | ||
import androidx.core.app.NotificationCompat | ||
import campus.tech.kakao.map.ui.SplashActivity | ||
import com.google.firebase.messaging.FirebaseMessagingService | ||
import com.google.firebase.messaging.RemoteMessage | ||
|
||
class MapFirebaseMessagingService : FirebaseMessagingService() { | ||
override fun onMessageReceived(remoteMessage: RemoteMessage) { | ||
Log.d("notification", "From: ${remoteMessage.from}") | ||
|
||
remoteMessage.notification?.let { | ||
Log.d("notification", "Message Notification Body: ${it.body}") | ||
} | ||
|
||
if (remoteMessage.notification != null) { | ||
createNotificationChannel() | ||
sendNotification() | ||
} | ||
} | ||
|
||
private fun sendNotification() { | ||
val intent = Intent(this, SplashActivity::class.java).apply { | ||
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK | ||
} | ||
val pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE) | ||
val builder = NotificationCompat.Builder(this, CHANNEL_ID) | ||
.setSmallIcon(R.drawable.ic_launcher_foreground) | ||
.setContentTitle("[중요] 포그라운드 알림") | ||
.setContentText("앱이 실행 중입니다.") | ||
.setPriority(NotificationCompat.PRIORITY_DEFAULT) | ||
.setContentIntent(pendingIntent) | ||
.setStyle( | ||
NotificationCompat.BigTextStyle() | ||
.bigText("앱이 실행 중일 때는 포그라운드 알림이 발생합니다.") | ||
) | ||
.setAutoCancel(true) | ||
|
||
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager | ||
notificationManager.notify(NOTIFICATION_ID, builder.build()) | ||
} | ||
|
||
private fun createNotificationChannel() { | ||
val name = getString(R.string.channel_name) | ||
val descriptionText = getString(R.string.channel_description) | ||
val importance = NotificationManager.IMPORTANCE_DEFAULT | ||
val channel = NotificationChannel(CHANNEL_ID, name, importance) | ||
channel.description = descriptionText | ||
val notificationManager: NotificationManager = getSystemService(NOTIFICATION_SERVICE) as NotificationManager | ||
notificationManager.createNotificationChannel(channel) | ||
} | ||
|
||
|
||
companion object { | ||
private const val NOTIFICATION_ID = 1 | ||
private const val CHANNEL_ID = "notification_default_channel" | ||
} | ||
|
||
} |
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
app/src/main/java/campus/tech/kakao/map/data/SplashModule.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,26 @@ | ||
package campus.tech.kakao.map.data | ||
|
||
import com.google.firebase.Firebase | ||
import com.google.firebase.remoteconfig.FirebaseRemoteConfig | ||
import com.google.firebase.remoteconfig.remoteConfig | ||
import com.google.firebase.remoteconfig.remoteConfigSettings | ||
import dagger.Module | ||
import dagger.Provides | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
object SplashModule { | ||
@Provides | ||
@Singleton | ||
fun provideFirebaseRemoteConfig(): FirebaseRemoteConfig { | ||
val remoteConfig: FirebaseRemoteConfig = Firebase.remoteConfig | ||
val configSettings = remoteConfigSettings { | ||
minimumFetchIntervalInSeconds = 0 | ||
} | ||
remoteConfig.setConfigSettingsAsync(configSettings) | ||
return remoteConfig | ||
} | ||
} |
44 changes: 0 additions & 44 deletions
44
app/src/main/java/campus/tech/kakao/map/ui/LoadingActivity.kt
This file was deleted.
Oops, something went wrong.
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
4 changes: 3 additions & 1 deletion
4
...pus/tech/kakao/map/domain/PlaceUiModel.kt → .../campus/tech/kakao/map/ui/PlaceUiModel.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
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
42 changes: 42 additions & 0 deletions
42
app/src/main/java/campus/tech/kakao/map/ui/SplashActivity.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,42 @@ | ||
package campus.tech.kakao.map.ui | ||
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
import androidx.databinding.DataBindingUtil | ||
import campus.tech.kakao.map.KakaoMapApplication | ||
import campus.tech.kakao.map.R | ||
import campus.tech.kakao.map.databinding.SplashLayoutBinding | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.delay | ||
import kotlinx.coroutines.launch | ||
|
||
@AndroidEntryPoint | ||
class SplashActivity : AppCompatActivity() { | ||
|
||
private lateinit var splashBinding: SplashLayoutBinding | ||
private val splashDisplayLength: Long = 1000 | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
splashBinding = DataBindingUtil.setContentView(this, R.layout.splash_layout) | ||
|
||
val remoteConfig = KakaoMapApplication.remoteConfig | ||
val serviceState = remoteConfig.getString("serviceState") | ||
val serviceMessage = remoteConfig.getString("serviceMessage") | ||
|
||
CoroutineScope(Dispatchers.Main).launch { | ||
delay(splashDisplayLength) | ||
if (serviceState == "ON_SERVICE") { | ||
val intent = Intent(this@SplashActivity, MapActivity::class.java) | ||
startActivity(intent) | ||
finish() | ||
} | ||
else { | ||
splashBinding.tvError.text = serviceMessage | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service 컴포넌트는 ui 패키지와는 별도의 공간에 두는편입니다. (물론 정답은 없습니다.)
아래 3가지 정도가 제가 본 일반적인 방법들인것 같습니다.