diff --git a/app/src/main/java/com/msg/gcms/presentation/view/intro/IntroActivity.kt b/app/src/main/java/com/msg/gcms/presentation/view/intro/IntroActivity.kt index 31097849..42e1176c 100644 --- a/app/src/main/java/com/msg/gcms/presentation/view/intro/IntroActivity.kt +++ b/app/src/main/java/com/msg/gcms/presentation/view/intro/IntroActivity.kt @@ -2,11 +2,13 @@ package com.msg.gcms.presentation.view.intro import android.content.Intent import android.net.Uri +import android.util.DisplayMetrics +import android.view.Display import android.view.View import android.widget.Toast import androidx.activity.viewModels -import com.google.firebase.messaging.FirebaseMessaging import androidx.compose.ui.unit.dp +import com.google.firebase.messaging.FirebaseMessaging import com.msg.gauthsignin.GAuthSigninWebView import com.msg.gauthsignin.component.GAuthButton import com.msg.gauthsignin.component.utils.Types @@ -38,12 +40,18 @@ class IntroActivity : BaseActivity(R.layout.activity_intro } private fun setGAuthButtonComponent() { + val display: Display = windowManager.defaultDisplay + val outMetrics = DisplayMetrics() + display.getMetrics(outMetrics) + val density = resources.displayMetrics.density + val dpWidth = outMetrics.widthPixels / density + binding.signInBtn.setContent { GAuthButton( style = Types.Style.DEFAULT, actionType = Types.ActionType.SIGNIN, colors = Types.Colors.OUTLINE, - horizontalPaddingValue = 80.dp + horizontalPaddingValue = (dpWidth / 2 - 120).dp ) { binding.gAuthWebView.visibility = View.VISIBLE setGAuthWebViewComponent() diff --git a/app/src/main/res/layout/activity_intro.xml b/app/src/main/res/layout/activity_intro.xml index 50fa764c..3fe9482a 100644 --- a/app/src/main/res/layout/activity_intro.xml +++ b/app/src/main/res/layout/activity_intro.xml @@ -180,10 +180,8 @@