Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleIndicator is not visible in activity #116

Open
ekizy opened this issue Nov 6, 2018 · 5 comments
Open

CircleIndicator is not visible in activity #116

ekizy opened this issue Nov 6, 2018 · 5 comments

Comments

@ekizy
Copy link

ekizy commented Nov 6, 2018

Hi when I use support version of this library, I couldn't render the indicator view in my activity. It does not give an exception, but in its position it does not show anything.

Here is my xml

@
<com.adesso.pepsipromo.common.view.AdsFrameLayout 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:id="@+id/framelayout_onboarding_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/background_activity_home"
tools:context=".scene.home.HomeActivity">

<android.support.v4.view.ViewPager
    android:id="@+id/view_pager"
    android:layout_width="match_parent"
    android:layout_height="20dp"
    android:layout_gravity="top"/>

<me.relex.circleindicator.CircleIndicator
    android:id="@+id/circle_indicator"
    android:layout_width="match_parent"
    android:layout_height="150dp"
    android:layout_gravity="center"
    app:ci_drawable="@drawable/ic_deny"
    app:ci_margin="10dp"
    app:ci_drawable_unselected="@drawable/ic_agree"/>

<com.adesso.pepsipromo.common.view.HomeNavigationView
    android:id="@+id/home_navigation"
    android:layout_width="match_parent"
    android:layout_height="@dimen/height_background_home_navigation_bar"
    android:layout_gravity="bottom" />

</com.adesso.pepsipromo.common.view.AdsFrameLayout>

Thanks for help.

@diegocdl
Copy link

Hi, which version of SDK are you using?, I'm having a similar problem using android 8 but it works with android 5

@amirreza-sobhdel
Copy link

i cant see the dots

@tabebqena
Copy link

tabebqena commented Apr 5, 2019

the following works for me:

 ` <me.relex.circleindicator.CircleIndicator
        android:id="@+id/circle"
        android:layout_width="match_parent"
        android:layout_alignBottom="@id/image_gallery_gallery"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:padding="8dp"
        android:visibility="visible"
        app:ci_drawable="@drawable/ic_drawable"
        android:layout_marginBottom="8dp"            />`

the 'ic_drawable.xml' file (colorize the circles) :

<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@color/design_default_color_primary" /> <corners android:bottomLeftRadius="100dp" android:bottomRightRadius="100dp" android:radius="300dp" android:topLeftRadius="100dp" android:topRightRadius="10 0dp" /> </shape>

in java :
'Adapter.registerDataSetObserver(circleIndicator.getDataSetObserver())'

@HosseinArabbeigi
Copy link

@ekizy can i see your java code? make sure you are setting viewpager for indicator after setting adapter for viewpager, priority is important.

I mean this way:

viewPager.setAdapter(adapter);
indicator.setViewPager(viewPager);

not this :

indicator.setViewPager(viewPager);
viewPager.setAdapter(adapter);

@aocz1
Copy link

aocz1 commented Jan 25, 2021

Remember that the dots are always white, so if your activity/window background is light/white then you wont be able to see it.

A nice future feature would be to add a property that allows you to choose between light and dark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants