Skip to content

Instantly share code, notes, and snippets.

@auramo
Created March 12, 2014 19:59
Show Gist options
  • Save auramo/9515103 to your computer and use it in GitHub Desktop.
Save auramo/9515103 to your computer and use it in GitHub Desktop.
class WeeksAdapter(activity: Activity, dimensions: ScreenParameters) extends BaseAdapter {
val nowIndex = Integer.MAX_VALUE/2
val nowDateTime = new DateTime().withTimeAtStartOfDay
val nowWeek = nowDateTime.getWeekyear
def positionOfNow: Int = nowIndex
override def getCount: Int = Integer.MAX_VALUE
override def getItem(position: Int): YearAndWeek = YearAndWeek.from(nowDateTime.plusWeeks(position - nowIndex))
override def getItemId(position: Int): Long = position
override def getView(position: Int, convertView: View, parent: ViewGroup): View = {
val wholeLineLayout : LinearLayout = new LinearLayout(activity)
wholeLineLayout.setOrientation(LinearLayout.HORIZONTAL)
val yearAndWeek = getItem(position)
render(Nil)
def render(eventsOfWeek: Seq[CalendarEvent]): Unit = {
//samat kurat ku ennenkin
}
wholeLineLayout.getRootView
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment