I am wondering how to achieve some kind of draggable view. I am not speaking about the navigation drawer!
Several other applications implement this kind of views, for example the new stock Android Lollipop Calculator application. There you can drag out the extended symbols view from the right hand corner.
Another application is Google maps. When checking out a location, it's possible to extend the location information by dragging up the bottom information view.
It appears that there are two points where the view is able to lock in, meaning that when pulling the view up to a specific point and releasing, will result in the drawer not closing entirely but to align to the specific locking points.
How is that achieved or is a library required?
Thanks in advance
The stock calculator app appears to use ViewPager to achieve the slideout numberpad. It's a part of android, no libraries so that would be a good starting point.
Here's the class in question (Rest of the code to the left)
Related
I am currently designing a Sudoku application for my own personal development, this is the first proper application I will be making. I can program in Java quite effectively with good object orientated understanding.
I want to create the application with 1 view as shown below:
As you can see I would like a single view with a grid object, the grid object will have it's own paint method.
How would I go about making this object zoomable?
How would I handle interaction with this object?
I also have 2 buttons on the bottom left and right,
How would I anchor these so they won't zoom?
Could I float these over the object and have the object as the entire view?
What pop up menu should I use? I would like a small menu with difficulty selection a restart button or a new puzzle button, also an exit button.
Thanks for reading this far, if you do have any advice for me at all then please post, If you require more information about anything then please ask!
You may find this Android Developers tutorial useful in achieving your zooming aims - https://developer.android.com/training/animation/zoom.html. It refers to an ImageView but with some changes I believe it could work similarly with your subclass of GridView.
You wouldn't have to worry about the buttons as long as the zoom was applied only to the GridView. However, you may wish to consider using an Action Bar instead of your current buttons for the menu and hint button.
I've been using the SWReveal View Controller as the basis for my app in iOS, and I want to find an analog in Android. I'm hoping to keep the same drawer effect going left and right as appears in John LLuch's SWRevealViewController https://www.cocoacontrols.com/controls/swrevealviewcontroller.
I know you can use a navigation drawers controller to show the left, but that is a pop over. It's not like moving the center screen over to the right. I am also aware of there being the Fixed tabs controller, but those do not allow the center screen to be shown on top either. I am hoping somebody has mimicked a controller in android that allows you to move the three screens as if you were paging between them and still show your center screen at all times.
Please let me know if you guys know of one or know how to make the fixed tabs controller do this.
Google has a navigationDrawer that looks similar to the SWRevealController. However in all our projects we use https://github.com/adamrocker/simple-side-drawer/tree/master/SimpleSideDrawer as it seems easier to get used to it.
It is not exactly the same but you will get same results. We always make a Base Activity that all the menu activities extends in order to get the actions of the menu.
It is as having a FragmentActivity and on the onCreate method add these:
mNav = new SimpleSideDrawer(this);
mNav.setLeftBehindContentView(R.layout.menu_left);
mNav.setRightBehindContentView(R.layout.menu_right);
I hope that helps!
The idea I'm having is having a view that can be pulled down on top of the current view, with similar animation features like the one you can pull down from the top all the time, on Android Devices.
Here's an illustration:
The idea is to grab it and being able to pull it down on top of the other view, and then being able to interact with that view. To slide it up again, you should grab the bottom of the view (the grey area in the illustration) again, and then pull it up.
I haven't even worked with animations before but I found a lot of topics on that, while searching for solutions to my problem, including this: Slide down view in android
but my impression is that, that is about making animations when the user isn't touching the phone.
What is the best way to do this?
Is there a better way to do something very similar?
EDIT:
Here's the topic that made me find the solution: How to make an Android SlidingDrawer slide out from the left?
And here's the solution I used:
SlidingDrawer Top-to-Bottom
You could use a SlidingDrawer, this is a built in component into Android, but as far as I know it slides only from bottom - up.
If you a comfortable to modify your app design, then this could be an option for you.
However, on internet are some libraries of custom SlidingDrawer that lets you put the marker on any side of your screen, so you can drag it top-down, left-right, right-left.. any way you want.
Useful links:
How to make an Android SlidingDrawer slide out from the left?
SlidingDrawer Top-to-Bottom
I want to add a sliding panel view using cocos2d for android. Any suggestions.
The way i've achieved this in one of my previous android market apps for paintball field designing is to have a separate CCLayer class added as a child to the main scene, and have the main scene responding to the CCTouchesBegan. if the location of the touch is within the co-ords of the visible panel, then call a 'touched' method inside it passing the touch co-ords, so that it can deal with it's own content.
On another panel at the bottom I had a button, which showed or hid the side panel, so it didn't 'slide' or support being 'flung' across the screen, but rather was shown or hidden.
Sliding it or flinging it on/off the screen could be written relatively simply i believe, using a combination of CCTouchesMoved and CCTouchesEnded to track the slide/fling and perform translation on the layer co-ords.
There's nothing to have prevented me implementing a slide in/out using some simple animation, but I had no requirement for it in the app, and hence didn't implement it.
Hope this is at least of some use,sorry i can't provide some worked examples right now, busy with work.
In the android home screen, we have the ability to slide the screen left and right and display multiple pages. Each of these pages has a different set of icons. In the Mac world these would be called "spaces". What are they called in the Android world?
More importantly is there a standard control that can be used to achieve this effect?
There is no such control to achieve this. Once I was digging through the Launcher's source code and this effect is done by creating few LinearLayouts and placing them side by side in the code. Sliding through the "spaces" is done by handlig touch events. Also the grid that handles widgets is created using aviable API.
Unfortunately, there isn't a standard control for that sliding effect.
This is another question about the effect which also contains a few pointers about implementing it.