GithubHelp home page GithubHelp logo

thisleo / anylayer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goweii/anylayer

0.0 1.0 0.0 1.19 MB

用于替代Android自带Dialog和PopupWindow

Home Page: https://github.com/goweii/AnyLayer

Java 100.00%

anylayer's Introduction

AnyLayer

用于替代Android自带Dialog和PopupWindow

GitHub主页

Demo下载

简介

  • 链式调用
  • 可实现dialog效果
  • 可实现popupWindow效果
  • 可实现悬浮菜单效果
  • 可自定义数据绑定
  • 可自定义进出场动画
  • 可自由控制显示大小和位置
  • 可自定义背景变暗或者显示图片
  • 可一行代码实现背景高斯模糊
  • 占用区域不会超过当前Activity,避免导航栏遮挡问题

截图

截图效果较差,建议下载Demo体验

anylayer.gif

使用说明

集成

  • 添加jitpack库

// build.gradle(Project:)
allprojects {
    repositories {
        ...
            maven { url 'https://www.jitpack.io' }
    }
}
// build.gradle(Module:)
dependencies {
    implementation 'com.github.goweii:AnyLayer:最新版本号'
}

调用

AnyLayer.with(MainActivity.this)
    .contentView(R.layout.dialog_test_3)
    .backgroundColorRes(R.color.dialog_bg)
    .gravity(Gravity.BOTTOM)
    .cancelableOnTouchOutside(true)
    .cancelableOnClickKeyBack(true)
    .contentAnim(new AnyLayer.IAnim() {
        @Override
        public long inAnim(View content) {
        AnimHelper.startBottomInAnim(content, ANIM_DURATION);
           return ANIM_DURATION;
        }

        @Override
        public long outAnim(View content) {
            AnimHelper.startBottomOutAnim(content, ANIM_DURATION);
            return ANIM_DURATION;
        }
    })
    .onClick(R.id.fl_dialog_no, new AnyLayer.OnLayerClickListener() {
        @Override
        public void onClick(AnyLayer AnyLayer, View v) {
            AnyLayer.dismiss();
        }
    })
    .show();

anylayer's People

Contributors

goweii avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.