Skip to content

Commit

Permalink
optmising onboardfragment (#2543)
Browse files Browse the repository at this point in the history
Co-authored-by: Rohit Kumar <[email protected]>
  • Loading branch information
chrk2205 and Rohit Kumar authored Jan 25, 2021
1 parent 4f0a60e commit 5fc69ff
Showing 1 changed file with 50 additions and 56 deletions.
106 changes: 50 additions & 56 deletions app/src/main/res/layout/onboarding_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,76 +26,70 @@
android:layout_height="0dp"
android:overScrollMode="never"
android:scrollbars="none"
app:layout_constraintBottom_toTopOf="@id/bottom_frame_layout"
app:layout_constraintBottom_toTopOf="@id/get_started_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<FrameLayout
android:id="@+id/bottom_frame_layout"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/get_started_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/get_started_container"
<View
android:id="@+id/onboarding_fragment_divider_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="1dp"
android:layout_marginBottom="16dp"
android:background="@color/oppiaPrimaryText"
app:layout_constraintBottom_toTopOf="@+id/slide_dots_container" />

<View
android:id="@+id/onboarding_fragment_divider_view"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginBottom="16dp"
android:background="@color/oppiaPrimaryText"
app:layout_constraintBottom_toTopOf="@+id/slide_dots_container" />
<LinearLayout
android:id="@+id/slide_dots_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginBottom="16dp"
android:gravity="center"
android:minHeight="48dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />

<LinearLayout
android:id="@+id/slide_dots_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginBottom="16dp"
android:gravity="center"
android:minHeight="48dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<ImageView
android:id="@+id/onboarding_fragment_next_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:gravity="center"
android:minWidth="48dp"
android:minHeight="48dp"
android:onClick="@{(v) -> presenter.clickOnNext()}"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:src="@drawable/ic_arrow_forward_black_24dp"
android:visibility="@{viewModel.slideNumber != 3 ? View.VISIBLE: View.GONE, default=visible}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/slide_dots_container" />

<ImageView
android:id="@+id/onboarding_fragment_next_image_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:gravity="center"
android:minWidth="48dp"
android:minHeight="48dp"
android:onClick="@{(v) -> presenter.clickOnNext()}"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:src="@drawable/ic_arrow_forward_black_24dp"
android:visibility="@{viewModel.slideNumber != 3 ? View.VISIBLE: View.GONE, default=visible}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/slide_dots_container" />

<TextView
android:id="@+id/skip_text_view"
style="@style/Caption"
android:layout_marginStart="20dp"
android:gravity="center"
android:minWidth="48dp"
android:minHeight="48dp"
android:onClick="@{(v) -> presenter.clickOnSkip()}"
android:text="@string/skip"
android:textAllCaps="true"
android:visibility="@{viewModel.slideNumber != (viewModel.totalNumberOfSlides - 1) ? View.VISIBLE: View.GONE, default=visible}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/slide_dots_container" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
<TextView
android:id="@+id/skip_text_view"
style="@style/Caption"
android:layout_marginStart="20dp"
android:gravity="center"
android:minWidth="48dp"
android:minHeight="48dp"
android:onClick="@{(v) -> presenter.clickOnSkip()}"
android:text="@string/skip"
android:textAllCaps="true"
android:visibility="@{viewModel.slideNumber != (viewModel.totalNumberOfSlides - 1) ? View.VISIBLE: View.GONE, default=visible}"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/slide_dots_container" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</layout>

0 comments on commit 5fc69ff

Please sign in to comment.