From d059f5811490d1835379300df507f515faa90032 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 5 Feb 2017 11:36:39 +0100 Subject: [PATCH] fix section divider width --- .../calendar/adapters/EventListAdapter.kt | 3 ++- .../calendar/adapters/EventListWidgetAdapterOld.kt | 2 +- app/src/main/res/drawable/divider_width.xml | 12 ++++++++++++ app/src/main/res/layout/event_list_section.xml | 2 +- .../main/res/layout/event_list_section_widget.xml | 2 +- 5 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/divider_width.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt index 02e997e14..12473a164 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListAdapter.kt @@ -51,7 +51,7 @@ class EventListAdapter(val activity: SimpleActivity, val mItems: List, init { textColor = activity.config.textColor - topDivider = activity.resources.getDrawable(R.drawable.divider) + topDivider = activity.resources.getDrawable(R.drawable.divider_width) primaryColor = activity.config.primaryColor val mTodayCode = Formatter.getDayCodeFromTS(mNow) todayDate = Formatter.getDayTitle(activity, mTodayCode) @@ -101,6 +101,7 @@ class EventListAdapter(val activity: SimpleActivity, val mItems: List, override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder { val layoutId = if (viewType == ITEM_EVENT) R.layout.event_list_item else R.layout.event_list_section val view = LayoutInflater.from(parent?.context).inflate(layoutId, parent, false) + return if (viewType == ITEM_EVENT) EventListAdapter.ViewHolder(activity, view, itemClick) else diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt index f58bdac5e..9cc9b933d 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/adapters/EventListWidgetAdapterOld.kt @@ -24,7 +24,7 @@ class EventListWidgetAdapterOld(val context: Context, val mEvents: List + + + + + + + diff --git a/app/src/main/res/layout/event_list_section.xml b/app/src/main/res/layout/event_list_section.xml index 655f45385..dcd64f8a1 100644 --- a/app/src/main/res/layout/event_list_section.xml +++ b/app/src/main/res/layout/event_list_section.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:drawablePadding="1dp" - android:drawableTop="@drawable/divider" + android:drawableTop="@drawable/divider_width" android:paddingTop="@dimen/small_margin" android:textSize="@dimen/normal_text_size" android:textStyle="bold"/> diff --git a/app/src/main/res/layout/event_list_section_widget.xml b/app/src/main/res/layout/event_list_section_widget.xml index 174ecde77..b99377302 100644 --- a/app/src/main/res/layout/event_list_section_widget.xml +++ b/app/src/main/res/layout/event_list_section_widget.xml @@ -5,7 +5,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:drawablePadding="1dp" - android:drawableTop="@drawable/divider" + android:drawableTop="@drawable/divider_width" android:paddingTop="@dimen/small_margin" android:textSize="@dimen/normal_text_size" android:textStyle="bold"/>