Dividing screen in android like frames in html - android-layout

I am making an android application.
There i want a common navigation menu on every activity like frames in html.
I want the menu at the left (say 20%) area and other navigation screens on the right (say 80% area)
please help me out.

You should use two fragments, that way you keep the menu in one fragment and only change the activity in the other, I should not be difficult to find an example on internet since it is very common in tablets.
http://developer.android.com/guide/components/fragments.html

Related

Is there a way to create something likea draggable menu in wearable device in Android?

I was wondering if it is possible to create something like a menu that I can drag either by the side or from above on a wearable device. But I don't want it to affect the activity I have. You know like on a smart phone and you drag down the menu with some settings like brightness, rotation, etc...
To elaborate, I have a timer with a progress bar, but my activity would be overcrowded if I added any other stuff. So I want something to drag from the top of the screen to check on something, then drag again to return to my view that has the timer and progress bar. I basically have an activity where I make some selections, I wanted my selections to appear in that draggable menu thing to check to see my selections displayed there.
There are two drawer components for the type of behavior that you describe. Which one is better depends on the specifics of your implementation. The documentation for Navigation Drawer and Action Drawer can be found here.

How to have activity that produce more than one layout when hitting button

Most of us saw the bottom bar in telegram , facebook messenger .. I think .
What i want to know " how is that bar still appear even if we go to another view ?
Thanks in advance .
After reading your comment I understand what you meant. You may want to learn about Fragments, and FragmentActivity. Basically, you would have multiple fragments for each button on the Bottom Navigation, meaning you would have multiple classes and layouts. Your activity's layout should have a container (above the bottom navigation, in a FrameLayout for example) on which you can attach your Fragment. When you hit a button on the bottom navigation, you switch fragments.
I don't really understand the question but I think you want to know how to use Bottom Navigation. You could use the same component in each layout and select a different item based on the layout. If it's in each layout it will appear on each view.

Android Menu coming from bottom like Google Drive

I have a floating action button and when the users taps on it I want a layout to be shown, animating from the bottom exactly like the Google Drive app (so not covering the whole screen).
I read someone suggest the open source Umano's AndroidSlidingUpPanel but that is more similar to the Google Play Music app and I don't want that as I don't need the panel to be draggable/slidable.
What component should I use?
This is the Bottom sheet component. Check out its specs:
http://www.google.com/design/spec/components/bottom-sheets.html#bottom-sheets-specs
There are third libraries for the bottom sheet if you don't want to make it your self.

Android application two layouts and changing layout based on the spinner value

I am new to android applications. I want to create an application that should have a spinner in the beginning and based on the item selected in the spinner the lower design/layout/values changes. Basically there can be two layouts one in the upper half with spinners and the lower half will vary based on the spinner value.
How can I achieve this?
Use Fragments to achieve this thing. Have a look at below tutorial this will help you.
http://www.vogella.com/articles/AndroidFragments/article.html

Magnifier like feature inside popup window....how to?

I need to create a magnifier like feature in my app. Like the "loupe" effect on the iphone !
The problem is that I need to do that inside a popup window and I don't get how to make it work !
The popup window display a grid of colors that I generate and draw one by one using shapeDrawables. What I want is to display that color bigger, zoom on it when the user touch and move his finger around the popup window (color grid). The idea is to create a tracking-zooming effect on the colors so the user can see more clearly under wich color his finger is currently located.
Problems are :
I can't seem to create another popup window on top of this one, Android limitation I think ?
If I modify the current shapeDrawable, resize it, change the boundaries, It needs to re-display the popup window before it takes effect (which is not acceptable of course)
So, anyone knows of a way I could draw over that popup window ?
EDIT :
I've tried solving this issue using a Custom Toast object...But it doesn't quite do the trick. It works, but toast object appears slowly and so the touch motion is not in sync at all with the user movement over the color grid.
I'm not sure if this will help you or not, but you might be able to accomplish this by using a second Activity... this second Activity would use Android's translucent theme if you include the following attribute in your manifest:
<activity android:theme="#android:style/Theme.Translucent">
This second activity will now only contain what you place in your layout. That is... the "real" activity you're running will still be visible behind it (anywhere you don't cover it up with views in the new layout).
You also might prefer Theme.Dialog if you really want to resemble a popup.
Something to keep in mind if you take this approach is you will probably want to override onWindowFocusChanged() in the new activity, and finish() in the event of you losing focus. Additionally, you'll need to figure out how to share your data between the two activities.

Resources