Android Application Architecture - android

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.

Related

Android slide out view

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)

Android - Create a view that includes the entire screen

I am not the best at android programming so please correct any errors I make.
According to this developer.android.com.
Android view is:
This class represents the basic building block for user interface
components. A View occupies a rectangular area on the screen and is
responsible for drawing and event handling. View is the base class for
widgets, which are used to create interactive UI components (buttons,
text fields, etc.).
However, I have not found an article about how to get a full view. I mean as in an entire screen as a view. The image I used below is to show what I want to include in that view. I want to include everything on screen. Everything On that Screen. (I can't repeat enough). It includes the chat heads, background, and menu bar. Everything that is on screen.
I can't figure out how to get a view like that from a service or from an activity. Any help is appreciated. I don't have exact code because I don't know how to do this.
Edit:
I know that I am very bad at explaining, so if you are confused, I am going to explain what I want to do with my view.
So basically, I want to make a screen tapper that taps for you so you can king of "cheat" games like cookie clicker. Therefore I need a view that contains the entire screen so then I can fake "touches" on the screen.
Hope this cleared any confusion
So you have a few things to deal with. Generally, the menu bar (and possibly soft-key buttons on the bottom) will remain visible. However, you can hide the menu bar:
hide the top menu bar in my android device & Tablet
You may want gestures to allow users to see it. Or, since it appears you are building a game, you just leave it hidden until they hit "home" or "back" or "exit" or whatever.
The "chat heads" are a horrible idea, but some developers think they are awesome. You can see more about that here:
Creating a system overlay window (always on top)
You might find something like this will work (but if new notifications pop-up, it may not help):
http://goobbe.com/questions/1390940/how-to-close-cancel-dismiss-a-system-dialog-programmatically-android

Circular / rotary dial view in android

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.

How to create a overlay with help bubbles on Android?

I recall seeing some android apps having a help overlay that greys the screen a bit and provides textbubbles with helpfull information pointing to various UI objects.
I thought this to be easy, just create a FrameLayoutwith 2 layers, 1 content, 1 helpoverlay.
However, it appears that you can't use a RelativeLayout with items that are based upon another RelativeLayout?
How would I go to position these bubbles? Manually?
Use a PopupWindow. a sample implementation can be found here : http://sree.cc/google/android/android-popup-window
You can use the popupWindow.showAsDropdown(View anchor) method to attach the popup to any view or manually set the x and y co-ordinates of the popup to be shown.
[EDIT]:
you may also want to have a look here : http://code.google.com/p/simple-quickactions/

Scrollable menu bar with left/right arrows

I am looking to create a navigation or menu bar similar to the functionality of the one at the top of the Fox News app. I started to code this myself using a Gallery but I'm not sure how to hide the left and right arrows when they are not needed. I was also wandering if you would have to use images for the menu items or if you could just use TextView or buttons so I could change the text without having to modify an image. I have seen this type of navigation on several apps and I tried all types of searches trying to find code examples but I must not be using the correct name for this type of scrollable menu because I couldn't find anything. If anyone has an example or provide a link to an article I would greatly appreciate it.
Look into HorizontalScrollView. It is a Layout that will handle the smooth scrolling and is likely to be much less of a hassle to work with than Gallery for this operation (I just added one for a similar reason).
To handle the left/right, look into setOnTouchListener. I'm not sure if you can get the current scroll position without making a new child class of HorizontalScrollView to access protected methods. There may be other ways, however - I didn't need to add buttons so I didn't investigate.

Categories

Resources