diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d231b3d1644..c3020e6211e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -32,7 +32,6 @@ android:theme="@style/OppiaThemeWithoutActionBar" /> (context.resources.getString(R.string.onboarding_slide_0_title)) val title = ObservableField(context.resources.getString(R.string.onboarding_slide_0_title)) val description = ObservableField(context.resources.getString(R.string.onboarding_slide_0_description)) + private val orientation = Resources.getSystem().configuration.orientation init { initializingSlide(viewPagerSlide) @@ -22,25 +25,41 @@ class OnboardingSlideViewModel(val context: Context, viewPagerSlide: ViewPagerSl private fun initializingSlide(viewPagerSlide: ViewPagerSlide) { when (viewPagerSlide) { ViewPagerSlide.SLIDE_0 -> { - slideImage.set(R.drawable.ic_onboarding_0) + if (orientation == Configuration.ORIENTATION_LANDSCAPE) { + slideImage.set(R.drawable.ic_landscape_onboarding_0) + } else if (orientation == Configuration.ORIENTATION_PORTRAIT){ + slideImage.set(R.drawable.ic_onboarding_0) + } contentDescription.set(context.resources.getString(R.string.onboarding_slide_0_title)) title.set(context.resources.getString(R.string.onboarding_slide_0_title)) description.set(context.resources.getString(R.string.onboarding_slide_0_description)) } ViewPagerSlide.SLIDE_1 -> { - slideImage.set(R.drawable.ic_onboarding_1) + if (orientation == Configuration.ORIENTATION_LANDSCAPE){ + slideImage.set(R.drawable.ic_landscape_onboarding_1) + } else if (orientation == Configuration.ORIENTATION_PORTRAIT){ + slideImage.set(R.drawable.ic_onboarding_1) + } contentDescription.set(context.resources.getString(R.string.onboarding_slide_1_title)) title.set(context.resources.getString(R.string.onboarding_slide_1_title)) description.set(context.resources.getString(R.string.onboarding_slide_1_description)) } ViewPagerSlide.SLIDE_2 -> { - slideImage.set(R.drawable.ic_onboarding_2) + if (orientation == Configuration.ORIENTATION_LANDSCAPE){ + slideImage.set(R.drawable.ic_landscape_onboarding_2) + } else if(orientation == Configuration.ORIENTATION_PORTRAIT){ + slideImage.set(R.drawable.ic_onboarding_2) + } contentDescription.set(context.resources.getString(R.string.onboarding_slide_2_title)) title.set(context.resources.getString(R.string.onboarding_slide_2_title)) description.set(context.resources.getString(R.string.onboarding_slide_2_description)) } ViewPagerSlide.SLIDE_3 -> { - slideImage.set(R.drawable.ic_onboarding_3) + if (orientation == Configuration.ORIENTATION_LANDSCAPE){ + slideImage.set(R.drawable.ic_landscape_onboarding_3) + } else if (orientation == Configuration.ORIENTATION_PORTRAIT){ + slideImage.set(R.drawable.ic_onboarding_3) + } contentDescription.set(context.resources.getString(R.string.onboarding_slide_3_title)) title.set(context.resources.getString(R.string.onboarding_slide_3_title)) description.set(context.resources.getString(R.string.onboarding_slide_3_description)) diff --git a/app/src/main/res/drawable/ic_landscape_onboarding_0.xml b/app/src/main/res/drawable/ic_landscape_onboarding_0.xml new file mode 100644 index 00000000000..dd2d96655ed --- /dev/null +++ b/app/src/main/res/drawable/ic_landscape_onboarding_0.xml @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_landscape_onboarding_1.xml b/app/src/main/res/drawable/ic_landscape_onboarding_1.xml new file mode 100644 index 00000000000..62b6af2b47b --- /dev/null +++ b/app/src/main/res/drawable/ic_landscape_onboarding_1.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_landscape_onboarding_2.xml b/app/src/main/res/drawable/ic_landscape_onboarding_2.xml new file mode 100644 index 00000000000..c0922d34fef --- /dev/null +++ b/app/src/main/res/drawable/ic_landscape_onboarding_2.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_landscape_onboarding_3.xml b/app/src/main/res/drawable/ic_landscape_onboarding_3.xml new file mode 100644 index 00000000000..a3f6cf8d08c --- /dev/null +++ b/app/src/main/res/drawable/ic_landscape_onboarding_3.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout-land/onboarding_fragment.xml b/app/src/main/res/layout-land/onboarding_fragment.xml new file mode 100644 index 00000000000..4a380790b5a --- /dev/null +++ b/app/src/main/res/layout-land/onboarding_fragment.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + +