Is it possible to change android background black colour? - android

Is it possible to change the colour of background while switching between activities?
I mean the black colour what apear while one of activities disappear and before second appear. Thanks.

Just you need to head over to the activity_home.xml
At the starting lines of code add this background parameter to set the screen black
android:background="#ffffff"

you may change the theme that you are using as follows:
application android:icon="#drawable/icon" android:label="#string/app_name"
android:theme="#android:style/Theme.Light" >
Edit
as mentioned in the documentation:
<application android:theme="#style/CustomTheme">
and then tweak the theme that you like:
<style>
<color name="custom_theme_color">#b0b0ff</color>
<style name="CustomTheme" parent="android:Theme.Light">
<item name="android:windowBackground">#color/custom_theme_color</item>
<item name="android:colorBackground">#color/custom_theme_color</item>
</style>
here is the link to the topic http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme

Related

Account Kit advanced UI customizing

My default color is purple (#9b59b6) i want to change top title (blue) color to purple as well. I red manual on Customizing the Account Kit UI in Android Implemented style like this, but had no further luck changing top title color to purple.
//Delauft color: purple
UIManager uiManager = new SkinManager(SkinManager.Skin.CONTEMPORARY, ContextCompat.getColor(this, R.color.default_color), R.drawable.register_screen, SkinManager.Tint.WHITE, 0.1);
configurationBuilder.setUIManager(uiManager);
In my style.xml i have
<style name="AppBaseTheme" parent="android:style/Theme.Light.NoTitleBar">
<item name="colorPrimary">#9b59b6</item>
<item name="colorPrimaryDark">#9b59b6</item>
<item name="colorAccent">#9b59b6</item>
<!-- other elements-->
</style>
Other activities works fine.
I have app that look like this:
UPDATE
Solution: In AndroidManifest
<activity android:name="com.facebook.accountkit.ui.AccountKitActivity" android:theme="#style/CustomFbStyle" tools:replace="android:theme"/>
And in style.xml
<style name="CustomFbStyle" parent="Theme.AccountKit">
<item name="colorPrimary">#9b59b6</item>
<item name="colorPrimaryDark">#9b59b6</item>
</style>
Please check the theme you are using i.e Appbasetheme is the same which you have mentioned in application tag of manifest.
<application
android:label="#string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="#style/AppbaseTheme">
or you can also use specific theme to specific class by giving android:theme tag to that class in manifest

Is it possible to customize the menu items by background color and padding?

I'm trying to do something like the mockup below. I need the first item to have a different background than the others. I also need this first item to be unclickable. I tried the enabled="false" attribute but that greys out the text which I don't want. Also I have tried itemBackground in styles.xml to change the item background color but this changes all of them and I only want the first item to have a different background. And lastly, I'd like some indentation in the last two items (not sure if this is even possible as I don't see padding and margin attributes).
Add popupMenu style to ur AppTheme:
<style name="AppTheme" parent="android:Theme.Light">
<item name="android:popupMenuStyle">#style/PopupMenu</item>
</style>
<style name="PopupMenu" parent="#android:style/Widget.PopupMenu">
<item name="android:popupBackground">#android:color/white</item>
</style>
manifest.xml:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
.............
</application>

Android Lollipop Theme

I want a white EditText.
Which theme shall I use?
I can customize the rest of the looks.
I searched for any xml file also, to find which one could I use as the drawable background, but did not find one.
Can anyone suggest any xml or theme?
The EditText now is black.
I want it to be white colored and same design.
I.e.: just a line, not the braces at the end.
I have looked into the drawable folder of the API 22 SDK, but it did not help...
I got only One solution, but it gives the older EditTexts in white colour.
Like this one
In android manifest file apply the theme .
<activity
android:name="your activity name"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#style/Theme.App.Base"
android:windowSoftInputMode="stateHidden|adjustPan" >
in the values-v14 folder change the style to below
<style name="Theme.App.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorControlNormal">#FFFFFF</item>
<item name="colorControlActivated">#FFFFFF</item>
<item name="colorControlHighlight">#FFFFFF</item>
</style>
Hope it will help you

Android normal button turns transparent

I have a RelativeLayout with a background set with android:background="#drawable/background".
In my RelativeLayout` I have a standard button but when I run the app in devices running 3.1 or higher the button are displayed transparent.
I have tried setting android:alpha to 1 with no luck.
I know I can make a custom background with selector and shapes but there has to be another way.
Anyone else had this problem?
You'll want to add something like this to your style.xml
Application theme
<style name="ApplicationStyle" parent="android:Theme">
<item name="android:buttonStyle">#style/MyButtons</item>
</style>
Button style
<style name="MyButtons" parent="#android:style/Widget.Button">
<item name="android:textSize">16sp</item>
<item name="android:background">#000000</item>
</style>
Make sure you're setting your theme correctly in the manifest also
<application
android:allowBackup="true"
android:icon="#drawable/app_icon"
android:label="#string/app_name"
android:theme="#style/Theme.ApplicationStyle" >

How to set text color in android app for all text?

I want to define a default text color for my android app.
I have a base activity class, that all activities are extended from it and I thought this might be a good place to define the colors.
If not what is a better solution? Maybe styles?
Trouble is this, all is new to me, so feel free to advise me and provide code snippets and explanations as well.
This is what my base class looks like. As you can see it's pretty empty
package com.ccslocal.mobile.quiz.jls;
import android.app.Activity;
import android.os.Bundle;
public class BaseActivity extends Activity {
//set up app preferences here
}
As was mentioned in denis.solonenko's answer, the correct approach would be to modify your theme.
Where you define your theme (in your themes.xml or styles.xml file), you'll want to add something like this:
<style name="AppTheme" parent="#style/Theme.AppCompat.Light">
...
<item name="android:textColor">#FF00FF</item>
...
</style>
Then make sure that the theme is applied to your Activity or Application in the manifest:
<application
...
android:theme="#style/AppTheme"
....
>
You can also define:
textColor - The default text color of any given view
textColorPrimary - The default text color for enabled buttons and Large Textviews
textColorSecondary - The default text color for Medium and Small Textviews
textColorTertiary - ?
(Source TextColor vs TextColorPrimary vs TextColorSecondary)
Keep in mind that many other things may override these predefined colors, such as applied styles or definitions in different resource folders.
See here for a full list of theme items: https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/themes.xml
Create a custom theme for your app. Take look at the official guide.
Yes you are right you can make that using style. Or you can use TextView.getTextColors().getDefaultColor() for set default text color. Actually I never used this but I think it may be help you.
For style
<style name="TextColor">
<item name="android:textColor">#00FF00</item>
</style>
Then in layout file
<TextView style="#style/TextColor" />
Set your default color in your res/values/colors.xml like this
<color name="defaultTextColor">#ffffff</color>
So this color to all your texts
android:textColor="#color/defaultTextColor"
or
textView.setTextColor(R.color.defaultTextColor);
Create style for TextView:
<style name="TextViewTheme">
<item name="android:textColor">#android:color/white</item>
</style>
Apply it in style for App:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:textViewStyle">#style/TextViewTheme</item>
</style>
And remember to change style in AndroidManifest.xml:
<application
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
...
</application>
#android:color/white
yes you can change default color of react native app only add this line in styles.xml file of android src

Categories

Resources