Changeset View
Changeset View
Standalone View
Standalone View
src/org/kde/kdeconnect/UserInterface/List/SmallEntryItem.java
Show All 39 Lines | 30 | public class SmallEntryItem implements ListAdapter.Item { | |||
---|---|---|---|---|---|
40 | protected SmallEntryItem(String title, View.OnClickListener clickListener) { | 40 | protected 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 | v.setPadding( | ||||
49 | ((int) (28 * layoutInflater.getContext().getResources().getDisplayMetrics().density)), | ||||
50 | 0, | ||||
51 | ((int) (28 * layoutInflater.getContext().getResources().getDisplayMetrics().density)), | ||||
52 | 0 | ||||
53 | ); | ||||
48 | 54 | | |||
49 | TextView titleView = v.findViewById(android.R.id.text1); | 55 | TextView titleView = v.findViewById(android.R.id.text1); | ||
50 | if (titleView != null) { | 56 | if (titleView != null) { | ||
51 | titleView.setText(title); | 57 | titleView.setText(title); | ||
52 | if (clickListener != null) { | 58 | if (clickListener != null) { | ||
53 | titleView.setOnClickListener(clickListener); | 59 | titleView.setOnClickListener(clickListener); | ||
54 | v.setBackgroundDrawable(ContextCompat.getDrawable(layoutInflater.getContext(), R.drawable.abc_list_selector_holo_dark)); | 60 | v.setBackgroundDrawable(ContextCompat.getDrawable(layoutInflater.getContext(), R.drawable.abc_list_selector_holo_dark)); | ||
55 | } | 61 | } | ||
56 | } | 62 | } | ||
57 | 63 | | |||
58 | return v; | 64 | return v; | ||
59 | } | 65 | } | ||
60 | 66 | | |||
61 | } | 67 | } |