From 15580374fa87cbcd59a868bb6ae2b5187cac7fc2 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 3 Apr 2017 13:32:14 +0100 Subject: [PATCH] Import: Make the select calendar/account lists nicer This also adds an icon (that will soon be replaced with the icon of the relevant account), and shares the design between the calendar and the contacts. --- .../LocalCalendarImportFragment.java | 7 +++- .../LocalContactImportFragment.java | 2 +- app/src/main/res/drawable/ic_account_dark.xml | 10 ++++++ .../layout/import_calendars_list_group.xml | 20 ----------- .../res/layout/import_contacts_list_item.xml | 21 ----------- .../layout/import_content_list_account.xml | 36 +++++++++++++++++++ .../res/layout/import_content_list_header.xml | 10 ++++++ 7 files changed, 63 insertions(+), 43 deletions(-) create mode 100644 app/src/main/res/drawable/ic_account_dark.xml delete mode 100644 app/src/main/res/layout/import_calendars_list_group.xml delete mode 100644 app/src/main/res/layout/import_contacts_list_item.xml create mode 100644 app/src/main/res/layout/import_content_list_account.xml create mode 100644 app/src/main/res/layout/import_content_list_header.xml diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.java b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.java index bf3dc046..aa0fb03d 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalCalendarImportFragment.java @@ -97,6 +97,7 @@ public class LocalCalendarImportFragment extends ListFragment { private class GroupViewHolder { TextView titleTextView; + TextView descriptionTextView; } @Override @@ -163,7 +164,7 @@ public class LocalCalendarImportFragment extends ListFragment { if (convertView == null) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.import_calendars_list_group, null); + convertView = inflater.inflate(R.layout.import_content_list_header, null); } if (convertView.getTag() != null) { viewHolder = (GroupViewHolder) convertView.getTag(); @@ -171,9 +172,13 @@ public class LocalCalendarImportFragment extends ListFragment { viewHolder = new GroupViewHolder(); viewHolder.titleTextView = (TextView) convertView .findViewById(R.id.title); + viewHolder.descriptionTextView = (TextView) convertView + .findViewById(R.id.description); convertView.setTag(viewHolder); } viewHolder.titleTextView.setText(headerTitle); + viewHolder.descriptionTextView.setText(headerTitle); + return convertView; } diff --git a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java index 501bf885..0288f6bc 100644 --- a/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java +++ b/app/src/main/java/com/etesync/syncadapter/ui/importlocal/LocalContactImportFragment.java @@ -235,7 +235,7 @@ public class LocalContactImportFragment extends Fragment { public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { // Create a new view. View v = LayoutInflater.from(viewGroup.getContext()) - .inflate(R.layout.import_contacts_list_item, viewGroup, false); + .inflate(R.layout.import_content_list_account, viewGroup, false); return new ViewHolder(v, mOnAccountSelected); } diff --git a/app/src/main/res/drawable/ic_account_dark.xml b/app/src/main/res/drawable/ic_account_dark.xml new file mode 100644 index 00000000..11d70533 --- /dev/null +++ b/app/src/main/res/drawable/ic_account_dark.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/layout/import_calendars_list_group.xml b/app/src/main/res/layout/import_calendars_list_group.xml deleted file mode 100644 index 1156eb47..00000000 --- a/app/src/main/res/layout/import_calendars_list_group.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/import_contacts_list_item.xml b/app/src/main/res/layout/import_contacts_list_item.xml deleted file mode 100644 index 82b598c6..00000000 --- a/app/src/main/res/layout/import_contacts_list_item.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/import_content_list_account.xml b/app/src/main/res/layout/import_content_list_account.xml new file mode 100644 index 00000000..0f49dc09 --- /dev/null +++ b/app/src/main/res/layout/import_content_list_account.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/import_content_list_header.xml b/app/src/main/res/layout/import_content_list_header.xml new file mode 100644 index 00000000..f80b4e4d --- /dev/null +++ b/app/src/main/res/layout/import_content_list_header.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file