Giter VIP home page Giter VIP logo

chromelikeswipelayout's Introduction

ChromeLikeSwipeLayout

Pull down, and execute more action!

Screenshot

DemoPreview

Usage

<com.asha.ChromeLikeSwipeLayout
    android:id="@+id/chrome_like_swipe_layout"
    app:clwl_circleColor="#89d999"
    app:clwl_gap="0dp"
    app:clwl_radius="45dp"
    app:clwl_maxHeight="30dp"
    app:clwl_collapseDuration="300"
    app:clwl_rippleDuration="300"
    app:clwl_gummyDuration="300"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#DDDDDD">
       ...	
    </LinearLayout>
</com.asha.ChromeLikeSwipeLayout>
  • item selected callback
ChromeLikeSwipeLayout chromeLikeSwipeLayout = (ChromeLikeSwipeLayout) findViewById(R.id.chrome_like_swipe_layout);
ChromeLikeSwipeLayout.makeConfig()
        .addIcon(R.drawable.selector_icon_add)
        .addIcon(R.drawable.selector_icon_refresh)
        .addIcon(R.drawable.selector_icon_close)
	.maxHeight(dp2px(40))
        .radius(dp2px(35))
        .gap(dp2px(5))
        .circleColor(0xFF11CCFF)
        .gummyDuration(1000)
        .rippleDuration(1000)
        .collapseDuration(1000)
        .listenItemSelected(new ChromeLikeSwipeLayout.IOnItemSelectedListener() {
            @Override
            public void onItemSelected(int index) {
                Toast.makeText(RecyclerViewActivity.this, "onItemSelected:" + index, Toast.LENGTH_SHORT).show();
            }
        })
        .setTo(chromeLikeSwipeLayout);

Supported

  • All ViewGroup

Download

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}
dependencies {
 compile 'com.github.ashqal:ChromeLikeSwipeLayout:<version>'
}

Release Note

0.4

  • maxHeight supported(Thanks to Tommy Chan).
  • Using jitpack instead of jCenter
  • NestedScroll supported.
  • Fix a few bugs.

0.3

  • add multi touch support

##LICENSE

Copyright 2015 Asha

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

chromelikeswipelayout's People

Contributors

ashqal avatar tomafc330 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

chromelikeswipelayout's Issues

Nested RecyclerView fails to scroll

Given the following layout RecyclerView fails to scroll up:

FrameLayout
    com.asha.ChromeLikeSwipeLayout
        android.support.percent.PercentRelativeLayout
            android.support.v7.widget.RecyclerView
            ...

I think it's due to the fact you only take into account the first child of ChromeLikeSwipeLayout to check if it's scrollable or not. This kind of situation must be taken into account since having a layout with a nested RecylcerView it's quite a common scenario.

Using library inside NestedScrollView

I have CollapsingToolbarLayout with flags app:layout_scrollFlags="scroll|exitUntilCollapsed|snap"

but snapping stops working with this library. is there any layout structure so I can put all this inside my NestedScrollView?

How to make changing option easier?

When finger is moving to e.g. right side it's very hard to choose left side option, because screen becomes too small. Is it possible to change moving distance?

onNestedPreFling throws error for projects that have minSDK < 21

So I was testing on an older phone (api 15) and used the library and unfortunately it crashes on fling with the following stacktrace:

02-08 17:36:44.324 20427-20427 E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: com.adhoclabs.burner, PID: 20427
                                                                      java.lang.NoSuchMethodError: android.view.ViewGroup.onNestedPreFling
                                                                          at com.asha.ChromeLikeSwipeLayout.onNestedPreFling(ChromeLikeSwipeLayout.java:578)
                                                                          at android.support.v4.view.ViewParentCompat$ViewParentCompatStubImpl.onNestedPreFling(ViewParentCompat.java:124)
                                                                          at android.support.v4.view.ViewParentCompat.onNestedPreFling(ViewParentCompat.java:404)
                                                                          at android.support.v4.view.NestedScrollingChildHelper.dispatchNestedPreFling(NestedScrollingChildHelper.java:252)
                                                                          at android.support.v7.widget.RecyclerView.dispatchNestedPreFling(RecyclerView.java:8675)
                                                                          at android.support.v7.widget.RecyclerView.fling(RecyclerView.java:1797)
                                                                          at android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2437)
                                                                          at android.view.View.dispatchTouchEvent(View.java:7782)
                                                                          at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2316)
                                                                          at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2013)

Looks like we might need to do a version check before call super. for onNestedFling and onNestedPreFling.

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.