Coder Social home page Coder Social logo

jignesh13 / googlecalendar Goto Github PK

View Code? Open in Web Editor NEW
157.0 4.0 61.0 58.86 MB

How make calendar like google calendar app in android using java and feature like Schedule, Day Views , Week Views, 3-Day Views, Year Views, Month Views, Zoom In/Out

License: Apache License 2.0

Java 99.01% Kotlin 0.99%
calendar calendar-view calendar-component calendar-events googlecalendarapi googlecalendar androidcalendar google-calendar calendarview collapsible-navbar

googlecalendar's Issues

canvas.clipRect with Region.op paramter deprecated

Hi Jignesh,
kuds for the awesome work! :)

Note that canvas.clipRect with the Region.op parameter has been deprecated from API Level 26 in Android.

https://developer.android.com/reference/android/graphics/Canvas.html#clipRect(float,%20float,%20float,%20float,%20android.graphics.Region.Op)

You use this method quite often in WeekView. I suggest to replace all calls to canvas.clipRect with the following method:

private void canvasclipRect(float left, float top, float right, float bottom, Region.Op op) {
        if (op == Region.Op.REPLACE) {
            mCanvas.restore();
            mCanvas.save();
            mCanvas.clipRect(left, top, right, bottom);
            return;
        }
    }

Best,
Marko

Heavily dependant on a single activity

The customized WeekView and the app the author came up with works great, however I can't say the same thing for readibility.

The code for both view and the app is heavily dependant on a single activity which is 2000+ lines of code as of me writing this making it really difficult to adapt to my use case. I was hoping you could seperate different logical parts of the app in the MainActivity so one could find what they were looking for easily, instead of searching through that big file.

Also the Readme.md explains a "How set event information and minimum and maximum date of calendar", content is outdated and no such method in the explanation exists in the code.
I'm currently using the "day view" on one of my ongoing projects and my use case is completely different, I get date information from a service thus creating my own "custom event" models so adding a custom event looks something like this:

mWeekView.weekViewLoader = object: WeekViewLoader{
            override fun onLoad(periodIndex: Int): MutableList<out WeekViewEvent> {
                return if (periodIndex == 0) {
                    mutableListOf(WeekViewEvent(0, "TEST EVENT", 2021, 8, 2, 20, 0, 2021, 8, 2, 21, 0))
                } else {
                    mutableListOf()
                }
            }
            //...
        }

And oh, one last thing, it would be GREAT if you could convert to Kotlin :)

Support for loading events individually.

Currently all events are loaded at once, but if we want to load events while changing the months(Swiping view pager left and right), It is very complicated to implement. If you can provide a support for that.

Multiple event in day/week/month view

Currently, it seems only one event can be viewed from the above view though there are multiple. I hope to get an answer on how can we show multiple events on the same day?

Zoom in/out Calendar

I cannot zoom in / out on calendar, can you add it or is there a way to add it like on real google calendar. Sorry for my English

Touch Events are not working in a month view(JCalendarMonthView) in a tablet

First of all great work buddy. 👏
I faced a problem when I am using project in a tablet. When I am selecting a any cell in a tablet the touch event is not working as expected. It is working fine in mobile view but it's failing when I am using a tablet. I tried debugging it but couldn't get the solution. Every time I select a cell in a month view my selectedrect and selectedcell sets to null and -1. It will be a great help if you can fix this issue. I am using Samsung tablet with android 9

Show weekview starting from Sunday.

I am unable to start my week view from Sunday. It always starts with the current day.
FYI - I have tried using
app:firstDayOfWeek="sunday" and app:showFirstDayOfWeekFirst="true"

However, this does nothing. Would it be possible to start the day on Sunday?

I appreciate your effort, thank you!

Weekview refresh issue

We have add one event in particular date in week view but event not show in week view. we have notify week view but it's can't work

MonthView - first day of week

How can I change the first day of week in month view from sunday to monday?
I gave a try but without success.

Thanks.

Bug: always crashes

Tested on Pixel 2 with Q beta 4, and Google Calendar is installed.
I always get this crash:

2019-06-29 21:38:37.425 24363-24363/? E/.GoogleCalenda: Unknown bits set in runtime_flags: 0x8000
2019-06-29 21:38:38.209 24363-24363/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.GoogleCalendar, PID: 24363
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.GoogleCalendar/com.example.GoogleCalendar.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3260)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7319)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.startsWith(java.lang.String)' on a null object reference
        at com.example.GoogleCalendar.GooglecalenderView.init(GooglecalenderView.java:252)
        at com.example.GoogleCalendar.MainActivity.onCreate(MainActivity.java:166)
        at android.app.Activity.performCreate(Activity.java:7783)
        at android.app.Activity.performCreate(Activity.java:7772)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3235)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3396) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7319) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934) 

Swipe left and right in the day view, there will be a little bad experience. Specifically, when the left and right swipes are close to the edge, there will be a short pause before the edge is automatically attached. It may be designed like this, but the actual experience is like a freeze. The left and right day view switching in Google Calendar is very smooth. The interface There will be no obvious pause in the welt, it may be better to suggest a change, thank you for your effort

Video_20210612_113206_416.gif
Swipe left and right in the day view, there will be a little bad experience. Specifically, when the left and right swipes are close to the edge, there will be a short pause before the edge is automatically attached. It may be designed like this, but the actual experience is like a freeze. The left and right day view switching in Google Calendar is very smooth. The interface There will be no obvious pause in the welt, it may be better to suggest a change, thank you for your effort

Add new event from the day view

Kindly include the provision to add a new event from the daywise view. As like how the google calendar allows the user to drawn a rectangle box by mentioning the start and end time of the event.
attachement

Library version

First of all thank you for you job!

This is more like a question:

This app allows user to switch between month, week, day view with google/custom (I believe) events. There is no such a library that have all the 3 types of views so far (at least I couldn't find anything)

Are you considering moving this to standalone library that can be used in user apps ?

We are not finding firstDay of month. How to open given month calendar

Hello
We have a query regarding how I can set the calendar with a start date and end date according to open.
We are given 2 dates and how to set the according to the start date month open the calendar and scroll also worked with the given end date month.

We are facing the below error.
org.joda.time.IllegalFieldValueException: Value 31 for dayOfMonth must be in the range [1,30]: year: 2022 month: 4
We set the other month and year that time we get the above error.

Please suggest how to set the custom date according to work. How I can open another date month? Its directly opens the current month.

Refresh calendar

I wanted to make the calendar refresh when "Refresh" in menu clicked, but I can't make it work. I need it to load new data from google calendar, e. g. I add new event in browser on PC and then when I click "Refresh" in the app, I need the new event to show up. Could you please tell me how to do it? Thanks!

Month view

First of all, congratulations! Great job!
The main view is apparently in the detailed type of events / days.
Is it possible to see the month view, the one that appears every day of the month and its events?

Show more in month view

Is there any way we can enable users to view all the events in the month view?
Currently, if there are say 10 events for the same day but the view only shows 5 events (assume). Is there any way we can show view more options so when clicked on it, user will be able to see all the events listed?
Thank you!

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.