khacpv / calendar-day-view Goto Github PK
View Code? Open in Web Editor NEWCalendar Day View is an android library to display calendars day view within the app. It supports custom styling.
License: MIT License
Calendar Day View is an android library to display calendars day view within the app. It supports custom styling.
License: MIT License
I've created a new public class (CalendarEvent) that implements IEvent, but am unable to call
List<CalendarEvent> events = new ArrayList<>();
dayView.setEvents(events);
it doesn't recognize my list as an appoicable argument.
Two-event overlap solution?
e.g.
int eventColor = ContextCompat.getColor(this, R.color.eventColor);
Calendar timeStart = Calendar.getInstance();
timeStart.set(Calendar.HOUR_OF_DAY, 11);
timeStart.set(Calendar.MINUTE, 0);
Calendar timeEnd = (Calendar) timeStart.clone();
timeEnd.set(Calendar.HOUR_OF_DAY, 15);
timeEnd.set(Calendar.MINUTE, 30);
Event event = new Event(1, timeStart, timeEnd, "11", "11", eventColor);
events.add(event);
int eventColor = ContextCompat.getColor(this, R.color.eventColor);
Calendar timeStart = Calendar.getInstance();
timeStart.set(Calendar.HOUR_OF_DAY, 11);
timeStart.set(Calendar.MINUTE, 0);
Calendar timeEnd = (Calendar) timeStart.clone();
timeEnd.set(Calendar.HOUR_OF_DAY, 15);
timeEnd.set(Calendar.MINUTE, 30);
Event event = new Event(1, timeStart, timeEnd, "22", "22", eventColor);
events.add(event);
Hello!
It seems I am unable the set a color of the event to be created. I also need to change the color after an action has been performed on an event(on click). How do I achieve this? Thank you!
I even tried your example, I logged the values parsed to the Event constructor and it prints the int representation (example: -49023 ), but I can't get to sort it out.
Hello !
I'm trying to use your component in a Kotlin project but I cannot have these events fired when I click anywhere in the visible control...
Here is the Kotlin code :
package com.reuniware.beautylogic
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.framgia.library.calendardayview.EventView
import com.framgia.library.calendardayview.EventView.OnEventClickListener
import com.framgia.library.calendardayview.data.IEvent
import com.framgia.library.calendardayview.decoration.CdvDecorationDefault
import kotlinx.android.synthetic.main.activity_main.*
class MainActivity : AppCompatActivity() {
val events = ArrayList<IEvent>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
(dayView.decoration as CdvDecorationDefault).setOnEventClickListener(
object : OnEventClickListener {
override fun onEventClick(view: EventView, data: IEvent) {
Log.e("TAG", "onEventClick:" + data.name)
}
override fun onEventViewClick(
view: View,
eventView: EventView,
data: IEvent
) {
Log.e("TAG", "onEventViewClick:" + data.name)
if (data is IEvent) { // change event (ex: set event color)
dayView.setEvents(events)
}
}
})
dayView.setEvents(events)
}
}
And here is the code of the XML layout file :
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="24dp"
android:layout_marginBottom="24dp"
android:layout_marginStart="24dp"
android:layout_marginEnd="24dp">
<com.framgia.library.calendardayview.CalendarDayView
android:id="@+id/dayView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
Thanks in advance !
Popup doesn't hide automatically after timeout.
On view_event_popup.xml line 100 there is a japanese text hardcoded in file btn_schedule_map.png.
Hello!
I am trying to change some colours in your app so it matches the design I want to achieve.
I have found no information about this in the documentation, where should I begin editing?
PS: To remove the line I tried to paint it white with app:lineColor="@android:color/white" but it fails to change any colour.
I am willing to fork and edit if needed, if you put me on the right track! Thank you!
I've looked through your project but I can't seem to find any documentation on it's licensing. Would love to verify if it had an MIT or Apache 2.0 license so that I could know whether or not I could use this project. Great project btw!
How do I apply a single OnClickListener to all events without having to loop into all of them?
Thanks!
Is there any provision to move the focus of the calendar screen directly to the particular hour which contains event?
Hello! I'm encountering a problem, the library does not render the correct intervals of time marked by events.
Start time console Log:
D/Event: startTime = java.util.GregorianCalendar[time=?,areFieldsSet=false,lenient=true,zone=Europe/Athens,firstDayOfWeek=2,minimalDaysInFirstWeek=1,ERA=1,YEAR=2017,MONTH=9,WEEK_OF_YEAR=41,WEEK_OF_MONTH=2,DAY_OF_MONTH=2,DAY_OF_YEAR=275,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=2,HOUR_OF_DAY=8,MINUTE=30,SECOND=41,MILLISECOND=763,ZONE_OFFSET=7200000,DST_OFFSET=3600000]
@khacpv
End time console Log:
D/Event: java.util.GregorianCalendar[time=?,areFieldsSet=false,lenient=true,zone=Europe/Athens,firstDayOfWeek=2,minimalDaysInFirstWeek=1,ERA=1,YEAR=2017,MONTH=9,WEEK_OF_YEAR=41,WEEK_OF_MONTH=2,DAY_OF_MONTH=2,DAY_OF_YEAR=275,DAY_OF_WEEK=2,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=2,HOUR_OF_DAY=9,MINUTE=30,SECOND=41,MILLISECOND=763,ZONE_OFFSET=7200000,DST_OFFSET=3600000]
And during runtime, the app shows this:
(Usually using a CustomDecorator, but for relevance I included the default one).
should it be possible to add week instead of day or n number of days ?
Hello, i'm adding three events to the dayView, giving them different colors, but it shows the same color for all the events.
I'm doing like this:
events.add(createEvent(1, entranceTime, jobTime1, R.color.entranceOrExitColor, "Entrata"));
events.add(createEvent(2, jobTime1, jobTime2, R.color.jobColor, "Al lavoro"));
events.add(createEvent(3, jobTime2, exitTime, R.color.entranceOrExitColor, "Uscita"));
dayView.setEvents(events);
private MyEvent createEvent(long id,Date timbTime1, Date timbTime2, int color, String eventType){
Calendar timeStart = Calendar.getInstance();
timeStart.set(Calendar.HOUR_OF_DAY, parseInt((DateFormat.format("HH", timbTime1).toString())));
timeStart.set(Calendar.MINUTE, parseInt((DateFormat.format("mm", timbTime1).toString())));
Calendar timeEnd = Calendar.getInstance();
timeEnd.set(Calendar.HOUR_OF_DAY, parseInt((DateFormat.format("HH", timbTime2).toString())));
timeEnd.set(Calendar.MINUTE, parseInt((DateFormat.format("mm", timbTime2).toString())));
return new MyEvent(id, timeStart, timeEnd, eventType, color);
}
I couldn't find why is this line is source of the problem, i need help
Hi there, I'm trying to implement this library in my code, however, whenever I do so, my code crashes telling me that I'm pointing to a null object. Mainly, the day view object is inside a fragment. How can I successfully implement this and add events in a fragment?
Hello,
can you please extend compatibility to com.android.support:cardview-v7:25.3.1 ?
Thanks
should it be possible to make onClickListener in every hour?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.