Giter Site home page Giter Site logo

custompopwindow's Introduction

基于通用Popwindow

平时使用Popwindow的频率还是蛮高的,为了避免每次使用都单独创建浪费时间,浪费精力所以封装了一个通用的Popwindow 使用效果图
mahua

使用方法:

 CustomPopupWindow customPopupWindow = new CustomPopupWindow.Builder()
                        .with(MainActivity.this)
                        .setContentView(R.layout.pop_view)
                        .setwidth(100)
                        .setheight(100)
                        .setBackGroudAlpha(MainActivity.this, 0.7f)
                        .setAnimationStyle(CustomPopupWindow.Builder.STYLE2)
                        .setFouse(true)
                        .setOutSideCancel(true)
                        .builder().showAsLaction(view, Gravity.CENTER, 0, 0);
方法名 功能
Builder().with(Context context) 初始化Builder对象
setContentView(int contentviewid) 设置Popwindow 布局
setwidth(int width) 设置宽度
setheight(int height) 设置高度
setBackGroudAlpha(Activity activity, float alpha) 设置Popwindow背景颜色
setAnimationStyle(int animstyle) 设置展示动画
setFouse(boolean fouse) 聚焦Popwindow
setOutSideCancel(boolean outsidecancel) 是否点击Popwindow以外关闭Popwindow
builder() 初始化Popwindow
showAsLaction(int rootviewid, int gravity, int x, int y) 显示Popwindow
showAtLocation(int targetviewId, int gravity, int offx, int offy) 显示Popwindow
setOnFocusListener(int viewid, View.OnFocusChangeListener listener) 根据id设置焦点监听
setOnClickListener(int viewid, View.OnClickListener listener) 根据id设置点击事件监听
getItemView(int viewid) 根据id获取view
dismiss() 关闭pop

custompopwindow's People

Contributors

faneq avatar

Stargazers

 avatar

Watchers

 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.