kandi background
Explore Kits

SwipeRecyclerView | RecyclerView侧滑菜单,Item拖拽,滑动删除Item,自动加载更多,HeaderView,FooterView,Item分组黏贴。 | RecyclerView library

 by   yanzhenjie Java Version: Current License: Apache-2.0

 by   yanzhenjie Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | SwipeRecyclerView Summary

SwipeRecyclerView is a Java library typically used in User Interface, RecyclerView applications. SwipeRecyclerView has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. However SwipeRecyclerView has 2 bugs. You can download it from GitHub, Maven.
:melon: RecyclerView侧滑菜单,Item拖拽,滑动删除Item,自动加载更多,HeaderView,FooterView,Item分组黏贴。
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • SwipeRecyclerView has a medium active ecosystem.
  • It has 5047 star(s) with 1055 fork(s). There are 105 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 94 open issues and 205 have been closed. On average issues are closed in 68 days. There are 2 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of SwipeRecyclerView is current.
SwipeRecyclerView Support
Best in #RecyclerView
Average in #RecyclerView
SwipeRecyclerView Support
Best in #RecyclerView
Average in #RecyclerView

quality kandi Quality

  • SwipeRecyclerView has 2 bugs (0 blocker, 0 critical, 0 major, 2 minor) and 383 code smells.
SwipeRecyclerView Quality
Best in #RecyclerView
Average in #RecyclerView
SwipeRecyclerView Quality
Best in #RecyclerView
Average in #RecyclerView

securitySecurity

  • SwipeRecyclerView has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • SwipeRecyclerView code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
SwipeRecyclerView Security
Best in #RecyclerView
Average in #RecyclerView
SwipeRecyclerView Security
Best in #RecyclerView
Average in #RecyclerView

license License

  • SwipeRecyclerView is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
SwipeRecyclerView License
Best in #RecyclerView
Average in #RecyclerView
SwipeRecyclerView License
Best in #RecyclerView
Average in #RecyclerView

buildReuse

  • SwipeRecyclerView releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • SwipeRecyclerView saves you 6447 person hours of effort in developing the same functionality from scratch.
  • It has 13406 lines of code, 1118 functions and 214 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
SwipeRecyclerView Reuse
Best in #RecyclerView
Average in #RecyclerView
SwipeRecyclerView Reuse
Best in #RecyclerView
Average in #RecyclerView
Top functions reviewed by kandi - BETA

kandi has reviewed SwipeRecyclerView and discovered the below as its top functions. This is intended to give you an instant insight into SwipeRecyclerView implemented functionality, and help decide if they suit your requirements.

  • Get the SwipeMenuView for a given item
  • Draws a vertical corner of a view
  • Initializes the RecyclerView .
  • Perform the sticky touching of the sticky view
  • Override this method to adjust the current state of the view to be dragged .
  • Creates the menu .
  • Dispatches for the content view .
  • Inits the tab layout .
  • Get the item position from a child position .
  • Initializes the RecyclerView .

SwipeRecyclerView Key Features

:melon: RecyclerView侧滑菜单,Item拖拽,滑动删除Item,自动加载更多,HeaderView,FooterView,Item分组黏贴。

如何使用

copy iconCopydownload iconDownload
implementation 'com.yanzhenjie.recyclerview:support:1.3.2'

加入布局

copy iconCopydownload iconDownload
<com.yanzhenjie.recyclerview.SwipeRecyclerView
    .../>

ItemDecoration

copy iconCopydownload iconDownload
// 默认构造,传入颜色即可。
ItemDecoration itemDecoration = new DefaultDecoration(color);

// 或者:颜色,宽,高,最后一个参数是不画分割线的ViewType,可以传入多个。
itemDecoration = new DefaultDecoration(color, width, height, excludeViewType);

// 或者:例如下面的123都是不画分割线的ViewType:
itemDecoration = new DefaultDecoration(color, width, height, 1, 2, 3);

SwipeRecyclerView recyclerView = ...;
recyclerView.setDecoration(itemDecoration);

Item点击监听

copy iconCopydownload iconDownload
recyclerView.setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(View view, int position) {
        // TODO...
    }
});

侧滑菜单

copy iconCopydownload iconDownload
// 设置监听器。
swipeRecyclerView.setSwipeMenuCreator(mSwipeMenuCreator);

// 创建菜单:
SwipeMenuCreator mSwipeMenuCreator = new SwipeMenuCreator() {
    @Override
    public void onCreateMenu(SwipeMenu leftMenu, SwipeMenu rightMenu, int position) {
        SwipeMenuItem deleteItem = new SwipeMenuItem(mContext)
            ...; // 各种文字和图标属性设置。
        leftMenu.addMenuItem(deleteItem); // 在Item左侧添加一个菜单。

        SwipeMenuItem deleteItem = new SwipeMenuItem(mContext)
            ...; // 各种文字和图标属性设置。
        leftMenu.addMenuItem(deleteItem); // 在Item右侧添加一个菜单。
        
        // 注意:哪边不想要菜单,那么不要添加即可。
    }
};

// 菜单点击监听。
swipeRecyclerView.setOnItemMenuClickListener(mItemMenuClickListener);

OnItemMenuClickListener mItemMenuClickListener = new OnItemMenuClickListener() {
    @Override
    public void onItemClick(SwipeMenuBridge menuBridge, int position) {
        // 任何操作必须先关闭菜单,否则可能出现Item菜单打开状态错乱。
        menuBridge.closeMenu();
        
        // 左侧还是右侧菜单:
        int direction = menuBridge.getDirection();
        // 菜单在Item中的Position:
        int menuPosition = menuBridge.getPosition();
    }
};

侧滑删除和拖拽

copy iconCopydownload iconDownload
recyclerView.setLongPressDragEnabled(true); // 拖拽排序,默认关闭。
recyclerView.setItemViewSwipeEnabled(true); // 侧滑删除,默认关闭。

HeaderView和FooterView

copy iconCopydownload iconDownload
addHeaderView(View); // 添加HeaderView。
removeHeaderView(View); // 移除HeaderView。
addFooterView(View); // 添加FooterView。
removeFooterView(View); // 移除FooterView。
getHeaderItemCount(); // 获取HeaderView个数。
getFooterItemCount(); // 获取FooterView个数。
getItemViewType(int); // 获取Item的ViewType,包括HeaderView、FooterView、普通ItemView。

加载更多

copy iconCopydownload iconDownload
RecyclerView recyclerView = ...;
...

recyclerView.useDefaultLoadMore(); // 使用默认的加载更多的View。
recyclerView.setLoadMoreListener(mLoadMoreListener); // 加载更多的监听。

LoadMoreListener mLoadMoreListener = new LoadMoreListener() {
    @Override
    public void onLoadMore() {
        // 该加载更多啦。
        
        ... // 请求数据,并更新数据源操作。
        mMainAdapter.notifyDataSetChanged();

        // 数据完更多数据,一定要调用这个方法。
        // 第一个参数:表示此次数据是否为空。
        // 第二个参数:表示是否还有更多数据。
        mRecyclerView.loadMoreFinish(false, true);

        // 如果加载失败调用下面的方法,传入errorCode和errorMessage。
        // errorCode随便传,你自定义LoadMoreView时可以根据errorCode判断错误类型。
        // errorMessage是会显示到loadMoreView上的,用户可以看到。
        // mRecyclerView.loadMoreError(0, "请求网络失败");
    }
};

License

copy iconCopydownload iconDownload
Copyright 2019 Zhenjie Yan

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Community Discussions

Trending Discussions on User Interface
  • Correct way to run two Tk() mainloops independently, with second being started from first script?
  • Xcode 13 - "Button" title not disappearing
  • ListView doesn't separate objects from doc
  • Change color of child button element regardless of box decoration background color
  • Stop child NSWindow disappearing when moved to another screen
  • How to open a new MDI sub-window in PyQt5?
  • TS7006: Parameter 'event' implicitly has an 'any' type
  • How to dynamically define Headers and Settings for UWP NavigationView's menu, using C++/winRT?
  • Android Jetpack Compose: Keyboard changing from numeric to alphabets after modifying input text
  • Achieve Unique Column Width for each Cell in Different Rows with a GridPane?
Trending Discussions on User Interface

QUESTION

Correct way to run two Tk() mainloops independently, with second being started from first script?

Asked 2022-Apr-18 at 02:03

script_a.py

from tkinter import *
from script_b import test

root = Tk()

var1 = stuff
var2 = stuff

def start_scriptb():
    test([var1, var2])

Button(root, text="Start", 
command=start_scriptb)


root.mainloop()

script_b.py

from tkinter import *


def test(x):
    main = Tk()
    Label(main, text=x)
    Button(main, text="Exit", command=main.destroy())

    main.mainloop() 

This is a very basic version of what I'm trying to achieve. I actually am spawning a progress window that uses subprocess.Popen in script 2 with the passed through variables from script one and viewing the progess through a scrolled text widget on the 2nd program. I'm trying to spawn a new process, independent from the root GUI each time that button is hit from script_a.

It works fine in my tests so far, but I wanted to see if this could cause any issues or if this is actually spawning two processes?

I know there should only be one Tk() per process.

Using a TopLevel() window to show the progress works fine with the threading module, but the TopLevel() window will freeze as well as root (and any other open TopLevels()) if root is doing any sort of processing that takes any length of time.

ANSWER

Answered 2022-Apr-18 at 02:03

With many hours of testing, I did have success in running two Tk() loops, but it had potential to be problematic, as "Bryan Oakley" had posted in many threads about.

Ultimately, I decided when I was in need of running something alone, I'd start my GUI with arguments and process it in an entirely new process instead of passing any arguments directly. Seems like a safer option.

Source https://stackoverflow.com/questions/71880097

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install SwipeRecyclerView

You can download it from GitHub, Maven.
You can use SwipeRecyclerView like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the SwipeRecyclerView component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.