-
Notifications
You must be signed in to change notification settings - Fork 2
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
로띠 스플래시 액티비티 추가 #231
Merged
Merged
로띠 스플래시 액티비티 추가 #231
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/mashup/dorabangs/splash/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,38 @@ | ||
package com.mashup.dorabangs.splash | ||
|
||
import android.annotation.SuppressLint | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.provider.Settings | ||
import androidx.activity.ComponentActivity | ||
import androidx.activity.compose.setContent | ||
import androidx.activity.viewModels | ||
import androidx.compose.runtime.collectAsState | ||
import com.mashup.dorabangs.MainActivity | ||
import dagger.hilt.android.AndroidEntryPoint | ||
|
||
@SuppressLint("CustomSplashScreen") | ||
@AndroidEntryPoint | ||
class SplashActivity : ComponentActivity() { | ||
private val splashViewModel: SplashViewModel by viewModels() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
|
||
val userId = Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID) | ||
splashViewModel.checkUserToken(userId) | ||
|
||
setContent { | ||
SplashScreen() | ||
|
||
val firstEntryScreen = splashViewModel.firstEntryScreen.collectAsState() | ||
if (firstEntryScreen.value != FirstEntryScreen.Splash) { | ||
val intent = Intent(this, MainActivity::class.java) | ||
intent.putExtra("firstEntry", firstEntryScreen.value.name) | ||
intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION) | ||
startActivity(intent) | ||
finish() | ||
} | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
app/src/main/java/com/mashup/dorabangs/splash/SplashScreen.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,21 @@ | ||
package com.mashup.dorabangs.splash | ||
|
||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import com.mashup.dorabangs.core.designsystem.component.util.LottieLoader | ||
import com.mashup.dorabangs.core.designsystem.R as coreR | ||
|
||
@Composable | ||
fun SplashScreen() { | ||
Box(modifier = Modifier.fillMaxSize()) { | ||
LottieLoader( | ||
lottieRes = coreR.raw.splash, | ||
modifier = Modifier.align(Alignment.Center).size(126.dp), | ||
) | ||
} | ||
} |
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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import com.mashup.dorabangs.domain.model.Folder | |
import com.mashup.dorabangs.domain.utils.isValidUrl | ||
|
||
data class HomeState( | ||
val isLoading: Boolean = false, | ||
val isLoading: Boolean = true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why??? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. false로 했더니 액티비티 전환 시 컴포저블 보이고 로딩 도는 이슈가 있어서 바꿨므당 |
||
val isScrollLoading: Boolean = false, | ||
val clipBoardState: ClipBoardState = ClipBoardState(), | ||
val tapElements: List<FeedUiModel.DoraChipUiModel> = emptyList(), | ||
|
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.
이거도 같이할 생각 없나~
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.
ㅋㅋ이건 호현오빠한테 토스~