Git Product home page Git Product logo

pageindicatorview's People

Contributors

andy671 avatar endy-s avatar froqstar avatar itretyak avatar jemshit avatar mpowloka avatar pro100svitlo avatar rayliverified avatar romandanylyk avatar sannyo avatar saulmm avatar terrakok avatar vdubedout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pageindicatorview's Issues

Can't set viewPager in XML when using ContextThemeWrapper

Cannot use piv_viewPager to select the view pager in the layout XML file. onAttachedToWindow calls findViewPager, which requires that getContext() instanceof Activity. But since the ContextThemeWrapper may be used, the check is too restrictive.

Current page visual selection

it would be good to select visually current selected item, f.e. make it bigger then the others, or smaller, etc.

Thank you.

set color

	pageIndicatorView.setUnselectedColor(R.color.bg_white);
	pageIndicatorView.setSelectedColor(R.color.bg_red); 不起作用啊

Reverse animation

Hey its a nice library.
I m using this with recycler view, it works fine when i scroll forward. But when i scroll backward then animation wont happen
I m using this method setSelection(POSITION); to set the dot.
But when i use this method to set the previous dot (say i scrolled reverse) the animation was not proper.
Could you help me on this.

Thanks

App Crashes

The app crashes after you last update. Please increase maven version, don't rewrite previous version with the same number. Now I should temporary disabled you lib from my projects ((.
I use different view ids.

Please look at the attached screenshots:
screen shot 2017-02-03 at 13 04 29
screen shot 2017-02-03 at 13 04 38

@romandanylyk ^^

Current position state not saved

Hello,

The current position of the PageIndicatorView is not saved when recreating the activity/fragment, as it is a custom view, I think it will be great if the PageIndicatorView could restore it state itself.

Workaround : Implement the onSaveInstanceState (Activity/Fragment) to store the PageIndicatorView current position and set it on the onCreate method.

Br.

Question: How does it work?

Without diving into the code, can you please explain shortly how does it work?
Why does it have minSdk 15 ?

Problem in Selection

Hi
My Name is mahdi Im 16 years old Ifrom Iran
VpStoreImage.setCurrentItem(nevao_engin.get_CorrectImageStore().length() - 1);
whene i set selection Whene
PageIndicatorView.setAnimationType(AnimationType.THIN_WORM);
Selection Item is Fin not Circle
Thanks For Good Library

Switching between pages

Hi guys! awesome job! I just added PageIndicatorView to my ViewPager and it works great!

I tried to find a way to switch between the pages by touching indicators but no success. Is there a simple way o achieve this?

ReadMe Typo

Attribute cannot be found error when using sample XML code provided in ReadMe.
Instead of:
attrs:piv_viewPager="@id/viewPager"

It should be:
attrs:piv_viewPager="@+id/viewPager"

Dependency on Support library can broke project

My project has supportLibraryVersion = "24.0.0"
But PageIndicatorView depends on compile 'com.android.support:appcompat-v7:24.2.1' and application crashes on runtime.

Work around:

//ViewPager Indicator
    compile ('com.romandanylyk:pageindicatorview:0.1.1') {
        exclude group: 'com.android.support'
    }

Please add it to Readme

Set visibility when count is one

It would be nice to have an xml attribute like visibilityWhenCountOne(or a better name) with the choices of "visible" "gone" and "invisible"

Prefix attributes to avoid collision

Library modules (except official support library) generally prefix all their resource name with thier initials so that they won't collide with each other which will fail the build. For this project piv_ seems good.

BTW the strings.xml inside the library module should also be removed, as it is unused and developers are highly likely to use the same name which will produce an overriding of resource unexpectedly.

It's not possible to change the color of the indicator.

Hi,

I slightly changed your sample: were added two lines to the initViews function.
The color of the indicators does not change. Can you tell me what the problem?

private void initViews() {
    HomeAdapter adapter = new HomeAdapter();
    adapter.setData(createPageList());

    ViewPager pager = (ViewPager) findViewById(R.id.viewPager);
    pager.setAdapter(adapter);

    PageIndicatorView indicatorView = (PageIndicatorView) findViewById(R.id.pageindicatorview);
    indicatorView.setViewPager(pager);
    indicatorView.setOrientation(Orientation.VERTICAL);

//<<<< New lines >>>>
indicatorView.setUnselectedColor(R.color.google_green);
indicatorView.setSelectedColor(R.color.google_yellow);
}

Regards,
Michael K

Can't set view pager in xml

Hi there,
@romandanylyk I found that I can't set viewPager for indicator in xml, if indicator is placed before viewPager.
Please fix it.

app:piv_viewPager="@id/view_pager"

But it does work if set indicator after viewPager or I set it programmatically.

Thank you.

Remove the logging from release build

Hei!

Please remove the logging line ("Log.e("TEST", "onPageSelected");") from release build from the onPageSelected method. Or add an option to turn logs on / off.

setSelection(position) problem

i have used it without ViewPager,just call setSelection(position) ,and then it will change postion to target position,but at last it must return back to postion 0. amazing。

Move PageIndicator if more Data available in ViewPager

Hi,

I've created a PageIndicator as follows:

        <com.rd.PageIndicatorView
            android:id="@+id/background_piv"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toEndOf="@id/opcamera"
            android:layout_centerHorizontal="true"
            android:layout_toStartOf="@+id/background_tv"/>

My ViewPager contains around 50 elements, the PageIndicator works fine for the first X pages (where X is the number of dots that the PageIndicator can show on Screen) but as soon as I display the page X+1 the PageIndicator doesn't scroll to the right, i.e. it stops being updated.

I'm sure I'm doing something wrong so any help will be greatly appreciated :D

Animations issues

Great job on this indicator widget @romandanylyk. I am currently working on porting it to NativeScript as a plugin. I seem to have some issues with 2 of the animations (Scale & Worm).

If I choose "Scale", then the entire app/view becomes sluggish and laggy. And the indicator becomes all white (the entire row).

If I choose "Worm", and when I do the first slide, the first indicator expands to the left edge of the screen (like a long worm), and then snaps back. This only happens the first time, after that it works very well.

I can provide you with gifs if you want.
The other animations work perfectly, even the new one "Fill", which is great btw. 👍

onPageSelected doesn't work before view get measured

The indicator's current selection won't change if the viewpager's current page changed before the view get measured, for example in the activity's onPostResume() callback.
Is there a proper reason why the selection get ignored if the view is not measured? And how to fix this? Thanks.

Attributes not initialized if view created from Java

If you use libraries like Anko or Anvil, you create your views from Java, not XML. Often there's only the Context contructor used, so there are no attrs passed. In that case PageIndicatorView calls init(null) and there's a condition in initAttributes() that won't initialize the attributes. But I don't think that's what you want. I think it should use the default attributes even if there are no passed.

Thank you for this library btw!

Styling through styles.xml

It would be nice if it was possible to style the PageIndicatorView throught a styles.xml file. The only change needed would be to declare an attribute PageIndicatorViewStyle and use that as defStyle argument in the PageIndicatorView's constructor

Caused by java.lang.IllegalStateException

android.database.Observable.unregisterObserver (Observable.java:69)
android.support.v4.view.PagerAdapter.unregisterDataSetObserver (PagerAdapter.java:305)
com.rd.PageIndicatorView.unRegisterSetObserver (PageIndicatorView.java:1114)
com.rd.PageIndicatorView.onDetachedFromWindow (PageIndicatorView.java:117)
android.view.View.dispatchDetachedFromWindow (View.java:14579)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:628)

I am getting this error reports for my app after i integrated your library in my app.
However i am not able to recreate the error myself but i am getting this error in my crashlytics dashboard.

Padding at top and bottom

I have a requirement to produce the following screenshot.

Currently, because it's an EditText, I can't get any padding at the top or bottom. It's always wrapped to the text size. Can anyone think of a solution to this and how it may be implemented?

My initial thoughts are to put the EditText inside another View and do the background drawing inside that so we can increase the bounds. This may not be a viable solution however so I wanted to get some other people's opinions.

screen shot 2017-08-10 at 15 39 25

Wrong repo sorry!

Failed to resolve: annotationProcessor

This is my grade file:
https://github.com/edx/edx-app-android/blob/a0a6b44845a438d28bb415250a8364317989d407/OpenEdXMobile/build.gradle

I just added these lines to use this awesome library:

    // For the optional Nullable annotation
    compile 'com.android.support:support-annotations:25.3.1'

    compile 'com.romandanylyk:pageindicatorview:0.2.0@aar'
    compile 'com.android.support:support-compat:25.3.1'
    compile 'com.android.support:support-core-ui:25.3.1'

But getting the said error i.e. Failed to resolve: annotationProcessor.

Why dependent on appcompat-v7?

I find that the pageindicatorview module's dependencies imported the appcompat-v7 library. But I can find any importion in all the java files in this module. So, Why are you dependent on this library?

How set Custom Image ?

Hi my bro,
Could to be change and set Custom Image for each index of indicator by programmability ?
thank.

how to add PageIndicatorView dependancy in nativescript

i am making android app using nativescript ...so please tell me how to add this dependancy.
Because nativescript carousal plugin is not working and its showing "cannot read property 'PageIndicatorView' of undefined,undefined"

Trouble with "slide" animation type

For Slide animation i found problem.

  1. PagerAdapter is empty
  2. load something from network
  3. set data to adapter
  4. call pageIndicatorView.setCount(adapter.getCount()); //because indicator not update automaticaly
  5. indicator looks broken (but after first slide all OK)

doesn't work properly with partially size

Hi @romandanylyk ,
I've created custom FragmentPagerAdapter with width of page = 0.9f.

public float getPageWidth(int position) {
        return .9f;
    }
app:piv_padding="5dp"
app:piv_radius="5dp"
app:piv_animationType="worm"
app:piv_dynamicCount="true"
app:piv_interactiveAnimation="true"

As the result indicator can't scroll to the final position. Last point should be circle, not oval. Please look at the screenshot.

Please fix it.
device-2017-02-19-193701

Thank you.

Dynamic count = false / custom piv_count not possible

I have 5 fragments, of which only 3 are displayed, the others will be skipped. But the piv always shows 5 dots:

    <com.rd.PageIndicatorView
        android:id="@+id/pageIndicatorView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="false"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="false"
        android:layout_marginTop="20dp"
        android:elevation="5dp"
        app:piv_count="3"
        app:piv_dynamicCount="false"
        app:piv_unselectedColor="#000000" />

Different behaviour on animation

Hi! I'm trying to achieve quite different behaviour, using your library.
In short: count of pages can be, i.e, 24, but indicators count should be, like, 8.
And when user has reached the end of indicators row (selected indicator position is 8, i.e.), the next move will cause the whole row to slide to the opposite direction so another "free" indicator is shown. And afterwards, currently selected indicator moves to the freshly "freed" one.
I hope i described it clearly:)
Is it possible to achive? If not, what would you suggest to change in your code to achive desired behaviour?

android:padding doesn't work

Setting the android:padding property into a PageIndicatorView has no effect.
I'm aware of the app:piv_padding property, but that serves a different purpose. What I desire is to set a padding around the page indicators.

<com.rd.PageIndicatorView
            android:layout_width="wrap_content"
            android:layout_height="24dp"
            android:background="@android:color/white"
            android:padding="24dp"
            app:piv_animationType="slide"
            app:piv_viewPager="@id/view_pager"/>

I believe the same would apply to the other android:padding variants, such as android:paddingStart, android:paddingEnd, etc

Invisible pageIndicator issue

Hi again @romandanylyk. Referring to an earlier case #7

If I upgrade to version 7 or higher, I get invisible indicator in my views. I get no crashes or exceptions. All properties are set, I get proper page count as well. ViewPager works fine. I can also see that the pageIndicator instance has a parent view. But still, nothing is shown.

Do you perhaps have any idea what this might be? I should say that my views & layouts are defined in code only, no xml. Does pageIndicator only work with RelativeLayout or can we use anything?

Version 6 and earlier works without issues.

setSelectedColor(int color) has no effect

My code:
PageIndicatorView pageIndicatorView = (PageIndicatorView)findViewById(R.id.pageIndicatorView);
pageIndicatorView.setSelectedColor(R.color.red_e6);
pageIndicatorView.setUnselectedColor(R.color.green7e);
pageIndicatorView.setViewPager(mViewPager);
but has no effect .although change color ,but the effect no change .

What is 'isLeftOverScrolled'?

private Pair<Integer, Float> getProgress(int position, float positionOffset) {
    boolean isRightOverScrolled = position > selectedPosition;
    boolean isLeftOverScrolled = position + 1 < selectedPosition;
    if (isRightOverScrolled || isLeftOverScrolled) {
        Log.d(TAG, "getProgress: " + (isRightOverScrolled ? "isRightOverScrolled" : "isLeftOverScrolled"));
        Log.d(TAG, "getProgress: " + "position :" + position + "\t selectedPosition:" + selectedPosition);
        selectedPosition = position;
    }
    ...
}

isRightOverScrolled means that scrolled to the right page.

I think isRightOverScrolled means scrolled to the left page.

But when I print the log, it does't show.

@romandanylyk @vdubedout Any help will be highly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.