From 7e35cb09c33c1c9b75bf1041a0b3e6f3165b602a Mon Sep 17 00:00:00 2001 From: cip Date: Wed, 1 May 2013 00:45:48 +0200 Subject: [PATCH] android search field use icon instead of text --- res/layout/main.xml | 14 +------------- src/org/kiwix/kiwixmobile/KiwixMobileActivity.java | 11 +++++++---- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/res/layout/main.xml b/res/layout/main.xml index aad91cb06..aa073d8ef 100644 --- a/res/layout/main.xml +++ b/res/layout/main.xml @@ -16,19 +16,7 @@ android:layout_marginLeft="10dp" android:layout_marginRight="10dp" > - - - - - articleSearchtextView.getWidth() - articleSearchtextView.getPaddingRight() - clearIcon.getIntrinsicWidth()) { articleSearchtextView.setText(""); - articleSearchtextView.setCompoundDrawables(null, null, null, null); + articleSearchtextView.setCompoundDrawables(searchIcon, null, null, null); } return false; } @@ -162,7 +165,7 @@ public class KiwixMobileActivity extends Activity { articleSearchtextView.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { - articleSearchtextView.setCompoundDrawables(null, null, articleSearchtextView.getText().toString().equals("") ? null : clearIcon, null); + articleSearchtextView.setCompoundDrawables(searchIcon, null, articleSearchtextView.getText().toString().equals("") ? null : clearIcon, null); } @Override