« first day (13 days earlier)      last day (868 days later) » 

6:04 AM
Why does my project which uses RecyclerViews (androidx.recyclerview.widget.RecyclerView) build successfully even after I remove the implementation 'androidx.recyclerview:recyclerview:1.1.0' dependency from the build.gradle file?
 
 
3 hours later…
9:19 AM
@TigerTN all good, working ;)
@Spikatrix It may be using the normal RecyclerView and using the androidx jetifier. Check your project's root for gradle.properties and see if you have something like
android.useAndroidX=true
android.enableJetifier=true
 
 
1 hour later…
10:29 AM
Yes, I do have those two lines in the gradle.properties file
So this means that I can safely remove the dependency without having issues, right?
 
Well, why would you want to remove it to begin with?
You'd be using the "old" RecyclerView version, instead of the new (which gets individually updated/fixed).
 
Well, if it works without it, I thought I can remove it since it looks redundant
Hmm, in that case, I'll put it in
Thanks
 
No worries. (I wouldn't remove it)
*unless you have a very valid reason which, so far I cannot think of.
 
It won't affect the APK size if I put it in or remove it, right?
 
> This package is part of the Android support library which is no longer maintained. The support library has been superseded by AndroidX which is part of Jetpack. We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX.
Shouldn't have a major impact, I highly doubt the androidx version of RecyclerView is a lot bigger (or smaller) than the support library.
Now the new version (still alpha) may have a few extra bytes, because it contains new features, but still, it's negligible.
 
10:34 AM
So import androidx.recyclerview.widget.RecyclerView; would import the recyclerview from the support library if I omit the dependency?
I see
 
hmmm
That's a good question, the way it works is: for every .support. thing you have, the JETIFIER will modify your source code to replace the "support" with AndroidX (and anything else that needs to be changed). This is done "automatically" for you, with different degrees of success. (it works fine most of the time, but I haven't used it in a while, at least not directly for most things are already using Android X).
 
I see
 
So, if you are importing androidx.* then I don't think it will import the support one. I also think (but I may be wrong) that RecyclerView is available via appcompat or similar artifact, so you're getting something. The way you can experiment / figure this out, is by looking at your bytecode or intermediate classes and see what it points at.
All in all, I'd include the recyclerview dependency because that's a way to be sure of what you're using.
 
Alright. Thanks for the info
 
It's not adding "bloat" nor anything, it's just adding the artifact for what you need. And the + benefit is that you can later update it when a new version comes out (which happens)
Sure thing. Good luck!
Check developer.android.com/jetpack/androidx also, it's all better explained there.
@MadinaSaidova hard to tell what may be happening by just looking at this class. I propose you do what I would do:
"file -> new -> Android Project -> empty " and add the badge library you're trying to use to the new project's gradle, then try to simply display a badge. If an empty project using the "sample" code from github's readme, doesn't work, then you know it's not your "fault" (At least not directly). If that works, then you take a step back and compare: "what is your failing project doing that this sample isn't?" "is there any dependency that is causing a problem?" "any conflicts?" etc.
If you can make a sample 5 lines project work, then you can use that as a starting point and take it from there. If you cannot make the 5 lines project work, then you have a bigger issue and working on your main/big project at the same time, may make things harder to debug, for there may be unrelated side-effects to all this.
Sorry for not having a better response, but I am not experienced with badges.
 
11:02 AM
Hi TextView first letter capital how to do in xml. inputtype not working
 
user11455292
hey guys, I need help with a sample android project which I have been tinkering with where I am stuck on a feature. I have a 24 hour time slot, where each slot is represented by 30 min slot. Current implementation is such that you can tap on the first slot then tap on consecutive slots to multi select. I want to make it such that you tap of the first slot then drag it to multi select other slots.
 
user11455292
I am not sure how difficult it is, you can find the whole project here: github.com/arlib/slider .
 
user11455292
Happy to share more info or any details about the project.
 
user11455292
This is the expected output : github.com/arlib/slider/blob/master/… ( on iOS, check out the slider) , need to make it work for android
 
user11455292
tried entire stackoverflow, didnt have any luck. happy to reward $100 amazon or a gift card of your choice if you manage to get it to work and for your time.
 
11:32 AM
@MartinMarconcini thank you very much. You are right. I will try it.
 
11:58 AM
@influx is there any question there that I miss? :)
@AngelaHeely iOS is most likely not using a UICollectionView with cells, so how are you displaying this scrollable content?
 
12:26 PM
@AngelaHeely I saw what you did there, it's a RecyclerView...
I don't have an answer; I'll ramble about how I'd approach the problem:
What you will need in one form of another:
1. Stop the recycler view from automatically scrolling as you move your finger (until you reach an edge threshold to be defined).
2. Know the start of the tap, and what view holder is down there (you kinda already have this, but you will need to change the "click listeners" for "touch" listeners, because now you're interested in a more "raw" version of the tap information. You need X,Y, and "motion".
3. You will need to also pay attention to the "event" when the user lifts the finger (to indicate the "end")
4. During the "drag" time-window, every time a new event arrives, you need to check if the viewholder below the "finger" is now different, and add (or remove) that from your selection. Since you cannot "skip" times (afaik) it's always a range you're going to edit from the "edges", this makes the data structure easier to maintain.
I see your unused attempt at a scroll change listener that may or may not be needed (maybe you will need to tell/hear from the RecycerView for some operation we haven't thought of yet)
I see you tried different things too.. the Horizntal Scroll View, a RecyclerView, there are a couple of "adapters" and "custom views"... so... what problem caused you to ask here on SO?
(fwiw: if you manage to make it work and think I deserve the gift card, don't worry, I won't accept it. Donate the 100 bucks to girlswhocode.com)
Anyway, now looking at this, the project you shared in GitHub, uses a HorizontalScrollView, you made it "observable"...
 
user11455292
1:05 PM
@MartinMarconcini thanks so much for suggesting the solution. I tried a lot of things but nothing worked to get me the required output as in the video in there. It never dragged to the slots as expected, so that's why I decided to ask for help on here. would you happen to have time to try it out and see if your suggestion helps get the output as shown in the video I posted. I am open to donate to girlswhocode + give you a gift cardd too if need be.Been trying this for weeks now to no avail.
 
user11455292
Any help appreciated as this has been a nightmare to get it right
 
I've been looking at your project (I'm on a meeting and it's boring) :)
hmmm The first thing I noticed is that it's quite messy (I can tell you've been trying things) :)))
 
Would like to say thank you for opening this room.
 
user11455292
thank you :) i am with you there, i am only a part time android developer, most of the time i do product management so i completely agree about meetings lol
 
I think I'd use a RecyclerView and create a custom RecyclerView.OnItemTouchListener
@JoJo anytime :)
Basically, what you need (primarily) is to detect the touch/drag events, select items in the RV as they are "selected" (or deselected), and then -and I think this may be partially free by RecyclerView- scroll if the "finger" approaches an edge and there's more content, *while still selecting stuff.
The rest is history, you already have the "model" to pass time-ranges, and selections to your Adapter and the "view holders" will re-bind with the "selected" state that you will create and "paint" the green background.
I also noticed you have quite a bunch of views on top of views using Relative + Linear layouts. I'd get rid of all this, and flatten the hierarchy into a simpler set of ConstraintLayouts. (where possible)
 
user11455292
1:11 PM
I tried messing around with recyclerview too, but it didn't work as expected where items were not selecting as expected or giving me the proper end results. Maybe I was doing something wrong. I was also afraid switching the entire implementation to support recyclerviews would require a complete refactor.
 
The reason is not only performance, is that your "touch" events need to transverse layers of views to reach the correct "view" to see if it's touched... so the less layers you have, the less you have to worry about "your tap events getting lost to some view that is swallowing them"
I see, so this ObservableHorizontalScrollView is already working in the project, it just doesn't support "tap + drag to select" ?
 
user11455292
if you have sometime this week and can help me clean up or refactor the code with your suggestion to get the required output I'd really appreciate that.
 
user11455292
yeah, the observable horizontal scroll doesnt support drag
 
user11455292
i was also wondering how I can show a white selector at the end of the selected slot which could allow dragging as shown in the video
 
user11455292
will it be a lot of work to change all of this to work right?
 
1:15 PM
Well, we all kinda "have time" lately... but not so much "free" time (unfortunately). I would love to give you 100% time (as I've done to other random strangers who happen to come here during these times) but I cannot promise you that I will have the time, will, and knowledge to fix this issue. I've been doing Android since early 2010 and I still have no idea what I'm doing sometimes.... :)
I think there's a lot of things you can improve in this code, but more often than not, improvements are less substantial than getting the thing to do what you need and forget about it...
In all honestly, I do not know if/how to make this "work". I can, however, and to satisfy my curiosity and hopefully help you, spend some time playing with it; maybe I find something that works and you overlooked, but I can't promise you that I'll have the ticket from "IN PROGRESS" to "REady for QA" in 1 day...
There was another user who recently posted an issue with a RecyclerView and I didn't get to help him/her because the question was not well worded. In your particular case, this is quite clear and you provided a working sample, so +1 to you.
> i was also wondering how I can show a white selector at the end of the selected slot which could allow dragging as shown in the video
^ I'm thinking about that
I'll get back to you -at least with a "I couldn't help, sorry" lame excuse-. Another meeting coming up. TTYL
 
user11455292
@MartinMarconcini no worries if you can't get it working, if you give it a try I'd appreciate it! And there's no rush for this, I have been struggling with this for weeks, even if you find time over the weekend or after hours for an hour or 2, and can help out that'll be great.I understand you must be busy with your current responsibilities, so anytime you can spend on this will be a huge favor to me
 
user11455292
thank you so much in advance for trying to help! :) i really appreciate it
 
@AngelaHeely anytime! Stay safe.
 
user11455292
you too! stay safe! lmk if it works out or if it's a small fix that i have overlooked
 
6:14 PM
the quarantine actually is helping me schcudeling everythning how was ur day @MartinMarconcini
 

« first day (13 days earlier)      last day (868 days later) »