Bigger Action Bar and Button Android - java

I'm learning how to program for Android and i have a question.
How can i do my action bar like this (which elements i have to use, etc...) :
With the text at the middle and a logo instead of the pink "+"
(I took this pic from google design and i modified it a little bit)

In Android Studio go to File > Import Sample and type:
Floating Action Button Basic
This is an Google's project example of what you looking for.

Related

Custom button with a selection

I don't know if this has been asked before. I am going to be building a calculator for my dad. He asked me if there is any way to have customization with the buttons.
I have not done any code yet. I plan on trying a few things. My research has come up with nothing.
This is what I am trying to accomplish, I have a feeling it breaks the android studio law of coding. This is the concept:
Imagine the calculator. You have 8 blank buttons above the numbers. Those buttons ordinarily have the functions such as percent and sqrt.,..etc.
I have been asked if it's possible can he just hold the button and change those functions at will.
So the question at hand is. Can I do if statements to change the symbol and the code for a particular button when long pressed?
The concept of the calculator would be in portrait mode he can customize the buttons to the functions he uses without having to turn the calculator in landscape mode?
So in theory you have a long press which would bring up a selector. He can select any math function and based on that function the symbol and code would change and the button will work properly to the new selection?
I was going to to build the calculator as a standard. But was also wondering myself if this is possible. I know the buttons serve as a one function but in coding anything is possible.
Any help or advice would be appreciated. If this can be done it opens new possibilities to app features to only show what you want and not a predefined controls.
*******once I try a few codes I will edit question to better see the issue and what I am trying to do.
OnLongPress show a dialog with the option you want and change the button text according to selected option.
On Onclick check the button text and call function according to the text

How do I create simple two page Android swipe app in Android Studio

I want to create a tabbed activity or empty activity in Android Studio, but I need to be able to swipe to a page 2.
All I would like is for the app to say the standard "Hello World" on the 1st screen, and then you can swipe to the next page that says "Hello World Page 2", Just those 2 screens with no title bar on any of the screens - that's it.
I've tried creating a tabbed activity and was able to create both pages and swipe works, but it creates a button in the lower right corner and a title bar with settings button up top that I couldn't figure out how to delete.
I tried an empty activity but couldn't figure out how to add another page. If anyone could provide me the code or a sample project I could edit that would be amazing as I've lost several days in frustration over this.
You can use ViewPager component. When you will use it you would to use TabLayout, but if you want to hide it you just simply can edit its visibility.
You Can try this Example.
https://www.sitepoint.com/using-viewpager-to-create-a-sliding-screen-ui-in-android/
Simply replace the image with TextView.
To hide the actionbar user getSupportActionBar().hide()

Android - Main menu for simple app

I'm making a simple android app, and I'm trying to work out the best way to make the main menu. The users of this app are not likely to be that sophisticated, so I want to make it as simple as possible.
So I want the first screen they see when the app opens to be this menu - they click on what they want, and it takes them to that part of the app (Not pressing a "Menu" button to bring it across from the left, which is common nowdays).
So, I want the menu to look a bit like this: http://cloud.addictivetips.com/wp-content/uploads/2012/10/AppZapp-Android-Menu.jpg , minus the search box, and the strip down the right hand side. (also this looks like it is one of those menus that slide out from the left, which I dont want)
I have had a look into menus (https://developer.android.com/guide/topics/ui/menus.html#options-menu), but it seems it is more used for contextual stuff, or letting the user select an option), then a navigation menu.
So - what is the best way to do this? Do I just create a list and put a button in each item?
Based on the your requirement , Use Navigation drawer see the below link.
Navigation drawer tutorial
NavigationDrawerSample
After used navigation drawer, you need to add search view on navigation header.For more info see the link
SearchView tutorial

Floating Action Button Without Checkable

I've been following this code example from Google about the Floating Action Button in the newest Android library http://developer.android.com/samples/FloatingActionButtonBasic/index.html
This works, as a Checkable button. However, I don't want it to be checkable, I just want to be able to click it and animate it as you'd expect (seems strange the Google example is for a checkable button when it seems like it'd be against their design principles, and others have had problems)
I'm reasonably new to Android, and so far my research has come up with a lot of external libraries, but I'm trying to keep it as native as possible
Is there an interface in Android Java that would allow me to essentially use this as a button? The FAB button example is Checkable and obviously the constructors and methods pertain to that.
#jmo : Please check Android Floating Action Button based on Material Design specification And NQH_FloatingActionButton For sample Purpose . I hope this link will help you http://android-developers.blogspot.in/2015/05/android-design-support-library.html
You should instead use FloatingActionButton, part of the official Android Design Support Library.

Android Dropdown Effect - Spinner or not?

Achieving a true "dropdown" effect (as seen in Adobe's Photoshop Mobile app for Android, image below) has proven challenging using Androids built-in methods.
As others on Stackoverflow have told me, editing the style of a dropdown list view of an Android spinner is limiting.
How is this dropdown effect done?
(I can't seem to get an image to show, so here's a link: Adobe Photoshop Mobile for Android
After viewing the Adobe slideshow I think the way I would attempt to get that to work, using the Android Java SDK, would be to create a ListView object with a transparent background, and then dynamically hide/show it in that position when the menu button is clicked by setting the View's visibility to VISIBLE or GONE.
Getting a ListView to be transparent shouldn't be that difficult. I'd look into AbsoluteLayout to get it to hover over everything in that spot.
Another option might be to display the ListView in a custom Dialog that you've written, again positioning it in that exact spot on the screen so that it looks like a menu extending from the button that was clicked.
It's probably done using low-level draw functions.

Categories

Resources