7
I added a ProgressBar simple to a LinearLayout, however I noticed that it generates a margin above and another below, such as this in the image:
These two white tracks, I tried to remove anyway, the only ones that "seem eventually" work are the custom progressbar, but really I would like to just remove the margins without needing something fully customized.
How can I remove these margins?
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        tools:context="foo.bar.guilherme.exemplo.MainActivity">
    <android.support.design.widget.AppBarLayout
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:theme="@style/AppTheme.AppBarOverlay">
        <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                app:popupTheme="@style/AppTheme.PopupOverlay"/>
    </android.support.design.widget.AppBarLayout>
    <include layout="@layout/content_main"/>
</android.support.design.widget.CoordinatorLayout>
content_main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:showIn="@layout/activity_main"
        tools:context="foo.bar.guilherme.exemplo.MainActivity">
    <ProgressBar
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:progress="50"
            android:id="@+id/siteProgress"/>
    <WebView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:id="@+id/siteView"
            android:fadeScrollbars="true"/>
</LinearLayout>



but dude, if you remove the bar you want you are already using a custom component, ririririri
– Armando Marques Sobrinho
@Armandomarquessobrinho I don’t want to remove the bar, just reduce the size so it looks similar to Chrome, when I referred to the custom I speak of those with images and Assets, in case I don’t want a complete customization, I’m sure it’s possible to fix this without injecting a lot of things
– Guilherme Nascimento
He wants to leave only the part that carries, as if it were a line, roughly speaking, an example, imagine that you go for two bars one at the bottom of the other, these margins would disturb, I believe that this is his thinking, because he would also like this.
– Florida
No reply pleased you @Guilhermenascimento?
– Florida
@Florida technically both work, but it is a matter of testing to be able to affirm all factors, I usually leave open my questions for a while to give the opportunity to appear better answers than my own ;)
– Guilherme Nascimento