diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt index feb2720bd..6a494f852 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/fragments/WeekFragmentsHolder.kt @@ -62,6 +62,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener { private fun setupFragment() { val weekTSs = getWeekTimestamps(currentWeekTS) val weeklyAdapter = MyWeekPagerAdapter(activity!!.supportFragmentManager, weekTSs, this) + val itemHeight = context!!.config.weeklyViewItemHeight.toInt() val textColor = context!!.config.textColor weekHolder!!.week_view_hours_holder.removeAllViews() @@ -71,6 +72,7 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener { (layoutInflater.inflate(R.layout.weekly_view_hour_textview, null, false) as TextView).apply { text = formattedHours setTextColor(textColor) + height = itemHeight weekHolder!!.week_view_hours_holder.addView(this) } } @@ -107,6 +109,14 @@ class WeekFragmentsHolder : MyFragmentHolder(), WeekFragmentListener { updateActionBarTitle() } + private fun updateRowHeight() { + val childCnt = weekHolder!!.week_view_hours_holder.childCount + for (i in 0..childCnt) { + val textView = weekHolder!!.week_view_hours_holder.getChildAt(i) as? TextView ?: continue + textView.layoutParams.height = context!!.config.weeklyViewItemHeight.toInt() + } + } + private fun getWeekTimestamps(targetSeconds: Long): List { val weekTSs = ArrayList(PREFILLED_WEEKS) val dateTime = Formatter.getDateTimeFromTS(targetSeconds) diff --git a/app/src/main/res/layout/weekly_view_hour_textview.xml b/app/src/main/res/layout/weekly_view_hour_textview.xml index 1022bc429..5cca0cdaa 100644 --- a/app/src/main/res/layout/weekly_view_hour_textview.xml +++ b/app/src/main/res/layout/weekly_view_hour_textview.xml @@ -5,7 +5,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="bottom|center_horizontal" - android:minHeight="@dimen/weekly_view_row_height" android:paddingStart="@dimen/small_margin" android:paddingEnd="@dimen/small_margin" android:textSize="@dimen/normal_text_size" />