Fixes some color icons issues

This commit is contained in:
stom79 2017-12-16 10:02:37 +01:00
parent 244f4a8c94
commit 647157dc5a
3 changed files with 16 additions and 2 deletions

View File

@ -19,8 +19,10 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
@ -94,6 +96,7 @@ public class ListAdapter extends BaseAdapter implements OnListActionInterface {
}
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
if( theme == Helper.THEME_LIGHT){
holder.search_container.setBackgroundResource(R.color.mastodonC3__);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.black);
@ -101,7 +104,13 @@ public class ListAdapter extends BaseAdapter implements OnListActionInterface {
holder.search_container.setBackgroundResource(R.color.mastodonC1_);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}
Drawable next = ContextCompat.getDrawable(context, R.drawable.ic_keyboard_arrow_right);
holder.search_title.setText(list.getTitle());
assert next != null;
next.setBounds(0,0,100,100);
assert next != null;
holder.search_title.setCompoundDrawables(null, null, next, null);
holder.search_container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@ -20,7 +20,9 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
@ -99,7 +101,12 @@ public class SearchTootsListAdapter extends BaseAdapter {
holder.search_container.setBackgroundResource(R.color.mastodonC1_);
changeDrawableColor(context, R.drawable.ic_keyboard_arrow_right,R.color.dark_text);
}
Drawable next = ContextCompat.getDrawable(context, R.drawable.ic_keyboard_arrow_right);
holder.search_title.setText(search);
assert next != null;
next.setBounds(0,0,100,100);
holder.search_title.setCompoundDrawables(null, null, next, null);
holder.search_container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

View File

@ -24,8 +24,6 @@
android:paddingTop="5dp"
android:orientation="vertical">
<TextView
android:drawableRight="@drawable/ic_keyboard_arrow_right"
android:drawableEnd="@drawable/ic_keyboard_arrow_right"
android:id="@+id/search_keyword"
android:textSize="18sp"
android:paddingBottom="10dp"