GithubHelp home page GithubHelp logo

dragger's Introduction

Logo 1

Build Status Maven Central Android Arsenal Join the chat at https://gitter.im/ppamorim/Dragger

The library was created in order to provide new animations for activities on Android. Using the ViewDragHelper class, it was possible to create smooth animations and that's allow a full controls of the view for user.

This new component has been created using some concepts described on Flavien Laurent Blog and Denevell Blog.

This library can works on API 8 (but not tested yet).

Demo 1

Usage

You can use this library like a view, you need just do it:

    1. Add ''DraggerView'' view on your root layout and add two layouts inside this. You can add a shadow view if you want(the first one) and it need to be invisible.
<com.github.library.DraggerView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    dragger_layout:drag_view_id="@+id/drag_view"
    dragger_layout:shadow_view_id="@+id/shadow_view"
    dragger_layout:drag_position="top">

    <FrameLayout
          android:id="@+id/shadow_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/transparent"
          android:visibility="invisible"/>

      <LinearLayout
          android:id="@+id/drag_view"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/>

</com.github.library.DraggerView>

In your ''styles'' file, you need config like this:

<style name="YourTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="android:windowIsTranslucent">true</item>
      <item name="android:windowBackground">@android:color/transparent</item>
      <item name="android:windowNoTitle">true</item>
      <item name="windowActionBar">false</item>
      <item name="android:windowAnimationStyle">@null</item>
</style>

And your ''manifest'':

<activity
    android:name="com.github.dragger.BaseActivity"
    android:theme="@style/YourTheme"/>

Or, if you need to be fast:

public class YourActivity extends DraggerActivity {
  @Override public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setShadowView(R.layout.custom_shadow); //No necessary, use if you want.
    setContentView(R.layout.layout_content);
  }
}

Import dependency

This library uses nineoldandroids:2.4.0 and appcompat-v7:21.0.3, you have to provide this dependencies from your local artifact repository or from maven central repository.

I'll release a day on MavenCentral, I haven't much time and had to deploy on jitPack

Into your build.gradle:

repositories {
  maven {
    url "https://jitpack.io"
  }
}

dependencies {
  compile 'com.github.ppamorim:Dragger:2324e5f2a5'
}

Contributors

This was only possible because Pedro Vicente Gómez Sánchez helped me and I am very grateful for that! Thank you. :)

Developed By

Follow me on Twitter Add me to Linkedin

Libraries used on the sample project

License

Copyright 2015 Pedro Paulo de Amorim

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.

dragger's People

Contributors

ppamorim avatar gitter-badger avatar

Watchers

MAY3AM 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.