Skip to content

Commit 269719c

Browse files
committed
xmls completed
1 parent a022a0b commit 269719c

10 files changed

+91
-31
lines changed

app/src/main/res/drawable/ic_done_black.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
android:viewportHeight="24"
66
android:tint="?attr/colorControlNormal">
77
<path
8-
android:fillColor="@android:color/white"
8+
android:fillColor="@android:color/black"
99
android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/>
1010
</vector>
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
4-
android:layout_height="match_parent">
2+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
xmlns:app="http://schemas.android.com/apk/res-auto">
56

7+
<androidx.constraintlayout.widget.ConstraintLayout
8+
android:id="@+id/toolbar_layout"
9+
android:layout_width="match_parent"
10+
android:layout_height="?attr/actionBarSize"
11+
app:layout_constraintTop_toTopOf="parent">
12+
<include
13+
layout="@layout/custom_selector_toolbar"
14+
android:id="@+id/toolbar"
15+
app:layout_constraintTop_toTopOf="parent"/>
16+
</androidx.constraintlayout.widget.ConstraintLayout>
17+
18+
<include
19+
layout="@layout/fragment_custom_selector"
20+
app:layout_constraintTop_toBottomOf="@+id/toolbar_layout"
21+
app:layout_constraintBottom_toBottomOf="parent"
22+
/>
623

724
</androidx.constraintlayout.widget.ConstraintLayout>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,44 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<androidx.constraintlayout.widget.ConstraintLayout
3-
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
4-
android:layout_height="match_parent">
2+
<merge xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
>
55

6-
</androidx.constraintlayout.widget.ConstraintLayout>
6+
<ImageView
7+
android:id="@+id/back"
8+
android:layout_width="wrap_content"
9+
android:layout_height="match_parent"
10+
app:layout_constraintBottom_toBottomOf="parent"
11+
app:layout_constraintStart_toStartOf="parent"
12+
app:layout_constraintTop_toTopOf="parent"
13+
android:layout_centerVertical="true"
14+
android:background="?attr/selectableItemBackgroundBorderless"
15+
android:padding="@dimen/standard_gap"
16+
app:srcCompat="?attr/custom_selector_back" />
17+
18+
19+
<TextView
20+
android:id="@+id/title"
21+
android:layout_width="wrap_content"
22+
android:layout_height="wrap_content"
23+
app:layout_constraintStart_toEndOf="@id/back"
24+
app:layout_constraintTop_toTopOf="parent"
25+
app:layout_constraintBottom_toBottomOf="parent"
26+
android:layout_marginHorizontal="@dimen/standard_gap"
27+
android:ellipsize="end"
28+
android:maxLines="1"
29+
android:text="@string/custom_selector_title"
30+
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
31+
32+
<ImageView
33+
android:id="@+id/done"
34+
app:layout_constraintEnd_toEndOf="parent"
35+
app:layout_constraintTop_toTopOf="parent"
36+
android:layout_width="wrap_content"
37+
android:layout_height="match_parent"
38+
android:layout_centerVertical="true"
39+
android:clickable="true"
40+
android:focusable="true"
41+
android:padding="@dimen/standard_gap"
42+
app:srcCompat="?attr/custom_selector_done"/>
43+
44+
</merge>

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

+6-8
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@
66
xmlns:app="http://schemas.android.com/apk/res-auto">
77

88
<androidx.recyclerview.widget.RecyclerView
9-
android:id="@+id/custom_selector_recycler_view"
9+
android:id="@+id/selector_rv"
1010
android:layout_width="match_parent"
1111
android:layout_height="match_parent"
12-
android:visibility="gone"
13-
tools:visibility="visible" />
12+
/>
1413

1514
<TextView
15+
android:id="@+id/empty_text"
1616
android:layout_height="wrap_content"
1717
android:layout_width="wrap_content"
1818
android:textSize="@dimen/normal_text"
19-
android:padding="10dp"
20-
android:text="No Images"
19+
android:padding="@dimen/standard_gap"
20+
android:text="@string/custom_selector_empty_text"
2121
android:visibility="gone"
22-
tools:visibility="visible"
2322
app:layout_constraintTop_toTopOf="parent"
2423
app:layout_constraintBottom_toBottomOf="parent"
2524
app:layout_constraintEnd_toEndOf="parent"
@@ -31,8 +30,7 @@
3130
android:layout_width="wrap_content"
3231
android:layout_height="wrap_content"
3332
android:layout_gravity="center"
34-
android:visibility="gone"
35-
tools:visibility="visible"
33+
android:visibility="visible"
3634
app:layout_constraintTop_toTopOf="parent"
3735
app:layout_constraintBottom_toBottomOf="parent"
3836
app:layout_constraintEnd_toEndOf="parent"

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<androidx.cardview.widget.CardView
99
android:layout_width="match_parent"
1010
android:layout_height="0dp"
11-
app:cardCornerRadius="5dp"
12-
app:cardElevation="2dp"
11+
app:cardCornerRadius="@dimen/dimen_6"
12+
app:cardElevation="@dimen/dimen_2"
1313
android:id="@+id/view"
1414
app:cardUseCompatPadding="true"
1515
app:layout_constraintDimensionRatio="H,1:1"
@@ -43,14 +43,13 @@
4343

4444
<TextView
4545
android:id="@+id/album_name"
46-
android:layout_width="wrap_content"
46+
android:layout_width="0dp"
4747
android:layout_height="wrap_content"
4848
app:layout_constraintLeft_toLeftOf="parent"
4949
app:layout_constraintBottom_toBottomOf="parent"
50-
android:layout_margin="5dp"
51-
android:padding="5dp"
52-
android:textColor="@color/white"
53-
android:textStyle="bold"
50+
android:layout_margin="@dimen/dimen_6"
51+
android:padding="@dimen/dimen_6"
52+
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
5453
android:layout_weight="1"
5554
android:textSize="16sp"
5655
android:singleLine="true"

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

+7-8
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<androidx.cardview.widget.CardView
99
android:layout_width="match_parent"
1010
android:layout_height="0dp"
11-
app:cardCornerRadius="5dp"
12-
app:cardElevation="2dp"
11+
app:cardCornerRadius="@dimen/dimen_6"
12+
app:cardElevation="@dimen/dimen_2"
1313
android:id="@+id/view"
1414
app:cardUseCompatPadding="true"
1515
app:layout_constraintDimensionRatio="H,1:1"
@@ -35,11 +35,10 @@
3535

3636
<TextView
3737
android:id="@+id/selected_count"
38-
android:layout_width="20dp"
39-
android:layout_height="20dp"
38+
android:layout_width="@dimen/dimen_20"
39+
android:layout_height="@dimen/dimen_20"
4040
app:layout_constraintDimensionRatio="H,1:1"
41-
android:layout_margin="4dp"
42-
android:textSize="11sp"
41+
android:layout_margin="@dimen/dimen_10"
4342
android:gravity="center|center_vertical"
4443
android:includeFontPadding="false"
4544
android:textStyle="bold"
@@ -67,8 +66,8 @@
6766

6867
<ImageView
6968
android:id="@+id/uploaded_overlay_icon"
70-
android:layout_width="80dp"
71-
android:layout_height="80dp"
69+
android:layout_width="@dimen/dimen_140"
70+
android:layout_height="@dimen/dimen_140"
7271
app:layout_constraintEnd_toEndOf="parent"
7372
app:layout_constraintBottom_toBottomOf="parent"
7473
app:srcCompat="@drawable/commons"

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

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
<attr name="menu_item_tint" format="reference"/>
5050
<attr name="search_icon" format="reference"/>
5151
<attr name="caption_description_text_color" format="reference" />
52+
<attr name="custom_selector_done" format="reference"/>
53+
<attr name="custom_selector_back" format="reference"/>
5254

5355
<declare-styleable name="Badge">
5456
<attr name="boundary" format="color"/>

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

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
<!-- Commonly used dimensions -->
6060
<dimen name="dimen_0">0dp</dimen>
61+
<dimen name="dimen_2">2dp</dimen>
6162
<dimen name="dimen_6">6dp</dimen>
6263
<dimen name="dimen_10">10dp</dimen>
6364
<dimen name="dimen_20">20dp</dimen>

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

+2
Original file line numberDiff line numberDiff line change
@@ -638,5 +638,7 @@ Upload your first media by tapping on the add button.</string>
638638
The shadow of the image view of the location picker</string>
639639
<string name="image_location">Image Location</string>
640640
<string name="check_whether_location_is_correct">Check whether location is correct</string>
641+
<string name="custom_selector_title">Custom Selector</string>
642+
<string name="custom_selector_empty_text">No Images</string>
641643

642644
</resources>

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

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
<item name="contributionsListTextSecondary">@color/white</item>
5656
<item name="menu_item_tint">@color/white</item>
5757
<item name="search_icon">@drawable/ic_search_white_24dp</item>
58+
<item name="custom_selector_done">@drawable/ic_done_white</item>
59+
<item name="custom_selector_back">@drawable/ic_arrow_back_white</item>
5860
<item name="android:windowEnableSplitTouch">false</item>
5961
<item name="android:splitMotionEvents">false</item>
6062
</style>
@@ -113,6 +115,8 @@
113115
<item name="contributionsListTextSecondary">@color/disabled_button_text_color_dark</item>
114116
<item name="menu_item_tint">@color/primaryDarkColor</item>
115117
<item name="search_icon">@drawable/ic_search_blue_24dp</item>
118+
<item name="custom_selector_done">@drawable/ic_done_black</item>
119+
<item name="custom_selector_back">@drawable/ic_arrow_back_black</item>
116120
<item name="android:windowEnableSplitTouch">false</item>
117121
<item name="android:splitMotionEvents">false</item>
118122
</style>

0 commit comments

Comments
 (0)