I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit d6c20baf authored by str4d's avatar str4d
Browse files

Material design: one-line text lists

parent b8998db3
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,7 @@ public class HelpListFragment extends ListFragment { ...@@ -36,7 +36,7 @@ public class HelpListFragment extends ListFragment {
public void onActivityCreated(Bundle savedInstanceState) { public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState); super.onActivityCreated(savedInstanceState);
setListAdapter(ArrayAdapter.createFromResource(getActivity(), setListAdapter(ArrayAdapter.createFromResource(getActivity(),
R.array.help_categories, android.R.layout.simple_list_item_1)); R.array.help_categories, R.layout.listitem_text));
} }
@Override @Override
......
...@@ -14,7 +14,7 @@ public class AddressEntryAdapter extends ArrayAdapter<AddressEntry> { ...@@ -14,7 +14,7 @@ public class AddressEntryAdapter extends ArrayAdapter<AddressEntry> {
private final LayoutInflater mInflater; private final LayoutInflater mInflater;
public AddressEntryAdapter(Context context) { public AddressEntryAdapter(Context context) {
super(context, R.layout.addressbook_list_item); super(context, R.layout.listitem_text);
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} }
...@@ -29,7 +29,7 @@ public class AddressEntryAdapter extends ArrayAdapter<AddressEntry> { ...@@ -29,7 +29,7 @@ public class AddressEntryAdapter extends ArrayAdapter<AddressEntry> {
@Override @Override
public View getView(int position, View convertView, ViewGroup parent) { public View getView(int position, View convertView, ViewGroup parent) {
View v = mInflater.inflate(R.layout.addressbook_list_item, parent, false); View v = mInflater.inflate(R.layout.listitem_text, parent, false);
AddressEntry address = getItem(position); AddressEntry address = getItem(position);
TextView text = (TextView) v.findViewById(R.id.text); TextView text = (TextView) v.findViewById(R.id.text);
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="6dp"
android:textSize="16sp" >
</TextView>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/listitem_height_one_line" android:layout_height="@dimen/listitem_height_one_line_avatar"
android:layout_marginEnd="@dimen/listitem_horizontal_margin" android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"> android:layout_marginRight="@dimen/listitem_horizontal_margin">
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="@dimen/listitem_height_one_line"
android:gravity="center_vertical"
android:paddingEnd="@dimen/listitem_horizontal_margin"
android:paddingLeft="@dimen/listitem_horizontal_margin"
android:paddingRight="@dimen/listitem_horizontal_margin"
android:paddingStart="@dimen/listitem_horizontal_margin"
android:textAppearance="@style/TextAppearance.AppCompat.Primary" />
\ No newline at end of file
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
<dimen name="listitem_text_left_margin">72dp</dimen> <dimen name="listitem_text_left_margin">72dp</dimen>
<dimen name="listitem_icon_left_margin">8dp</dimen> <dimen name="listitem_icon_left_margin">8dp</dimen>
<dimen name="listitem_height_one_line">56dp</dimen> <dimen name="listitem_height_one_line">48dp</dimen>
<dimen name="listitem_height_one_line_avatar">56dp</dimen>
<dimen name="listitem_height_two_lines">72dp</dimen> <dimen name="listitem_height_two_lines">72dp</dimen>
<dimen name="listitem_text_top_margin_two_lines">16dp</dimen> <dimen name="listitem_text_top_margin_two_lines">16dp</dimen>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment