Comments (8)
Currently, this functionality is not available in the library. But soon it will be added.
from android-week-view.
Could you say when new event handling will be implemented? I would love to apply this functionality in my app, which uses your plugin.
from android-week-view.
I just made a workaround to get this by extending the code on the "onSingleTapConfirmed"
if (mEventClickListener != null) {
boolean didSelect = false;
if (mEventRects != null) {
List reversedEventRects = mEventRects;
Collections.reverse(reversedEventRects);
for (EventRect event : reversedEventRects) {
if (event.rectF != null && e.getX() > event.rectF.left
&& e.getX() < event.rectF.right
&& e.getY() > event.rectF.top
&& e.getY() < event.rectF.bottom) {
mEventClickListener.onEventClick(
event.originalEvent, event.rectF);
playSoundEffect(SoundEffectConstants.CLICK);
didSelect = true;
break;
}
}
}
if (!didSelect) {
int day_1 = mFirstVisibleDay.get(Calendar.DAY_OF_YEAR);
int day_2 = mLastVisibleDay.get(Calendar.DAY_OF_YEAR);
int chosen_day;
if (day_1 != day_2) {
chosen_day = (int) (day_1 - 1 + Math.round((e.getX() - mHeaderColumnPadding - (mNumberOfVisibleDays-1)*mColumnGap - mTextSize)
/ mWidthPerDay));
} else {
chosen_day = day_1;
}
Calendar RETCAL = Calendar.getInstance();
RETCAL.setTime(mFirstVisibleDay.getTime());
// int totalY = mScroller
int chosen_hour = Math.max(Math.min((int) Math.round((e.getY() - mHeaderTextHeight - mHeaderRowPadding - mHeaderMarginBottom - mScroller
.getCurrY()) / mHourHeight),23),0);
RETCAL.set(Calendar.DAY_OF_YEAR, chosen_day);
RETCAL.set(Calendar.HOUR_OF_DAY, chosen_hour);
RETCAL.set(Calendar.MINUTE, 0);
mEventClickListener.onBlankClick(RETCAL.getTime());
}
}
return super.onSingleTapConfirmed(e);
onBlankClick is an extra method i added in the Interface.
This will give you the next full hour where the user has tapped.
Then you can use this to call your "insert new event" form
from android-week-view.
I just created a pull request that can solve this problem. Please have a look.
from android-week-view.
Issue solved: #34.
mWeekView.setEmptyViewClickListener(new WeekView.EmptyViewClickListener() {
@Override
public void onEmptyViewClicked(Calendar time) {
...
}
});
from android-week-view.
@alamkanak Wao! Awesome man! due to my busy schedule i was not able to work with this!
I will love to contribute! Thanx!
from android-week-view.
thank you
from android-week-view.
Well normally you hold events in a list (List), so you created a new event (newEvent) and add it to that list now.
from android-week-view.
Related Issues (20)
- How to show the event that starts at Today 11PM and ends at Tomorrow morning 5AM HOT 1
- Accessibility/Talkback implementation of WeekView and its Events
- How to navigate to particular date HOT 1
- How can I hide or clear the header area?
- How to use this in Kotlin project? HOT 1
- Unable to display events
- Auto scroll to current hour?
- use firebase with Android-week-View HOT 2
- Events issue
- Name of event is repeated 3 times HOT 1
- Using a deprecated clipRect() in 1.2.6 HOT 2
- How to add new column in Day View?
- AAPT: error: duplicate value for resource 'attr/textStyle' with config ''.
- Is there a recent Kotlin Sample I can see to understand how this code is implemented HOT 2
- How can we change the **todayHeaderText** date format
- Is it possible to add event in normal date format?
- Is it possible to highlight weekends?
- Need to use Android X as its conflicting dependencies with recent android version
- Change X-axis and y-axis, and vertical scrolling to specific range
- Not integrated Lib
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-week-view.