GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - shiloudong/pull-back-layout: Pull down to finish an Activity.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

6 Commits
6 Commits

Folders and files

NameName
Last commit message
Last commit date
gradle/wrapper
gradle/wrapper
 
 
library
library
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
screenshot.gif
screenshot.gif
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

Pull Back Layout

Pull down to finish an Activity.

Download

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

dependencies {
    // ... support library ...
    // ...
    compile 'com.github.oxoooo:pull-back-layout:1.0.1'
}

Usage

You may refer to one of our apps that already using this library: mr-mantou-android

  1. Make your Activity translucent by adding these two lines to your theme:
<style name="AppTheme" ...>
    <!-- ... -->

    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:windowIsTranslucent">true</item>

    <!-- also translucent system ui -- suggested but not required -->
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
</style>
  1. Wraps ooo.oxo.library.widget.PullBackLayout around your ImageView or ViewPager:
<ooo.oxo.library.widget.PullBackLayout
    android:id="@+id/puller"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</ooo.oxo.library.widget.PullBackLayout>
  1. Set a callback:
public class ViewerActivity extends AppCompatActivity implements PullBackLayout.Callback {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        /* ... */
        puller.setCallback(this);
    }

    @Override
    public void onPullStart() {
        // fade out Action Bar ...
        // show Status Bar ...
    }

    @Override
    public void onPull(float progress) {
        // set the opacity of the window's background
    }

    @Override
    public void onPullCancel() {
        // fade in Action Bar
    }

    @Override
    public void onPullComplete() {
        supportFinishAfterTransition();
    }

}

License

MIT License

About

Pull down to finish an Activity.

www.oxo.ooo

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.