Coder Social home page Coder Social logo

andraskindler / parallaxviewpager Goto Github PK

View Code? Open in Web Editor NEW
438.0 438.0 86.0 18 KB

[Development stopped in 2014. Unfinished and not stable - not recommended to use.] An easy-to-use ViewPager subclass with parallax background effect for Android apps.

Java 100.00%

parallaxviewpager's People

Contributors

andraskindler avatar rafaeltoledo 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

parallaxviewpager's Issues

Delete addOnPageChangeListener method

Hi,

as I see, there are already a couple of questions, how to make your library work with the popular ViewPagerIndicator library.

Can you please just delete a ParallaxViewPager#addOnPageChangeListener(OnPageChangeListener listener) method, to make it possible to call the native method from ViewPager#addOnPageChangeListener(OnPageChangeListener listener)?
So it becomes possible to use not only 2 listeners.
Actually secondOnPageChangeListener field is unnecessary now, it can be removed too.

thanks in advance & best regards
Vitaly

Not supplying XML background cause crashes

Love the component you've made!

However, I'm encountering a couple of problems, which I haven't been able to save yet.
If I leave out the background of the XML, the app crashes because of an inflation exception. Even if it is specified in the activity. Might be nice to fix this one at a certain time.

The other thing:
The background is not drawn before there was a swipe/motion event. Have you ever experienced this? I think it happened after I made the FragmentStatePagerAdapter so that it could add Fragments dynamically.

Any of this sounds familiar? I'm still looking to see if I can find anything in the code, if so, I will let you know as well.

Unexpected layout changes with sticky header and scrolling

app:viewpager_hideToolbarAndTitle="false"

Then scroll down just a little bit (halfway)

Then swipe left/right

Suddenly the actionbar has background color and tabstrip also.

Also sometimes when sticky the whole header gets pulled up beyond the status bar, sometimes opposite it gets pulled to almost middle of the screen.

More an report for the author to look for bugs. Tested on Samsung S6 Edge, Android 5.1

onSizeChanged selective execution

Hi. It seems that every time the soft keyboard pops up, the method onSizeChanged is called and the background resource drawn again, which means that the image will sqeeze vertically. It would be nice if the pager included a "allowBackgroundResize(boolean allow)" method, so we could disable it if, for example, the keyboard pops up.

samsung s4 android 4.4.4 setBackground cannot show ?

 hello,Here's my code:

 mViewpager.setAdapter(mAdapter);
 mViewpager.setOverlapPercentage(0.99f);
 mViewpager.setBackgroundResource(R.drawable.btn_page_bg);
 mIndicator.setViewPager(mViewpager);

 android:id="@+id/viewpager"
 android:layout_width="match_parent"
 android:layout_height="match_parent"

background disappears when I check "Don't keep activities"

Maybe some states need to be saved? As a habit, I check "Don't keep activities" at system settings when debugging. After I switch to other app and switch back, which means the activity is destroyed, The background image disappears.

I carefully check the background, and find that the image is still there actually, but it's placed at the right side of screen; I can only see the image at the right edge of screen at first page of viewPager.

Any idea to fix it?

doesn't work properly when page width is below 1f

this is my code:
<com.andraskindler.parallaxviewpager.ParallaxViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:background="@drawable/background"
android:layout_weight="1"
android:visibility="gone"/>
and the page width: return(0.8f);
the problem is when u go to the next page 0.2 background of the page is white

setCurrentItem makes black background

@Override
public View onCreateView(LayoutInflater inflater,
                         @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_home, container, false);

    parallaxHorizontalViewPager = ((ParallaxViewPager) view.findViewById(R.id.parallaxviewpager));

    parallaxHorizontalViewPager.setAdapter(new PageHorizontalHomeAdapter(getFragmentManager()));

    parallaxHorizontalViewPager.setScaleType(ParallaxViewPager.FIT_WIDTH);
    parallaxHorizontalViewPager.setBackgroundResource(R.drawable.image);
    return view;
}


@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    parallaxHorizontalViewPager.setCurrentItem(1, false);
}

setCurrentItem makes black background. It's like it can calculate the width or something

If not on first page, background image disappears on rotation

If the ViewPager is on the first page, screen rotation works just fine. But if on any of the other pages and I rotate my phone, the background image disappears, resulting, in my case, in a white background.

I have tried in vain to reset the background resource on onConfigurationChange().

I am using a resource with the dimensions 1500x1000 as background, set with setBackgroundResource()

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.