master 7d7704c528b9 cached
57 files
78.9 KB
21.7k tokens
98 symbols
1 requests
Download .txt
Repository: prolificinteractive/swipe-action-layout
Branch: master
Commit: 7d7704c528b9
Files: 57
Total size: 78.9 KB

Directory structure:
gitextract_y9qces16/

├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── prolificinteractive/
│       │   │           └── chandelier/
│       │   │               └── sample/
│       │   │                   ├── MainActivity.java
│       │   │                   ├── RecyclerViewActivity.java
│       │   │                   ├── SampleApplication.java
│       │   │                   └── WebViewActivity.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── al_github_selector.xml
│       │       │   ├── ic_add.xml
│       │       │   ├── ic_check.xml
│       │       │   ├── ic_close.xml
│       │       │   ├── ic_github.xml
│       │       │   ├── ic_launcher.xml
│       │       │   ├── ic_notifications.xml
│       │       │   └── ic_pull_request.xml
│       │       ├── layout/
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_recycler_view.xml
│       │       │   ├── activity_web_view.xml
│       │       │   ├── content_main.xml
│       │       │   ├── content_recycler_view.xml
│       │       │   ├── content_web_view.xml
│       │       │   ├── include_toolbar.xml
│       │       │   ├── item_dummy.xml
│       │       │   └── swipe_content.xml
│       │       ├── menu/
│       │       │   └── menu_main.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── prolificinteractive/
│                       └── chandelier/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── prolificinteractive/
│       │               └── chandelier/
│       │                   └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── prolificinteractive/
│       │   │           └── chandelier/
│       │   │               └── widget/
│       │   │                   ├── ChandelierLayout.java
│       │   │                   ├── IdleScrollListener.java
│       │   │                   ├── Ornament.java
│       │   │                   ├── OrnamentLayout.java
│       │   │                   └── SimpleAnimationListener.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   └── item_white_circle.xml
│       │       └── values/
│       │           ├── attrs.xml
│       │           ├── defaults.xml
│       │           └── strings.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── prolificinteractive/
│                       └── chandelier/
│                           └── ExampleUnitTest.java
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Eclipse
.project
.classpath
.settings
.checkstyle

# Crashlytics
com_crashlytics_export_strings.xml
crashlytics-build.properties

# IntelliJ IDEA
.idea
*.iml
*.ipr
*.iws
classes
gen-external-apklibs

# Gradle
.gradle
build

# Maven
target
release.properties
pom.xml.*

# Ant
bin
gen
build.xml
ant.properties
local.properties
proguard.cfg
proguard-project.txt

# Other
.DS_Store
tmp

================================================
FILE: .travis.yml
================================================
language: android

jdk:
 - oraclejdk8

android:
  components:
    - tools
    - platform-tools
    - build-tools-27.0.3
    - android-27
    - extra-google-m2repository
    - extra-android-m2repository
  licenses:
    - 'android-sdk-license-.+'
    - 'google-gdk-license-.+'

before_install:
  - echo yes | sdkmanager "platforms;android-27"

before_install:
- yes | sdkmanager "platforms;android-27"

script:
  - ./gradlew clean build -PdisablePreDex --stacktrace --console plain

before_cache:
  - rm -f  $HOME/.gradle/caches/modules-2/modules-2.lock
  - rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
  directories:
    - $HOME/.gradle/caches/
    - $HOME/.gradle/wrapper/
    - $HOME/.android/build-cache

sudo: false

================================================
FILE: LICENSE
================================================
Copyright (c) 2018 Prolific Interactive

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: README.md
================================================
<img src="/images/hero.jpg"/>

Chandelier
==========
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Chandelier-blue.svg?style=true)](https://android-arsenal.com/details/1/3598) [![Maven Central](https://img.shields.io/maven-central/v/com.prolificinteractive/chandelier.svg?maxAge=2592000)](http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22chandelier%22) [![Travis](https://img.shields.io/travis/prolificinteractive/Chandelier.svg?maxAge=2592000)](https://travis-ci.org/prolificinteractive/Chandelier)

A nice swipe layout that provides new actions with a material design look and feel.

<img src="/images/demo1.gif" alt="Demo Screen Capture" width="300px" />
<img src="/images/demo2.gif" alt="Demo Screen Capture" width="300px" />

## Installation

Step 1. Add the JitPack repository to your build file

```groovy
allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}
```

Step 2. Add the dependency

```groovy
dependencies {
  implementation 'com.github.prolificinteractive:chandelier:${chandelierVersion}'
}
```


Usage
-----

1. Wrap your list around `ChandelierLayout` in your layouts or view hierarchy.
2. Add a list of `ActionItem` using `ChandelierLayout#populateActionItems()` method.
3. Set a `OnActionSelectedListener` to listen for selected action and update the view accordingly.

Or

1 Wrap your list around `ChandelierLayout` in your layouts or view hierarchy.
2. Create Objects that extend `ActionItem` and add them using `ChandelierLayout#populateActionItems()` method.
3. Override `ActionItem#Execute()` method to execute the action when selected.

Example:

```xml
  <com.prolificinteractive.chandelier.widget.ChandelierLayout
      android:id="@+id/chandelier_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:al_background="?attr/colorPrimary"
      >
      
      <!-- Insert your list here -->
      <include layout="@layout/example_recycler_view" />
  
  </com.prolificinteractive.chandelier.widget.ChandelierLayout>
```

Customization
-------------

XML attributes:

- `al_background` Set background color
- `al_elevation` Set elevation 
- `al_selector` Set background selector
- `al_animate_to_start_duration` Set the duration that the layout takes to get into its original position. Default is 300 Millisecond.

- `ai_margin` Set action item margin

Make sure to check sample for more examples.

Contributing
============

Would you like to contribute? Fork us and send a pull request! Be sure to checkout our issues first.

## License

Chandelier is Copyright (c) 2018 Prolific Interactive. It may be redistributed under the terms specified in the [LICENSE] file.

[LICENSE]: /LICENSE

## Maintainers

![prolific](https://s3.amazonaws.com/prolificsitestaging/logos/Prolific_Logo_Full_Color.png)

Chandelier is maintained and funded by Prolific Interactive. The names and logos are trademarks of Prolific Interactive.


================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "com.prolificinteractive.chandelier"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation project(':library')
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.3.1'
}


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/chahine/Applications/android-sdk-macosx/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.prolificinteractive.chandelier.sample"
    >

  <uses-permission android:name="android.permission.INTERNET" />

  <application
      android:name=".SampleApplication"
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:supportsRtl="true"
      android:theme="@style/AppTheme"
      >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:theme="@style/AppTheme.NoActionBar"
        >
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>

        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
    </activity>
    <activity
        android:name=".WebViewActivity"
        android:label="@string/title_activity_web_view"
        android:theme="@style/GitHubTheme.NoActionBar"
        >

      <intent-filter>
        <action android:name="android.intent.action.RUN"/>
        <category android:name="com.prolificinteractive.chandelier.sample.SAMPLE"/>
      </intent-filter>
    </activity>
    <activity
        android:name=".RecyclerViewActivity"
        android:label="@string/title_activity_recycler_view"
        android:theme="@style/AppTheme.NoActionBar"
        >
      <intent-filter>
        <action android:name="android.intent.action.RUN"/>
        <category android:name="com.prolificinteractive.chandelier.sample.SAMPLE"/>
      </intent-filter>
    </activity>
  </application>

</manifest>


================================================
FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/MainActivity.java
================================================
package com.prolificinteractive.chandelier.sample;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.List;

public class MainActivity extends AppCompatActivity {
  private static final String CATEGORY_SAMPLE = "com.prolificinteractive.chandelier.sample.SAMPLE";

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    RecyclerView list = (RecyclerView) findViewById(android.R.id.list);
    list.setLayoutManager(new LinearLayoutManager(this));
    list.setAdapter(new SampleAdapter(this, getAllSampleActivities()));
  }

  private List<ResolveInfo> getAllSampleActivities() {
    Intent filter = new Intent();
    filter.setAction(Intent.ACTION_RUN);
    filter.addCategory(CATEGORY_SAMPLE);
    return getPackageManager().queryIntentActivities(filter, 0);
  }

  private class SampleAdapter extends RecyclerView.Adapter<SampleAdapter.SampleViewHolder> {
    private final List<ResolveInfo> samples;
    private final LayoutInflater inflater;
    private final PackageManager pm;

    public SampleAdapter(Context context, List<ResolveInfo> resolveInfos) {
      this.samples = resolveInfos;
      this.inflater = LayoutInflater.from(context);
      this.pm = context.getPackageManager();
    }

    @Override public SampleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      View view = inflater.inflate(android.R.layout.simple_list_item_1, parent, false);
      return new SampleViewHolder(view);
    }

    @Override public void onBindViewHolder(SampleViewHolder holder, int position) {
      holder.activityName.setText(samples.get(position).loadLabel(pm));
    }

    @Override public int getItemCount() {
      return samples.size();
    }

    class SampleViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
      TextView activityName;

      public SampleViewHolder(View view) {
        super(view);
        activityName = (TextView) view.findViewById(android.R.id.text1);
        view.setOnClickListener(this);
      }

      @Override public void onClick(View v) {
        ActivityInfo activity = samples.get(getAdapterPosition()).activityInfo;
        ComponentName name = new ComponentName(activity.applicationInfo.packageName, activity.name);
        startActivity(new Intent(Intent.ACTION_VIEW).setComponent(name));
      }
    }
  }

}


================================================
FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/RecyclerViewActivity.java
================================================
package com.prolificinteractive.chandelier.sample;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.prolificinteractive.chandelier.widget.Ornament;
import com.prolificinteractive.chandelier.widget.ChandelierLayout;
import java.util.Arrays;

public class RecyclerViewActivity extends AppCompatActivity {

  private ChandelierLayout chandelierLayout;
  private RecyclerView list;
  private DummyAdapter adapter;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_recycler_view);

    final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    chandelierLayout = (ChandelierLayout) findViewById(R.id.chandelier_layout);
    chandelierLayout.setOnActionSelectedListener(new ChandelierLayout.OnActionListener() {
      @Override public void onActionSelected(int index, Ornament action) {
        Toast.makeText(RecyclerViewActivity.this, String.format("%d", index), Toast.LENGTH_SHORT)
            .show();
      }
    });

    adapter = new DummyAdapter();
    list = (RecyclerView) findViewById(android.R.id.list);
    list.setLayoutManager(new LinearLayoutManager(this));
    list.setAdapter(adapter);

    chandelierLayout.populateActionItems(Arrays.asList(
        new Ornament(R.drawable.ic_close),
        new Ornament(R.drawable.ic_add),
        new Ornament(R.drawable.ic_check)
    ));
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.menu_main, menu);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
    int id = item.getItemId();

    //noinspection SimplifiableIfStatement
    if (id == R.id.action_settings) {
      return true;
    }

    return super.onOptionsItemSelected(item);
  }

  class DummyAdapter extends RecyclerView.Adapter<DummyViewHolder>
      implements View.OnLongClickListener {

    @Override
    public DummyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
      final View view = LayoutInflater
          .from(parent.getContext())
          .inflate(R.layout.item_dummy, list, false);
      view.setOnLongClickListener(this);
      return new DummyViewHolder(view);
    }

    @Override
    public void onBindViewHolder(DummyViewHolder holder, int position) {
      holder.title.setText(String.format("Title %d", position));
      holder.subtitle.setText(String.format("Subtitle %d", position));
    }

    @Override
    public int getItemCount() {
      return 10;
    }

    @Override public boolean onLongClick(View v) {
      chandelierLayout.showActions();
      return true;
    }
  }

  class DummyViewHolder extends RecyclerView.ViewHolder {

    private final TextView title;
    private final TextView subtitle;

    public DummyViewHolder(View view) {
      super(view);
      title = (TextView) view.findViewById(android.R.id.text1);
      subtitle = (TextView) view.findViewById(android.R.id.text2);
    }
  }
}


================================================
FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/SampleApplication.java
================================================
package com.prolificinteractive.chandelier.sample;

import android.app.Application;
import com.squareup.leakcanary.LeakCanary;

public class SampleApplication extends Application {
  @Override public void onCreate() {
    super.onCreate();
    LeakCanary.install(this);
  }
}


================================================
FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/WebViewActivity.java
================================================
package com.prolificinteractive.chandelier.sample;

import android.os.Bundle;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import com.prolificinteractive.chandelier.widget.Ornament;
import com.prolificinteractive.chandelier.widget.ChandelierLayout;
import java.util.Arrays;

public class WebViewActivity extends AppCompatActivity {

  public static final String GITHUB_URL = "https://www.github.com/";
  public static final String GITHUB_NOTIFICATIONS_URL = GITHUB_URL + "notifications";
  public static final String GITHUB_PULLS_URL = GITHUB_URL + "pulls";
  public static final String GITHUB_SEARCH_URL = GITHUB_URL + "search";

  private ChandelierLayout chandelierLayout;
  private WebView webView;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_web_view);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress_bar);

    webView = (WebView) findViewById(R.id.web_view);
    webView.setWebViewClient(new WebViewClient());
    webView.getSettings().setJavaScriptEnabled(true);
    webView.setWebChromeClient(new WebChromeClient() {
      @Override public void onProgressChanged(WebView view, int newProgress) {
        if (newProgress == 100) {
          progressBar.setVisibility(View.INVISIBLE);
        } else {
          progressBar.setVisibility(View.VISIBLE);
        }

        progressBar.setProgress(newProgress);
      }
    });
    webView.loadUrl(GITHUB_URL);

    chandelierLayout = (ChandelierLayout) findViewById(R.id.chandelier_layout);
    chandelierLayout.setOnActionSelectedListener(new ChandelierLayout.OnActionListener() {
      @Override public void onActionSelected(int index, Ornament action) {
        action.execute();
      }
    });
    chandelierLayout.populateActionItems(Arrays.asList(
        new GitHubAction.Builder()
            .setDrawableResId(R.drawable.ic_notifications)
            .setUrl(GITHUB_NOTIFICATIONS_URL)
            .setWebView(webView)
            .build(),
        new GitHubAction.Builder()
            .setDrawableResId(R.drawable.ic_github)
            .setUrl(GITHUB_URL)
            .setWebView(webView)
            .build(),
        new GitHubAction.Builder()
            .setDrawableResId(R.drawable.ic_pull_request)
            .setUrl(GITHUB_PULLS_URL)
            .setWebView(webView)
            .build()
    ));

    FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
    fab.setOnClickListener(new View.OnClickListener() {
      @Override
      public void onClick(View view) {
        webView.loadUrl(GITHUB_SEARCH_URL);
      }
    });
  }

  static class GitHubAction extends Ornament {
    private String url;
    private WebView webView;

    public GitHubAction(@DrawableRes int drawableResId) {
      super(drawableResId);
    }

    @Override public void execute() {
      if (!TextUtils.isEmpty(url)) {
        webView.loadUrl(url);
      }
    }

    public void setUrl(String url) {
      this.url = url;
    }

    public void setWebView(WebView webView) {
      this.webView = webView;
    }

    static class Builder {
      String url = "";
      int drawableResId;
      WebView webView;

      public Builder setDrawableResId(@DrawableRes int resId) {
        drawableResId = resId;
        return this;
      }

      public Builder setUrl(@NonNull String url) {
        this.url = url;
        return this;
      }

      public Builder setWebView(@NonNull WebView webView) {
        this.webView = webView;
        return this;
      }

      public GitHubAction build() {
        if (url == null || webView == null) {
          throw new IllegalArgumentException("URL and WebView must be set");
        }
        GitHubAction action = new GitHubAction(drawableResId);
        action.setUrl(url);
        action.setWebView(webView);
        return action;
      }
    }
  }
}


================================================
FILE: app/src/main/res/drawable/al_github_selector.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
  <solid android:color="@color/githubSelector" />
</shape>

================================================
FILE: app/src/main/res/drawable/ic_add.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_selected="true"
      android:drawable="@drawable/ic_add_purple_light"/>
  <item android:drawable="@drawable/ic_add_light"/>
</selector>

================================================
FILE: app/src/main/res/drawable/ic_check.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_selected="true"
      android:drawable="@drawable/ic_check_purple_light"/>
  <item android:drawable="@drawable/ic_check_light"/>
</selector>

================================================
FILE: app/src/main/res/drawable/ic_close.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_selected="true"
      android:drawable="@drawable/ic_close_purple_light"/>
  <item android:drawable="@drawable/ic_close_light"/>
</selector>

================================================
FILE: app/src/main/res/drawable/ic_github.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_selected="true"
      android:drawable="@drawable/ic_github_selected"/>
  <item>
    <bitmap android:src="@drawable/ic_github_selected"
        android:tint="@color/githubUnselected"/>
  </item>
</selector>

================================================
FILE: app/src/main/res/drawable/ic_launcher.xml
================================================
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="48dp"
        android:height="48dp"
        android:viewportWidth="48.0"
        android:viewportHeight="48.0">
    <path
        android:pathData="M24,47.91C37.25,47.91 48,37.2 48,23.99C48,10.77 37.25,0.07 24,0.07C10.75,0.07 0,10.77 0,23.99C0,37.2 10.75,47.91 24,47.91Z"
        android:strokeColor="#00000000"
        android:fillColor="#0093FF"
        android:strokeWidth="1"/>
    <path
        android:pathData="M23.69,15.56C25.23,15.56 26.48,14.31 26.48,12.77L20.89,12.77C20.89,14.31 22.14,15.56 23.69,15.56L23.69,15.56Z"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M23.69,15.56L23.69,23.94"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M23.69,25.93C23.69,23.07 26.01,20.76 28.88,20.76C31.75,20.76 34.08,23.07 34.08,25.93"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M13.29,25.93C13.29,23.07 15.62,20.76 18.49,20.76C21.36,20.76 23.69,23.07 23.69,25.93"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M19.69,29.52C19.69,27.32 21.48,25.53 23.69,25.53C25.89,25.53 27.68,27.32 27.68,29.52C27.68,31.71 25.89,33.5 23.69,33.5C21.48,33.5 19.69,31.71 19.69,29.52L19.69,29.52Z"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M30.08,29.52C30.08,27.32 31.87,25.53 34.08,25.53C36.29,25.53 38.08,27.32 38.08,29.52C38.08,31.71 36.29,33.5 34.08,33.5C31.87,33.5 30.08,31.71 30.08,29.52L30.08,29.52Z"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M9.3,29.52C9.3,27.32 11.09,25.53 13.29,25.53C15.5,25.53 17.29,27.32 17.29,29.52C17.29,31.71 15.5,33.5 13.29,33.5C11.09,33.5 9.3,31.71 9.3,29.52L9.3,29.52Z"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M34.08,24.14C33.31,24.14 32.68,24.76 32.68,25.53L35.48,25.53C35.48,24.76 34.85,24.14 34.08,24.14"
        android:strokeColor="#00000000"
        android:fillColor="#0093FF"
        android:strokeWidth="1"/>
    <path
        android:pathData="M34.08,24.14C33.31,24.14 32.68,24.76 32.68,25.53L35.48,25.53C35.48,24.76 34.85,24.14 34.08,24.14L34.08,24.14Z"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M23.69,24.14C22.91,24.14 22.29,24.76 22.29,25.53L25.09,25.53C25.09,24.76 24.46,24.14 23.69,24.14"
        android:strokeColor="#00000000"
        android:fillColor="#0093FF"
        android:strokeWidth="1"/>
    <path
        android:pathData="M23.69,24.14C22.91,24.14 22.29,24.76 22.29,25.53L25.09,25.53C25.09,24.76 24.46,24.14 23.69,24.14L23.69,24.14Z"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
    <path
        android:pathData="M13.29,24.14C12.52,24.14 11.9,24.76 11.9,25.53L14.69,25.53C14.69,24.76 14.07,24.14 13.29,24.14"
        android:strokeColor="#00000000"
        android:fillColor="#0093FF"
        android:strokeWidth="1"/>
    <path
        android:pathData="M13.29,24.14C12.52,24.14 11.9,24.76 11.9,25.53L14.69,25.53C14.69,24.76 14.07,24.14 13.29,24.14L13.29,24.14Z"
        android:strokeColor="#FFFFFF"
        android:fillColor="#00000000"
        android:strokeWidth="0.751958225"/>
</vector>


================================================
FILE: app/src/main/res/drawable/ic_notifications.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_selected="true"
      android:drawable="@drawable/ic_notifications_selected"/>
  <item>
    <bitmap android:src="@drawable/ic_notifications_selected"
        android:tint="@color/githubUnselected"/>
  </item>
</selector>

================================================
FILE: app/src/main/res/drawable/ic_pull_request.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_selected="true"
      android:drawable="@drawable/ic_pull_request_selected"/>
  <item>
    <bitmap android:src="@drawable/ic_pull_request_selected"
        android:tint="@color/githubUnselected"/>
  </item>
</selector>

================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.prolificinteractive.chandelier.sample.MainActivity">

  <android.support.design.widget.AppBarLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay"/>

  </android.support.design.widget.AppBarLayout>

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

</android.support.design.widget.CoordinatorLayout>


================================================
FILE: app/src/main/res/layout/activity_recycler_view.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity"
    >

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

  <com.prolificinteractive.chandelier.widget.ChandelierLayout
      android:id="@+id/chandelier_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@id/toolbar"
      app:chandelier_background="?attr/colorPrimary"
      >
    <include layout="@layout/content_recycler_view" />
  </com.prolificinteractive.chandelier.widget.ChandelierLayout>
</RelativeLayout>


================================================
FILE: app/src/main/res/layout/activity_web_view.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.prolificinteractive.chandelier.sample.WebViewActivity"
    >

  <android.support.design.widget.AppBarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:theme="@style/AppTheme.AppBarOverlay"
      >

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:popupTheme="@style/AppTheme.PopupOverlay"
        />

  </android.support.design.widget.AppBarLayout>
  <com.prolificinteractive.chandelier.widget.ChandelierLayout
      android:id="@+id/chandelier_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      app:chandelier_selected_size="40dp"
      app:chandelier_selector="@drawable/al_github_selector"
      app:layout_behavior="@string/appbar_scrolling_view_behavior"
      >
    <android.support.v4.widget.NestedScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        >
      <include layout="@layout/content_web_view"/>
    </android.support.v4.widget.NestedScrollView>
  </com.prolificinteractive.chandelier.widget.ChandelierLayout>

  <ProgressBar
      android:id="@+id/progress_bar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_marginTop="-7dp"
      android:elevation="4dp"
      android:max="100"
      style="@style/Widget.AppCompat.ProgressBar.Horizontal"
      />
  <android.support.design.widget.FloatingActionButton
      android:id="@+id/fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom|end"
      android:layout_margin="@dimen/fab_margin"
      android:src="@drawable/ic_search"
      />

</android.support.design.widget.CoordinatorLayout>


================================================
FILE: app/src/main/res/layout/content_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@android:id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:showIn="@layout/activity_main"
    tools:context="com.prolificinteractive.chandelier.sample.MainActivity">

</android.support.v7.widget.RecyclerView>


================================================
FILE: app/src/main/res/layout/content_recycler_view.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@android:id/list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:showIn="@layout/activity_main" />


================================================
FILE: app/src/main/res/layout/content_web_view.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<WebView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/web_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:showIn="@layout/activity_web_view"
    tools:context="com.prolificinteractive.chandelier.sample.WebViewActivity">
</WebView>


================================================
FILE: app/src/main/res/layout/include_toolbar.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary"
    android:elevation="@dimen/elevation"
    app:titleTextColor="@android:color/white"
    tools:showIn="@layout/activity_recycler_view"
    />


  

================================================
FILE: app/src/main/res/layout/item_dummy.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/selectableItemBackground"
    android:clickable="true"
    android:focusable="true"
    android:orientation="vertical"
    android:padding="@dimen/activity_horizontal_margin">

    <TextView
        android:id="@android:id/text1"
        style="@style/Base.TextAppearance.AppCompat.Body1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Title" />

    <TextView
        android:id="@android:id/text2"
        style="@style/Base.TextAppearance.AppCompat.Body2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Subtitle" />

</LinearLayout>

================================================
FILE: app/src/main/res/layout/swipe_content.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?attr/colorPrimary"
    android:elevation="@dimen/elevation"
    android:gravity="center_vertical"
    android:minHeight="80dp"
    android:orientation="horizontal"
    android:padding="@dimen/activity_horizontal_margin">

    <ImageView
        style="@style/swipe_item"
        android:src="@android:drawable/ic_dialog_email" />

    <ImageView
        style="@style/swipe_item"
        android:src="@android:drawable/ic_dialog_dialer" />

    <ImageView
        style="@style/swipe_item"
        android:src="@android:drawable/ic_dialog_alert" />

</LinearLayout>

================================================
FILE: app/src/main/res/menu/menu_main.xml
================================================
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity">
    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        app:showAsAction="never" />
</menu>


================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>

    <color name="githubPrimary">#666666</color>
    <color name="githubPrimaryDark">#333333</color>
    <color name="githubAccent">#4183c4</color>
    <color name="githubUnselected">@color/githubPrimaryDark</color>
    <color name="githubSelector">@color/githubAccent</color>
</resources>


================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
  <!-- Default screen margins, per the Android Design guidelines. -->
  <dimen name="activity_horizontal_margin">16dp</dimen>
  <dimen name="activity_vertical_margin">16dp</dimen>
  <dimen name="fab_margin">16dp</dimen>
  <dimen name="elevation">4dp</dimen>
  <dimen name="action_selected_size">40dp</dimen>
  <dimen name="chandelier_margin">16dp</dimen>
</resources>


================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
  <string name="app_name">Chandelier</string>
  <string name="action_settings">Settings</string>

  <string name="title_activity_web_view">WebViewActivity</string>
  <string name="title_activity_recycler_view">RecyclerViewActivity</string>
</resources>


================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>

  <!-- Base application theme. -->
  <style name="AppTheme"
      parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
  </style>

  <style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
  </style>

  <!--Theme for WebViewActivity-->
  <style name="GitHubTheme"
      parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/githubPrimary</item>
    <item name="colorPrimaryDark">@color/githubPrimaryDark</item>
    <item name="colorAccent">@color/githubAccent</item>
  </style>

  <style name="GitHubTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
  </style>

  <style name="AppTheme.AppBarOverlay"
      parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>

  <style name="AppTheme.PopupOverlay"
      parent="ThemeOverlay.AppCompat.Light"/>

  <style name="swipe_item">
    <item name="android:layout_width">0dp</item>
    <item name="android:layout_height">20dp</item>
    <item name="android:layout_weight">1</item>
  </style>

</resources>


================================================
FILE: app/src/main/res/values-w820dp/dimens.xml
================================================
<resources>
    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
         (such as screen margins) for screens with more than 820dp of available width. This
         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
    <dimen name="activity_horizontal_margin">64dp</dimen>
</resources>


================================================
FILE: app/src/test/java/com/prolificinteractive/chandelier/ExampleUnitTest.java
================================================
package com.prolificinteractive.chandelier;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class ExampleUnitTest {
    @Test
    public void addition_isCorrect() throws Exception {
        assertEquals(4, 2 + 2);
    }
}

================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
  repositories {
    google()
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
  }
}

allprojects {
  repositories {
    google()
    jcenter()
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
  }
}

task clean(type: Delete) {
  delete rootProject.buildDir
}

ext {
  versionName = "0.1.0"
  versionCode = 1
}

================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Tue Apr 24 17:38:59 EDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip


================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
    [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: library/.gitignore
================================================
/build


================================================
FILE: library/build.gradle
================================================
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

group = 'com.github.prolificinteractive'

android {
  compileSdkVersion 27
  buildToolsVersion "27.0.3"

  defaultConfig {
    minSdkVersion 16
    targetSdkVersion 27
    versionCode rootProject.ext.versionCode
    versionName rootProject.ext.versionName
  }
}

dependencies {
  testImplementation 'junit:junit:4.12'
  implementation 'com.android.support:appcompat-v7:27.1.1'
  implementation 'com.android.support:recyclerview-v7:27.1.1'
}

================================================
FILE: library/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/erickchang/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}


================================================
FILE: library/src/androidTest/java/com/prolificinteractive/chandelier/ApplicationTest.java
================================================
package com.prolificinteractive.chandelier;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
  public ApplicationTest() {
    super(Application.class);
  }
}

================================================
FILE: library/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.prolificinteractive.chandelier">

  <application android:allowBackup="true"
      android:label="@string/app_name"
      android:supportsRtl="true"
      >

  </application>

</manifest>


================================================
FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/ChandelierLayout.java
================================================
package com.prolificinteractive.chandelier.widget;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.ScrollingView;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.NestedScrollView;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.DecelerateInterpolator;
import android.view.animation.Transformation;
import android.widget.AbsListView;
import com.prolificinteractive.chandelier.R;
import java.util.List;

public class ChandelierLayout extends ViewGroup {
  private static final String LOG_TAG = ChandelierLayout.class.getSimpleName();

  private static final float DECELERATE_INTERPOLATION_FACTOR = 2f;
  private static final int INVALID_POINTER = -1;
  private static final float DRAG_RATE = .8f;
  private static final int ANIMATE_TO_START_DURATION = 300;
  private static final int[] LAYOUT_ATTRS = new int[] {
      android.R.attr.enabled
  };

  private final AttributeSet attrs;
  private final DecelerateInterpolator decelerateInterpolator;

  protected int from;
  protected int originalOffsetTop;

  private boolean actionSelected;
  private View absListView;
  private View target; // the target of the gesture
  private OnActionListener listener;
  private int touchSlop;
  private float totalDragDistance = -1;
  private int currentTargetOffsetTop;
  // Whether or not the starting offset has been determined.
  private boolean originalOffsetCalculated = false;
  private float initialMotionY;
  private float initialDownY;
  private boolean isBeingDragged;
  private int activePointerId = INVALID_POINTER;
  // Target is returning to its start offset because it was cancelled or a
  // refresh was triggered.
  private boolean isReturningToStart;
  private int animateToStartDuration;
  private OrnamentLayout ornamentLayout;
  private float spinnerFinalOffset;
  private IdleScrollListener scrollListener = new IdleScrollListener();

  private final AnimationListener moveToStartListener = new SimpleAnimationListener() {
    @Override public void onAnimationEnd(Animation animation) {
      if (actionSelected) {
        int selectedIndex = ornamentLayout.getSelectedIndex();
        listener.onActionSelected(selectedIndex, ornamentLayout.getActionItem(selectedIndex));
        actionSelected = false;
      }
    }
  };

  private final Animation animateToStartPosition = new Animation() {
    @Override
    public void applyTransformation(float interpolatedTime, Transformation t) {
      moveToStart(interpolatedTime);
    }
  };
  private boolean isShowingAction = false;

  /**
   * Simple constructor to use when creating a SwipeRefreshLayout from code.
   */
  public ChandelierLayout(Context context) {
    this(context, null);
  }

  /**
   * Constructor that is called when inflating SwipeRefreshLayout from XML.
   */
  public ChandelierLayout(Context context, AttributeSet attrs) {
    super(context, attrs);
    this.attrs = attrs;

    final Resources res = getResources();
    // Defaults
    final int defaultElevation = res.getDimensionPixelSize(R.dimen.default_elevation);

    touchSlop = ViewConfiguration.get(context).getScaledTouchSlop();

    setWillNotDraw(false);
    decelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);

    final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
    setEnabled(a.getBoolean(0, true));

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      setElevation(
          a.getDimensionPixelSize(R.styleable.ChandelierLayout_chandelier_elevation, defaultElevation));
    }

    animateToStartDuration =
        a.getInteger(R.styleable.ChandelierLayout_chandelier_animate_to_start_duration,
            ANIMATE_TO_START_DURATION);

    a.recycle();

    createProgressView();
    ViewCompat.setChildrenDrawingOrderEnabled(this, true);
  }

  private void createProgressView() {
    ornamentLayout = new OrnamentLayout(getContext(), attrs);
    ornamentLayout.setVisibility(View.GONE);
    addView(ornamentLayout);
  }

  /**
   * Set the listener to be notified when a refresh is triggered via the swipe
   * gesture.
   */
  public void setOnActionSelectedListener(OnActionListener listener) {
    this.listener = listener;
  }

  private void ensureTarget() {
    // Don't bother getting the parent height if the parent hasn't been laid
    // out yet.
    if (target == null) {
      for (int i = 0; i < getChildCount(); i++) {
        View child = getChildAt(i);
        if (!child.equals(ornamentLayout)) {
          target = child;
          break;
        }
      }
    }

    if (absListView == null) {
      for (int i = 0; i < getChildCount(); i++) {
        final View child = getChildAt(i);
        if (child instanceof ScrollingView || child instanceof NestedScrollView) {
          // TODO fix validation
          absListView = child;
          scrollListener.setParent(absListView);
          if (absListView instanceof AbsListView) {
            ((AbsListView) absListView).setOnScrollListener(scrollListener);
          } else if (absListView instanceof RecyclerView) {
            ((RecyclerView) absListView).addOnScrollListener(scrollListener);
          }
          absListView.setOnTouchListener(new OnTouchListener() {
            @Override public boolean onTouch(View v, MotionEvent event) {
              if (isShowingAction) {
                onTouchEvent(event);
                return true;
              }
              return false;
            }
          });
          break;
        }
      }
    }
  }

  @Override
  protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
    final int width = getMeasuredWidth();
    final int height = getMeasuredHeight();
    if (getChildCount() == 0) {
      return;
    }
    if (target == null) {
      ensureTarget();
    }
    if (target == null) {
      return;
    }
    final View child = target;
    final int childLeft = getPaddingLeft();
    final int childTop = getPaddingTop();
    final int childWidth = width - getPaddingLeft() - getPaddingRight();
    final int childHeight = height - getPaddingTop() - getPaddingBottom();
    child.layout(childLeft, childTop, childLeft + childWidth, childTop + childHeight);
    ornamentLayout.layout(0, currentTargetOffsetTop,
        width, currentTargetOffsetTop + ornamentLayout.getMeasuredHeight());
  }

  @Override
  public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    if (target == null) {
      ensureTarget();
    }
    if (target == null) {
      return;
    }

    target.measure(
        MeasureSpec.makeMeasureSpec(
            getMeasuredWidth() - getPaddingLeft() - getPaddingRight(),
            MeasureSpec.EXACTLY
        ),
        MeasureSpec.makeMeasureSpec(
            getMeasuredHeight() - getPaddingTop() - getPaddingBottom(),
            MeasureSpec.EXACTLY
        ));

    ornamentLayout.measure(
        MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),
        ornamentLayout.getMeasuredHeight()
    );

    if (!originalOffsetCalculated) {
      originalOffsetCalculated = true;
      spinnerFinalOffset = ornamentLayout.getMeasuredHeight();
      totalDragDistance = spinnerFinalOffset;
      currentTargetOffsetTop = originalOffsetTop = -ornamentLayout.getMeasuredHeight();
    }
  }

  /**
   * @return Whether it is possible for the child view of this layout to
   * scroll up. Override this if the child view is a custom view.
   */
  public boolean canChildScrollUp() {
    if (android.os.Build.VERSION.SDK_INT < 14) {
      if (target instanceof AbsListView) {
        final AbsListView absListView = (AbsListView) target;
        return absListView.getChildCount() > 0
            && (absListView.getFirstVisiblePosition() > 0 || absListView.getChildAt(0)
            .getTop() < absListView.getPaddingTop());
      } else {
        return ViewCompat.canScrollVertically(target, -1) || target.getScrollY() > 0;
      }
    } else {
      return ViewCompat.canScrollVertically(target, -1);
    }
  }

  @Override
  public boolean onInterceptTouchEvent(MotionEvent ev) {
    ensureTarget();

    final int action = MotionEventCompat.getActionMasked(ev);

    if (isReturningToStart && action == MotionEvent.ACTION_DOWN) {
      isReturningToStart = false;
    }

    if (!isEnabled() || isReturningToStart || canChildScrollUp()) {
      // Fail fast if we're not in a state where a swipe is possible
      return false;
    }

    switch (action) {
      case MotionEvent.ACTION_DOWN:
        setTargetOffsetTopAndBottom(originalOffsetTop - ornamentLayout.getTop());
        activePointerId = MotionEventCompat.getPointerId(ev, 0);
        isBeingDragged = false;
        final float initialDownY = getMotionEventY(ev, activePointerId);
        if (initialDownY == -1) {
          return false;
        }
        this.initialDownY = initialDownY;
        break;

      case MotionEvent.ACTION_MOVE:
        if (activePointerId == INVALID_POINTER) {
          Log.e(LOG_TAG, "Got ACTION_MOVE event but don't have an active pointer id.");
          return false;
        }

        final float y = getMotionEventY(ev, activePointerId);
        if (y == -1) {
          return false;
        }
        final float yDiff = y - this.initialDownY;
        if (yDiff > touchSlop && !isBeingDragged) {
          initialMotionY = this.initialDownY + touchSlop;
          isBeingDragged = true;
        }
        break;

      case MotionEventCompat.ACTION_POINTER_UP:
        onSecondaryPointerUp(ev);
        break;

      case MotionEvent.ACTION_UP:
      case MotionEvent.ACTION_CANCEL:
        isBeingDragged = false;
        activePointerId = INVALID_POINTER;
        break;
    }

    return isBeingDragged;
  }

  private float getMotionEventY(MotionEvent ev, int activePointerId) {
    final int index = MotionEventCompat.findPointerIndex(ev, activePointerId);
    if (index < 0) {
      return -1;
    }
    return MotionEventCompat.getY(ev, index);
  }

  @Override
  public void requestDisallowInterceptTouchEvent(boolean b) {
    // if this is a List < L or another view that doesn't support nested
    // scrolling, ignore this request so that the vertical scroll event
    // isn't stolen
    if ((android.os.Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView))
        && (target == null || ViewCompat.isNestedScrollingEnabled(target))) {
      super.requestDisallowInterceptTouchEvent(b);
    }
  }

  private void moveActionLayout(final float overscrollTop) {
    Log.d(LOG_TAG,
        "### overscrollTop: " + overscrollTop + "; mOriginalOffsetTop: " + originalOffsetTop);
    final float originalDragPercent = overscrollTop / totalDragDistance;
    final float dragPercent = Math.min(1f, Math.abs(originalDragPercent));
    final int targetY = originalOffsetTop + (int) (spinnerFinalOffset * dragPercent);

    if (ornamentLayout.getVisibility() != View.VISIBLE) {
      ornamentLayout.setVisibility(View.VISIBLE);
    }
    setTargetOffsetTopAndBottom(targetY - currentTargetOffsetTop);
    ornamentLayout.onLayoutTranslated(1 - (float) targetY / currentTargetOffsetTop);
  }

  private void finishAction(final float overscrollTop) {
    actionSelected = overscrollTop > totalDragDistance;
    if (actionSelected) {
      ornamentLayout.finishAction(new SimpleAnimationListener() {
        @Override public void onAnimationEnd(Animation animation) {
          animateOffsetToStartPosition();
        }
      });
    } else {
      animateOffsetToStartPosition();
    }
  }

  @Override
  public boolean onTouchEvent(MotionEvent ev) {
    final int action = MotionEventCompat.getActionMasked(ev);

    if (isReturningToStart && action == MotionEvent.ACTION_DOWN) {
      isReturningToStart = false;
    }

    if (action == MotionEvent.ACTION_UP && isShowingAction) {
      hideActions();
      return true;
    }

    if (!isEnabled() || isReturningToStart || canChildScrollUp() || (!scrollListener.isIdle()
        && !isShowingAction)) {
      // Fail fast if we're not in a state where a swipe is possible
      if (ornamentLayout != null && isShowingAction) {
        ornamentLayout.onParentTouchEvent(ev);
      }
      return false;
    }

    switch (action) {
      case MotionEvent.ACTION_DOWN:
        activePointerId = MotionEventCompat.getPointerId(ev, 0);
        isBeingDragged = false;
        break;

      case MotionEvent.ACTION_MOVE: {
        final int pointerIndex = MotionEventCompat.findPointerIndex(ev, activePointerId);
        if (pointerIndex < 0) {
          Log.e(LOG_TAG, "Got ACTION_MOVE event but have an invalid active pointer id.");
          return false;
        }

        final float y = MotionEventCompat.getY(ev, pointerIndex);
        final float overscrollTop = (y - initialMotionY) * DRAG_RATE;
        if (isBeingDragged) {
          if (overscrollTop > 0) {
            moveActionLayout(overscrollTop);
          } else if (!isShowingAction) {
            Log.d(LOG_TAG, "### false");
            return false;
          }
        }
        break;
      }
      case MotionEventCompat.ACTION_POINTER_DOWN: {
        final int index = MotionEventCompat.getActionIndex(ev);
        activePointerId = MotionEventCompat.getPointerId(ev, index);
        break;
      }

      case MotionEventCompat.ACTION_POINTER_UP:
        onSecondaryPointerUp(ev);
        break;

      case MotionEvent.ACTION_UP:
      case MotionEvent.ACTION_CANCEL: {
        if (activePointerId == INVALID_POINTER) {
          if (action == MotionEvent.ACTION_UP) {
            Log.e(LOG_TAG, "Got ACTION_UP event but don't have an active pointer id.");
          }
          return false;
        }
        final int pointerIndex = MotionEventCompat.findPointerIndex(ev, activePointerId);
        final float y = MotionEventCompat.getY(ev, pointerIndex);
        final float overscrollTop = (y - initialMotionY) * DRAG_RATE;
        isBeingDragged = false;
        finishAction(overscrollTop);
        activePointerId = INVALID_POINTER;
        return false;
      }
    }

    if (ornamentLayout != null) {
      ornamentLayout.onParentTouchEvent(ev);
    }

    return true;
  }

  private void animateOffsetToStartPosition() {
    from = Math.round(ViewCompat.getTranslationY(ornamentLayout));
    animateToStartPosition.reset();
    animateToStartPosition.setDuration(animateToStartDuration);
    animateToStartPosition.setInterpolator(decelerateInterpolator);
    animateToStartPosition.setAnimationListener(moveToStartListener);
    ornamentLayout.clearAnimation();
    ornamentLayout.startAnimation(animateToStartPosition);
  }

  private void moveToStart(float interpolatedTime) {
    setTargetOffsetTopAndBottom(Math.round((1 - interpolatedTime) * from));
  }

  private void setTargetOffsetTopAndBottom(final int offset) {
    ViewCompat.setTranslationY(ornamentLayout, offset);
    ViewCompat.setTranslationY(absListView, offset);
    currentTargetOffsetTop = ornamentLayout.getTop();
  }

  private void onSecondaryPointerUp(MotionEvent ev) {
    final int pointerIndex = MotionEventCompat.getActionIndex(ev);
    final int pointerId = MotionEventCompat.getPointerId(ev, pointerIndex);
    if (pointerId == activePointerId) {
      // This was our active pointer going up. Choose a new
      // active pointer and adjust accordingly.
      final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
      activePointerId = MotionEventCompat.getPointerId(ev, newPointerIndex);
    }
  }

  /**
   * Add a list of actions to the {@link ChandelierLayout}.
   *
   * @param items list of {@link Ornament} to display
   */
  public void populateActionItems(@Nullable final List<? extends Ornament> items) {
    ornamentLayout.populateActionItems(items);
  }

  /**
   * Show the actions of the {@link ChandelierLayout}
   */
  public void showActions() {
    isShowingAction = true;
    final Animation showAnimation = new Animation() {
      @Override protected void applyTransformation(float interpolatedTime, Transformation t) {
        moveActionLayout(-interpolatedTime * originalOffsetTop);
      }
    };
    showAnimation.reset();
    showAnimation.setDuration(200);
    startAnimation(showAnimation);
  }

  /**
   * Hide the actions of the {@link ChandelierLayout}
   */
  public void hideActions() {
    isShowingAction = false;
    final float top = ViewCompat.getTranslationY(ornamentLayout);
    final Animation hideAnimation = new Animation() {
      @Override protected void applyTransformation(float interpolatedTime, Transformation t) {
        moveActionLayout((1 - interpolatedTime) * top);
      }
    };
    hideAnimation.reset();
    hideAnimation.setDuration(200);
    startAnimation(hideAnimation);
  }

  /**
   * Set the duration that the layout takes to get into its original position. Default is
   * {@link ChandelierLayout#ANIMATE_TO_START_DURATION} = 300 millisecond.
   *
   * @param duration in millisecond
   */
  public void setAnimateToStartDuration(final int duration) {
    animateToStartDuration = duration;
  }

  /**
   * Classes that wish to be notified when the swipe gesture correctly
   * triggers an action should implement this interface.
   */
  public interface OnActionListener {
    void onActionSelected(int index, Ornament action);
  }
}

================================================
FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/IdleScrollListener.java
================================================
package com.prolificinteractive.chandelier.widget;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.AbsListView;

class IdleScrollListener extends RecyclerView.OnScrollListener
    implements AbsListView.OnScrollListener {
  private Class parentType;
  private int scrollState;

  public void setParent(View view) {
    parentType = view.getClass();
  }

  @Override public void onScrollStateChanged(AbsListView view, int scrollState) {
    this.scrollState = scrollState;
  }

  @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
      int totalItemCount) {

  }

  @Override public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
    super.onScrollStateChanged(recyclerView, newState);
    this.scrollState = newState;
  }

  @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
    super.onScrolled(recyclerView, dx, dy);
  }

  public boolean isIdle() {
    if (parentType == AbsListView.class) {
      return scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE;
    }

    if (parentType == RecyclerView.class) {
      return scrollState == RecyclerView.SCROLL_STATE_IDLE;
    }

    return true;
  }
}


================================================
FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/Ornament.java
================================================
package com.prolificinteractive.chandelier.widget;

import android.support.annotation.DrawableRes;

/**
 * Create a list of actions using this class to add to the {@link ChandelierLayout}.
 */
public class Ornament {
  public final int drawableResId;

  public Ornament(@DrawableRes final int drawableResId) {
    this.drawableResId = drawableResId;
  }

  public void execute() {

  }
}

================================================
FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/OrnamentLayout.java
================================================
package com.prolificinteractive.chandelier.widget;

import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.animation.AccelerateDecelerateInterpolator;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
import android.view.animation.Transformation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.prolificinteractive.chandelier.R;
import java.util.ArrayList;
import java.util.List;

import static android.view.Gravity.CENTER;
import static android.view.Gravity.CENTER_VERTICAL;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;

public class OrnamentLayout extends FrameLayout {

  private static final int ITEM_WEIGHT = 1;
  private static final AccelerateInterpolator ACCELERATE_INTERPOLATOR =
      new AccelerateInterpolator();
  private static final AccelerateDecelerateInterpolator ACCELERATE_DECELERATE_INTERPOLATOR =
      new AccelerateDecelerateInterpolator();
  private static final int DEFAULT_SCALE = 1;

  private final int imageViewMargin;
  private final int selectedSize;

  private final LinearLayout container;
  private final ImageView selectedImageView;
  private final List<Ornament> ornaments = new ArrayList<>();
  private final List<ImageView> imageViews = new ArrayList<>();
  private final int actionItemLayoutHeight;
  private final int actionItemLayoutWidth;
  private final int shortAnimDuration =
      getResources().getInteger(android.R.integer.config_shortAnimTime);

  private boolean isScaleEnabled;
  private int measuredWidth;
  private int selectedIndex = -1;
  private boolean isAnimating = false;
  private Animation.AnimationListener actionListener;

  private final Animation.AnimationListener animationListener = new SimpleAnimationListener() {
    @Override public void onAnimationStart(Animation animation) {
      imageViews.get(selectedIndex).setSelected(true);
    }

    @Override public void onAnimationEnd(Animation animation) {
      isAnimating = false;
      if (actionListener != null) {
        actionListener.onAnimationEnd(null);
      }
      actionListener = null;
    }
  };

  public OrnamentLayout(final Context context, final AttributeSet attrs) {
    super(context);
    final Resources res = getResources();
    final TypedArray a = context.getTheme().obtainStyledAttributes(
        attrs,
        R.styleable.ChandelierLayout,
        0, 0);

    // Defaults
    final int defaultElevation = res.getDimensionPixelSize(R.dimen.default_elevation);
    final int defaultSelectorMargin = res.getDimensionPixelSize(R.dimen.default_selector_margin);
    final int defaultSelectorSize = res.getDimensionPixelSize(R.dimen.default_selector_size);
    final boolean defaultScaleEnabled = res.getBoolean(R.bool.default_scale_enabled);

    isScaleEnabled = a.getBoolean(R.styleable.ChandelierLayout_chandelier_scale_enabled,
        defaultScaleEnabled);
    actionItemLayoutHeight =
        a.getDimensionPixelSize(R.styleable.ChandelierLayout_ornament_layout_height,
            WRAP_CONTENT);
    actionItemLayoutWidth = a.getDimensionPixelSize(R.styleable.ChandelierLayout_ornament_layout_width,
        WRAP_CONTENT);

    // Action Layout
    container = new LinearLayout(context);
    container.setLayoutParams(new LayoutParams(MATCH_PARENT, WRAP_CONTENT, CENTER_VERTICAL));
    setBackground(a.getDrawable(R.styleable.ChandelierLayout_chandelier_background));

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      setElevation(
          a.getDimensionPixelSize(R.styleable.ChandelierLayout_chandelier_elevation, defaultElevation));
    }

    container.setOrientation(LinearLayout.HORIZONTAL);
    container.setGravity(CENTER_VERTICAL);

    // Action Item
    imageViewMargin =
        a.getDimensionPixelSize(R.styleable.ChandelierLayout_ornament_margin, defaultSelectorMargin);
    selectedSize = a.getDimensionPixelSize(R.styleable.ChandelierLayout_chandelier_selected_size,
        defaultSelectorSize);
    selectedImageView = new ImageView(context);
    final LayoutParams selectedLp = new LayoutParams(selectedSize, selectedSize, CENTER_VERTICAL);
    selectedLp.setMargins(0, imageViewMargin, 0, imageViewMargin);
    selectedImageView.setLayoutParams(selectedLp);

    Drawable selectorBackground = a.getDrawable(R.styleable.ChandelierLayout_chandelier_selector);
    if (selectorBackground != null) {
      selectedImageView.setBackground(selectorBackground);
    } else {
      selectedImageView.setBackground(res.getDrawable(R.drawable.default_selector));
    }

    Drawable layoutBackground = a.getDrawable(R.styleable.ChandelierLayout_chandelier_background);
    if (layoutBackground != null) {
      setBackground(layoutBackground);
    } else {
      TypedValue typedValue = new TypedValue();
      context.getTheme().resolveAttribute(R.attr.colorPrimary, typedValue, true);
      setBackgroundColor(typedValue.data);
    }

    a.recycle();

    addView(selectedImageView);
    addView(container);
  }

  public void populateActionItems(int... drawablesResIds) {
    final ArrayList<Ornament> items = new ArrayList<>();
    for (int resId : drawablesResIds) {
      items.add(new Ornament(resId));
    }
    populateActionItems(items);
  }

  public void populateActionItems(@Nullable final List<? extends Ornament> items) {
    container.removeAllViews();
    ornaments.clear();
    imageViews.clear();

    if (items != null) {
      ornaments.addAll(items);
      final Context context = getContext();
      for (final Ornament item : items) {
        final FrameLayout frame = new FrameLayout(context);
        frame.setLayoutParams(new LinearLayout.LayoutParams(
            MATCH_PARENT,
            WRAP_CONTENT,
            ITEM_WEIGHT)
        );

        final ImageView imageView = new ImageView(context);
        final FrameLayout.LayoutParams imageLp = new FrameLayout.LayoutParams(
            actionItemLayoutWidth,
            actionItemLayoutHeight,
            CENTER
        );
        imageLp.setMargins(imageViewMargin, imageViewMargin, imageViewMargin, imageViewMargin);
        imageView.setLayoutParams(imageLp);
        imageView.setBackgroundResource(item.drawableResId);

        imageViews.add(imageView);

        frame.addView(imageView);
        container.addView(frame);
      }
      selectedIndex = ornaments.size() / 2;
      imageViews.get(selectedIndex).setSelected(true);
    }
  }

  @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    this.measuredWidth = getMeasuredWidth();
  }

  public void onParentTouchEvent(final MotionEvent ev) {
    if (measuredWidth <= 0 || isAnimating) {
      return;
    }

    final float x = ev.getX();
    final int count = ornaments.size();

    // One quarter of the screen width
    final int q = measuredWidth / 4;
    // projected x in center of screen
    final int pX = getInRange(Math.round((x - q) * 2), 0, measuredWidth);
    // width of one item
    final int iW = Math.round(measuredWidth / count);
    final int newSelectedIndex = getInRange(Math.round(pX / iW), 0, count - 1);

    // sensitivity range
    final int xS = iW / count;

    switch (ev.getAction()) {
      case MotionEvent.ACTION_MOVE:
        if (pX < selectedIndex * iW + xS) {
          // left edge

          if (selectedIndex == 0) {
            break;
          }

          // actual progress
          final float t = getInRange((selectedIndex * iW + xS - pX) / (2f * xS), 0f, 1f);
          // scale
          final float sX = isScaleEnabled ? t / 2 + 1 : 1;
          // position in the middle
          final int mX = iW * selectedIndex + (iW - selectedSize) / 2;
          // interpolated progress
          final float it = getInRange(ACCELERATE_INTERPOLATOR.getInterpolation(t), 0f, 1f);
          // amount to move
          final int dX = Math.round(it * 2 * xS);
          // target
          final int tX = mX - dX;

          selectedImageView.setPivotX(0);
          selectedImageView.setScaleX(sX);
          selectedImageView.setTranslationX(tX);

          if (pX < iW * selectedIndex - xS) {
            setSelectedIndex(newSelectedIndex);
          }
        } else if (pX > (selectedIndex + 1) * iW - xS) {
          // right edge

          if (selectedIndex == count - 1) {
            break;
          }

          // actual progress
          final float t = getInRange((pX - (selectedIndex + 1) * iW + xS) / (2f * xS), 0f, 1f);
          // scale
          final float sX = isScaleEnabled ? t / 2 + 1 : 1;
          // position in the middle
          final int mX = iW * selectedIndex + (iW - selectedSize) / 2;
          // interpolated progress
          final float it = getInRange(ACCELERATE_INTERPOLATOR.getInterpolation(t), 0f, 1f);
          // amount to move
          final int dX = Math.round(it * 2 * xS);
          // target
          final int tX = mX + dX;

          selectedImageView.setPivotX(selectedSize);
          selectedImageView.setScaleX(sX);
          selectedImageView.setTranslationX(tX);

          if (pX > iW * (selectedIndex + 1) + xS) {
            setSelectedIndex(newSelectedIndex);
          }
        } else {
          // middle
          selectedImageView.setTranslationX(selectedIndex * iW + (iW - selectedSize) / 2);
          selectedImageView.setScaleX(DEFAULT_SCALE);
        }
        break;
    }
  }

  private void setSelectedIndex(final int newSelectedIndex) {
    // Un-select previous index
    imageViews.get(selectedIndex).setSelected(false);

    selectedIndex = newSelectedIndex;
    isAnimating = true;

    final int iW = measuredWidth / ornaments.size();
    final int target = iW * selectedIndex + (iW - selectedSize) / 2;
    final float currentScale = selectedImageView.getScaleX();
    final float currentTranslation = selectedImageView.getTranslationX();

    final Animation animation = new Animation() {
      @Override protected void applyTransformation(float t, Transformation transformation) {
        ViewCompat.setScaleX(selectedImageView, (DEFAULT_SCALE - currentScale) * t + currentScale);
        ViewCompat.setTranslationX(selectedImageView,
            (target - currentTranslation) * t + currentTranslation);
      }
    };

    animation.setAnimationListener(animationListener);
    animation.setDuration(shortAnimDuration);
    animation.setInterpolator(ACCELERATE_DECELERATE_INTERPOLATOR);
    selectedImageView.clearAnimation();
    selectedImageView.startAnimation(animation);
  }

  private int getInRange(final int value, final int min, final int max) {
    return Math.max(min, Math.min(max, value));
  }

  private float getInRange(final float value, final float min, final float max) {
    return Math.max(min, Math.min(max, value));
  }

  public int getSelectedIndex() {
    return selectedIndex;
  }

  public void finishAction(Animation.AnimationListener mActionListener) {
    actionListener = mActionListener;
    setSelectedIndex(selectedIndex);
  }

  public void onLayoutTranslated(final float progress) {

  }

  public Ornament getActionItem(int index) {
    return ornaments.get(index);
  }
}


================================================
FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/SimpleAnimationListener.java
================================================
package com.prolificinteractive.chandelier.widget;

import android.view.animation.Animation;

class SimpleAnimationListener implements Animation.AnimationListener {
  @Override public void onAnimationStart(Animation animation) {

  }

  @Override public void onAnimationEnd(Animation animation) {

  }

  @Override public void onAnimationRepeat(Animation animation) {

  }
}


================================================
FILE: library/src/main/res/drawable/item_white_circle.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
  <solid android:color="@android:color/white" />
</shape>

================================================
FILE: library/src/main/res/values/attrs.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <declare-styleable name="ChandelierLayout">
    <!-- Action Layout -->
    <attr name="chandelier_background" format="reference" />
    <attr name="chandelier_elevation" format="dimension" />
    <attr name="chandelier_selector" format="reference" />
    <attr name="chandelier_selected_size" format="dimension" />
    <attr name="chandelier_scale_enabled" format="boolean" />
    <attr name="chandelier_animate_to_start_duration" format="integer" />

    <!-- Action Item -->
    <attr name="ornament_margin" format="dimension" />
    <attr name="ornament_layout_height" format="dimension" />
    <attr name="ornament_layout_width" format="dimension" />
  </declare-styleable>
</resources>

================================================
FILE: library/src/main/res/values/defaults.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <dimen name="default_elevation">4dp</dimen>
  <dimen name="default_selector_margin">16dp</dimen>
  <dimen name="default_selector_size">40dp</dimen>
  <drawable name="default_selector">@drawable/item_white_circle</drawable>
  <bool name="default_scale_enabled">true</bool>
</resources>

================================================
FILE: library/src/main/res/values/strings.xml
================================================
<resources>
  <string name="app_name">Chandelier</string>
</resources>


================================================
FILE: library/src/test/java/com/prolificinteractive/chandelier/ExampleUnitTest.java
================================================
package com.prolificinteractive.chandelier;

import org.junit.Test;

import static org.junit.Assert.*;

/**
 * To work on unit tests, switch the Test Artifact in the Build Variants view.
 */
public class ExampleUnitTest {
  @Test
  public void addition_isCorrect() throws Exception {
    assertEquals(4, 2 + 2);
  }
}

================================================
FILE: settings.gradle
================================================
include ':app', ':library'

rootProject.name = 'chandelier'
Download .txt
gitextract_y9qces16/

├── .gitignore
├── .travis.yml
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── prolificinteractive/
│       │   │           └── chandelier/
│       │   │               └── sample/
│       │   │                   ├── MainActivity.java
│       │   │                   ├── RecyclerViewActivity.java
│       │   │                   ├── SampleApplication.java
│       │   │                   └── WebViewActivity.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   ├── al_github_selector.xml
│       │       │   ├── ic_add.xml
│       │       │   ├── ic_check.xml
│       │       │   ├── ic_close.xml
│       │       │   ├── ic_github.xml
│       │       │   ├── ic_launcher.xml
│       │       │   ├── ic_notifications.xml
│       │       │   └── ic_pull_request.xml
│       │       ├── layout/
│       │       │   ├── activity_main.xml
│       │       │   ├── activity_recycler_view.xml
│       │       │   ├── activity_web_view.xml
│       │       │   ├── content_main.xml
│       │       │   ├── content_recycler_view.xml
│       │       │   ├── content_web_view.xml
│       │       │   ├── include_toolbar.xml
│       │       │   ├── item_dummy.xml
│       │       │   └── swipe_content.xml
│       │       ├── menu/
│       │       │   └── menu_main.xml
│       │       ├── values/
│       │       │   ├── colors.xml
│       │       │   ├── dimens.xml
│       │       │   ├── strings.xml
│       │       │   └── styles.xml
│       │       └── values-w820dp/
│       │           └── dimens.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── prolificinteractive/
│                       └── chandelier/
│                           └── ExampleUnitTest.java
├── build.gradle
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       ├── androidTest/
│       │   └── java/
│       │       └── com/
│       │           └── prolificinteractive/
│       │               └── chandelier/
│       │                   └── ApplicationTest.java
│       ├── main/
│       │   ├── AndroidManifest.xml
│       │   ├── java/
│       │   │   └── com/
│       │   │       └── prolificinteractive/
│       │   │           └── chandelier/
│       │   │               └── widget/
│       │   │                   ├── ChandelierLayout.java
│       │   │                   ├── IdleScrollListener.java
│       │   │                   ├── Ornament.java
│       │   │                   ├── OrnamentLayout.java
│       │   │                   └── SimpleAnimationListener.java
│       │   └── res/
│       │       ├── drawable/
│       │       │   └── item_white_circle.xml
│       │       └── values/
│       │           ├── attrs.xml
│       │           ├── defaults.xml
│       │           └── strings.xml
│       └── test/
│           └── java/
│               └── com/
│                   └── prolificinteractive/
│                       └── chandelier/
│                           └── ExampleUnitTest.java
└── settings.gradle
Download .txt
SYMBOL INDEX (98 symbols across 12 files)

FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/MainActivity.java
  class MainActivity (line 20) | public class MainActivity extends AppCompatActivity {
    method onCreate (line 23) | @Override
    method getAllSampleActivities (line 35) | private List<ResolveInfo> getAllSampleActivities() {
    class SampleAdapter (line 42) | private class SampleAdapter extends RecyclerView.Adapter<SampleAdapter...
      method SampleAdapter (line 47) | public SampleAdapter(Context context, List<ResolveInfo> resolveInfos) {
      method onCreateViewHolder (line 53) | @Override public SampleViewHolder onCreateViewHolder(ViewGroup paren...
      method onBindViewHolder (line 58) | @Override public void onBindViewHolder(SampleViewHolder holder, int ...
      method getItemCount (line 62) | @Override public int getItemCount() {
      class SampleViewHolder (line 66) | class SampleViewHolder extends RecyclerView.ViewHolder implements Vi...
        method SampleViewHolder (line 69) | public SampleViewHolder(View view) {
        method onClick (line 75) | @Override public void onClick(View v) {

FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/RecyclerViewActivity.java
  class RecyclerViewActivity (line 19) | public class RecyclerViewActivity extends AppCompatActivity {
    method onCreate (line 25) | @Override
    method onCreateOptionsMenu (line 54) | @Override
    method onOptionsItemSelected (line 61) | @Override
    class DummyAdapter (line 76) | class DummyAdapter extends RecyclerView.Adapter<DummyViewHolder>
      method onCreateViewHolder (line 79) | @Override
      method onBindViewHolder (line 88) | @Override
      method getItemCount (line 94) | @Override
      method onLongClick (line 99) | @Override public boolean onLongClick(View v) {
    class DummyViewHolder (line 105) | class DummyViewHolder extends RecyclerView.ViewHolder {
      method DummyViewHolder (line 110) | public DummyViewHolder(View view) {

FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/SampleApplication.java
  class SampleApplication (line 6) | public class SampleApplication extends Application {
    method onCreate (line 7) | @Override public void onCreate() {

FILE: app/src/main/java/com/prolificinteractive/chandelier/sample/WebViewActivity.java
  class WebViewActivity (line 19) | public class WebViewActivity extends AppCompatActivity {
    method onCreate (line 29) | @Override
    class GitHubAction (line 87) | static class GitHubAction extends Ornament {
      method GitHubAction (line 91) | public GitHubAction(@DrawableRes int drawableResId) {
      method execute (line 95) | @Override public void execute() {
      method setUrl (line 101) | public void setUrl(String url) {
      method setWebView (line 105) | public void setWebView(WebView webView) {
      class Builder (line 109) | static class Builder {
        method setDrawableResId (line 114) | public Builder setDrawableResId(@DrawableRes int resId) {
        method setUrl (line 119) | public Builder setUrl(@NonNull String url) {
        method setWebView (line 124) | public Builder setWebView(@NonNull WebView webView) {
        method build (line 129) | public GitHubAction build() {

FILE: app/src/test/java/com/prolificinteractive/chandelier/ExampleUnitTest.java
  class ExampleUnitTest (line 10) | public class ExampleUnitTest {
    method addition_isCorrect (line 11) | @Test

FILE: library/src/androidTest/java/com/prolificinteractive/chandelier/ApplicationTest.java
  class ApplicationTest (line 9) | public class ApplicationTest extends ApplicationTestCase<Application> {
    method ApplicationTest (line 10) | public ApplicationTest() {

FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/ChandelierLayout.java
  class ChandelierLayout (line 27) | public class ChandelierLayout extends ViewGroup {
    method onAnimationEnd (line 66) | @Override public void onAnimationEnd(Animation animation) {
    method applyTransformation (line 76) | @Override
    method ChandelierLayout (line 86) | public ChandelierLayout(Context context) {
    method ChandelierLayout (line 93) | public ChandelierLayout(Context context, AttributeSet attrs) {
    method createProgressView (line 124) | private void createProgressView() {
    method setOnActionSelectedListener (line 134) | public void setOnActionSelectedListener(OnActionListener listener) {
    method ensureTarget (line 138) | private void ensureTarget() {
    method onLayout (line 178) | @Override
    method onMeasure (line 201) | @Override
    method canChildScrollUp (line 238) | public boolean canChildScrollUp() {
    method onInterceptTouchEvent (line 253) | @Override
    method getMotionEventY (line 311) | private float getMotionEventY(MotionEvent ev, int activePointerId) {
    method requestDisallowInterceptTouchEvent (line 319) | @Override
    method moveActionLayout (line 330) | private void moveActionLayout(final float overscrollTop) {
    method finishAction (line 344) | private void finishAction(final float overscrollTop) {
    method onTouchEvent (line 357) | @Override
    method animateOffsetToStartPosition (line 439) | private void animateOffsetToStartPosition() {
    method moveToStart (line 449) | private void moveToStart(float interpolatedTime) {
    method setTargetOffsetTopAndBottom (line 453) | private void setTargetOffsetTopAndBottom(final int offset) {
    method onSecondaryPointerUp (line 459) | private void onSecondaryPointerUp(MotionEvent ev) {
    method populateActionItems (line 475) | public void populateActionItems(@Nullable final List<? extends Ornamen...
    method showActions (line 482) | public void showActions() {
    method hideActions (line 497) | public void hideActions() {
    method setAnimateToStartDuration (line 516) | public void setAnimateToStartDuration(final int duration) {
    type OnActionListener (line 524) | public interface OnActionListener {
      method onActionSelected (line 525) | void onActionSelected(int index, Ornament action);

FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/IdleScrollListener.java
  class IdleScrollListener (line 7) | class IdleScrollListener extends RecyclerView.OnScrollListener
    method setParent (line 12) | public void setParent(View view) {
    method onScrollStateChanged (line 16) | @Override public void onScrollStateChanged(AbsListView view, int scrol...
    method onScroll (line 20) | @Override public void onScroll(AbsListView view, int firstVisibleItem,...
    method onScrollStateChanged (line 25) | @Override public void onScrollStateChanged(RecyclerView recyclerView, ...
    method onScrolled (line 30) | @Override public void onScrolled(RecyclerView recyclerView, int dx, in...
    method isIdle (line 34) | public boolean isIdle() {

FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/Ornament.java
  class Ornament (line 8) | public class Ornament {
    method Ornament (line 11) | public Ornament(@DrawableRes final int drawableResId) {
    method execute (line 15) | public void execute() {

FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/OrnamentLayout.java
  class OrnamentLayout (line 29) | public class OrnamentLayout extends FrameLayout {
    method onAnimationStart (line 57) | @Override public void onAnimationStart(Animation animation) {
    method onAnimationEnd (line 61) | @Override public void onAnimationEnd(Animation animation) {
    method OrnamentLayout (line 70) | public OrnamentLayout(final Context context, final AttributeSet attrs) {
    method populateActionItems (line 137) | public void populateActionItems(int... drawablesResIds) {
    method populateActionItems (line 145) | public void populateActionItems(@Nullable final List<? extends Ornamen...
    method onMeasure (line 181) | @Override protected void onMeasure(int widthMeasureSpec, int heightMea...
    method onParentTouchEvent (line 186) | public void onParentTouchEvent(final MotionEvent ev) {
    method setSelectedIndex (line 270) | private void setSelectedIndex(final int newSelectedIndex) {
    method getInRange (line 297) | private int getInRange(final int value, final int min, final int max) {
    method getInRange (line 301) | private float getInRange(final float value, final float min, final flo...
    method getSelectedIndex (line 305) | public int getSelectedIndex() {
    method finishAction (line 309) | public void finishAction(Animation.AnimationListener mActionListener) {
    method onLayoutTranslated (line 314) | public void onLayoutTranslated(final float progress) {
    method getActionItem (line 318) | public Ornament getActionItem(int index) {

FILE: library/src/main/java/com/prolificinteractive/chandelier/widget/SimpleAnimationListener.java
  class SimpleAnimationListener (line 5) | class SimpleAnimationListener implements Animation.AnimationListener {
    method onAnimationStart (line 6) | @Override public void onAnimationStart(Animation animation) {
    method onAnimationEnd (line 10) | @Override public void onAnimationEnd(Animation animation) {
    method onAnimationRepeat (line 14) | @Override public void onAnimationRepeat(Animation animation) {

FILE: library/src/test/java/com/prolificinteractive/chandelier/ExampleUnitTest.java
  class ExampleUnitTest (line 10) | public class ExampleUnitTest {
    method addition_isCorrect (line 11) | @Test
Condensed preview — 57 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (88K chars).
[
  {
    "path": ".gitignore",
    "chars": 383,
    "preview": "# Eclipse\n.project\n.classpath\n.settings\n.checkstyle\n\n# Crashlytics\ncom_crashlytics_export_strings.xml\ncrashlytics-build."
  },
  {
    "path": ".travis.yml",
    "chars": 729,
    "preview": "language: android\n\njdk:\n - oraclejdk8\n\nandroid:\n  components:\n    - tools\n    - platform-tools\n    - build-tools-27.0.3\n"
  },
  {
    "path": "LICENSE",
    "chars": 1064,
    "preview": "Copyright (c) 2018 Prolific Interactive\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof"
  },
  {
    "path": "README.md",
    "chars": 2948,
    "preview": "<img src=\"/images/hero.jpg\"/>\n\nChandelier\n==========\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "chars": 972,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 27\n    buildToolsVersion \"27.0.3\"\n\n    defaultC"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 677,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 1626,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "app/src/main/java/com/prolificinteractive/chandelier/sample/MainActivity.java",
    "chars": 3022,
    "preview": "package com.prolificinteractive.chandelier.sample;\n\nimport android.content.ComponentName;\nimport android.content.Context"
  },
  {
    "path": "app/src/main/java/com/prolificinteractive/chandelier/sample/RecyclerViewActivity.java",
    "chars": 3667,
    "preview": "package com.prolificinteractive.chandelier.sample;\n\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatAct"
  },
  {
    "path": "app/src/main/java/com/prolificinteractive/chandelier/sample/SampleApplication.java",
    "chars": 276,
    "preview": "package com.prolificinteractive.chandelier.sample;\n\nimport android.app.Application;\nimport com.squareup.leakcanary.LeakC"
  },
  {
    "path": "app/src/main/java/com/prolificinteractive/chandelier/sample/WebViewActivity.java",
    "chars": 4400,
    "preview": "package com.prolificinteractive.chandelier.sample;\n\nimport android.os.Bundle;\nimport android.support.annotation.Drawable"
  },
  {
    "path": "app/src/main/res/drawable/al_github_selector.xml",
    "chars": 185,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_add.xml",
    "chars": 267,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item and"
  },
  {
    "path": "app/src/main/res/drawable/ic_check.xml",
    "chars": 271,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item and"
  },
  {
    "path": "app/src/main/res/drawable/ic_close.xml",
    "chars": 271,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item and"
  },
  {
    "path": "app/src/main/res/drawable/ic_github.xml",
    "chars": 337,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item and"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher.xml",
    "chars": 3904,
    "preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"48dp\"\n        android:height=\""
  },
  {
    "path": "app/src/main/res/drawable/ic_notifications.xml",
    "chars": 351,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item and"
  },
  {
    "path": "app/src/main/res/drawable/ic_pull_request.xml",
    "chars": 349,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<selector xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <item and"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 1056,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.design.widget.CoordinatorLayout\n    xmlns:android=\"http://schema"
  },
  {
    "path": "app/src/main/res/layout/activity_recycler_view.xml",
    "chars": 854,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xm"
  },
  {
    "path": "app/src/main/res/layout/activity_web_view.xml",
    "chars": 2321,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.design.widget.CoordinatorLayout\n    xmlns:android=\"http://schema"
  },
  {
    "path": "app/src/main/res/layout/content_main.xml",
    "chars": 827,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v7.widget.RecyclerView\n    xmlns:android=\"http://schemas.android"
  },
  {
    "path": "app/src/main/res/layout/content_recycler_view.xml",
    "chars": 503,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v7.widget.RecyclerView xmlns:android=\"http://schemas.android.com"
  },
  {
    "path": "app/src/main/res/layout/content_web_view.xml",
    "chars": 465,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<WebView\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns"
  },
  {
    "path": "app/src/main/res/layout/include_toolbar.xml",
    "chars": 554,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.v7.widget.Toolbar\n    android:id=\"@+id/toolbar\"\n    xmlns:androi"
  },
  {
    "path": "app/src/main/res/layout/item_dummy.xml",
    "chars": 886,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/swipe_content.xml",
    "chars": 783,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/menu/menu_main.xml",
    "chars": 389,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 485,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 380,
    "preview": "<resources>\n  <!-- Default screen margins, per the Android Design guidelines. -->\n  <dimen name=\"activity_horizontal_mar"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 265,
    "preview": "<resources>\n  <string name=\"app_name\">Chandelier</string>\n  <string name=\"action_settings\">Settings</string>\n\n  <string "
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 1363,
    "preview": "<resources>\n\n  <!-- Base application theme. -->\n  <style name=\"AppTheme\"\n      parent=\"Theme.AppCompat.Light.DarkActionB"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "chars": 358,
    "preview": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as s"
  },
  {
    "path": "app/src/test/java/com/prolificinteractive/chandelier/ExampleUnitTest.java",
    "chars": 327,
    "preview": "package com.prolificinteractive.chandelier;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work o"
  },
  {
    "path": "build.gradle",
    "chars": 559,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n  rep"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 230,
    "preview": "#Tue Apr 24 17:38:59 EDT 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradlew",
    "chars": 5080,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2404,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@r"
  },
  {
    "path": "library/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "library/build.gradle",
    "chars": 528,
    "preview": "apply plugin: 'com.android.library'\napply plugin: 'com.github.dcendents.android-maven'\n\ngroup = 'com.github.prolificinte"
  },
  {
    "path": "library/proguard-rules.pro",
    "chars": 668,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "library/src/androidTest/java/com/prolificinteractive/chandelier/ApplicationTest.java",
    "chars": 357,
    "preview": "package com.prolificinteractive.chandelier;\n\nimport android.app.Application;\nimport android.test.ApplicationTestCase;\n\n/"
  },
  {
    "path": "library/src/main/AndroidManifest.xml",
    "chars": 273,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.prolificinteractive.chandelier\">\n\n"
  },
  {
    "path": "library/src/main/java/com/prolificinteractive/chandelier/widget/ChandelierLayout.java",
    "chars": 17805,
    "preview": "package com.prolificinteractive.chandelier.widget;\n\nimport android.content.Context;\nimport android.content.res.Resources"
  },
  {
    "path": "library/src/main/java/com/prolificinteractive/chandelier/widget/IdleScrollListener.java",
    "chars": 1253,
    "preview": "package com.prolificinteractive.chandelier.widget;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.view.V"
  },
  {
    "path": "library/src/main/java/com/prolificinteractive/chandelier/widget/Ornament.java",
    "chars": 387,
    "preview": "package com.prolificinteractive.chandelier.widget;\n\nimport android.support.annotation.DrawableRes;\n\n/**\n * Create a list"
  },
  {
    "path": "library/src/main/java/com/prolificinteractive/chandelier/widget/OrnamentLayout.java",
    "chars": 11588,
    "preview": "package com.prolificinteractive.chandelier.widget;\n\nimport android.content.Context;\nimport android.content.res.Resources"
  },
  {
    "path": "library/src/main/java/com/prolificinteractive/chandelier/widget/SimpleAnimationListener.java",
    "chars": 375,
    "preview": "package com.prolificinteractive.chandelier.widget;\n\nimport android.view.animation.Animation;\n\nclass SimpleAnimationListe"
  },
  {
    "path": "library/src/main/res/drawable/item_white_circle.xml",
    "chars": 184,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\" android:shape=\""
  },
  {
    "path": "library/src/main/res/values/attrs.xml",
    "chars": 743,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <declare-styleable name=\"ChandelierLayout\">\n    <!-- Action Layout "
  },
  {
    "path": "library/src/main/res/values/defaults.xml",
    "chars": 337,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <dimen name=\"default_elevation\">4dp</dimen>\n  <dimen name=\"default_"
  },
  {
    "path": "library/src/main/res/values/strings.xml",
    "chars": 71,
    "preview": "<resources>\n  <string name=\"app_name\">Chandelier</string>\n</resources>\n"
  },
  {
    "path": "library/src/test/java/com/prolificinteractive/chandelier/ExampleUnitTest.java",
    "chars": 317,
    "preview": "package com.prolificinteractive.chandelier;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * To work o"
  },
  {
    "path": "settings.gradle",
    "chars": 59,
    "preview": "include ':app', ':library'\n\nrootProject.name = 'chandelier'"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the prolificinteractive/swipe-action-layout GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 57 files (78.9 KB), approximately 21.7k tokens, and a symbol index with 98 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!