dynamic text and sizes dependency
dynamic size of the image on onboard slide
This commit is contained in:
15
.idea/deploymentTargetDropDown.xml
generated
15
.idea/deploymentTargetDropDown.xml
generated
@@ -3,7 +3,20 @@
|
||||
<component name="deploymentTargetDropDown">
|
||||
<value>
|
||||
<entry key="app">
|
||||
<State />
|
||||
<State>
|
||||
<targetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
<value value="$PROJECT_DIR$/../.android/avd/6.7_Horizontal_Fold-in_API_34.avd" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-05-02T15:28:18.084749Z" />
|
||||
</State>
|
||||
</entry>
|
||||
</value>
|
||||
</component>
|
||||
|
||||
@@ -44,6 +44,11 @@ dependencies {
|
||||
|
||||
implementation 'com.github.bumptech.glide:glide:4.16.0'
|
||||
|
||||
// dynamics text sizes
|
||||
implementation 'com.intuit.ssp:ssp-android:1.1.1'
|
||||
// dynamic sizes
|
||||
implementation 'com.intuit.sdp:sdp-android:1.1.1'
|
||||
|
||||
implementation libs.androidx.core.ktx
|
||||
implementation libs.androidx.appcompat
|
||||
implementation libs.material
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.woka.onboard
|
||||
|
||||
import android.util.DisplayMetrics
|
||||
import android.util.TypedValue
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@@ -35,6 +37,21 @@ class OnboardingAdapter : RecyclerView.Adapter<OnboardingAdapter.ViewHolder>() {
|
||||
image.setImageResource(R.drawable.slide3)
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate screen dimensions in pixels
|
||||
|
||||
// Calculate screen dimensions in pixels
|
||||
val displayMetrics: DisplayMetrics = itemView.context.resources.displayMetrics
|
||||
val screenWidth = displayMetrics.widthPixels
|
||||
val screenHeight = displayMetrics.heightPixels
|
||||
|
||||
// Calculate aspect ratio
|
||||
val aspectRatio = screenHeight.toFloat() / screenWidth.toFloat()
|
||||
|
||||
if (aspectRatio < 2){
|
||||
binding.image.layoutParams.height = 140 * displayMetrics.density.toInt()
|
||||
binding.image.layoutParams.width = 160 * displayMetrics.density.toInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
android:shape="ring"
|
||||
android:thickness="6dp"
|
||||
android:useLevel="false">
|
||||
<solid android:color="@color/white" />
|
||||
<solid android:color="@color/color_primary" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@android:color/darker_gray"/>
|
||||
android:color="@color/color_primary"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -6,10 +6,10 @@
|
||||
android:shape="ring"
|
||||
android:thickness="6dp"
|
||||
android:useLevel="false">
|
||||
<solid android:color="@color/color_primary" />
|
||||
<solid android:color="@color/white" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/color_primary"/>
|
||||
android:color="@android:color/darker_gray"/>
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/back_btn"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:contentDescription="@string/image"
|
||||
android:src="@drawable/ic_arrow_back"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/title"
|
||||
|
||||
@@ -4,20 +4,21 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:scrollbars="none"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_width="@dimen/_200sdp"
|
||||
android:layout_height="@dimen/_180sdp"
|
||||
android:contentDescription="@string/image"
|
||||
android:layout_marginTop="50dp"
|
||||
tools:src="@drawable/slide1"/>
|
||||
|
||||
<LinearLayout
|
||||
@@ -25,7 +26,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="50dp"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:gravity="center"
|
||||
>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
tools:text="@string/slide_1_title"
|
||||
android:fontFamily="@font/exo_2_extrabold"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textSize="20sp"
|
||||
android:textSize="@dimen/_18ssp"
|
||||
android:textAlignment="center"
|
||||
|
||||
/>
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
tools:text="@string/slide_1_subtitle"
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:textSize="16sp"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
android:textColor="@color/color_primary"
|
||||
android:textAlignment="center"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user