GithubHelp home page GithubHelp logo

ranjan101 / tinder-like-stretchtopviewexample Goto Github PK

View Code? Open in Web Editor NEW

This project forked from klaszlo8207/stretchtopviewexample

0.0 2.0 0.0 1007 KB

This is an Android Tinder like Stretch Top ScrollView custom View!

Java 100.00%

tinder-like-stretchtopviewexample's Introduction

Tinder like ANDROID stretch top ScrollView

or just

Pull to zoom:

This is a Tinder like android Stretch Top ScrollView / pull to zoom custom View.. The Examples show you how can you use this type of view

Gifs:

Alt Text Alt Text

Usage for a top ImageView in xml:

<?xml version="1.0" encoding="utf-8"?>
<hu.lacroix82.stretchtopviewlibrary.StretchTopScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/stretchTopView"
    >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        >

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:id="@+id/topView"
            android:src="@drawable/img1"
            android:scaleType="centerCrop"
            />

       <include layout="@layout/view_bottom" />

    </LinearLayout>

</hu.lacroix82.stretchtopviewlibrary.StretchTopScrollView>

Usage for a top ViewPager in xml:

<?xml version="1.0" encoding="utf-8"?>
<hu.lacroix82.stretchtopviewlibrary.StretchTopScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/stretchTopView"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="400dp"
            android:id="@+id/topView"
            >

            <android.support.v4.view.ViewPager
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

            <com.viewpagerindicator.CirclePageIndicator
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center|bottom"
                android:layout_marginBottom="20dp"
                android:id="@+id/indicator"
                />

        </FrameLayout>

        <include layout="@layout/view_bottom" />

    </LinearLayout>

</hu.lacroix82.stretchtopviewlibrary.StretchTopScrollView>

after just use in code:

        stretchTopView.setFactor(1.7f);

        stretchTopView.setChangeListener(new StretchTopScrollView.onOverScrollChanged() {
            @Override
            public void onChanged(float factor) {
                descriptionTextView.setAlpha(factor);
            }
        });

.setFactor(float v) : a float factor for the stretch, between 1.0f and maybe 2.0f, optional, default is 1.6f

.setChangeListener(...) : a simple callback that can return the animated factor in a float : 0-100%, between 0f and 1f

Author:

created by Kozári László

tinder-like-stretchtopviewexample's People

Contributors

klaszlo8207 avatar

Watchers

James Cloos avatar Ranjan Kumar Singh avatar

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.