Skip to content

Commit

Permalink
fix full screen step layout
Browse files Browse the repository at this point in the history
  • Loading branch information
kareemradwan committed Jul 1, 2020
1 parent c8d6662 commit 0819deb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/kareemradwan/stepeer/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MainActivity : AppCompatActivity(), SteeperView.SteeperHandler {

val adapter = OrderAdapter(
this, listOf(
Order(1, "Step1" , true),
Order(1, "Step1" ),
Order(2, "Step2"),
Order(3, "Step3"),
Order(4, "Step4")
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/kareemradwan/stepeer/OrderAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OrderAdapter(private val context: Context, list: List<Order>) : StepAdapte
val tvDescriptor = view.findViewById<TextView>(R.id.tvDesc)

tvTitle.text = model.title
tvDescriptor.text = "${model.id}"
tvDescriptor.text = "This Sub Title of Cutome View ${model.id}"

return view
}
Expand Down
49 changes: 34 additions & 15 deletions app/src/main/res/layout/order_step.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:paddingStart="20dp"
android:paddingBottom="10dp"
android:paddingEnd="20dp"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_marginStart="20dp"
android:layout_marginLeft="20dp"
android:orientation="vertical"
android:paddingBottom="4dp">

<TextView
android:layout_width="wrap_content"
android:id="@+id/tvTitle"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:text="@string/app_name"
android:textSize="24sp" />
android:orientation="horizontal">

<View
android:layout_width="match_parent"
android:layout_height="50dp"/>

<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/title_label"
android:textColor="@android:color/black"
android:textSize="24sp" />

<TextView
android:id="@+id/tvTitleEnd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:layout_weight="0"
android:gravity="top"
android:text="@string/d_2_hour_label"
android:textColor="@android:color/holo_red_dark"
android:textSize="14sp"
android:textStyle="bold" />

</LinearLayout>

<TextView
android:id="@+id/tvDesc"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:lines="3"
android:text="@string/title_label"
android:textColor="@android:color/black"
android:textSize="14sp" />
</LinearLayout>
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<resources>
<string name="app_name">Stepeer</string>
<string name="title_label">Title</string>
<string name="d_2_hour_label">2 hour</string>
</resources>
2 changes: 1 addition & 1 deletion stepeer/src/main/res/layout/item_step.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<LinearLayout

android:id="@+id/stepContentContainer"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
Expand Down

0 comments on commit 0819deb

Please sign in to comment.