-
-
Notifications
You must be signed in to change notification settings - Fork 7
Improve onboarding screen UI (XML layout) #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,46 +1,83 @@ | ||||||
| <?xml version="1.0" encoding="utf-8"?> | ||||||
| <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||||||
| <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:id="@+id/main" | ||||||
| android:layout_width="match_parent" | ||||||
| android:layout_height="match_parent" | ||||||
| android:background="@color/white" | ||||||
| tools:context=".views.activites.OnboardingActivity"> | ||||||
|
|
||||||
| <androidx.viewpager.widget.ViewPager | ||||||
| android:id="@+id/slider" | ||||||
| android:layout_width="0dp" | ||||||
| android:layout_height="0dp" | ||||||
| app:layout_constraintTop_toTopOf="parent" | ||||||
| app:layout_constraintBottom_toTopOf="@id/titleText" | ||||||
| app:layout_constraintStart_toStartOf="parent" | ||||||
| app:layout_constraintEnd_toEndOf="parent" /> | ||||||
|
|
||||||
| <TextView | ||||||
| android:id="@+id/titleText" | ||||||
| android:layout_width="0dp" | ||||||
| android:layout_height="wrap_content" | ||||||
| android:text="Welcome to UpdateApp" | ||||||
| android:textSize="24sp" | ||||||
| android:textStyle="bold" | ||||||
| android:textColor="#212121" | ||||||
| android:gravity="center" | ||||||
| android:layout_marginTop="12dp" | ||||||
| android:layout_marginHorizontal="24dp" | ||||||
| app:layout_constraintTop_toBottomOf="@id/slider" | ||||||
| app:layout_constraintStart_toStartOf="parent" | ||||||
| app:layout_constraintEnd_toEndOf="parent" /> | ||||||
|
|
||||||
| <TextView | ||||||
| android:id="@+id/descText" | ||||||
| android:layout_width="0dp" | ||||||
| android:layout_height="wrap_content" | ||||||
| android:text="Get the latest updates, features, and improvements all in one place." | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extract hardcoded description to strings.xml. The description text is hardcoded, preventing localization. 🔎 Proposed fixIn <string name="onboarding_description">Get the latest updates, features, and improvements all in one place.</string>Then update the layout: - android:text="Get the latest updates, features, and improvements all in one place."
+ android:text="@string/onboarding_description"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| android:textSize="15sp" | ||||||
| android:textColor="#757575" | ||||||
| android:gravity="center" | ||||||
| android:lineSpacingExtra="4dp" | ||||||
| android:layout_marginTop="8dp" | ||||||
| android:layout_marginHorizontal="32dp" | ||||||
| app:layout_constraintTop_toBottomOf="@id/titleText" | ||||||
| app:layout_constraintStart_toStartOf="parent" | ||||||
| app:layout_constraintEnd_toEndOf="parent" /> | ||||||
|
|
||||||
| <LinearLayout | ||||||
| android:id="@+id/dotsLayout" | ||||||
| android:layout_width="wrap_content" | ||||||
| android:layout_height="wrap_content" | ||||||
| android:orientation="horizontal" | ||||||
| android:gravity="center" | ||||||
| android:layout_marginTop="24dp" | ||||||
| app:layout_constraintTop_toBottomOf="@id/descText" | ||||||
| app:layout_constraintStart_toStartOf="parent" | ||||||
| app:layout_constraintEnd_toEndOf="parent" /> | ||||||
|
|
||||||
| <androidx.cardview.widget.CardView | ||||||
| android:id="@+id/nextCard" | ||||||
| android:layout_width="56dp" | ||||||
| android:layout_height="56dp" | ||||||
| android:layout_marginEnd="24dp" | ||||||
| android:layout_marginBottom="32dp" | ||||||
| app:cardCornerRadius="28dp" | ||||||
| android:layout_marginEnd="30dp" | ||||||
| android:layout_marginBottom="60dp" | ||||||
| app:cardElevation="8dp" | ||||||
| android:backgroundTint="@color/blue" | ||||||
| android:clickable="true" | ||||||
| android:focusable="true" | ||||||
| app:layout_constraintBottom_toBottomOf="parent" | ||||||
| app:layout_constraintEnd_toEndOf="parent"> | ||||||
|
|
||||||
| <ImageView | ||||||
| android:layout_width="match_parent" | ||||||
| android:layout_height="match_parent" | ||||||
| android:layout_margin="17dp" | ||||||
| android:src="@drawable/ic_next"/> | ||||||
| android:padding="16dp" | ||||||
| android:src="@drawable/ic_next" | ||||||
| android:contentDescription="Next" /> | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extract hardcoded contentDescription to strings.xml. The contentDescription is hardcoded, which should be localized for accessibility. 🔎 Proposed fixIn <string name="next_button">Next</string>Then update the layout: - android:contentDescription="Next" />
+ android:contentDescription="@string/next_button" />📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| </androidx.cardview.widget.CardView> | ||||||
|
|
||||||
| <androidx.viewpager.widget.ViewPager | ||||||
| android:id="@+id/slider" | ||||||
| android:layout_width="match_parent" | ||||||
| android:layout_height="match_parent"/> | ||||||
|
|
||||||
| <LinearLayout | ||||||
| android:id="@+id/dotsLayout" | ||||||
| android:layout_width="wrap_content" | ||||||
| android:layout_height="wrap_content" | ||||||
| android:gravity="center" | ||||||
| android:orientation="horizontal" | ||||||
| app:layout_constraintBottom_toBottomOf="@+id/nextCard" | ||||||
| app:layout_constraintTop_toTopOf="@+id/nextCard" | ||||||
| app:layout_constraintStart_toStartOf="parent" | ||||||
| android:layout_marginStart="30dp"/> | ||||||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
| </androidx.constraintlayout.widget.ConstraintLayout> | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract hardcoded strings to strings.xml for internationalization.
The title text is hardcoded, which prevents localization for non-English users.
🔎 Proposed fix
In
res/values/strings.xml, add:Then update the layout:
📝 Committable suggestion
🤖 Prompt for AI Agents