Navdrawer: Change text color, not imageview

This commit is contained in:
Bradlee Speice 2014-07-20 21:50:49 -04:00
parent 9a2ede432e
commit 54c3dd01a9
3 changed files with 3 additions and 20 deletions

View File

@ -1,12 +1,10 @@
package org.bspeice.minimalbible.activity; package org.bspeice.minimalbible.activity;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import org.bspeice.minimalbible.R; import org.bspeice.minimalbible.R;
@ -74,9 +72,6 @@ public class NavDrawerAdapter<T> extends BaseAdapter {
*/ */
protected class NavItemHolder { protected class NavItemHolder {
@InjectView(R.id.navlist_selected_highlight)
ImageView highlight;
@InjectView(R.id.navlist_content) @InjectView(R.id.navlist_content)
TextView content; TextView content;
@ -94,11 +89,9 @@ public class NavDrawerAdapter<T> extends BaseAdapter {
public void bind() { public void bind() {
content.setText(object.toString()); content.setText(object.toString());
if (highlighted) { if (highlighted) {
highlight.setImageDrawable(new ColorDrawable(v.getResources() content.setTextColor(v.getResources().getColor(R.color.navbar_highlight));
.getColor(R.color.navbar_highlight)));
} else { } else {
highlight.setImageDrawable(new ColorDrawable(v.getResources() content.setTextColor(v.getResources().getColor(R.color.navbar_unhighlighted));
.getColor(R.color.navbar_unhighlighted)));
} }
} }
} }

View File

@ -4,16 +4,6 @@
android:orientation="horizontal" android:layout_width="match_parent" android:orientation="horizontal" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/navlist_selected_highlight"
android:minHeight="@dimen/navigation_drawer_highlight_height"
android:minWidth="24dp"
android:layout_gravity="center_vertical|right"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"/>
<!-- Largely taken from simple_list_item_1.xml --> <!-- Largely taken from simple_list_item_1.xml -->
<TextView <TextView
style="?android:attr/textAppearanceListItemSmall" style="?android:attr/textAppearanceListItemSmall"

View File

@ -3,5 +3,5 @@
<color name="statusbar">#dddddd</color> <color name="statusbar">#dddddd</color>
<color name="actionbar">#ffffff</color> <color name="actionbar">#ffffff</color>
<color name="navbar_highlight">#cc0000</color> <color name="navbar_highlight">#cc0000</color>
<color name="navbar_unhighlighted">#00cc0000</color> <color name="navbar_unhighlighted">#000000</color>
</resources> </resources>