I have created tabs for my application using this tutorial: http://www.android4devs.com/2015/01/how-to-make-material-design-sliding-tabs.html
I have done this successfully and now trying to change the colour of the tab when pressed. It seems to have a built in default colour and I have googled quite alot but found no answers.
I have found how to change the background colour of the actual tab but I need to change the background when pressed. Please can someone help me with this?
Note: this changed the background colour of the tab in normal state by adding it to the constructor of SlidingTabLayout
this.setBackgroundColor(context.getResources().getColor(R.color.ColorPrimaryDark));
Thanks,
Sam
Check here
But it suggest to use SmartTabLayout library which is better.
Related
I am coding in android studio for some months and everything worked great. In the last 2 weeks I updated android studio and since then, every time I put a button its color is defined as purple no matter what I am doing, even if I change its background.
I tried to change it from the xml and also from the java file but without success.
If someone knows how to change it, it would be very helpful.
Thanks for answers.
the color of the button
Instead of button use <androidx.appcompat.widget.AppCompatButton>
Setting the app:backgroundTint to the color or transparent as well fixed this for me.
Change the theme.xml
style name="Theme.PROJECTNAME" parent="Theme.AppCompat.Light.NoActionBar">
Then the button without background will become grey and can be edited by color and drawable
I get a strange problem. When I open design-menu for redacting xml file (Activity or Fragment) I dont see elements(buttons, textviews etc).
Picture:
How can I fix this?
This looks like a render problem, please click on the top right red exclamation mark to see the exact error.
For the time being, you can change the display theme to resolve the problem. Click on AppTheme in the top menu, and choose another theme (I would suggest Material Light > Material.Light.DarkActionBar
Please see the image below:
i'm developing an application for android that is already done for IOS, is not big problem.
the thing is that my boss want it to be exactly the same, but one of the menus is the problem, is like a slide menu but with zoom and a background image, anyone have any idea how can i do this, i already google it but no results :(, a library would help.
here is a picture with the menu for IOS.
I don't think if it would be an effective solution but you can use a RelativeLayout.
Put the selection part behind in a LinearLayout then put a framelayout front to contain list fragments. This way you shouldn't use an action bar to have absolutely same looking with iOs version.
When someone clicks open button apply an animation to your framelayout. scale it by %75 and move it 25% in y coordinate and move it %50 in x coordinate. When buttons in your LinearLayout apply a reverse animation to your FrameLayout. If swap button clicked change your fragment with new one. You can also aply a transaction animation to your fragments.
I hope you know how to handle this stuff. If no I can do my best to code an example.
EDIT:
Don't forget to set your flame layout unclickable when you move it to right side.
https://github.com/SpecialCyCi/AndroidResideMenu
I think I found your answer. I came across this in a list of libraries it is 3.8 on the list https://github.com/Trinea/android-open-project/tree/master/English%20Version
Cheers!
Im having quite a difficult time setting up this GUI
As you can see in the picture i need to have several clickable items and i dont know how to do it. So i thought i could make one different VerticalFieldManager representing the white background. But it looks impossible to have more than two VerticalFieldManager over the main manager. So i thought i could use a LabelField and change the background color to white (it didnt work either) and on top of it put clickable labels and clickable textField but i dont get the background VerticalFieldManager to repeat it self and put itself under the previous one with a slight margin between them. Anyways, can you guys give me ideas on how to accomplish this GUI, what to use as background.
Thanks in advance and have a nice one.
I would suggest the following layout
Screen delegate should be VerticalFieldManager
Each item should be VerticalFieldManager as well
The body of the item itself should be RichTextField
The rest of the clickable elements you mentioned should be clickable Labels.
You will have to use HorizontalFieldManagers as well. One for the top panel and one for the bottom panel. Check the JustifiedHorizontalFieldManager from the advanced UI libarary.
As for clickable label - it is easy to implement one. Search SO for "[blackberry] clickable label". You can also check the BaseButtonField and BitmapButtonField provided in BlackBerry advanced UI library and available here.
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.