Comments (7)
Closing this issue as there's now a solution. If you need any further assistance, let me know.
from calendar.
I finally got my hands on a Samsung device and can confirm that the suggested workaround does not work on the device.
However, after further testing, there's another workaround which works on Samsung devices as well as other devices which I tested on:
calendarView.addOnItemTouchListener(object : RecyclerView.SimpleOnItemTouchListener() {
override fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean {
return rv.scrollState == RecyclerView.SCROLL_STATE_DRAGGING
}
})
For reference purposes, here are other things I tried and how they turned out.
calendarView.setOnTouchListener { _, event ->
event.action == MotionEvent.ACTION_MOVE
}
The above workaround allows an initial scroll action on the calendar before taking effect which is rather weird.
Another option is to extend the CalenderView
class and override the dispatchTouchEvent
method.
override fun dispatchTouchEvent(ev: MotionEvent): Boolean {
return if (ev.action == MotionEvent.ACTION_MOVE) true else super.dispatchTouchEvent(ev)
}
This gives the desired result. However, while the calendar does not move after a swipe action, a touch event is registered at the start position of the swipe gesture, hence the date cell at that position receives a click event.
from calendar.
Clicks are not detected using Action.MOVE
event. I disabled scroll in example 5 in the sample app and clicks are still received. See the screen recording below:
from calendar.
@kizitonwose I tried the same on my end by adding:
exFiveCalendar.addOnItemTouchListener(object : RecyclerView.SimpleOnItemTouchListener() {
override fun onInterceptTouchEvent(rv: RecyclerView, e: MotionEvent): Boolean {
return if (e.action == MotionEvent.ACTION_MOVE) {
true
} else {
super.onInterceptTouchEvent(rv, e)
}
}
})
to the example you mentioned but I got the same result... I can't tap on a day...
I tried using a Motorola One with Android Pie.
from calendar.
That's very strange. Can you test with a different phone?
Also, do you have any other click listeners attached on any other part of the calendar? Example, month header or footer?
Sadly, this is a problem with RecyclerView
itself, not this library so I may not be able to help much.
from calendar.
@kizitonwose unfortunately it also happens on Samsung devices but it's strange because it does works on other like Xiaomi. :/
from calendar.
Currently waiting to get a Samsung device to test with.
from calendar.
Related Issues (20)
- Don't want to show extra adjusted start and end dates in WeekCalender HOT 1
- Range Date Picker selector in WeekCalendar HOT 1
- Add Grid Calendar
- Preload view in MonthDayBinder HOT 3
- Home Sample Sample Inquiry HOT 1
- Calendar DaysView
- Single Selection in Vertical Calendar HOT 1
- can not implement single selection HOT 1
- Consider turning off corelibrarydesugaring for this lib HOT 9
- Show week numbers HOT 1
- from example1 to exapmle8,i can't find this example HOT 1
- help HOT 1
- how can i show the lunar calendar's bellow the number? HOT 2
- Consider multiple platforms? HOT 1
- Exception after updating dependencies Compose 1.7.0-beta01 Kotlin 1.9.24 HOT 2
- Bug with WeekCalendar
- Desugaring required even if the min sdk is set to 28 (MultiModule project) HOT 4
- [Compose] Add spacing between Day composables in HorizontalCalendar without affecting container edges HOT 2
- For compose Calendar, Is that possible to implement that toggle week/month mode? HOT 1
- some suggest HOT 2
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 calendar.