Skip to content

It is custom CalenderView which is basically inspired from iOS 7 style calendar, for Android

Notifications You must be signed in to change notification settings

Zulqurnain/ZCalenderView

Repository files navigation

ZCalendarView 📅

A custom iOS-style vertical calendar view with event marking support for Android

Banner Image

📸 Screenshots

Month View Day Selection Event Marking
Month View Day Selection Event Marking

✨ Features

  • 🗓️ Vertical month scrolling calendar
  • 🎯 Current day highlighting
  • 🔴 Custom event markers
  • 🎨 Theme customization options
  • 📱 Android 5.0+ (API 21+) support
  • 💯 100% Kotlin compatible
  • 🛠️ Regular maintenance and updates

💻 Installation

Gradle (via JitPack)

JitPack

  1. Add JitPack repository in your root settings.gradle:
dependencyResolutionManagement {
    repositories {
        maven { url "https://jitpack.io" }
    }
}
  1. Add dependency in your module's build.gradle:
dependencies {
    implementation 'com.github.Zulqurnain:ZCalenderView:2.0'
}

Maven

<project>
    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
    
    <dependency>
        <groupId>com.github.Zulqurnain</groupId>
        <artifactId>ZCalenderView</artifactId>
        <version>2.0</version>
    </dependency>
</project>

🚀 Usage

XML Layout

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <jutt.com.zcalenderview.ZCalenderView
        android:id="@+id/calendar_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:colorMonthName="@color/green"
        app:colorCurrentDayCircle="@color/red"
        app:calendarHeight="400dp"/>
</LinearLayout>

Kotlin Implementation

class MainActivity : AppCompatActivity(), DatePickerController {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        
        val calendarView = findViewById<ZCalenderView>(R.id.calendar_view).apply {
            setController(this@MainActivity)
            setEventsHashMap(createEventMap())
        }
        calendarView.scrollToToday()
    }

    private fun createEventMap() = mapOf<SimpleMonthAdapter.CalendarDay,Int>(
        SimpleMonthAdapter.CalendarDay(2024, Calendar.JANUARY, 15) to 1,
        SimpleMonthAdapter.CalendarDay(2024, Calendar.FEBRUARY, 14) to 2
    )

    override fun onDayOfMonthSelected(year: Int, month: Int, day: Int) {
        Toast.makeText(this, "Selected: ${day}/${month + 1}/$year", Toast.LENGTH_SHORT).show()
    }
}

🎨 Customization

XML Attributes

Attribute Description Default Value
app:colorMonthName Month text color #000000
app:colorDayName Day header text color #000000
app:colorCurrentDayCircle Current day highlight color #FF0000
app:colorCurrentDayText Current day text color #FFFFFF
app:calendarHeight Initial calendar height 400dp
app:textSizeDay Day number text size 14sp
app:selectedDayRadius Selected day circle radius 16dp

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

MIT License

Copyright (c) 2024 Zulqurnain

Permission is hereby granted...

📱 Connect

GitHub Twitter YouTube LinkedIn


**Key Fixes Applied:**
1. Added proper alt text for all images
2. Fixed code block formatting and syntax highlighting
3. Corrected XML namespace declarations
4. Added proper table formatting
5. Removed HTML tags in favor of pure Markdown
6. Added consistent emoji usage
7. Improved section organization
8. Added license section
9. Included contribution guidelines

**To Use:**
1. Copy entire content
2. Paste into your `README.md` file
3. Replace placeholder banner URL with actual image
4. Update license text if needed
5. Verify all links work correctly

The formatting is now compatible with Android Studio's Markdown parser and follows best practices for GitHub documentation.

About

It is custom CalenderView which is basically inspired from iOS 7 style calendar, for Android

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Packages

No packages published