summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/ProviderRenderer.java
blob: 6e194e842f239d1e67d71b1cc6602b765e079eb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package se.leap.bitmaskclient;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.pedrogomez.renderers.Renderer;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnItemClick;
import butterknife.OnItemSelected;

/**
 * Created by parmegv on 4/12/14.
 */
public class ProviderRenderer extends Renderer<Provider> {
    private final Context context;

    @InjectView(R.id.provider_name)
    TextView name;
    @InjectView(R.id.provider_domain)
    TextView domain;

    public ProviderRenderer(Context context) {
        this.context = context;
    }

    @Override
    protected View inflate(LayoutInflater inflater, ViewGroup parent) {
        View view = inflater.inflate(R.layout.provider_list_item, parent, false);
        ButterKnife.inject(this, view);
        return view;
    }

    @Override
    protected void setUpView(View rootView) {
        /*
         * Empty implementation substituted with the usage of ButterKnife library by Jake Wharton.
         */
    }

    @Override
    protected void hookListeners(View rootView) {
        //Empty
    }

    @Override
    public void render() {
        Provider provider = getContent();
        name.setText(provider.getName());
        domain.setText(provider.getDomain());
    }
}