StatusItemViewAdapter add redundant casting for travis

This commit is contained in:
Jamorham 2018-01-26 17:10:43 +00:00
parent f30efd0224
commit ee0a53976f
No known key found for this signature in database
GPG key ID: 0BC5C3E0AAD64DF9

View file

@ -30,10 +30,10 @@ public class StatusItemViewAdapter {
public View inflateStatus(StatusItem statusItem) { public View inflateStatus(StatusItem statusItem) {
if (activity == null) return null; if (activity == null) return null;
final View child = activity.getLayoutInflater().inflate(R.layout.insightpump_statuselements, null); final View child = activity.getLayoutInflater().inflate(R.layout.insightpump_statuselements, null);
final TextView name = child.findViewById(R.id.insightstatuslabel); final TextView name = (TextView) child.findViewById(R.id.insightstatuslabel);
final TextView value = child.findViewById(R.id.insightstatusvalue); final TextView value = (TextView)child.findViewById(R.id.insightstatusvalue);
final TextView spacer = child.findViewById(R.id.insightstatusspacer); final TextView spacer = (TextView)child.findViewById(R.id.insightstatusspacer);
final LinearLayout layout = child.findViewById(R.id.insightstatuslayout); final LinearLayout layout = (LinearLayout)child.findViewById(R.id.insightstatuslayout);
if (statusItem.name.equals("line-break")) { if (statusItem.name.equals("line-break")) {
spacer.setVisibility(View.GONE); spacer.setVisibility(View.GONE);
@ -56,6 +56,11 @@ public class StatusItemViewAdapter {
value.setBackgroundColor(this_color); value.setBackgroundColor(this_color);
spacer.setBackgroundColor(this_color); spacer.setBackgroundColor(this_color);
if (this_color != Color.TRANSPARENT) {
name.setTextColor(Color.WHITE);
spacer.setTextColor(Color.WHITE);
}
if (holder != null) { if (holder != null) {
holder.addView(child); holder.addView(child);
} }