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

Commit

Permalink
Merge pull request #112 from spacecowboy/srccompat
Browse files Browse the repository at this point in the history
Use `srcCompat` for vector drawables
  • Loading branch information
spacecowboy authored Sep 30, 2016
2 parents e4167c3 + f460071 commit 6d1bfec
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ android {
targetSdkVersion 24
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
Expand Down
1 change: 1 addition & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ android {
targetSdkVersion 23
versionCode gitCommitCount
versionName gitTag
vectorDrawables.useSupportLibrary = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<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:id="@+id/nnf_item_container"
android:layout_width="match_parent"
Expand All @@ -25,7 +26,7 @@
android:layout_height="?android:listPreferredItemHeight"
android:adjustViewBounds="true"
android:scaleType="center"
android:src="@drawable/nnf_ic_folder_black_48dp"
app:srcCompat="@drawable/nnf_ic_folder_black_48dp"
android:tint="?attr/nnf_dir_icon_color"
android:visibility="visible"
tools:ignore="ContentDescription" />
Expand Down Expand Up @@ -53,4 +54,4 @@
android:paddingRight="8dp"
tools:ignore="RtlSymmetry" />

</LinearLayout>
</LinearLayout>
5 changes: 3 additions & 2 deletions library/src/main/res/layout/nnf_filepicker_listitem_dir.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
~ file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<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:id="@+id/nnf_item_container"
android:layout_width="match_parent"
Expand All @@ -24,7 +25,7 @@
android:layout_height="?android:listPreferredItemHeight"
android:adjustViewBounds="true"
android:scaleType="center"
android:src="@drawable/nnf_ic_folder_black_48dp"
app:srcCompat="@drawable/nnf_ic_folder_black_48dp"
android:tint="?attr/nnf_dir_icon_color"
android:visibility="visible"
tools:ignore="ContentDescription" />
Expand All @@ -41,4 +42,4 @@
android:padding="8dp"
android:singleLine="true"
android:text="@string/nnf_name" />
</LinearLayout>
</LinearLayout>
5 changes: 3 additions & 2 deletions library/src/main/res/layout/nnf_fragment_filepicker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".FilePickerActivity">

<android.support.v7.widget.Toolbar
Expand Down Expand Up @@ -92,7 +93,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:hint="@android:string/ok"
android:src="@drawable/nnf_ic_save_black_24dp"
app:srcCompat="@drawable/nnf_ic_save_black_24dp"
android:tint="?attr/nnf_save_icon_color"/>

</LinearLayout>
Expand All @@ -104,4 +105,4 @@
android:layout_height="1dp"
android:layout_above="@id/nnf_buttons_container"
android:background="?nnf_separator_color"/>
</RelativeLayout>
</RelativeLayout>
1 change: 1 addition & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ android {
versionName gitTag
archivesBaseName = "nononsensefilepicker-sample-${gitTag}".toString()
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:hint="@android:string/ok"
android:src="@drawable/nnf_ic_save_black_24dp"
app:srcCompat="@drawable/nnf_ic_save_black_24dp"
android:tint="?attr/nnf_save_icon_color"/>

</LinearLayout>
Expand All @@ -108,4 +108,4 @@
android:layout_height="1dp"
android:layout_above="@id/nnf_buttons_container"
android:background="?nnf_separator_color"/>
</RelativeLayout>
</RelativeLayout>
7 changes: 4 additions & 3 deletions sample/src/main/res/layout/fragment_loading_filepicker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<!-- This file is just a copy of the normal nnf_fragment_filepicker, with an added progress bar -->

<RelativeLayout 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"
Expand Down Expand Up @@ -103,7 +104,7 @@
android:layout_width="48dp"
android:layout_height="48dp"
android:hint="@android:string/ok"
android:src="@drawable/nnf_ic_save_black_24dp"
app:srcCompat="@drawable/nnf_ic_save_black_24dp"
android:tint="?attr/nnf_save_icon_color"/>

</LinearLayout>
Expand All @@ -113,6 +114,6 @@
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="@id/nnf_button_container"
android:layout_above="@id/nnf_buttons_container"
android:background="?nnf_separator_color"/>
</RelativeLayout>
</RelativeLayout>

0 comments on commit 6d1bfec

Please sign in to comment.