Skip to content

Commit

Permalink
Finalize tablet recipe selector stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport committed Jun 13, 2015
1 parent fc646cb commit 82ac31c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion res/drawable/selector_tablet.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<!-- This item masks the stroke on the sides where we don't want to see it -->
<item android:left="5dp">
<shape android:shape="rectangle">
<solid android:color="#FFFFFF" />
<solid android:color="@color/tablet_selector_bg" />
</shape>
</item>
</layer-list>
1 change: 1 addition & 0 deletions res/values/color.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<color name="theme_brown">#B38D42</color>
<color name="theme_grey">#E6E6E6</color>

<color name="tablet_selector_bg">#E6E6E6</color>
<color name="button_color">#FFFFFF</color>
<color name="background">#FFFFFF</color>
<color name="activity_background">#FFFFFF</color>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,25 @@ public View getView(int position, View convertView, ViewGroup parent) {
vs.volView.setText(String.format("%2.2f", list.get(position).getDisplayBatchSize()));
vs.unitsView.setText(list.get(position).getVolumeUnits());

// Set beer color
color = ColorHandler.getSrmColor(list.get(position).getColor());
vs.imageView.setBackgroundColor(Color.parseColor(color));

// If we're running as a tablet, we should do some extra stuff here.
if (frag.isTablet) {
// If currently selected, set the background to indicate it.
// Otherwise, set the background to transparent.
if (position == frag.currentSelectedIndex) {
row.setBackgroundResource(R.drawable.selector_tablet);
vs.imageView.setImageResource(R.drawable.beer_icon_selected);
}
else {
row.setBackgroundColor(Color.parseColor("#00FFFFFF"));
vs.imageView.setImageResource(R.drawable.beer_icon);
}
}

// Set beer color
color = ColorHandler.getSrmColor(list.get(position).getColor());
vs.imageView.setBackgroundColor(Color.parseColor(color));


return row;
}

Expand Down

0 comments on commit 82ac31c

Please sign in to comment.