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

[IDLE-000] AppsFlyer Deferred DeepLink 버그 수정 #158

Merged
merged 4 commits into from
Nov 14, 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
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
namespace = "com.idle.care"

defaultConfig {
versionCode = 15
versionName = "1.2.0"
versionCode = 17
versionName = "1.2.2"
targetSdk = 34

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down
9 changes: 9 additions & 0 deletions core/designresource/src/main/res/drawable/ic_call_inquiry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="25dp"
android:viewportWidth="24"
android:viewportHeight="25">
<path
android:pathData="M7.908,4.967L9.2,4.578C9.626,4.45 10.085,4.481 10.49,4.665C10.895,4.85 11.219,5.176 11.401,5.582L12.307,7.596C12.464,7.945 12.508,8.335 12.432,8.711C12.357,9.086 12.165,9.429 11.885,9.69L10.506,10.974C10.322,11.15 10.462,11.833 11.137,13.003C11.812,14.174 12.334,14.636 12.575,14.564L14.381,14.012C14.747,13.9 15.139,13.906 15.502,14.028C15.865,14.149 16.18,14.382 16.404,14.692L17.691,16.476C17.951,16.836 18.072,17.279 18.03,17.721C17.989,18.163 17.788,18.576 17.465,18.881L16.47,19.823C16.149,20.127 15.753,20.341 15.322,20.442C14.892,20.543 14.442,20.528 14.019,20.399C11.934,19.761 10.004,17.867 8.201,14.744C6.394,11.616 5.712,8.978 6.188,6.823C6.284,6.388 6.494,5.987 6.796,5.661C7.099,5.335 7.482,5.096 7.908,4.967Z"
android:fillColor="#26282E"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ internal fun WorkerJobPostingDetailScreen(
description = "${jobPostingDetail.centerName} | ${jobPostingDetail.centerOfficeNumber}",
titleLeftComponent = {
Image(
painter = painterResource(R.drawable.ic_call),
painter = painterResource(R.drawable.ic_call_inquiry),
contentDescription = null,
)
},
Expand Down
29 changes: 15 additions & 14 deletions presentation/src/main/java/com/idle/presentation/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.appsflyer.AppsFlyerLib
import com.appsflyer.deeplink.DeepLink
import com.appsflyer.deeplink.DeepLinkResult
import com.idle.analytics.AnalyticsEvent
import com.idle.analytics.businessmetric.AnalyticsHelper
Expand Down Expand Up @@ -245,26 +244,28 @@ class MainActivity : AppCompatActivity() {
private fun handleDeepLinking() {
AppsFlyerLib.getInstance().subscribeForDeepLink { deepLinkResult ->
when (deepLinkResult.status) {
DeepLinkResult.Status.FOUND -> handleDeepLink(deepLinkResult.deepLink)
DeepLinkResult.Status.FOUND -> {
val sharedJobPostingId =
deepLinkResult.deepLink.getStringValue("deep_link_value")
val sharedJobPostingType =
deepLinkResult.deepLink.getStringValue("deep_link_sub1")

handleDeepLink(sharedJobPostingId, sharedJobPostingType)
}

DeepLinkResult.Status.NOT_FOUND -> viewModel.errorLoggingHelper.logError(Exception("AppsFlyer User Not Found"))
else -> viewModel.errorLoggingHelper.logError(Exception(deepLinkResult.error.toString()))
}
}
}

private fun handleDeepLink(deepLink: DeepLink) {
try {
val sharedJobPostingId = deepLink.getStringValue("deep_link_value")
val sharedJobPostingType = deepLink.getStringValue("deep_link_sub1")
viewModel.setSharedJobPostingInfo(
SharedJobPostingInfo(
jobPostingId = sharedJobPostingId ?: return,
jobPostingType = JobPostingType.create(sharedJobPostingType ?: return)
)
private fun handleDeepLink(sharedJobPostingId: String?, sharedJobPostingType: String?) {
viewModel.setSharedJobPostingInfo(
SharedJobPostingInfo(
jobPostingId = sharedJobPostingId ?: return,
jobPostingType = JobPostingType.create(sharedJobPostingType ?: return)
)
} catch (e: Exception) {
viewModel.errorLoggingHelper.logError(e)
}
)
}

private fun showNetworkDialog() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class ForceUpdateFragment(private val forceUpdate: ForceUpdate) : DialogFragment

override fun onStart() {
super.onStart()
resizeDialog(1f, 0.25f)
val fontScale = resources.configuration.fontScale
resizeDialog(1f, 0.4f * fontScale)
}

private fun resizeDialog(width: Float, height: Float) {
Expand Down
107 changes: 57 additions & 50 deletions presentation/src/main/res/layout/fragment_force_update.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,69 @@
type="com.idle.presentation.forceupdate.ForceUpdateViewModel" />
</data>

<LinearLayout
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_dialog"
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="12dp"
android:paddingTop="20dp"
android:paddingBottom="12dp">

<TextView
style="@style/Subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/app_update_title"
android:textAlignment="center"
android:textColor="@color/gray_900" />

<TextView
style="@style/Body3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:text="@{viewModel.forceUpdate.noticeMsg}"
android:textAlignment="center"
android:textColor="@color/gray_500" />
android:layout_height="wrap_content">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:background="@drawable/shape_dialog"
android:gravity="center"
android:orientation="vertical"
android:paddingHorizontal="12dp"
android:paddingTop="20dp"
android:paddingBottom="12dp">

<TextView
style="@style/Subtitle1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:text="@string/app_update_title"
android:textAlignment="center"
android:textColor="@color/gray_900" />

<TextView
style="@style/Body3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="24dp"
android:ellipsize="end"
android:maxLines="3"
android:text="@{viewModel.forceUpdate.noticeMsg}"
android:textAlignment="center"
android:textColor="@color/gray_500" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<Button
android:id="@+id/dialog_left_BTN"
style="@style/Heading4"
android:layout_width="0dp"
android:layout_height="52dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/shape_button_white"
android:onClick="@{()->viewModel.dismiss()}"
android:text="@string/end_short"
android:textColor="@color/gray_300" />
<Button
android:id="@+id/dialog_left_BTN"
style="@style/Heading4"
android:layout_width="0dp"
android:layout_height="52dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/shape_button_white"
android:onClick="@{()->viewModel.dismiss()}"
android:text="@string/end_short"
android:textColor="@color/gray_300" />

<Button
android:id="@+id/dialog_right_BTN"
style="@style/Heading4"
android:layout_width="0dp"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@drawable/shape_button_red"
android:backgroundTint="@color/orange_500"
android:onClick="@{()->viewModel.update()}"
android:text="@string/app_update"
android:textColor="@color/white" />
<Button
android:id="@+id/dialog_right_BTN"
style="@style/Heading4"
android:layout_width="0dp"
android:layout_height="52dp"
android:layout_weight="1"
android:background="@drawable/shape_button_red"
android:backgroundTint="@color/orange_500"
android:onClick="@{()->viewModel.update()}"
android:text="@string/app_update"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
</layout>