diff --git a/art/ic_no_results_black.svg b/art/ic_no_results_black.svg
new file mode 100644
index 000000000..fb0f78117
--- /dev/null
+++ b/art/ic_no_results_black.svg
@@ -0,0 +1,54 @@
+
+
diff --git a/art/ic_no_results_white.svg b/art/ic_no_results_white.svg
new file mode 100644
index 000000000..744616a48
--- /dev/null
+++ b/art/ic_no_results_white.svg
@@ -0,0 +1,54 @@
+
+
diff --git a/art/render.rb b/art/render.rb
index 8634d9b37..2d58453d7 100755
--- a/art/render.rb
+++ b/art/render.rb
@@ -16,6 +16,8 @@ images = {
'main_logo.svg' => ['splash_logo', 144],
'ic_search_black.svg' => ['ic_search_background_black', 144],
'ic_search_white.svg' => ['ic_search_background_white', 144],
+ 'ic_no_results_white.svg' => ['ic_no_results_background_white', 144],
+ 'ic_no_results_black.svg' => ['ic_no_results_background_black', 144],
'play_video.svg' => ['play_video', 128],
'play_gif.svg' => ['play_gif', 128],
'conversations_mono.svg' => ['ic_notification', 24],
diff --git a/src/main/java/eu/siacs/conversations/ui/SearchActivity.java b/src/main/java/eu/siacs/conversations/ui/SearchActivity.java
index 873518731..be0949692 100644
--- a/src/main/java/eu/siacs/conversations/ui/SearchActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/SearchActivity.java
@@ -47,6 +47,8 @@ import eu.siacs.conversations.R;
import eu.siacs.conversations.databinding.ActivitySearchBinding;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.ui.adapter.MessageAdapter;
+import eu.siacs.conversations.ui.util.Color;
+import eu.siacs.conversations.ui.util.Drawable;
import static eu.siacs.conversations.ui.util.SoftKeyboardUtils.hideSoftKeyboard;
import static eu.siacs.conversations.ui.util.SoftKeyboardUtils.showKeyboard;
@@ -96,6 +98,18 @@ public class SearchActivity extends XmppActivity implements TextWatcher {
}
+ private void changeBackground(boolean hasSearch, boolean hasResults) {
+ if (hasSearch) {
+ if (hasResults) {
+ binding.searchResults.setBackgroundColor(Color.get(this,R.attr.color_background_secondary));
+ } else {
+ binding.searchResults.setBackground(Drawable.get(this,R.attr.activity_background_no_results));
+ }
+ } else {
+ binding.searchResults.setBackground(Drawable.get(this,R.attr.activity_background_search));
+ }
+ }
+
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
diff --git a/src/main/java/eu/siacs/conversations/ui/util/Drawable.java b/src/main/java/eu/siacs/conversations/ui/util/Drawable.java
new file mode 100644
index 000000000..993ef49aa
--- /dev/null
+++ b/src/main/java/eu/siacs/conversations/ui/util/Drawable.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2018, Daniel Gultsch All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation and/or
+ * other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors
+ * may be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+package eu.siacs.conversations.ui.util;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.support.annotation.AttrRes;
+
+public class Drawable {
+ public static android.graphics.drawable.Drawable get(Context context, @AttrRes int id) {
+ TypedArray typedArray = context.obtainStyledAttributes(new int[]{id});
+ android.graphics.drawable.Drawable drawable = typedArray.getDrawable(0);
+ typedArray.recycle();
+ return drawable;
+ }
+}
diff --git a/src/main/res/drawable-hdpi/ic_no_results_background_black.png b/src/main/res/drawable-hdpi/ic_no_results_background_black.png
new file mode 100644
index 000000000..79f226833
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_no_results_background_black.png differ
diff --git a/src/main/res/drawable-hdpi/ic_no_results_background_white.png b/src/main/res/drawable-hdpi/ic_no_results_background_white.png
new file mode 100644
index 000000000..aebc5886a
Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_no_results_background_white.png differ
diff --git a/src/main/res/drawable-mdpi/ic_no_results_background_black.png b/src/main/res/drawable-mdpi/ic_no_results_background_black.png
new file mode 100644
index 000000000..9b39879bc
Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_no_results_background_black.png differ
diff --git a/src/main/res/drawable-mdpi/ic_no_results_background_white.png b/src/main/res/drawable-mdpi/ic_no_results_background_white.png
new file mode 100644
index 000000000..48aa58298
Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_no_results_background_white.png differ
diff --git a/src/main/res/drawable-xhdpi/ic_no_results_background_black.png b/src/main/res/drawable-xhdpi/ic_no_results_background_black.png
new file mode 100644
index 000000000..588f94847
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_no_results_background_black.png differ
diff --git a/src/main/res/drawable-xhdpi/ic_no_results_background_white.png b/src/main/res/drawable-xhdpi/ic_no_results_background_white.png
new file mode 100644
index 000000000..7b4ddc907
Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_no_results_background_white.png differ
diff --git a/src/main/res/drawable-xxhdpi/ic_no_results_background_black.png b/src/main/res/drawable-xxhdpi/ic_no_results_background_black.png
new file mode 100644
index 000000000..a7b07043b
Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_no_results_background_black.png differ
diff --git a/src/main/res/drawable-xxhdpi/ic_no_results_background_white.png b/src/main/res/drawable-xxhdpi/ic_no_results_background_white.png
new file mode 100644
index 000000000..4def0934b
Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_no_results_background_white.png differ
diff --git a/src/main/res/drawable-xxxhdpi/ic_no_results_background_black.png b/src/main/res/drawable-xxxhdpi/ic_no_results_background_black.png
new file mode 100644
index 000000000..8437800ac
Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/ic_no_results_background_black.png differ
diff --git a/src/main/res/drawable-xxxhdpi/ic_no_results_background_white.png b/src/main/res/drawable-xxxhdpi/ic_no_results_background_white.png
new file mode 100644
index 000000000..c8253cbd3
Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/ic_no_results_background_white.png differ
diff --git a/src/main/res/drawable/no_results_background_dark.xml b/src/main/res/drawable/no_results_background_dark.xml
new file mode 100644
index 000000000..eb1025cb6
--- /dev/null
+++ b/src/main/res/drawable/no_results_background_dark.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/drawable/no_results_background_light.xml b/src/main/res/drawable/no_results_background_light.xml
new file mode 100644
index 000000000..31bc8efa7
--- /dev/null
+++ b/src/main/res/drawable/no_results_background_light.xml
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/res/drawable/search_background_dark.xml b/src/main/res/drawable/search_background_dark.xml
index e2aa24725..6e3341306 100644
--- a/src/main/res/drawable/search_background_dark.xml
+++ b/src/main/res/drawable/search_background_dark.xml
@@ -30,11 +30,11 @@
-
+
diff --git a/src/main/res/drawable/search_background_light.xml b/src/main/res/drawable/search_background_light.xml
index fd1735c03..766c539fd 100644
--- a/src/main/res/drawable/search_background_light.xml
+++ b/src/main/res/drawable/search_background_light.xml
@@ -30,11 +30,11 @@
-
+
diff --git a/src/main/res/values/attrs.xml b/src/main/res/values/attrs.xml
index cbf50c40d..625ab3c68 100644
--- a/src/main/res/values/attrs.xml
+++ b/src/main/res/values/attrs.xml
@@ -1,23 +1,24 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
@@ -38,7 +39,7 @@
-
+
diff --git a/src/main/res/values/dimens.xml b/src/main/res/values/dimens.xml
index bf7d5b353..583b2b676 100644
--- a/src/main/res/values/dimens.xml
+++ b/src/main/res/values/dimens.xml
@@ -24,4 +24,6 @@
8dp1200dp
+
+ 0.12
diff --git a/src/main/res/values/themes.xml b/src/main/res/values/themes.xml
index ca8299552..26f1bc214 100644
--- a/src/main/res/values/themes.xml
+++ b/src/main/res/values/themes.xml
@@ -12,6 +12,7 @@
@color/red_a700@drawable/search_background_light
+ @drawable/no_results_background_light@color/black
@@ -102,6 +103,7 @@
@color/grey800@color/grey900@drawable/search_background_dark
+ @drawable/no_results_background_dark@color/red_a100@color/white