mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-13 09:13:56 +01:00
add the horizontal grid in weekly view
This commit is contained in:
parent
41922a7579
commit
915909f330
@ -16,11 +16,13 @@ import android.widget.TextView
|
||||
import com.simplemobiletools.calendar.R
|
||||
import com.simplemobiletools.calendar.activities.EventActivity
|
||||
import com.simplemobiletools.calendar.activities.MainActivity
|
||||
import com.simplemobiletools.calendar.adapters.WeekEventsAdapter
|
||||
import com.simplemobiletools.calendar.extensions.config
|
||||
import com.simplemobiletools.calendar.extensions.seconds
|
||||
import com.simplemobiletools.calendar.extensions.secondsInWeek
|
||||
import com.simplemobiletools.calendar.helpers.*
|
||||
import com.simplemobiletools.calendar.helpers.EVENT_ID
|
||||
import com.simplemobiletools.calendar.helpers.Formatter
|
||||
import com.simplemobiletools.calendar.helpers.WEEK_START_TIMESTAMP
|
||||
import com.simplemobiletools.calendar.helpers.WeeklyCalendarImpl
|
||||
import com.simplemobiletools.calendar.interfaces.WeeklyCalendar
|
||||
import com.simplemobiletools.calendar.models.Event
|
||||
import com.simplemobiletools.calendar.views.MyScrollView
|
||||
@ -66,16 +68,10 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
||||
updateScrollY(Math.max(MainActivity.mWeekScrollY, minScrollY))
|
||||
}
|
||||
})
|
||||
|
||||
week_events_grid.adapter = WeekEventsAdapter(context, mWeekTimestamp) {
|
||||
Intent(context, EventActivity::class.java).apply {
|
||||
putExtra(NEW_EVENT_START_TS, it)
|
||||
startActivity(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(0..6).map { (LayoutInflater.from(context).inflate(R.layout.stroke_width_divider, mView.week_vertical_grid_holder, true)) }
|
||||
(0..6).map { (LayoutInflater.from(context).inflate(R.layout.stroke_vertical_divider, mView.week_vertical_grid_holder)) }
|
||||
(0..23).map { (LayoutInflater.from(context).inflate(R.layout.stroke_horizontal_divider, mView.week_horizontal_grid_holder)) }
|
||||
|
||||
mCalendar = WeeklyCalendarImpl(this, context)
|
||||
wasFragmentInit = true
|
||||
|
@ -19,18 +19,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<GridView
|
||||
android:id="@+id/week_events_grid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/weekly_view_events_height"
|
||||
android:numColumns="7"
|
||||
android:verticalSpacing="1px"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/week_events_columns_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/weekly_view_events_height"
|
||||
android:layout_alignLeft="@+id/week_events_grid"
|
||||
android:background="@android:color/transparent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
@ -77,6 +69,13 @@
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/week_horizontal_grid_holder"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/weekly_view_events_height"
|
||||
android:orientation="vertical"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</com.simplemobiletools.calendar.views.MyScrollView>
|
||||
|
||||
|
7
app/src/main/res/layout/stroke_horizontal_divider.xml
Normal file
7
app/src/main/res/layout/stroke_horizontal_divider.xml
Normal 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_bottom"/>
|
Loading…
Reference in New Issue
Block a user