0

I'm sorry for the unclear title , it's just that I don't the name of this thing. Anyway , here is a picture of the main screen of the app:

enter image description here

I want to remove the blue bar/title/line at the top (where it shows the time and battery..) If I can't remove it than atleast modify it by changing it color to black of something that suits better the background of the layout. Thank you, Noam

Noam
  • 1,640
  • 4
  • 26
  • 55

4 Answers4

1

Yes, you can hide the status bar programmatically. Here are the steps for Android 4.1 and higher:

View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
// Remember that you should never show the action bar if the
// status bar is hidden, so hide that too if necessary.
ActionBar actionBar = getActionBar();
actionBar.hide();

For more detail (and lower Android versions) see: https://developer.android.com/training/system-ui/status.html

Roel
  • 3,089
  • 2
  • 30
  • 34
Lino
  • 5,084
  • 3
  • 21
  • 39
0

The blue bar at the top is called "status bar". You can control it's colour by setting android:colorPrimaryDark (or colorPrimaryDark if you're using an AppCompat theme).

If you started your project from an Android Studio template then you should have a styles.xml file with AppTheme defined. One of the lines inside should look like this:

<item name="colorPrimaryDark">@color/primaryDark</item>

You can either change the value directly here to something like @android:color/black or go into colors.xml where primaryDark is defined and change it to black there.

If you want to hide the status bar completely, see Lino's answer.

Community
  • 1
  • 1
Marcin Koziński
  • 10,835
  • 3
  • 47
  • 61
  • Thank you all for your answers. I eventually decided to simply change the color so I accept Marcin answer. – Noam Jun 04 '16 at 15:07
0

That blue line is called StatusBar.

There are two ways to do it

if you want to do it programatically:

public class MainActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setContentView(R.layout.main_activity);
    }
}

Or else in your AndroidManifest.xml file:

<activity android:name=".MainActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/>
Atiq
  • 14,435
  • 6
  • 54
  • 69
0

Using AppCompatActivity in 3.0.1 solved the issue by adding in manifest:

application android:theme="@style/AppTheme.NoActionBar"          
סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68