Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.

Commit 6d1bfec

Browse files
authored
Merge pull request #112 from spacecowboy/srccompat
Use `srcCompat` for vector drawables
2 parents e4167c3 + f460071 commit 6d1bfec

File tree

8 files changed

+18
-11
lines changed

8 files changed

+18
-11
lines changed

examples/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ android {
1010
targetSdkVersion 24
1111
versionCode 1
1212
versionName "1.0"
13+
vectorDrawables.useSupportLibrary = true
1314
}
1415
buildTypes {
1516
release {

library/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ android {
2222
targetSdkVersion 23
2323
versionCode gitCommitCount
2424
versionName gitTag
25+
vectorDrawables.useSupportLibrary = true
2526
}
2627
}
2728

library/src/main/res/layout/nnf_filepicker_listitem_checkable.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
77
-->
88
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
9+
xmlns:app="http://schemas.android.com/apk/res-auto"
910
xmlns:tools="http://schemas.android.com/tools"
1011
android:id="@+id/nnf_item_container"
1112
android:layout_width="match_parent"
@@ -25,7 +26,7 @@
2526
android:layout_height="?android:listPreferredItemHeight"
2627
android:adjustViewBounds="true"
2728
android:scaleType="center"
28-
android:src="@drawable/nnf_ic_folder_black_48dp"
29+
app:srcCompat="@drawable/nnf_ic_folder_black_48dp"
2930
android:tint="?attr/nnf_dir_icon_color"
3031
android:visibility="visible"
3132
tools:ignore="ContentDescription" />
@@ -53,4 +54,4 @@
5354
android:paddingRight="8dp"
5455
tools:ignore="RtlSymmetry" />
5556

56-
</LinearLayout>
57+
</LinearLayout>

library/src/main/res/layout/nnf_filepicker_listitem_dir.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
77
-->
88
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
9+
xmlns:app="http://schemas.android.com/apk/res-auto"
910
xmlns:tools="http://schemas.android.com/tools"
1011
android:id="@+id/nnf_item_container"
1112
android:layout_width="match_parent"
@@ -24,7 +25,7 @@
2425
android:layout_height="?android:listPreferredItemHeight"
2526
android:adjustViewBounds="true"
2627
android:scaleType="center"
27-
android:src="@drawable/nnf_ic_folder_black_48dp"
28+
app:srcCompat="@drawable/nnf_ic_folder_black_48dp"
2829
android:tint="?attr/nnf_dir_icon_color"
2930
android:visibility="visible"
3031
tools:ignore="ContentDescription" />
@@ -41,4 +42,4 @@
4142
android:padding="8dp"
4243
android:singleLine="true"
4344
android:text="@string/nnf_name" />
44-
</LinearLayout>
45+
</LinearLayout>

library/src/main/res/layout/nnf_fragment_filepicker.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xmlns:tools="http://schemas.android.com/tools"
1111
android:layout_width="match_parent"
1212
android:layout_height="match_parent"
13+
xmlns:app="http://schemas.android.com/apk/res-auto"
1314
tools:context=".FilePickerActivity">
1415

1516
<android.support.v7.widget.Toolbar
@@ -92,7 +93,7 @@
9293
android:layout_width="48dp"
9394
android:layout_height="48dp"
9495
android:hint="@android:string/ok"
95-
android:src="@drawable/nnf_ic_save_black_24dp"
96+
app:srcCompat="@drawable/nnf_ic_save_black_24dp"
9697
android:tint="?attr/nnf_save_icon_color"/>
9798

9899
</LinearLayout>
@@ -104,4 +105,4 @@
104105
android:layout_height="1dp"
105106
android:layout_above="@id/nnf_buttons_container"
106107
android:background="?nnf_separator_color"/>
107-
</RelativeLayout>
108+
</RelativeLayout>

sample/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ android {
3030
versionName gitTag
3131
archivesBaseName = "nononsensefilepicker-sample-${gitTag}".toString()
3232
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
33+
vectorDrawables.useSupportLibrary = true
3334
}
3435

3536
buildTypes {

sample/src/main/res/layout/fragment_fastscrollerfilepicker.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
android:layout_width="48dp"
9797
android:layout_height="48dp"
9898
android:hint="@android:string/ok"
99-
android:src="@drawable/nnf_ic_save_black_24dp"
99+
app:srcCompat="@drawable/nnf_ic_save_black_24dp"
100100
android:tint="?attr/nnf_save_icon_color"/>
101101

102102
</LinearLayout>
@@ -108,4 +108,4 @@
108108
android:layout_height="1dp"
109109
android:layout_above="@id/nnf_buttons_container"
110110
android:background="?nnf_separator_color"/>
111-
</RelativeLayout>
111+
</RelativeLayout>

sample/src/main/res/layout/fragment_loading_filepicker.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<!-- This file is just a copy of the normal nnf_fragment_filepicker, with an added progress bar -->
1010

1111
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
12+
xmlns:app="http://schemas.android.com/apk/res-auto"
1213
xmlns:tools="http://schemas.android.com/tools"
1314
android:layout_width="match_parent"
1415
android:layout_height="match_parent"
@@ -103,7 +104,7 @@
103104
android:layout_width="48dp"
104105
android:layout_height="48dp"
105106
android:hint="@android:string/ok"
106-
android:src="@drawable/nnf_ic_save_black_24dp"
107+
app:srcCompat="@drawable/nnf_ic_save_black_24dp"
107108
android:tint="?attr/nnf_save_icon_color"/>
108109

109110
</LinearLayout>
@@ -113,6 +114,6 @@
113114
android:id="@+id/divider"
114115
android:layout_width="match_parent"
115116
android:layout_height="1dp"
116-
android:layout_above="@id/nnf_button_container"
117+
android:layout_above="@id/nnf_buttons_container"
117118
android:background="?nnf_separator_color"/>
118-
</RelativeLayout>
119+
</RelativeLayout>

0 commit comments

Comments
 (0)