Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to bring Circle Page Indicator to the front in Android

I have a view pager gallery and a circle page indicator in the bottom of the view. I want to bring page indicator in front of the view pager and make it transparent if it's possible as like in iphone image gallery. Do you have any idea how to do it ?

enter image description here

SOLUTION:

Here is the xml code as the solution. Thanks to @sanna

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000">


<android.support.v4.view.ViewPager
    android:id="@+id/gallery_view"
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"
    />

<com.viewpagerindicator.CirclePageIndicator
    android:id="@+id/indicator"
    android:padding="10dip"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:layout_alignParentBottom="true"
    />
</RelativeLayout>

And here is the new appearance of my gallery.

enter image description here

like image 314
osayilgan Avatar asked May 29 '12 07:05

osayilgan


1 Answers

I would use RelativeLayout with your Pager covering the whole view first and then add the indicator view with parentAlignBottom=true.

like image 179
sanna Avatar answered Nov 07 '22 08:11

sanna