1

enter image description hereI am creating a gmail like progress bar functionality. There seems to be some space between the actionbar and the progress bar.

Following is the code

<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- As the main content view, the view below consumes the entire
     space available using match_parent in both dimensions. -->
<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

    <ProgressBar
    android:id="@+id/progressBar1"
    style="?android:attr/progressBarStyleHorizontal"
    android:indeterminateOnly="true"
    android:layout_width="wrap_content"
    android:layout_height="?android:attr/actionBarSize" />

<ListView
    android:id="@+id/left_drawer"
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp"
    android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
android developer
  • 1,253
  • 2
  • 13
  • 43
  • You use or see sources already developed bars here: http://stackoverflow.com/questions/17029256/how-to-implement-swipe-down-to-refresh-like-in-new-gmail-app – eleven Jul 23 '14 at 13:31
  • I did go through it. But thats the swipe down to refresh functionality. I looked at its implementation as well. But couldn't find anything specific – android developer Jul 23 '14 at 13:33
  • I dont understand the space between the progress bar and the action bar. it should ideally start from where the action bar height ends – android developer Jul 23 '14 at 13:33
  • Oh, sorry. Understood. – eleven Jul 23 '14 at 13:39

2 Answers2

1

DrawerLayout should contain only two children: FrameLayout for your content and fragment for drawer. Thus ProgressBar should be located inside dynamically created content.

eleven
  • 6,779
  • 2
  • 32
  • 52
0

To add a navigation drawer, declare your user interface with a DrawerLayout object as the root view of your layout. Inside the DrawerLayout, add one view that contains the main content for the screen (your primary layout when the drawer is hidden) and another view that contains the contents of the navigation drawer. for more Creating a Navigation Drawer.

Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70