fix #1313, dim past events at the month/day view too
This commit is contained in:
parent
1d0072b633
commit
ab0a8153f1
|
@ -958,7 +958,7 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||||
search_results_list.beVisibleIf(events.isNotEmpty())
|
search_results_list.beVisibleIf(events.isNotEmpty())
|
||||||
search_placeholder.beVisibleIf(events.isEmpty())
|
search_placeholder.beVisibleIf(events.isEmpty())
|
||||||
val listItems = getEventListItems(events)
|
val listItems = getEventListItems(events)
|
||||||
val eventsAdapter = EventListAdapter(this, listItems, true, this, search_results_list, true) {
|
val eventsAdapter = EventListAdapter(this, listItems, true, this, search_results_list) {
|
||||||
if (it is ListEvent) {
|
if (it is ListEvent) {
|
||||||
Intent(applicationContext, EventActivity::class.java).apply {
|
Intent(applicationContext, EventActivity::class.java).apply {
|
||||||
putExtra(EVENT_ID, it.id)
|
putExtra(EVENT_ID, it.id)
|
||||||
|
|
|
@ -46,7 +46,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
EventListAdapter(this, getListItems(), false, null, config_events_list, true) {}.apply {
|
EventListAdapter(this, getListItems(), false, null, config_events_list) {}.apply {
|
||||||
updateTextColor(mTextColor)
|
updateTextColor(mTextColor)
|
||||||
config_events_list.adapter = this
|
config_events_list.adapter = this
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ import kotlinx.android.synthetic.main.event_list_section.view.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListItem>, val allowLongClick: Boolean, val listener: RefreshRecyclerViewListener?,
|
class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListItem>, val allowLongClick: Boolean, val listener: RefreshRecyclerViewListener?,
|
||||||
recyclerView: MyRecyclerView, val tryDimPastEvents: Boolean, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
|
recyclerView: MyRecyclerView, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, null, itemClick) {
|
||||||
|
|
||||||
private val topDivider = resources.getDrawable(R.drawable.divider_width)
|
private val topDivider = resources.getDrawable(R.drawable.divider_width)
|
||||||
private val allDayString = resources.getString(R.string.all_day)
|
private val allDayString = resources.getString(R.string.all_day)
|
||||||
|
@ -177,7 +177,7 @@ class EventListAdapter(activity: SimpleActivity, var listItems: ArrayList<ListIt
|
||||||
startTextColor = adjustedPrimaryColor
|
startTextColor = adjustedPrimaryColor
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tryDimPastEvents && dimPastEvents && listEvent.isPastEvent && !isPrintVersion) {
|
if (dimPastEvents && listEvent.isPastEvent && !isPrintVersion) {
|
||||||
startTextColor = startTextColor.adjustAlpha(LOWER_ALPHA)
|
startTextColor = startTextColor.adjustAlpha(LOWER_ALPHA)
|
||||||
endTextColor = endTextColor.adjustAlpha(LOWER_ALPHA)
|
endTextColor = endTextColor.adjustAlpha(LOWER_ALPHA)
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,7 @@ class EventListFragment : MyFragmentHolder(), RefreshRecyclerViewListener {
|
||||||
|
|
||||||
val currAdapter = mView.calendar_events_list.adapter
|
val currAdapter = mView.calendar_events_list.adapter
|
||||||
if (currAdapter == null || forceRecreation) {
|
if (currAdapter == null || forceRecreation) {
|
||||||
EventListAdapter(activity as SimpleActivity, listItems, true, this, mView.calendar_events_list, true) {
|
EventListAdapter(activity as SimpleActivity, listItems, true, this, mView.calendar_events_list) {
|
||||||
if (it is ListEvent) {
|
if (it is ListEvent) {
|
||||||
context?.editEvent(it)
|
context?.editEvent(it)
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ class MonthDayFragment : Fragment(), MonthlyCalendar, RefreshRecyclerViewListene
|
||||||
|
|
||||||
val currAdapter = mHolder.month_day_events_list.adapter
|
val currAdapter = mHolder.month_day_events_list.adapter
|
||||||
if (currAdapter == null) {
|
if (currAdapter == null) {
|
||||||
EventListAdapter(activity as SimpleActivity, listItems, true, this, month_day_events_list, false) {
|
EventListAdapter(activity as SimpleActivity, listItems, true, this, month_day_events_list) {
|
||||||
if (it is ListEvent) {
|
if (it is ListEvent) {
|
||||||
activity?.editEvent(it)
|
activity?.editEvent(it)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue