Skip to content

Commit

Permalink
Fix: 앱 바 오른쪽 버튼
Browse files Browse the repository at this point in the history
  • Loading branch information
skdud0629 committed Dec 14, 2024
1 parent 6ad88ff commit 538a377
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,47 +115,7 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() {
}

AppBarBase.getRightButtonId() -> {
dialogElapsedTime = System.currentTimeMillis() - dialogCurrentTime
reviewElapsedTime = System.currentTimeMillis() - reviewCurrentTime

showCallDialog()

if (intent.extras?.getBoolean(StoreDetailActivityContract.IS_BENEFIT) == true) {
EventLogger.logClickEvent(
EventAction.BUSINESS,
AnalyticsConstant.Label.BENEFIT_SHOP_CALL,
viewModel.store.value?.name ?: "Unknown",
EventExtra(
AnalyticsConstant.DURATION_TIME,
(dialogElapsedTime / 1000.0).toString()
)
)
} else {
EventLogger.logClickEvent(
EventAction.BUSINESS,
AnalyticsConstant.Label.SHOP_CALL,
(viewModel.store.value?.name
?: "Unknown"),
EventExtra(
AnalyticsConstant.DURATION_TIME,
(dialogElapsedTime / 1000.0).toString()
)

)
}
if (currentTab == 2) {// 리뷰탭에서 전화누르기까지 시간
EventLogger.logClickEvent(
EventAction.BUSINESS,
AnalyticsConstant.Label.SHOP_DETAIL_VIEW_REVIEW_BACK,
viewModel.store.value?.name ?: "Unknown",
EventExtra(AnalyticsConstant.PREVIOUS_PAGE, "리뷰"),
EventExtra(AnalyticsConstant.CURRENT_PAGE, currentPage),
EventExtra(
AnalyticsConstant.DURATION_TIME,
(reviewElapsedTime / 1000.0).toString()
)
)
}
toggleNavigationDrawer()
}
}
}
Expand Down Expand Up @@ -276,6 +236,24 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() {
.makeShort(getString(R.string.store_detail_wrong_store_id_message))
finish()
}

when (abtestName) {
ExperimentGroup.CALL_NUMBER -> {
binding.callFloatingButton.visibility = View.GONE
binding.storeDetailPhoneTextview.setTextColor(
ContextCompat.getColor(
this@StoreDetailActivity,
R.color.colorPrimary
)
)
}

ExperimentGroup.CALL_FLOATING -> {
binding.scrollUpButton.visibility = View.GONE
binding.storeDetailPhoneImage.visibility = View.GONE
}
}

viewModel.getStoreWithMenu(storeId!!)
viewModel.getShopMenus(storeId)
viewModel.getShopEvents(storeId)
Expand Down Expand Up @@ -340,6 +318,7 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() {
withLoading(this@StoreDetailActivity, viewModel)

observeLiveData(viewModel.variableName) {
abtestName = it
when (viewModel.variableName.value) {
ExperimentGroup.CALL_NUMBER -> {
EventLogger.logCustomEvent(
Expand All @@ -358,6 +337,8 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() {
}

ExperimentGroup.CALL_FLOATING -> {
binding.scrollUpButton.visibility = View.GONE
binding.storeDetailPhoneImage.visibility = View.GONE
EventLogger.logCustomEvent(
action = "AB_TEST",
category = "a/b test 로깅(전화하기)",
Expand Down Expand Up @@ -492,6 +473,8 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() {

if (currentTab == 2) {
reviewElapsedTime = System.currentTimeMillis() - reviewCurrentTime


EventLogger.logClickEvent(
EventAction.BUSINESS,
AnalyticsConstant.Label.SHOP_DETAIL_VIEW_REVIEW_BACK,
Expand Down Expand Up @@ -577,5 +560,6 @@ class StoreDetailActivity : KoinNavigationDrawerActivity() {
const val STORE_NAME = "storeName"
const val BACK_ACTION = "back_action"
var isABTestAssigned = false
var abtestName = ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,12 @@ class StoreDetailViewModel @Inject constructor(
private val _variableName = MutableLiveData<String>()
val variableName: LiveData<String> get() = _variableName


fun postABTestAssign(title: String) = viewModelScope.launchWithLoading {
abTestUseCase(title).onSuccess {
_variableName.value = it
}
}


fun getStoreWithMenu(storeId: Int) = viewModelScope.launchWithLoading {
getStoreWithMenuUseCase(storeId).also { store ->
_store.value = store
Expand Down
4 changes: 2 additions & 2 deletions koin/src/main/res/layout/store_activity_detail.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
app:leftButtonBackground="@drawable/ic_back_arrow"
app:leftButtonHeight="14dp"
app:leftButtonWidth="14dp"
app:rightButtonBackground="@drawable/ic_call"
app:rightButtonBackground="@drawable/ic_hamburger_button"
app:rightButtonHeight="24dp"
app:rightButtonWidth="24dp"
app:titleText="@string/nearby_store" />
Expand Down Expand Up @@ -453,4 +453,4 @@
<include layout="@layout/base_navigation_drawer_right" />

</androidx.drawerlayout.widget.DrawerLayout>
</layout>
</layout>

0 comments on commit 538a377

Please sign in to comment.