package com.funnyhatsoftware.spacedock.holder;

import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.widget.TextView;

import com.funnyhatsoftware.spacedock.data.SetItem;

/**
 * Maps SetItem data to views
 */
public abstract class ItemHolder {
    public void navigateToDetailsActivity(Context context, SetItem item, Class activityClass) {
        String id = item.getExternalId();
        Intent intent = new Intent(context, activityClass);
        intent.putExtra("externalId", id);
        context.startActivity(intent);
    }
    public abstract void reinitialize(Resources res, Object item);
    public abstract void navigateToDetails(Context context, Object item);

    protected static void setPositiveIntegerText(TextView textView, int value) {
        if (value > 0) {
            textView.setText(Integer.toString(value));
        } else {
            textView.setText(null);
        }
    }
}

@@ -142,16 +142,42 @@
 ources;%0A
+import android.view.View;%0A
 import a
@@ -928,50 +928,152 @@
     
-%7D else %7B%0A            textView.setText(null
+    textView.setVisibility(View.VISIBLE);%0A        %7D else %7B%0A            textView.setText(null);%0A            textView.setVisibility(View.INVISIBLE
 );%0A 

Fix weapon/flagship background visibility