1
0
mirror of https://github.com/etesync/android synced 2025-01-11 00:01:12 +00:00

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.
This commit is contained in:
Tom Hacohen 2017-04-03 13:32:14 +01:00
parent 7915a51f1f
commit 15580374fa
7 changed files with 63 additions and 43 deletions

View File

@ -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;
}

View File

@ -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);
}

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:alpha="0.54" >
<path
android:fillColor="#FF000000"
android:pathData="M12,4A4,4 0 0,1 16,8A4,4 0 0,1 12,12A4,4 0 0,1 8,8A4,4 0 0,1 12,4M12,14C16.42,14 20,15.79 20,18V20H4V18C4,15.79 7.58,14 12,14Z" />
</vector>

View File

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/light_green700"
android:padding="8dp"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:textColor="@android:color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="Title"/>
</LinearLayout>

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="Title"/>
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="Subtitle"/>
</LinearLayout>

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="8dp">
<ImageView
android:layout_gravity="center"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_account_dark" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
tools:text="me@etesync.com" />
<TextView
android:id="@+id/description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:text="EteSync" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="?android:attr/expandableListPreferredItemPaddingLeft">
<include layout="@layout/import_content_list_account" />
</LinearLayout>