All Projects → VRGsoftUA → VRCalendarView

VRGsoftUA / VRCalendarView

Licence: other
Flexible calendar view

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to VRCalendarView

react-calendar
A no dependencies, lightweight and feature-rich ⚡ calendar component for react.
Stars: ✭ 68 (+106.06%)
Mutual labels:  calendar-component, calendarview
Cvcalendar
A custom visual calendar for iOS 8+ written in Swift (>= 4.0).
Stars: ✭ 3,435 (+10309.09%)
Mutual labels:  calendar-component, calendarview
Calendarview
Android上一个优雅、万能自定义UI、仿iOS、支持垂直、水平方向切换、支持周视图、自定义周起始、性能高效的日历控件,支持热插拔实现的UI定制!支持标记、自定义颜色、农历、自定义月视图各种显示模式等。Canvas绘制,速度快、占用内存低,你真的想不到日历居然还可以如此优雅!An elegant, highly customized and high-performance Calendar Widget on Android.
Stars: ✭ 7,998 (+24136.36%)
Mutual labels:  calendar-component, calendarview
Customfloatingactionbutton
This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button
Stars: ✭ 222 (+572.73%)
Mutual labels:  view
Flexml
🚀基于Litho的Android高性能动态业务容器。
Stars: ✭ 225 (+581.82%)
Mutual labels:  view
vanillaview
Easy to use views with vanilla JS semantics
Stars: ✭ 12 (-63.64%)
Mutual labels:  view
handMadeCalendarAdvance
[ING]Swift版の日本の祝祭日判定コードとカレンダーサンプル(iOS Sample Study: Swift)
Stars: ✭ 62 (+87.88%)
Mutual labels:  calendar-component
Foregroundviews
Views that supports a foreground, like FrameLayout does
Stars: ✭ 215 (+551.52%)
Mutual labels:  view
ShadowStackView
Create something like Shadow-View animation when drag the view on screen
Stars: ✭ 25 (-24.24%)
Mutual labels:  view
Android Stepsview
A more complete version of stepsViews in android
Stars: ✭ 244 (+639.39%)
Mutual labels:  view
Viewanimator
A fluent Android animation library
Stars: ✭ 2,656 (+7948.48%)
Mutual labels:  view
Laravel Tag Helper
Add powerful HTML tag helpers to your Laravel application
Stars: ✭ 227 (+587.88%)
Mutual labels:  view
ViewWorld
自定义View合集,展示各种自定义View/控件。项目包含了自定义Banner轮播图控件,自定义验证码输入框,自定义TabLayout等控件,持续更新中😉😉😉
Stars: ✭ 94 (+184.85%)
Mutual labels:  view
Transition
Easy interactive interruptible custom ViewController transitions
Stars: ✭ 2,566 (+7675.76%)
Mutual labels:  view
bottomsheets
Material Bottom Sheets library for Android
Stars: ✭ 76 (+130.3%)
Mutual labels:  view
Goview
Goview is a lightweight, minimalist and idiomatic template library based on golang html/template for building Go web application.
Stars: ✭ 213 (+545.45%)
Mutual labels:  view
andColorPicker
Color picker library for Android
Stars: ✭ 233 (+606.06%)
Mutual labels:  view
Slidemenulayout
🔥An android slide menu that supports left and right swipes and slides with parallax.(一个支持左右滑动并带有视差滑动效果的安卓侧滑菜单控件.仿[QQ/探探侧滑])
Stars: ✭ 235 (+612.12%)
Mutual labels:  view
Shadowimageview
🔥可以根据图片内容变阴影颜色,更加细腻的阴影效果 It can change color according to the picture, more delicate shadow effect
Stars: ✭ 2,560 (+7657.58%)
Mutual labels:  view
angular-calendar-week-hours-view
This is an alternative week view for the angular calendar which allows the user to see all the week hours
Stars: ✭ 20 (-39.39%)
Mutual labels:  view

VRCalendarView

Usage

For a working implementation, Have a look at the Sample Project - app

  1. Include the library as local library project.
allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

dependencies {

    compile 'com.github.VRGsoftUA:VRCalendarView:1.0.3'

}
  1. Include the VRCalendarView widget in your layout.

       <com.vrgsoft.calendar.VRCalendarView
             android:id="@+id/calendar"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             app:vr_background_color="@color/colorDark"
             app:vr_calendar_day_text_size="15sp"
             app:vr_chosen_day_background_color="@color/colorGreen"
             app:vr_chosen_day_background_drawable="@drawable/background"
             app:vr_current_day_text_color="@android:color/darker_gray"
             app:vr_current_month_other_days_background_drawable="@drawable/background"
             app:vr_current_month_other_days_text_color="@color/colorAccent"
             app:vr_current_month_text_color="@android:color/darker_gray"
             app:vr_next_button="@drawable/ic_next"
             app:vr_other_month_text_color="@color/colorPrimary"
             app:vr_previous_button="@drawable/ic_previous"
             app:vr_title_text_color="@color/colorGreen"
             app:vr_week_days_color="@android:color/darker_gray" />
  2. You can do same with java

        vrCalendarView.getSettings()
			      .setOtherMonthTextStyle(VRCalendarView.BOLD)
                              .setCurrentMonthBackgroundColor(Color.CYAN)
                              .updateCalendar();

or

       vrCalendarView.getSettings()
                      .setOnCalendarClickListener(this)
                      .setOnCalendarLongClickListener(this)
                      .setVRCalendarMonthCallback(this);
  1. You can update all days by calling VRCalendarView.getSettings().updateCalendar();

     vrCalendarView.getSettings()
     			.setOtherMonthTextStyle(VRCalendarView.BOLD)
     			.setCurrentMonthBackgroundColor(Color.CYAN)
     			.updateCalendar();

    if VRCalendarView.getSettings().updateCalendar() is called and you want to save some custom day List getCustomizeDayView(Calendar calendar) method should be overridden getCustomizeDayView(Calendar calendar) is return all days you need to make custom. With parameter calendar you can get the year and the month to return customised days from specific month

        @Override
        public List<VrCalendarDay> getCustomizeDayView(Calendar calendar) {
            List<VrCalendarDay> vrCalendarDays = new ArrayList<>();
            VrCalendarDay today = new VrCalendarDay();
            today.setDate(new Date());
    
            VrCalendarDaySettings todaySettings = new VrCalendarDaySettings();
            todaySettings.setDayTextColor(Color.CYAN);
            today.setVrCalendarDaySettings(todaySettings);
            today.setVRCalendarCustomViewCallback(new VRCalendarCustomViewCallback() {
                @Override
                public View getNewCustomiseView() {
                    ImageView imageView = new ImageView(MainActivity.this);
                    imageView.setImageResource(R.drawable.ic_stat_name);
                    return imageView;
                }
            });
    
            vrCalendarDays.add(today);
    
            VrCalendarDay tomorrow = new VrCalendarDay();
            Date d = new Date(1513435110633L); // December 16, 2017
            tomorrow.setDate(d);
            VrCalendarDaySettings vrtomorCalendarDaySettings = new VrCalendarDaySettings();
            vrtomorCalendarDaySettings.setDayTextStyle(VRCalendarView.BOLD);
            vrtomorCalendarDaySettings.setDayBackgroundColor(ContextCompat.getColor(this, R.color.colorAccent));
            vrtomorCalendarDaySettings.setDayTextColor(ContextCompat.getColor(this, R.color.colorYellow));
            tomorrow.setVrCalendarDaySettings(vrtomorCalendarDaySettings);
    
            vrCalendarDays.add(tomorrow);
    
            return vrCalendarDays;
        }

    You can set set whatever view you want and customise it like you want if standard customisation does not fit

    Attention!!!

    View getNewCustomiseView() should always return new View. other wise it doesn't work properly

    today.setVRCalendarCustomViewCallback(new VRCalendarCustomViewCallback() {
                @Override
                public View getNewCustomiseView() {
                    ImageView imageView = new ImageView(MainActivity.this);
                    imageView.setImageResource(R.drawable.ic_stat_name);
                    return imageView;
                }
            });

    but if you need to update specific day it is better to call

        vrCalendarView.getSettings().updateCalendarDay(VrCalendarDay today, boolean hasToSelect);

    where VrCalendarDay has settings to customise specific day - hasToSelect should be false than and hasToSelect is boolean that sets specific customisation not from VrCalendarDay settings but from default settings that has attribute "chosen". Like below

    app:vr_chosen_day_background_color="@color/colorGreen"
    app:vr_chosen_day_background_drawable="@drawable/background"

    to update specific day you have to set VRCalendarDay.setDate(Date date); - it is required

      VrCalendarDay today = new VrCalendarDay();
            today.setVRCalendarCustomViewCallback(new VRCalendarCustomViewCallback() {
                @Override
                public View getNewCustomiseView() {
                    ImageView imageView = new ImageView(MainActivity.this);
                    imageView.setImageResource(R.drawable.ic_stat_name);
                    return imageView;
                }
            });
            today.setDate(day.getDate());

    Move to date with

    VrCalendarView.moveToDate(Date date);

  2. There is onClick listener and onLongClick

      public interface OnCalendarLongClickListener {
          void onCalendarDayLongClick(VrCalendarDay day);
      }

    and

    public interface OnCalendarClickListener {
        void onCalendarDayClick(VrCalendarDay day);
    }

that returns VrCalendarDay you click on

Customisation

 You can add fields via xml or VrCalendarView or VrCalendarView.getSettings().

Supported fields:

Method Type
vr_current_day_text_color color
vr_current_month_text_color color
vr_other_month_text_color color
vr_current_month_other_days_text_color color
vr_chosen_day_text_color color
vr_current_day_background_color color
vr_current_month_background_color color
vr_other_month_background_color color
vr_current_month_other_days_background_color color
vr_chosen_day_background_color color
vr_current_day_background_drawable integer
vr_current_month_background_drawable integer
vr_other_month_background_drawable" integer
vr_current_month_other_days_background_drawable integer
vr_chosen_day_background_drawable integer
vr_calendar_day_text_size dimension
vr_calendar_title_text_size dimension
vr_next_button integer
vr_previous_button integer
vr_title_text_color color
vr_background_color color
vr_week_days_color color
vr_current_day_text_style normal,bold,italic
vr_current_month_text_style normal,bold,italic
vr_other_month_text_style normal,bold,italic
vr_current_month_other_days_text_style normal,bold,italic
vr_chosen_day_text_style normal,bold,italic

Contributing

  • Contributions are always welcome
  • If you want a feature and can code, feel free to fork and add the change yourself and make a pull request
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].