-
Notifications
You must be signed in to change notification settings - Fork 0
[Refactor] 새로운 Intent 구조 적용 #400
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
Open
PeraSite
wants to merge
24
commits into
develop
Choose a base branch
from
refactor/typesafe-intent
base: develop
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 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
95e1da5
refactor: IntroActivity 새로운 Intent 구조 적용
PeraSite ccea94a
chore: companion object private 변경, androidx.core.content.IntentCompa…
PeraSite 76a1f20
feat: ActivityCompanion, ActivityCompanionWithArgs 분리
PeraSite 7786e8e
refactor: WebViewActivity 새 Intent 구조 적용
PeraSite e54505f
refactor: ForceUpdateDialogActivity 새 Intent 구조 적용
PeraSite 27029a2
refactor: LoginActivity 새 Intent 구조 적용
PeraSite c79d3d1
refactor: MainActivity 새 Intent 구조 적용
PeraSite f9373c6
chore: ActivityUtil.kt startActivity deprecate
PeraSite f3cbe9a
feat: 기본값으로 만들 수 있는 ActivityCompanionWithArgsDefault 추가
PeraSite 2b05847
refactor: SignOutActivity 새 Intent 구조 적용
PeraSite 9e2860d
refactor: WebViewActivity 호출 구조 변경
PeraSite 07a00fa
refactor: DeveloperActivity 새 Intent 구조 적용
PeraSite 6e96014
refactor: MyReviewListActivity 새 Intent 구조 적용
PeraSite a03b597
refactor: AndroidMessageDialogActivity 새 Intent 구조 적용
PeraSite a9a8bc9
chore: Default start 추가
PeraSite a096d62
refactor: UserInfoActivity 새 Intent 구조 적용
PeraSite 18e60af
refactor: ReportActivity 새 Intent 구조 적용
PeraSite 3371d2e
refactor: ModifyReviewActivity 새 Intent 구조 적용
PeraSite b6f4318
refactor: ReviewActivity 새 Intent 구조 적용
PeraSite 20db1c5
refactor: ReviewWriteRateActivity 새 Intent 구조 적용
PeraSite dec1a51
refactor: type-safe한 Fragment arguments
PeraSite 37ea8ea
Merge branch 'develop' into refactor/typesafe-intent
PeraSite 5a12705
docs: ActivityCompanion, FragmentCompanion 주석 추가
PeraSite 49eabf7
feat: FragmentCompanionWithArgsDefault 추가
PeraSite 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 hidden or 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 hidden or 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
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/eatssu/android/presentation/base/ActivityCompanion.kt
This file contains hidden or 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,39 @@ | ||
| package com.eatssu.android.presentation.base | ||
|
|
||
| import android.app.Activity | ||
| import android.content.Context | ||
| import android.content.Intent | ||
| import android.os.Build | ||
| import android.os.Parcelable | ||
| import kotlin.reflect.KClass | ||
|
|
||
| abstract class ActivityCompanion<IntentOptions>( | ||
| private val activityClass: KClass<out Activity>, | ||
| private val optionsClass: KClass<IntentOptions> | ||
| ) where IntentOptions : Parcelable { | ||
| companion object { | ||
| private const val INTENT_OPTIONS_KEY = "intent_options" | ||
| } | ||
|
|
||
| fun intent( | ||
| context: Context, | ||
| options: IntentOptions, | ||
| intentBuilder: Intent.() -> Unit = {} | ||
| ): Intent = | ||
| Intent(context, activityClass.java).apply { | ||
| putExtra(INTENT_OPTIONS_KEY, options) | ||
| intentBuilder() | ||
| } | ||
|
|
||
| fun start(context: Context, options: IntentOptions, intentBuilder: Intent.() -> Unit = {}) { | ||
| context.startActivity(intent(context, options, intentBuilder)) | ||
| } | ||
|
|
||
| val Activity.intentOptions: IntentOptions? | ||
| get() = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { | ||
| this.intent.getParcelableExtra<IntentOptions>(INTENT_OPTIONS_KEY, optionsClass.java) | ||
| } else { | ||
| @Suppress("DEPRECATION") | ||
| this.intent.getParcelableExtra<IntentOptions>(INTENT_OPTIONS_KEY) | ||
| } | ||
PeraSite marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or 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 hidden or 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
15 changes: 0 additions & 15 deletions
15
app/src/main/java/com/eatssu/android/presentation/widget/util/launchApp.kt
This file was deleted.
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.
Uh oh!
There was an error while loading. Please reload this page.