add the vertical grid programmatically

This commit is contained in:
tibbi 2017-02-04 22:58:35 +01:00
parent 0a46941b9c
commit 07d06ba067
3 changed files with 12 additions and 45 deletions

View File

@ -75,6 +75,8 @@ class WeekFragment : Fragment(), WeeklyCalendar {
}
}
(0..6).map { (LayoutInflater.from(context).inflate(R.layout.stroke_width_divider, mView.week_vertical_grid_holder, true)) }
mCalendar = WeeklyCalendarImpl(this, context)
wasFragmentInit = true
return mView
@ -232,7 +234,6 @@ class WeekFragment : Fragment(), WeeklyCalendar {
val daysCnt = Days.daysBetween(Formatter.getDateTimeFromTS(minTS), Formatter.getDateTimeFromTS(maxTS)).days
activity.runOnUiThread {
val dayColumnWidth = getColumnWithId(1).width
mView.week_all_day_holder.addView(this)
(layoutParams as LinearLayout.LayoutParams).apply {
topMargin = mRes.getDimension(R.dimen.tiny_margin).toInt()

View File

@ -81,51 +81,10 @@
</com.simplemobiletools.calendar.views.MyScrollView>
<LinearLayout
android:id="@+id/week_vertical_grid_holder"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>
</LinearLayout>
android:layout_height="match_parent"
android:orientation="horizontal"/>
<RelativeLayout
android:id="@+id/week_top_holder"

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/stroke_right"/>