-
Notifications
You must be signed in to change notification settings - Fork 0
feat - 홈화면 작업 #63
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 - 홈화면 작업 #63
Changes from 12 commits
c74c847
c62cd3b
a15a442
4fe6e0a
bc88bc4
7130e5e
ae29cae
ae69488
843ac4a
dea12f5
41d48ad
c3b69cb
4189838
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -0,0 +1,48 @@ | ||||
| package com.apptive.japkor | ||||
|
|
||||
| import android.content.Intent | ||||
| import android.media.MediaPlayer | ||||
| import android.net.Uri | ||||
| import android.os.Bundle | ||||
| import androidx.activity.ComponentActivity | ||||
| import com.apptive.japkor.widget.FullscreenVideoView | ||||
|
|
||||
| class SplashActivity : ComponentActivity() { | ||||
| private var hasNavigated = false | ||||
|
|
||||
| override fun onCreate(savedInstanceState: Bundle?) { | ||||
| super.onCreate(savedInstanceState) | ||||
| setContentView(R.layout.activity_splash) | ||||
|
|
||||
| val videoView = findViewById<FullscreenVideoView>(R.id.splashVideo) | ||||
| val videoUri = Uri.parse("android.resource://${packageName}/${R.raw.n_splash}") | ||||
| videoView.setVideoURI(videoUri) | ||||
| videoView.setOnPreparedListener { mediaPlayer -> | ||||
| videoView.updateVideoSize(mediaPlayer.videoWidth, mediaPlayer.videoHeight) | ||||
| mediaPlayer.isLooping = false | ||||
| mediaPlayer.setVideoScalingMode( | ||||
| MediaPlayer.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING | ||||
| ) | ||||
| videoView.start() | ||||
| } | ||||
| videoView.setOnCompletionListener { | ||||
| videoView.stopPlayback() | ||||
| navigateToMain() | ||||
| } | ||||
| videoView.setOnErrorListener { _, _, _ -> | ||||
| navigateToMain() | ||||
| true | ||||
| } | ||||
| } | ||||
|
|
||||
| private fun navigateToMain() { | ||||
| if (hasNavigated) return | ||||
| hasNavigated = true | ||||
| val intent = Intent(this, MainActivity::class.java) | ||||
| intent.putExtras(this.intent) | ||||
|
||||
| intent.putExtras(this.intent) |
Copilot
AI
Jan 4, 2026
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.
The navigateToMain() function can be called from multiple sources (completion listener and error listener) without proper synchronization. Although hasNavigated flag is checked, this is not thread-safe and could lead to race conditions if both callbacks are triggered simultaneously.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||||||||||||||||||||||||||||||||||||||||||
| package com.apptive.japkor.data.api | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| import com.apptive.japkor.data.model.MatchingResponse | ||||||||||||||||||||||||||||||||||||||||||||||
| import retrofit2.Call | ||||||||||||||||||||||||||||||||||||||||||||||
| import retrofit2.http.GET | ||||||||||||||||||||||||||||||||||||||||||||||
| import retrofit2.http.POST | ||||||||||||||||||||||||||||||||||||||||||||||
| import retrofit2.http.Path | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| interface MatchingService { | ||||||||||||||||||||||||||||||||||||||||||||||
| @GET("members/matchings/female") | ||||||||||||||||||||||||||||||||||||||||||||||
| fun getFemaleMatchings(): Call<List<MatchingResponse>> | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| @POST("members/matchings/{matchingId}/select") | ||||||||||||||||||||||||||||||||||||||||||||||
| fun selectMatching(@Path("matchingId") matchingId: Long): Call<Void> | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+4
to
+14
|
||||||||||||||||||||||||||||||||||||||||||||||
| import retrofit2.Call | |
| import retrofit2.http.GET | |
| import retrofit2.http.POST | |
| import retrofit2.http.Path | |
| interface MatchingService { | |
| @GET("members/matchings/female") | |
| fun getFemaleMatchings(): Call<List<MatchingResponse>> | |
| @POST("members/matchings/{matchingId}/select") | |
| fun selectMatching(@Path("matchingId") matchingId: Long): Call<Void> | |
| import retrofit2.Response | |
| import retrofit2.http.GET | |
| import retrofit2.http.POST | |
| import retrofit2.http.Path | |
| interface MatchingService { | |
| @GET("members/matchings/female") | |
| suspend fun getFemaleMatchings(): Response<List<MatchingResponse>> | |
| @POST("members/matchings/{matchingId}/select") | |
| suspend fun selectMatching(@Path("matchingId") matchingId: Long): Response<Void> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,15 @@ class DataStoreManager(private val context: Context) { | |
| } | ||
| } | ||
|
|
||
| suspend fun clearUserInfo() { | ||
| context.dataStore.edit { prefs -> | ||
| prefs.remove(KEY_MEMBER_ID) | ||
| prefs.remove(KEY_NAME) | ||
| prefs.remove(KEY_TOKEN) | ||
| prefs.remove(KEY_STATUS) | ||
| } | ||
| } | ||
|
Comment on lines
+90
to
+97
|
||
|
|
||
| suspend fun clear() { | ||
| context.dataStore.edit { it.clear() } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.apptive.japkor.data.model | ||
|
|
||
| data class MatchingResponse( | ||
| val matchingId: Long, | ||
| val maleMemberId: Long, | ||
| val maleName: String, | ||
| val maleEmail: String, | ||
| val height: Int?, | ||
| val weight: Int?, | ||
| val residenceArea: String?, | ||
| val matchingOrder: Int, | ||
| val status: String | ||
| ) |
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.
The error handler for the video view returns true, which indicates the error was handled. However, the video is not properly cleaned up before navigating. Consider calling stopPlayback() before navigating to ensure resources are released properly.