Created
March 12, 2014 19:59
-
-
Save auramo/9515103 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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