0

enter image description hereenter image description here If I use window Translucent Status then status bar wont change the status color. I want to draw image under the status bar with status bar white color and text as black.

  • Possible duplicate of [How to change the status bar color in android](https://stackoverflow.com/questions/22192291/how-to-change-the-status-bar-color-in-android) – Sagar Balyan Feb 21 '19 at 09:37
  • I have already gone through it.....my status bar color changes well and also its text color...but image doesn't draw back of status if i use windowLightStatusBar....any way thank you for your answer – danny morrison Feb 21 '19 at 09:42

2 Answers2

0

Better than using Translucent Status Bar in your style make that Activity as FullScreen Activity. Put

<style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
</style>

And call that style in your android manifest where you will add activity.

android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen"
Ankit Tale
  • 1,924
  • 4
  • 17
  • 30
  • this is making my status bar unvisible.....its applying black color....pls check my question i have updated it with my styles file – danny morrison Feb 21 '19 at 09:50
0

enter image description here Here is another update. Try this for your project

styles.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

Activity Code

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
}

I tried and it works for me you need to add a large image in .webp format for the background.

Remove an unnecessary style from your XML

Ankit Tale
  • 1,924
  • 4
  • 17
  • 30