Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/UserInterface/List/SmallEntryItem.java
Show All 40 Lines | 40 | public SmallEntryItem(String title, View.OnClickListener clickListener) { | |||
---|---|---|---|---|---|
41 | this.title = title; | 41 | this.title = title; | ||
42 | this.clickListener = clickListener; | 42 | this.clickListener = clickListener; | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | @Override | 45 | @Override | ||
46 | public View inflateView(LayoutInflater layoutInflater) { | 46 | public View inflateView(LayoutInflater layoutInflater) { | ||
47 | View v = layoutInflater.inflate(android.R.layout.simple_list_item_1, null); | 47 | View v = layoutInflater.inflate(android.R.layout.simple_list_item_1, null); | ||
48 | 48 | | |||
49 | TextView titleView = (TextView)v.findViewById(android.R.id.text1); | 49 | TextView titleView = (TextView) v.findViewById(android.R.id.text1); | ||
50 | if (titleView != null) { | 50 | if (titleView != null) { | ||
51 | titleView.setText(title); | 51 | titleView.setText(title); | ||
52 | if (clickListener != null) { | 52 | if (clickListener != null) { | ||
53 | titleView.setOnClickListener(clickListener); | 53 | titleView.setOnClickListener(clickListener); | ||
54 | v.setBackgroundDrawable(ContextCompat.getDrawable(layoutInflater.getContext(), R.drawable.abc_list_selector_holo_dark)); | 54 | v.setBackgroundDrawable(ContextCompat.getDrawable(layoutInflater.getContext(), R.drawable.abc_list_selector_holo_dark)); | ||
55 | } | 55 | } | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | return v; | 58 | return v; | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | } | 61 | } |