mirror of
https://github.com/MinimalBible/MinimalBible
synced 2024-11-04 23:28:19 -05:00
Navdrawer: Change text color, not imageview
This commit is contained in:
parent
9a2ede432e
commit
54c3dd01a9
@ -1,12 +1,10 @@
|
||||
package org.bspeice.minimalbible.activity;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.bspeice.minimalbible.R;
|
||||
@ -74,9 +72,6 @@ public class NavDrawerAdapter<T> extends BaseAdapter {
|
||||
*/
|
||||
|
||||
protected class NavItemHolder {
|
||||
@InjectView(R.id.navlist_selected_highlight)
|
||||
ImageView highlight;
|
||||
|
||||
@InjectView(R.id.navlist_content)
|
||||
TextView content;
|
||||
|
||||
@ -94,11 +89,9 @@ public class NavDrawerAdapter<T> extends BaseAdapter {
|
||||
public void bind() {
|
||||
content.setText(object.toString());
|
||||
if (highlighted) {
|
||||
highlight.setImageDrawable(new ColorDrawable(v.getResources()
|
||||
.getColor(R.color.navbar_highlight)));
|
||||
content.setTextColor(v.getResources().getColor(R.color.navbar_highlight));
|
||||
} else {
|
||||
highlight.setImageDrawable(new ColorDrawable(v.getResources()
|
||||
.getColor(R.color.navbar_unhighlighted)));
|
||||
content.setTextColor(v.getResources().getColor(R.color.navbar_unhighlighted));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,16 +4,6 @@
|
||||
android:orientation="horizontal" android:layout_width="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 -->
|
||||
<TextView
|
||||
style="?android:attr/textAppearanceListItemSmall"
|
||||
|
@ -3,5 +3,5 @@
|
||||
<color name="statusbar">#dddddd</color>
|
||||
<color name="actionbar">#ffffff</color>
|
||||
<color name="navbar_highlight">#cc0000</color>
|
||||
<color name="navbar_unhighlighted">#00cc0000</color>
|
||||
<color name="navbar_unhighlighted">#000000</color>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user