Skip to content
This repository was archived by the owner on Jun 27, 2020. It is now read-only.

Commit 0babba3

Browse files
author
Evgeniy Kanivets
committed
Customized view of date-and-report bar
1 parent d8f2984 commit 0babba3

File tree

6 files changed

+45
-4
lines changed

6 files changed

+45
-4
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:state_pressed="false" android:drawable="@color/grey"/>
5+
<item android:state_pressed="true" android:drawable="@color/dark_grey"/>
6+
</selector>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
4+
<item android:state_pressed="false" android:drawable="@color/yellow_light"/>
5+
<item android:state_pressed="true" android:drawable="@color/yellow_dark"/>
6+
</selector>

app/src/main/res/layout/activity_main.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
android:orientation="vertical"
33
android:layout_width="fill_parent"
44
android:layout_height="fill_parent"
5-
xmlns:android="http://schemas.android.com/apk/res/android">
5+
xmlns:android="http://schemas.android.com/apk/res/android"
6+
android:background="@color/light_grey">
67

78
<LinearLayout
89
android:orientation="horizontal"
910
android:layout_width="match_parent"
1011
android:layout_height="wrap_content"
11-
android:layout_gravity="center_horizontal">
12+
android:layout_gravity="center_horizontal"
13+
android:background="@color/grey">
1214

1315
<TextView
1416
android:layout_width="wrap_content"
1517
android:layout_height="match_parent"
1618
android:text="New Text"
1719
android:id="@+id/tv_from_date"
1820
android:layout_weight="1"
21+
android:background="@drawable/selector_change_date"
1922
android:gravity="center" />
2023

2124
<TextView
@@ -24,13 +27,16 @@
2427
android:text="New Text"
2528
android:id="@+id/tv_to_date"
2629
android:layout_weight="1"
30+
android:background="@drawable/selector_change_date"
2731
android:gravity="center" />
2832

2933
<Button
3034
android:layout_width="wrap_content"
3135
android:layout_height="wrap_content"
3236
android:text="@string/report"
33-
android:id="@+id/btn_report" />
37+
android:id="@+id/btn_report"
38+
android:background="@drawable/selector_report"
39+
android:padding="15dp" />
3440
</LinearLayout>
3541

3642
<ListView

app/src/main/res/layout/dialog_change_date.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,20 @@
22

33
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
44
android:orientation="vertical" android:layout_width="match_parent"
5-
android:layout_height="match_parent">
5+
android:layout_height="match_parent"
6+
android:background="@color/white"
7+
android:layout_gravity="center">
8+
9+
<TextView
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:textAppearance="?android:attr/textAppearanceLarge"
13+
android:text="@string/change_date"
14+
android:background="@color/blue"
15+
android:textColor="@color/white"
16+
android:gravity="center"
17+
android:textAllCaps="true"
18+
android:id="@+id/tv_title" />
619

720
<DatePicker
821
android:layout_width="wrap_content"

app/src/main/res/values/colors.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@
1515
<color name="red_light">#ff4444</color>
1616
<color name="red">#e21d1d</color>
1717
<color name="red_dark">#cc0000</color>
18+
19+
<color name="light_grey">#f6f6f6</color>
20+
<color name="grey">#e8e8e8</color>
21+
<color name="dark_grey">#d6d6d6</color>
22+
23+
<color name="yellow_light">#ffbd21</color>
24+
<color name="yellow">#ffa00e</color>
25+
<color name="yellow_dark">#ff8a00</color>
26+
1827
</resources>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818

1919
<string name="wrong_number_text">Sorry, but entered data is wrong!</string>
2020
<string name="report">Report</string>
21+
<string name="change_date">CHANGE THE DATE</string>
2122

2223
</resources>

0 commit comments

Comments
 (0)