remove a redundant arraylist related to filling the week view
This commit is contained in:
parent
190a2bdcab
commit
f64212eb79
|
@ -6,9 +6,8 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.widget.BaseAdapter
|
||||
import com.simplemobiletools.calendar.R
|
||||
import com.simplemobiletools.calendar.models.Event
|
||||
|
||||
class WeekEventsAdapter(val context: Context, val mEvents: List<Event>) : BaseAdapter() {
|
||||
class WeekEventsAdapter(val context: Context) : BaseAdapter() {
|
||||
private val mInflater: LayoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE) as LayoutInflater
|
||||
|
||||
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
|
||||
|
@ -21,7 +20,7 @@ class WeekEventsAdapter(val context: Context, val mEvents: List<Event>) : BaseAd
|
|||
return view!!
|
||||
}
|
||||
|
||||
override fun getItem(position: Int) = mEvents[position]
|
||||
override fun getItem(position: Int) = null
|
||||
|
||||
override fun getItemId(position: Int) = 0L
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.simplemobiletools.calendar.models.Event
|
|||
import com.simplemobiletools.calendar.views.MyScrollView
|
||||
import kotlinx.android.synthetic.main.fragment_week.view.*
|
||||
import org.joda.time.DateTime
|
||||
import java.util.*
|
||||
|
||||
class WeekFragment : Fragment(), WeeklyCalendar {
|
||||
private var mListener: WeekScrollListener? = null
|
||||
|
@ -38,8 +37,7 @@ class WeekFragment : Fragment(), WeeklyCalendar {
|
|||
}
|
||||
})
|
||||
|
||||
mView.week_events_grid.adapter = WeekEventsAdapter(context, ArrayList<Event>())
|
||||
|
||||
mView.week_events_grid.adapter = WeekEventsAdapter(context)
|
||||
mCalendar = WeeklyCalendarImpl(this, context)
|
||||
return mView
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue