On the frontpage you can drag icons to the trash by pressing them for a few seconds, the trash pops up and you move them out of the way. Is it possible to implement this functionality to my own application? Meaning I want to press on a shape in a my drawing view and then move this shape into the trash and remove it from my drawing queue.
You can not get the readymade thing for your requirement but visit links below so that you will get the idea and guideline how to achieve your goal.
DragDropArticle
Step By Step Guide
Android Developers
I tried my best ....
Related
I am developing an app and I would appreciate to get some input and your 2cents about this scenario:
I want to have 5 buttons in a circle and 1 button in the middle.
The buttons in the circle shall be able to be moved to the middle button and there are two scenarios:
if the button touches the middle button --> switch screen
if the button does not touch the middle button and you stop moving --> it should be moved back to the original place (gravity)
Is it optimal to solve this scenario with buttons or would you prefer any other item?
Thanks a lot!
Developing this will take a lot of time and effort. I don't know if this can be done using simple buttons or you need custom elements but I can help you get started. Try looking into the Facebook chat heads behaviour. I think the behavior of chat heads when removing them (with the X circle in middle bottom where you drag chat heads to remove) is similar to what you are trying to achieve.
Here is some useful information you can go through and maybe you find what you're looking for.
What APIs in Android is Facebook using to create Chat Heads?
https://github.com/henrychuangtw/Android-ChatHead
https://github.com/marshallino16/Demo-FloatingView
Note: I am still going through all the information in these links because it looks like it might be helpful for you. You also go through the links and we can further discuss in the comments and later edit the answer when we have a solution
I am going to code a walkthrough tutorial for my app.
I wish the user will follow the step of the tutorial. So I want to force the user to click on a specific button but not other parts of the app.
My app has many UI components and some of them are added programmatically so disabling them one by one is not practical.
One immediate solution is that I make a transparent Activity to cover the original Activity.
But I don't know how should I detect the touch event through the overlay Activity to operate the original Activity.
Or are there any better way to make a walkthrough tutorial on android apps without much affects to the original code? Tutorial is an adhoc feature and I dont want these adhoc features to ruin my coding with a lot of if-statement on every Activity.
Thank you.
Activity won't work. Only the one at the top of the stack can process infos.
Simply add a semi-opaque view above the screen using a relativelayout
Then simply monitor the ontouch event of this view. If the touch is in the accepted zone of the tutorial, then let it bubble up to underneath control. If if is outside the accepted zone consume the event.
Button btn = new Button(getActivity());
btn.setText("Next");
// Adding button to bottom
lv.addFooterView(btn);
I have a need to create a circular dial/rotary style component for use in an application. It's essentially a circular menu that allows users to select from the items that are ringed around it, and then they can click the button in the center to activate the selected item. However, I've never created a custom UIView of this type, and don't really know where to begin. Can anyone give me any pointers as to how I would draw the view and then rotate it as the user drags their finger? I obviously know how to intercept touch events, etc. but I'm not sure how to actually go about manipulating the UI appropriately. Any tips or pointers would be great!
I don't know if you've already found a solution to this, but here is a nice overview of how to get started:
http://shahabhameed.blogspot.com/2011/05/custom-views-in-android.html
For you, I think you can extend an existing View, that View being the SeekBar. You can take the standard SeekBar and draw it in a circle.
Finally, here is a source code that does the rotation with a volume knob. It is its own project though, so you have to do some work to use it in your own app.
http://mindtherobot.com/blog/534/android-ui-making-an-analog-rotary-knob/
Good Luck!
I have a neat library to do this. It is extremely stable and well maintained. https://bitbucket.org/warwick/hgdialrepo
Heres a youtube demo: https://youtu.be/h_7VxrZ2W-g
This library comes with a demo app with source code and the demo app actually uses a dial as a menu, So I think this should be the perfect solution for you.
After seeing the last screenshots of new foursquare application and their balloon like cartoon instructions, I'd like to create some of these in my application.
I found a similar question for iPhone
Small popup for instructions... How?
Here is another screenshot of foursquare app:
I'd like to know how I could achieve that with Android.
Thanks in advance for any help.
UPDATE: This is what I could get so far but adding some buttons with a custom drawn background and layering them with a FrameLayout:
But I still couldn't get the triangle effect. Maybe there is something I can do with my custom background shape?
UPDATE2
After checking your suggestions, I decided to go with Aaron C idea and added an image with an arrow on it. This is my current result:
Thank you Snailer, QuickAction API project seems very much promissing. I'll check it out when implementing more features in my app.
Now, I just need to get the right color or maybe I could just let it this way. It seems nice too.
And, so, to summarize what I did:
Got my initial xml layout inside a FrameView.
As I'm using a frameview, everything I put in here will be piled one over the other. That's how I could add things to the layout.
In that framelayout, I put 2 relativelayouts whith an image with the triangle and a button to create the two upper popups. In the bottom I put a button only.
That's it. I hope it helps somebody.
Thank you very much again for all your help!
That sounds like a neat thing to implement. There might be a built-in Android variation on AlertDialog that achieves this, but if not here is how I would go about implementing it:
Create a new Activity whose background is black with a very high (low?) alpha color value. This will allow you to see through it to the previous Activity in the stack. Then, add your alert at whatever coordinates you like using a relative layout with padding values.
You might also want to add a touch listener that exits the Activity if the user touches the balloon (or maybe anywhere in the screen).
If you want to be fancy with coordinate placement of the balloon, you can pass this information into the new Activity using the Activity's launch Intent with the putExtra() methods.
It's probably achieved through skinning a toast.
The developer documentation shows a skinned toast in "Creating a custom toast view" at http://developer.android.com/guide/topics/ui/notifiers/toasts.html
You may want to look at the QuickAction API. It acheives this by using PopupWindow, skinned, positioned, and animated.
I saw one iphone application if the button is visible and we press cancel button then that button should gone. in that case there is animation "the button diposes from left to right and finally got vanished". In android i am able to rotate any view or move it from left to right. But how can i get the effect that the button destroy animation and make a button visible in that type of animation.
Thanks
Deepak
I'm not sure that I fully understand what you're trying to do, but it seems like you want to fade the button as well as translating it. If that's the case, then you can use alpha animations to change the opacity of the button. By gradually reducing the alpha to 0, the button will appear to fade away.
I have recently completed a series on animations on my blog. It is probably best to read the articles in order starting with the first, but the final article covers animating individual widgets.
To get a general idea of animations in android, check out this awesome page on quick actions. There is plenty of code and working animations with different options so you can get a full tutorial of how they work.
How to create quick action dialog