fix(splash): 스플래시 화면 구성을 단순화한다
This commit is contained in:
@@ -2,13 +2,11 @@ package kr.co.vividnext.sodalive.splash
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.view.View
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.net.toUri
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import com.google.firebase.ktx.Firebase
|
||||
import com.google.firebase.remoteconfig.ktx.get
|
||||
@@ -31,40 +29,10 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setLayoutParams(binding.llBottom, start = 0, end = 0, top = 0, bottom = 68)
|
||||
|
||||
setupRemoteConfig()
|
||||
fetchAndroidLatestVersion()
|
||||
}
|
||||
|
||||
private fun setLayoutParams(
|
||||
view: View,
|
||||
start: Int = 0,
|
||||
end: Int = 0,
|
||||
top: Int = 0,
|
||||
bottom: Int = 0
|
||||
) {
|
||||
val lp = view.layoutParams as ConstraintLayout.LayoutParams
|
||||
|
||||
if (top > 0) {
|
||||
lp.topMargin = screenHeight * top / 2337
|
||||
}
|
||||
|
||||
if (bottom > 0) {
|
||||
lp.bottomMargin = screenHeight * bottom / 2337
|
||||
}
|
||||
|
||||
if (start > 0) {
|
||||
lp.leftMargin = screenWidth * start / 1080
|
||||
}
|
||||
|
||||
if (end > 0) {
|
||||
lp.rightMargin = screenWidth * end / 1080
|
||||
}
|
||||
|
||||
view.layoutParams = lp
|
||||
}
|
||||
|
||||
private fun setupRemoteConfig() {
|
||||
val configSettings = remoteConfigSettings {
|
||||
minimumFetchIntervalInSeconds = 60
|
||||
@@ -145,7 +113,7 @@ class SplashActivity : BaseActivity<ActivitySplashBinding>(ActivitySplashBinding
|
||||
startActivity(
|
||||
Intent(
|
||||
Intent.ACTION_VIEW,
|
||||
Uri.parse("market://details?id=${BuildConfig.APPLICATION_ID}")
|
||||
"market://details?id=${BuildConfig.APPLICATION_ID}".toUri()
|
||||
)
|
||||
)
|
||||
finish()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.1 MiB |
@@ -1,23 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:contentDescription="@null"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/splash_bg"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/black">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
@@ -25,32 +13,19 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
style="@style/Typography.Heading3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/bold"
|
||||
android:text="@string/screen_splash_tagline"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="23sp" />
|
||||
android:textColor="@color/white" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_text_logo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/splash_text_logo" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_company_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="52dp"
|
||||
android:fontFamily="@font/bold"
|
||||
android:text="@string/screen_splash_brand_name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="21sp" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
Reference in New Issue
Block a user