All Projects → MoyuruAizawa → Timetablelayout

MoyuruAizawa / Timetablelayout

Licence: apache-2.0
TimetableLayout is a RecyclerView.LayoutManager to display the timetable for Android.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Timetablelayout

CardLayoutManager
A custom layoutManager providing a Tinder-like cards effect.
Stars: ✭ 37 (-94.9%)
Mutual labels:  recyclerview, layoutmanager
SpannedGridLayoutManager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 522 (-28.1%)
Mutual labels:  recyclerview, layoutmanager
epg magic carousel
Awesome RecyclerView with custom LayoutManager
Stars: ✭ 98 (-86.5%)
Mutual labels:  recyclerview, layoutmanager
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+662.12%)
Mutual labels:  layoutmanager, recyclerview
Stackcardlayoutmanager
Stars: ✭ 376 (-48.21%)
Mutual labels:  layoutmanager, recyclerview
Cardstackview
📱Tinder like swipeable card view for Android
Stars: ✭ 1,850 (+154.82%)
Mutual labels:  layoutmanager, recyclerview
SlideView
🔖 Card RecycleViewManager, to make your interface cool.Use recyclerView to add cool effects to the view.
Stars: ✭ 16 (-97.8%)
Mutual labels:  recyclerview, layoutmanager
Cardswipelayout
Use RecyclerView to achieve card swipe layout , like Tantan . (模仿探探卡片滑动效果的布局)
Stars: ✭ 1,081 (+48.9%)
Mutual labels:  layoutmanager, recyclerview
Stacklayoutmanager
customized layoutmanager,let item pile up like stackview/类似最美有物卡片堆叠效果
Stars: ✭ 343 (-52.75%)
Mutual labels:  layoutmanager, recyclerview
Horizontalpicker
A simple, customizable and easy to use picker where centre view is scaled up
Stars: ✭ 337 (-53.58%)
Mutual labels:  layoutmanager, recyclerview
Carouselrecyclerview
Carousel Recyclerview let's you create carousel layout with the power of recyclerview by creating custom layout manager.
Stars: ✭ 107 (-85.26%)
Mutual labels:  layoutmanager, recyclerview
Awesome Recyclerview Layoutmanager
RecyclerView-LayoutManager Resources
Stars: ✭ 581 (-19.97%)
Mutual labels:  layoutmanager, recyclerview
Jkcardlayout
高仿即刻APP探索页卡片布局拖拽、卡片前进、回退和下拉效果,采用RecyclerView和自定义LayoutManager实现
Stars: ✭ 111 (-84.71%)
Mutual labels:  layoutmanager, recyclerview
RollingLayoutManager
vrgsoft.net
Stars: ✭ 57 (-92.15%)
Mutual labels:  recyclerview, layoutmanager
Reel Search Android
Reel Search for Android is a UI/UX design for autocomplete action. It is a beautiful minimalistic addition to any use case.
Stars: ✭ 110 (-84.85%)
Mutual labels:  layoutmanager, recyclerview
InfiniteScrollRecyclerView
Enables the RecyclerView to Auto scroll for indefinite time.
Stars: ✭ 49 (-93.25%)
Mutual labels:  recyclerview, layoutmanager
Focuslayoutmanager
有焦点item的水平/垂直滚动RecyclerView-LayoutManager。仿Android豆瓣书影音“推荐“频道列表布局
Stars: ✭ 772 (+6.34%)
Mutual labels:  layoutmanager, recyclerview
Turn Layout Manager
A carousel layout manager for RecyclerView
Stars: ✭ 946 (+30.3%)
Mutual labels:  layoutmanager, recyclerview
Chipslayoutmanager
ANDROID. ChipsLayoutManager (SpanLayoutManager, FlowLayoutManager). A custom layout manager for RecyclerView which mimicric TextView span behaviour, flow layouts behaviour with support of amazing recyclerView features
Stars: ✭ 3,138 (+332.23%)
Mutual labels:  layoutmanager, recyclerview
Spannedgridlayoutmanager
Android RecyclerView.LayoutManager that resizes and reorders views based on SpanSize
Stars: ✭ 492 (-32.23%)
Mutual labels:  layoutmanager, recyclerview

TimetableLayout

Platform API License Download Build Status
TimetableLayout is a layout manager and item decorations to display the timetable.

sample01 sample02

Usage

Dependency

implementation 'io.moyuru:timetablelayout:1.0.0-alpha02'

LayoutManager

recyclerView.layoutManager = TimetableLayoutManager(columnWidth, heightPerMin) { position ->
  val period = periods[position]
  TimetableLayoutManager.PeriodInfo(period.startAt, period.endAt, period.stageNumber)
}

ItemDecoration

recyclerView.addItemDecoration(ProgramTimeLabelDecoration(context, periods, heightPerMin))
recyclerView.addItemDecoration(StageNameDecoration(context, periods, columnCount))

class ProgramTimeLabelDecoration(private val periods: List<Period>, ...) : TimeLabelDecoration(...) {

  private val formatter = DateTimeFormatter.ofPattern("HH:mm")

  override fun canDecorate(position: Int): Boolean = periods.getOrNull(position) is Program

  override fun getStartUnixMillis(position: Int): Long = periods.getOrNull(position)?.startAt ?: 0

  override fun formatUnixMillis(unixMillis: Long): String =
    LocalDateTime.ofEpochSecond(unixMillis / 1000, 0, ZoneOffset.UTC).format(formatter)
}

class StageNameDecoration(private val periods: List<Period>, ...) : ColumnNameDecoration(...) {

  override fun getColumnNumber(position: Int): Int {
    return periods.getOrNull(position)?.stageNumber ?: 0
  }

  override fun getColumnName(columnNumber: Int): String {
    return when (columnNumber) {
      0 -> "Melodic Hardcore"
      1 -> "Metalcore"
      2 -> "Hardcore"
      3 -> "Deathcore"
      else -> "Djent"
    }
  }
}

Sample

License

Copyright 2019 Moyuru Aizawa

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].