https://github.com/zhanzengyu/wechatpopupwindowkotlin
Kotlin for WechatPopupWindow
https://github.com/zhanzengyu/wechatpopupwindowkotlin
kotlin kotlin-android popupwindow wechat wechat-app
Last synced: 7 months ago
JSON representation
Kotlin for WechatPopupWindow
- Host: GitHub
- URL: https://github.com/zhanzengyu/wechatpopupwindowkotlin
- Owner: zhanzengyu
- License: apache-2.0
- Created: 2020-07-30T11:59:32.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-30T12:01:37.000Z (about 5 years ago)
- Last Synced: 2025-01-08T09:20:56.267Z (9 months ago)
- Topics: kotlin, kotlin-android, popupwindow, wechat, wechat-app
- Language: Kotlin
- Homepage: https://github.com/nesger/WechatPopupWindow
- Size: 152 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WechatPopupWindow
高仿微信聊天界面长按弹框样式## Run Result
## Usage
1.
```
implementation 'com.zengyu:popupwindowlist:1.0.0'
```
2. do as the follow sample example show.```java
private PopupWindowList mPopupWindowList;
private void showPopWindows(View view){
List 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](https://github.com/nesger/WechatPopupWindow/blob/master/app/src/main/java/com/nesger/wechatpopupwindow/PopupWindowList.java).Any problem you can create issue for me.
