-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a17713d
commit 7c11bcd
Showing
13 changed files
with
833 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
app/src/main/java/org/oppia/android/app/onboardingv2/OnboardingFragmentPresenter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package org.oppia.android.app.onboardingv2 | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import javax.inject.Inject | ||
import org.oppia.android.R | ||
import org.oppia.android.app.fragment.FragmentScope | ||
import org.oppia.android.app.translation.AppLanguageResourceHandler | ||
import org.oppia.android.databinding.OnboardingAppLanguageSelectionFragmentBinding | ||
|
||
/** The presenter for [OnboardingFragment] V2. */ | ||
@FragmentScope | ||
class OnboardingFragmentPresenter @Inject constructor( | ||
private val fragment: Fragment, | ||
private val appLanguageResourceHandler: AppLanguageResourceHandler | ||
) { | ||
private lateinit var binding: OnboardingAppLanguageSelectionFragmentBinding | ||
|
||
/** Handle creation and binding of the [OnboardingFragment] V2 layout. */ | ||
fun handleCreateView(inflater: LayoutInflater, container: ViewGroup?): View { | ||
binding = OnboardingAppLanguageSelectionFragmentBinding.inflate( | ||
inflater, | ||
container, | ||
/* attachToRoot= */ false | ||
) | ||
|
||
binding.let { | ||
it.lifecycleOwner = fragment | ||
} | ||
|
||
binding.onboardingLanguageTitle.text = appLanguageResourceHandler.getStringInLocaleWithWrapping( | ||
R.string.onboarding_language_activity_title, | ||
appLanguageResourceHandler.getStringInLocale(R.string.app_name) | ||
) | ||
|
||
return binding.root | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/component_color_shared_white_background_color" /> | ||
<corners | ||
android:bottomLeftRadius="@dimen/onboarding_shared_corner_radius" | ||
android:bottomRightRadius="@dimen/onboarding_shared_corner_radius" /> | ||
</shape> | ||
</item> | ||
<item | ||
android:bottom="2dp" | ||
android:left="1dp" | ||
android:right="2dp" | ||
android:top="0dp"> | ||
<shape android:shape="rectangle"> | ||
<solid android:color="@color/component_color_shared_white_background_color" /> | ||
<corners | ||
android:bottomLeftRadius="@dimen/onboarding_shared_corner_radius" | ||
android:bottomRightRadius="@dimen/onboarding_shared_corner_radius" /> | ||
</shape> | ||
</item> | ||
</layer-list> |
139 changes: 139 additions & 0 deletions
139
app/src/main/res/layout-land/onboarding_app_language_selection_fragment.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<layout 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"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:background="@color/component_color_onboarding_shared_green_color"> | ||
|
||
<TextView | ||
android:id="@+id/onboarding_language_title" | ||
style="@style/OnboardingHeaderStyle" | ||
android:layout_marginTop="@dimen/onboarding_shared_margin_medium_large" | ||
android:text="@string/onboarding_language_activity_title" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/onboarding_language_subtitle" | ||
style="@style/OnboardingLanguageSubtitleStyle" | ||
android:layout_marginTop="@dimen/onboarding_shared_margin_small" | ||
android:text="@string/onboarding_language_activity_subtitle" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/onboarding_language_title" /> | ||
|
||
<TextView | ||
android:id="@+id/onboarding_language_text" | ||
style="@style/OnboardingLanguageMessageStyle" | ||
android:layout_marginTop="@dimen/onboarding_shared_margin_medium_small" | ||
android:text="@string/onboarding_language_activity_text" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/onboarding_language_subtitle" /> | ||
|
||
<androidx.constraintlayout.widget.Guideline | ||
android:id="@+id/onboarding_language_center_guide" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:orientation="horizontal" | ||
app:layout_constraintGuide_percent="0.40" /> | ||
|
||
<org.oppia.android.app.customview.OppiaCurveBackgroundView | ||
android:id="@+id/onboarding_app_language_background" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
app:customBackgroundColor="@color/component_color_onboarding_shared_white_color" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintTop_toTopOf="@id/onboarding_language_center_guide" /> | ||
|
||
<ImageView | ||
android:id="@+id/onboarding_app_language_image" | ||
android:layout_width="132dp" | ||
android:layout_height="140dp" | ||
android:layout_marginEnd="@dimen/onboarding_shared_margin_3xl" | ||
android:contentDescription="@string/onboarding_otter_content_description" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/onboarding_language_title" | ||
app:srcCompat="@drawable/otter" /> | ||
|
||
<TextView | ||
android:id="@+id/onboarding_language_label" | ||
style="@style/OnboardingLanguageLabelStyle" | ||
android:layout_marginTop="@dimen/onboarding_shared_margin_medium_large" | ||
android:text="@string/onboarding_language_activity_select_label" | ||
app:layout_constraintBottom_toTopOf="@id/onboarding_language_dropdown_background" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/onboarding_language_center_guide" /> | ||
|
||
<RelativeLayout | ||
android:id="@+id/onboarding_language_dropdown_background" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="@dimen/onboarding_shared_margin_5xl" | ||
android:layout_marginEnd="@dimen/onboarding_shared_margin_5xl" | ||
android:layout_marginBottom="@dimen/onboarding_shared_margin_small" | ||
android:background="@drawable/dropdown_background" | ||
android:elevation="@dimen/onboarding_shared_elevation" | ||
android:padding="@dimen/onboarding_shared_padding_small" | ||
app:layout_constraintBottom_toTopOf="@id/onboarding_language_explanation"> | ||
|
||
<ImageView | ||
android:id="@+id/onboarding_language_dropdown_icon" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="@dimen/onboarding_shared_margin_small" | ||
android:layout_marginTop="@dimen/onboarding_shared_margin_x_small" | ||
android:layout_marginEnd="@dimen/onboarding_shared_margin_small" | ||
android:layout_marginBottom="@dimen/onboarding_shared_margin_x_small" | ||
android:contentDescription="@string/onboarding_language_dropdown_icon_description" | ||
app:srcCompat="@drawable/ic_language_icon_black_24dp" /> | ||
|
||
<Spinner | ||
android:id="@+id/onboarding_language_dropdown" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentStart="true" | ||
android:layout_marginStart="@dimen/onboarding_shared_margin_2xl" | ||
android:layout_toStartOf="@id/onboarding_language_dropdown_arrow" | ||
android:background="@drawable/transparent_background" | ||
android:textColor="@color/component_color_onboarding_shared_text_color" | ||
tools:listheader="English" /> | ||
|
||
<ImageView | ||
android:id="@+id/onboarding_language_dropdown_arrow" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_alignParentEnd="true" | ||
android:layout_marginStart="@dimen/onboarding_shared_margin_small" | ||
android:layout_marginTop="@dimen/onboarding_shared_margin_x_small" | ||
android:layout_marginEnd="@dimen/onboarding_shared_margin_small" | ||
android:layout_marginBottom="@dimen/onboarding_shared_margin_x_small" | ||
android:contentDescription="@string/onboarding_language_dropdown_arrow_icon_description" | ||
app:srcCompat="@drawable/ic_arrow_drop_down_black_24dp" /> | ||
</RelativeLayout> | ||
|
||
<TextView | ||
android:id="@+id/onboarding_language_explanation" | ||
style="@style/OnboardingLanguageExplanationStyle" | ||
android:layout_marginBottom="@dimen/onboarding_shared_margin_medium_small" | ||
android:text="@string/onboarding_language_activity_explanation_text" | ||
app:layout_constraintBottom_toTopOf="@id/onboarding_language_lets_go_button" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/onboarding_language_lets_go_button" | ||
style="@style/OnboardingLanguageLetsGoButton" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="@string/onboarding_language_activity_button_text" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</layout> |
Oops, something went wrong.