Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding to project using gradle doesn't work #13

Closed
Virthuss opened this issue Sep 18, 2015 · 16 comments
Closed

Adding to project using gradle doesn't work #13

Virthuss opened this issue Sep 18, 2015 · 16 comments

Comments

@Virthuss
Copy link

Hi,

I'm trying to use your project using gradle.

However using compile 'com.jmedeisis:draglinearlayout:1.1.0' in gradle doesn't work.
Is that normal? Thanks in advance.

EDIT: my bad, succeed with adding
allprojects {
repositories {
jcenter()
}
}

@justasm
Copy link
Owner

justasm commented Sep 18, 2015

Glad you managed to solve the issue 👍, sorry I didn't respond sooner.

@Virthuss
Copy link
Author

No problem, and thanks for this amazing library! However I noticed some troubles while I'm using it in a scrollview. The library then work once every ten click, like if the scrollview was stealing the focus. Am I missing something? It working fine without the scrollview. I can open a new issue if needed.

@justasm
Copy link
Owner

justasm commented Sep 18, 2015

That shouldn't be happening, but it's difficult to say what's up without seeing your code / layout. Perhaps your touch targets are too small.

The sample includes a demo of the DragLinearLayout inside of a ScrollView, might be a good place to look at for reference. You're of course welcome to open an issue if you don't manage to resolve it.

@Virthuss
Copy link
Author

I will try to fix it by myself and will open a new issue thread about that with more technical informations if needed. As a beginner may I ask you if it's possible to override some features of your library quite easily? I would like to activate your feature on a longclick only and be able to change the background color as well.

@meesec
Copy link

meesec commented Sep 18, 2015

for long tap check out my fork. i have been meaning to merge back the changes to justas' code but haven't gotten to it yet. it might even have code related to changing the background in it - i remember playing around with that as well.

@justasm
Copy link
Owner

justasm commented Sep 18, 2015

You can customize the background just like you would for any other View in Android, most commonly through the android:background property.

And for long-press, as always, I can depend on @meesec jumping in :) Check out the fork here.

@Virthuss
Copy link
Author

I'll check the fork thanks :)

However for the view it's possible to do so, but my aim is to 'highlight' the element touched by the user after a long click ( since the 'quick' onclick open a new fragment ) while his finger is pressing the screen. On release the color must return to an original value. I did it easily with a ontouchlistener but it seems that in this case, the listener in charge of the drag and sort is not working anymore.

:(

@meesec
Copy link

meesec commented Sep 18, 2015

yes, that's the kind of change i did in the fork (changing the elevation / shadow of the item and i think it also slightly translates the views position). i think it is working in the current state, it's mainly the documentation that i haven't updated that keeps me from creating a pull request.

@justasm
Copy link
Owner

justasm commented Sep 18, 2015

Yes, the library overrides the View's existing OnTouchListener. You may want to consider whether it's all necessary; as you can see in the sample, clickable buttons can happily coexist with the drag feature without resorting to long press. If it is, @meesec's fork or your own modifications may be your best bet.

The library would definitely be improved if it delegated events to any existing OnTouchListener, and / or had additional callbacks for drag start / stop.

@Virthuss
Copy link
Author

Just another beginner question: How to get the fork version instead of the main branch's one?

@Virthuss Virthuss reopened this Sep 18, 2015
@meesec
Copy link

meesec commented Sep 18, 2015

as far as i know you can't because i haven't published the fork to maven central or sth like that. you'd have to manually download it.

The reason i'm not publishing it is that i'd rather have the changes merged to the main lib at some point - although that might create issues with existing users of the lib as the behavior of components would change.

@Virthuss
Copy link
Author

I'll try with the zip file then. Thanks 👍

@Virthuss
Copy link
Author

Sadly I didn't success to import your lib as a zip file... That was the problem I encountered before finding a solution with my edit on the first post... which is not applicable on this new case

@justasm
Copy link
Owner

justasm commented Sep 18, 2015

Haven't reviewed all the additions / changes @meesec made to the library,
but it may be sufficient to just drop in the main class file
(DragLinearLayout.java) to your project, it is largely self-contained.

On Fri, Sep 18, 2015 at 11:18 AM, Virthuss notifications@github.com wrote:

Sadly I didn't success to import your lib as a zip file... That was the
problem I encountered before finding a solution with my edit on the first
post... which is not applicable on this new case


Reply to this email directly or view it on GitHub
#13 (comment)
.

Justas Medeisis

@Virthuss
Copy link
Author

Error:Cannot access first() element from an empty List

Is returned every time...

@justasm
Copy link
Owner

justasm commented Sep 21, 2015

Sorry @Virthuss but I'm closing this issue as it has diverged too far from its original intent.

The information you have provided about your error is not detailed enough. Please post a new issue with the full stack trace, and we may be able to help.

@justasm justasm closed this as completed Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants