Code Monkey home page Code Monkey logo

wechatpopupwindow's Introduction

WechatPopupWindow

高仿微信聊天界面长按弹框样式

Run Result

run result

Usage

implementation 'com.zengyu:popupwindowlist:1.0.0'
  1. do as the follow sample example show.
private PopupWindowList mPopupWindowList;
private void showPopWindows(View view){
    List<String> dataList = new ArrayList<>();
    for(int i = 0; i < 13; i++){
        dataList.add(String.valueOf(i));
    }
    if (mPopupWindowList == null){
        mPopupWindowList = new PopupWindowList(view.getContext());
    }
    mPopupWindowList.setAnchorView(view);
    mPopupWindowList.setItemData(dataList);
    mPopupWindowList.setModal(true);
    mPopupWindowList.show();
    mPopupWindowList.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Log.e(TAG, "click position="+position);
            mPopupWindowList.hide();
        }
    });
}

NOTE

setAnchorView() and setItemData() is must set, or will throw Exception.

  • setAnchorView() set the view which your popwindow show.
  • setItemData() set the listview adapter data.
  • setModal() means whether make popwindow focus.
  • setOnItemClickListener() set item click listener for popwindow.
  • setPopupWindowWidth() set PopupWindow width.
  • setPopupWindowHeight() set PopupWindow height.
  • setPopAnimStyle() set PopupWindow anim style.

EXTRA

If you don't like the simple listview style, you can customize the PopupWindowList.java.

Any problem you can create issue for me.

wechatpopupwindow's People

Contributors

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