So here's the thing, I want to build a GridView containing few items that are movable/rearrangeable by the user. Pretty much similiar as the one you'd see on the home screen of Android.
I've looked into some places but ended up with zero result. The closest thing I was able to find was the sample of a home screen app found on developers.android.com but It doesn't have the thing I'm looking for (the items are unarrangeable).
Please give me a hint how this could be done. Code examples are also welcome.
Thanks in advance! :)
I think you should implement a drag&drop.
The GridView can handle the OnDragListener, so you could do : myGridView.setOnDragListener and do whatever you want with it.
I also advise you to check the following link
I hope it helped!
Related
I'm trying to get the same item as Window's combobox in Android java. I realize there's a spinner but what I need is to display a scrollable list of items that the user can simply select one or more. The spinner is nice, but it's a totally different beast.
Is there an equivalent? Because otherwise I guess I would have to create a section of text items, that I would have to build my own scroll function as well as selection. Hoping to avoid all that.
Thanks.
You're going to have to write your own, or find a library. There is no builtin equivalent. Luckily it should be easy, you basically just want a recycler view where the adapter keeps track of what items you've clicked on. That will take care of the scrolling, and the display simplifies to a normal list adapter.
Import third-party library just for little feature is unnecessary, you could try change spinnerMode to dialog, then the spinner is scrollable.
Edited:
sorry, I noticed that you need select multiple items, my answer is not suitable. You could create a custom widget.
The easiest solution is using library. There a alot library you can use for that problem. Here is the some library you can used:
https://github.com/prsidhu/MultiSelectSpinner
https://github.com/pratikbutani/MultiSelectSpinner
Or you can follow this tutorial
https://trinitytuts.com/tips/multiselect-spinner-item-in-android/
Hope it help
Immagine a blank activity. If you swipe from left to right another activity (I think) comes in partially covering the parent.
I would like to recreate this effect:
I'm new to android programming and the only thing that i could think to do that is to use fragment in some strange way.
Since i don't know how to call this "function" i didn't manage to find a lot on the web.
So, is there a method to easly accomplish this? Can you give me any info on where to start e what to search for to do that?
Thanks.
This can be done using the DrawerLayout. You can find a lot of help online about using DrawerLayouts, but this link is how I learned and it helped me so much:
https://github.com/codepath/android_guides/wiki/Fragment-Navigation-Drawer
I know it's not a legitimate question but I'm searching an example to this menu for Android\Java about 2.5 hours and I'm lost. Please just give me a link or write me its name so I can google it, find examples and implement it by myself.
I just saw that many people use sliding menu or dropdown menu but it's different than what I want I guess.
(source: smashingmagazine.com)
Each of those is a spinner, so I thought it might be called an expandable spinner, and got some hits for what you're trying to do : expandable-spinner : How to implement expandable spinner entry in Android
Another term for it might be "multi-level spinner" for which there are more hits similar to what you want. Best practices for implementing a multi-level Option Menu on Android?
I'm not sure this is the best approach for a menu, though. Would you consider something like this instead: https://github.com/pratikbutani/MultiSelectSpinner
I wanna start out by saying that im just starting to learn android development(and programming) just so you guys know that im not an expert or anything.
So im creating an app that has 5 fragments. the first one has a spinner, the next 3 have each of them 1 edittext, and the last one has a textview. My problem is, i want to collect the user input from the edittext's and the spinner and use it on a formula that is going to give a result to be shown on the last fragment.
And what i need to know is how do i get the user input from the edittexts and the spinner so i can use them on the formula.
For you guys to have an idea of what im aiming for here is a video that i found: http://www.youtube.com/watch?v=gcap7DUgIHg
(I have done other apps that use a basic layout with the edittexts all on one activity, but i wanted to try with the type of layout you see on the video)
I want my app to work exactly like that one, but instead of using numberpickers i use edittexts and a spinner.
This is probably a lot for anyone to explain, but i have been on this forever and i need to deliver this school project tomorrow. Hopefully anyone can give me a help with this as fast as possible.
I appreciate any help given!
Thank you
Here is the code:
MainActivity- http://snipt.org/BGaf2
ResultFragment- http://snipt.org/BGag2
One of the Fragments(Basically all the same)- http://snipt.org/BGah5
PS: SORRY FOR ALL THE COMMENTED CODE AND THE LONG POST, I COULDNT PUT MORE THEN 2 LINKS BECAUSE OF MY REPUTATION
EDIT: Thanks for the reputation! I can now post more than 2 links
I'd like to make a listview that, initially shows some elements of an array, loading more entries when you scroll down as maket does in example.
Can someone help me with or link solving that?
thanks
See https://github.com/johannilsson/android-pulltorefresh for one possible solution, and https://github.com/commonsguy/cwac-endless for another.