In my application,the splash screen image for Samsung S5 does not appear properly.Instead of working in Genymotion but not on real device of Samsung S5. Also working on other mobile phone.Below is my style.xml file and in Splash screen i have added one handler consisting using intent
Complete style file is not able to add,so i have provided some useful code
Please help me.
styles.xml
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="AppTheme.Base"></style>
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/primary</item>
<item name="colorPrimaryDark">#color/primaryDarker</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:textStyle">normal</item>
<item name="floatingHintEditTextStyle">#style/Widget.FloatingHintEditText</item>
</style>
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
<style name="PauseDialogAnimation">
<item name="android:windowEnterAnimation">#anim/zoom_in</item>
<item name="android:windowExitAnimation">#anim/zoom_out</item>
</style>
<style name="Theme.Transparent.splash" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">false</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>
Related
All of them work except the background, but I couldn't get the background color to work. All I want is #000 for the background, but no matter what I tried, colorBackround popupBackround etc. I tried all of them but it didn't work. Everyone on the internet gave the same link. I've been trying for about 5 6 hours, but I couldn't change the background color.
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:navigationBarColor">#151617</item>
<item name="android:windowBackground">#151617</item>
<item name="android:editTextBackground">#drawable/rn_edit_text_material</item>
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerDropDownItem</item>
</style>
<style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:textSize">18dp</item>
</style>
<style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">#ffffff</item>
<item name="android:textSize">18dp</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:gravity">center</item>
<item name="android:background">#000</item>
</style>
<item name="android:background">#drawable/mydivider</item> // I tried that too, it didn't work
When I run it like this, all items are centered, a white page comes up background white texts white what I want is black background white text
Your background custom code seems to be in the wrong place.
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:forceDarkAllowed">false</item>
<item name="android:navigationBarColor">#151617</item>
<item name="android:windowBackground">#151617</item>
<item name="android:editTextBackground">#drawable/rn_edit_text_material</item>
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerDropDownItem</item>
</style>
<style name="SpinnerItem" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:textSize">18dp</item>
</style>
<style name="SpinnerDropDownItem" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:textColor">#ffffff</item>
<item name="android:textSize">18dp</item>
<item name="android:fontFamily">sans-serif-light</item>
<item name="android:gravity">center</item>
<item name="android:background">#000</item>
<item name="android:background">#drawable/mydivider</item> // here
</style>
I have this customized theme which I want to convert into Transparent theme
<resources>
<style name="MyMaterialTheme" parent="MyMaterialTheme.Base"></style>
<style name="MyMaterialTheme.Base"
parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item> </style>
</resources>
Do the following
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources>
The value #color/transparent is the color value #00000000 which I put in res/values/color.xml file. You can also use #android:color/transparent in later Android versions.
Then apply the style to your Activity, for example:
<activity android:name=".SampleActivity" android:theme="#style/Theme.Transparent">
...
</activity>
Add this style in your `values/styles.xml
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
And the following in `values/styles.xml
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
Try putting these items
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
I have created a transparent AppCompatActivity that is a type of 'launcher' activity for other activities. This launcher activity uses a transparent style as found with other stackoverflow questions.
<style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
</style>
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">#color/primary</item>
</style>
Sometimes this launcher activity needs to show a progress dialog. However, the progress dialog does not show up when I use the tag android:windowIsTranslucent. Commenting out this tag allows the progress dialog to appear, but the activity is no longer transparent.
Is there some sort of alternative solution for this?
I didn't tried this solution, But i think this could work.
Just add <item name="android:windowIsTranslucent">false</item> in your AppCompatAlertDialogStyle
Solution would be like
<style name="Theme.AppCompat.Translucent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
</style>
<style name="AppCompatAlertDialogStyle" parent="Theme.AppCompat.Light.Dialog.Alert">
<item name="colorAccent">#color/primary</item>
<item name="android:windowIsTranslucent">false</item>
</style>
how to customize the icon in the right side of the spinner. As you can see in the image below inside of the red circle there is a black circle the data inside of that spinner came from database. Is there a way to remove it? if none, how to change it?
For the code, I just add this in my styles.xml and then that black circles appeared also.
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerItem.DropDownItem</item>
</style>
<style name="SpinnerItem" parent="#android:style/Widget.TextView.SpinnerItem">
<item name="android:textColor">#909090</item>
</style>
<style name="SpinnerItem.DropDownItem" parent="#android:style/Widget.DropDownItem.Spinner">
<item name="android:textColor">#909090</item>
</style>
Thanks.
I already have answer.
instead of this code
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:spinnerItemStyle">#style/SpinnerItem</item>
<item name="android:spinnerDropDownItemStyle">#style/SpinnerItem.DropDownItem</item>
</style>
<style name="SpinnerItem" parent="#android:style/Widget.TextView.SpinnerItem">
<item name="android:textColor">#909090</item>
</style>
<style name="SpinnerItem.DropDownItem" parent="#android:style/Widget.DropDownItem.Spinner">
<item name="android:textColor">#909090</item>
</style>
I made it like this
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:textColor">#909090</item>
<item name="android:dropDownListViewStyle">#style/Theme.MyListView</item>
</style>
<style name="Theme.MyListView" parent="#android:style/Widget.Holo.Light.ListView">
</style>
How do you set DialogFragment.STYLE_NO_FRAME, which hides the frame, in your styles.xml file? Or does this have to be done outside of the xml file?
Have a look at this link.
Put STYLE_NO_FRAME in styles.xml
<style name="DialogWindowAnim">
<item name="android:windowFrame">#null</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowEnterAnimation">#anim/slide_up_from_bottom</item>
<item name="android:windowExitAnimation">#anim/slide_down_to_bottom</item>
</style>
<style name="DialogSlideAnim" parent="DialogWindowAnim">
<item name="android:windowAnimationStyle">#style/DialogWindowAnim</item>
</style>
This is how I did it.