0

I'm new to Android studio and I figured out how I can send my application to my phone. The problem is, In the preview, At the bottom, it has this auction bar (See photo) Is there a way to get rid of that? Because my phone (Samsung Galaxy S6 Edge) Does not have that, And it sits in the way if I want to place something at the very bottom. Because in android studio it may be at the very bottom, But on my phone, it isn't.

enter image description here

Also, Is there a way to make that top bar, That is now black, Sort of transparent? So it takes the colour of the background? You see it in a lot of apps. As I mentioned, I'm very new in android studio so sorry.

Thanks in advance

Kaushik NP
  • 6,733
  • 9
  • 31
  • 60
Rainier laan
  • 1,101
  • 5
  • 26
  • 63
  • At the bottom, you have Navigation bar. And to remove that you can refer to this : [Hide the Navigation Bar](https://developer.android.com/training/system-ui/navigation.html). Though I think you are misunderstanding something basic here. Try running the app in your mobile (Samsung) once. – Kaushik NP Sep 21 '17 at 17:06
  • And the top bar that you want translucent is called the Status bar and you can refer this for changing its color : [How to change the status bar color in android](https://stackoverflow.com/questions/22192291/how-to-change-the-status-bar-color-in-android) – Kaushik NP Sep 21 '17 at 17:08

1 Answers1

0

The control bar at the bottom is part of the emulator aka any phone without hard buttons. You can toggle to full screen and it will hide it for you.

For example code simply create new activity and select fullscreen activity. You will see that it manages it by touch of surface to reappear and timer to dissappear. Just remove that bloat and handle it yourself. Done !

As for the status bar at the top, it uses your activity default background. So if you want to change this go to your styles and add a background to your AppTheme and this will be the default background color of unspecified areas instead of black.

Example:

 <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>
    <item name="android:windowBackground">@color/blue</item>
    <item name="android:actionMenuTextColor">@color/white</item>
</style>

The windowBackground color will drive the background color of unspecified areas unless you override the theme on any particular activity in the manifest. Goodluck.

Sam
  • 5,342
  • 1
  • 23
  • 39
  • But how about downloading a Samsung S6 preset? Because the only preview sets you can have are Nexus phones and such. And those do not have hard buttons so it makes sense that if I select a nexus phone. That these buttons are there. I don't know if that is possible but as you can see in this image, I only have nexus and Pixel phones available https://imgur.com/a/RFJNz – Rainier laan Sep 21 '17 at 17:13
  • I think you are chasing the wrong rabbit ;) Those buttons are on any phone that does not have hard buttons. There are over 23,000 various devices for Android so screen sizes and density will vary on many levels. If you app does not look good here it will not look good on any device. What it comes down to is your App measures the viewing area and displays within that rectangle. If these controls are there (like many phones) then your rectangle is smaller. You absolutely have to be able to look good on this style of phone as it is no different then hard button phone. – Sam Sep 21 '17 at 17:47
  • Use the Preview in the editor to ensure you are happy with the look of your UI, then launch on the emulator. if you use layouts properly it will scale and grow/shrink perfectly. If you did not, then you need to look at your xml file again to improve how you are doing your layout. Now if your layout just has to be bigger then the screen and there is no way around it, then wrap it in a scrollview and it will scroll at least. – Sam Sep 21 '17 at 17:49