change color brightness in android - android

I want to change brightness in color
I implemented this...
Settings.System.putInt(context.getContentResolver(),android.provider.Settings.System.SCREEN_BRIGHTNESS, 200);
this will change my device's brightness in black&white mode.
like above images, I can change brightness but how can I give color?
Is there any other parameter which I don't know?

This can be accomplished using windows of type TYPE_SYSTEM_ALERT.
The idea is that even services can have a Window; so you can use a service, which makes a view and call WindowManager#addView() with a view and layout params. In your case, the view will just have a background color with an alpha value. You can experiment with different layout params to achieve the required effect.
This is also how facebook chat heads works. Check out this link to know more about the implementation details: http://www.piwai.info/chatheads-basics/ This will give you an idea on how to go about implementing this type of screen overlay.

Related

ios version of themes and styles

As an Android developer new to iOS/swift, I am trying to implement a global theme/style which every view controller can inherit. I expect one file which I can modify which would affect all View Controllers's UI. This is possible in android. Does iOS have anything similar?
The best match for what you are looking for is probably UIAppearance, although not quite the same.
What it allows you to do is basically setup each component once, and then have that be the default look for all other components.
An example for setting button colors (you could do this in your AppDelegate):
UIButton.appearance().setTitleColor(.white, forState: .normal)
UIButton.appearance().backgroundColor = .blue
Try looking at these tutorials:
https://www.raywenderlich.com/108766/uiappearance-tutorial
http://blog.iseinc.biz/use-uiappearance-create-ios-app-themes
Usually if you want to do something like that, you can go to the AppDelegate File, and add code like the ones below:
[[UITextField appearance] setTintColor:[UIColor redColor]];
[[UINavigationBar appearance] setTranslucent:NO];
[[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
For example textfield by default has a bluish tint color, but with the code above, the default tint color becomes red. The single line of code you place will affect all UI related to it. Try it out.

i want to set seekbar setSplitTrack under lollipop

i want to setSplitTrack(true) under lollipop, but i can't.
i tried set thumb's padding or margin, but it was not working.
I guess, android seekbar has stack structure, so it through all background.
thanks.
The Material seek bar has split track enabled by default. You need to turn it off.
This link might help you : https://stackoverflow.com/a/27000942/5816000

Horizontal Seletor

I need to create horizontal selector like in Uber android app (Please check screen shot). But that selector list must be dynamic means (Array[1,2,3,4...]). Please check screen shot:
I trid a lot but nothing worked with grate UI like this, I have trid also this link: check link. Its worked but bad UI because its uses paint to create things. Please help me to achieve same thing. I am trying it for payment selection option based on region. So its must be dynamic.
You can use android ui widget seekbar for this purpose and then customize it.
Also you can refer the following example
Seekbar

How to change my background of the screen for my view

I have simple job to do. I have to create an Help page for my android application. On that page I want to just put a full page of text of green color with some background image. Can anybody suggest me how can I do this in my XML file. Either in GraphicalLayoutMode or XML mode.
Please suggest what are the components required to this type of Help page...
android:background="#0abcde"
to set a color
android:background="#drawable/filename"
to set a image background.
use these tags for your layout parent view.

Should I set my TextView colours if my background colour is not set?

When I comes to specifying colours for an application, I recently came across #android:color. Is it recommended to try to always use predefined system colors?
I changed the colours of some of my labels to something brighter, so that they'll stand out against the black background. But then I start to wonder... would themes/skins (not familiar with those) and such cause the default background colour to be something other than black?
If so... what's the proper way to deal with colouring one's widgets?
(Disclaimer: I don't know Android. This is general UI design advice.)
If you set the foreground color, you should change the background color as well. Otherwise, if someone's background is set to something wacky, your labels could wind up invisible -- or at the least, hard to see -- and you'll have defeated the purpose of using different colors.
I'd recommend you leave the colors as they are, unless you can change the background color as well. Perhaps using a bold font or something would be a better idea.
You've got 2 options:
1) define explicitly fore/background colors of all of your elements
2) use only default colors, so when the user change its theme, everything will change accordingly. Personally, i prefer this way, but be careful if your UI's got some images
Be consistent, so you'll avoid issues when users change its themes. choose one and back to work!

Categories

Resources