Skip to content

Commit

Permalink
code optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
samwelnyandoro committed Jul 4, 2024
1 parent 2d385d6 commit bde1904
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 9 deletions.
38 changes: 29 additions & 9 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_gravity="center"
android:paddingTop="50dp"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"

<EditText
android:layout_width="match_parent"
android:inputType="phone"
android:layout_margin="10dp"
android:id="@+id/phone"
android:hint="Your Phone Number"
android:layout_height="wrap_content" />

<EditText
android:layout_width="match_parent"
android:inputType="number"
android:id="@+id/amount"
android:text="1"
android:layout_margin="10dp"
android:hint="Amount"
android:layout_height="wrap_content" />

<androidx.appcompat.widget.AppCompatButton
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:text="Pay"
android:id="@+id/pay"
android:enabled="false"
android:layout_margin="10dp" />

</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
26 changes: 26 additions & 0 deletions app/src/main/res/layout/success_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:padding="10dp"
android:layout_centerInParent="true"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/success"
android:layout_width="100dp"
android:layout_height="100dp"
app:srcCompat="@drawable/ic_check_circle_black_24dp"
android:layout_gravity="center_horizontal"/>

<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:textSize="16sp"
android:id="@+id/message"
android:layout_gravity="center"
android:gravity="center"
android:text="Lorem Ipsum"
android:layout_height="wrap_content" />
</LinearLayout>

0 comments on commit bde1904

Please sign in to comment.