Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Commit aed4cea

Browse files
committed
Enabled support library for vector drawables
1 parent 896adcc commit aed4cea

9 files changed

Lines changed: 1022 additions & 388 deletions

File tree

0 Bytes
Binary file not shown.

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ android {
1515
versionCode rootProject.ext.versionCode
1616
versionName rootProject.ext.versionName
1717
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18+
vectorDrawables.useSupportLibrary = true
1819
}
1920

2021
dataBinding {

app/src/main/java/apps/jizzu/simpletodo/ui/view/SearchActivity.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.view.MenuItem
66
import android.view.View
77
import android.widget.ImageView
88
import android.widget.TextView
9+
import androidx.appcompat.content.res.AppCompatResources
910
import androidx.appcompat.widget.SearchView
1011
import androidx.core.content.ContextCompat
1112
import androidx.lifecycle.Observer
@@ -66,10 +67,12 @@ class SearchActivity : BaseActivity(), SearchView.OnQueryTextListener {
6667
mAdapter.updateData(arrayListOf())
6768
llEmptyView.visible()
6869
if (isSearchFieldEmpty) {
69-
ivEmptyIllustration.setImageResource(R.drawable.illustration_search)
70+
ivEmptyIllustration.setImageDrawable(AppCompatResources.getDrawable(this,
71+
R.drawable.illustration_search))
7072
tvEmptyTitle.text = getString(R.string.search_view_empty_text)
7173
} else {
72-
ivEmptyIllustration.setImageResource(R.drawable.illustration_not_found)
74+
ivEmptyIllustration.setImageDrawable(AppCompatResources.getDrawable(this,
75+
R.drawable.illustration_not_found))
7376
tvEmptyTitle.text = getString(R.string.search_view_not_found_text)
7477
}
7578
}

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

Lines changed: 274 additions & 107 deletions
Large diffs are not rendered by default.

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

Lines changed: 323 additions & 122 deletions
Large diffs are not rendered by default.

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

Lines changed: 150 additions & 55 deletions
Large diffs are not rendered by default.

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

Lines changed: 266 additions & 100 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
android:layout_width="140dp"
3535
android:layout_height="140dp"
3636
android:gravity="center_horizontal"
37-
android:src="@drawable/illustration_no_tasks" />
37+
app:srcCompat="@drawable/illustration_no_tasks" />
3838

3939
<TextView
4040
android:layout_width="match_parent"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
android:layout_width="match_parent"
55
android:layout_height="match_parent"
6+
xmlns:app="http://schemas.android.com/apk/res-auto"
67
android:background="?attr/colorBackground"
78
tools:context=".ui.view.SearchActivity">
89

@@ -30,7 +31,7 @@
3031
android:layout_width="match_parent"
3132
android:layout_height="130dp"
3233
android:gravity="center_horizontal"
33-
android:src="@drawable/illustration_search" />
34+
app:srcCompat="@drawable/illustration_search" />
3435

3536
<TextView
3637
android:id="@+id/tvEmptyTitle"

0 commit comments

Comments
 (0)