GithubHelp home page GithubHelp logo

calendarfill's Introduction

CalendarFill

add CalenarFill component in your layout xml

<br.com.mirespeiti.calendarfill.calendardiario.CalendarFillView
        android:id="@+id/fill_calendar"
        android:layout_width="match_parent"
        android:layout_height="350dp"
        android:paddingBottom="20dp"
        app:type_callback="both"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/fill_fake"
        app:layout_constraintStart_toStartOf="parent"/>

configure the initial setup of Calendar Fill, through the initSetupToolbarCalendar() method

bind.fillFake.initSetupToolbarCalendar(  
    initMonth = Calendar.getInstance(),  
  datesColors = viewModel.fakeDates(Calendar.getInstance()),  
  notReturn = { viewModel.getFakeDates(it) },  
  adapter = YourCustomAdapterFill(calendarFillContext = bind.fillFake, selectedDay = Date()),  
  datesColors = listOf<CalendarItem>()  
    colors = object : ColorFill() {
    // set your colors   
        override var selected: Int = android.R.color.holo_red_dark  
  override var default: Int = android.R.color.holo_green_dark  
  override var secondary: Int = android.R.color.holo_purple  
  }           
)

you can create your own calendar through the abstract class CalendarFull BaseAdapter

#### has a default adapter (it's very nice), you don't need to create your own.
abstract class CalendarFillBaseAdapter(  
 calendarFillContext: CalendarFillView,  
 open var colors: ColorFill = object : ColorFill() {},  
 open var dateColors: Array<CalendarioItem> = emptyArray(),  
 var currentMonth: Calendar,  
 var dates: List<Date> = calendarFillContext.fillDaysOnVisible(currentMonth),  
  @LayoutRes layout: Int = R.layout.item_calendar_adapter,  
) : ArrayAdapter<Date>(calendarFillContext.context, layout, dates), CalendarFillInterface {

... ... ...

}

change the borders to a pattern you like

Screenshots

Without filling the days of the month (default calendarfill) - Custom layout - Full month (default calendarfill)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.