Comments (8)
DialogsList.setOnDialogLongClickListener
should give you a Dialog instance of the dialog the user is pressing. So, having that instance already you should invoke DialogsList.getLayoutManager
to get the LinearLayoutManager instance held by the RecyclerView that DialogsList extends from. Once you have the reference to that LayoutManager it's easy, you should invoke LayoutManager.findViewByPosition
which will return the view you are looking for.
from chatkit.
How can I get the position of that dialog instance, as dialog adapter does not have that method? kindly help!
from chatkit.
DialogsListAdapter doesn't seem to provide a getter for the list of items you need, so you either keep track of your actions (by having a secondary list of DIALOG synchronized with the one held inside the DialogsListAdapter) or fork this repo and add a getItems()
method on the DialogsListAdapter class. Having that list of DIALOG you'll be able to call List.indexOf
to get the position.
Check the code of DialogsListAdapter and read the RecyclerView.adapter and LinearLayoutManager official documentation. All you need is in there, you just need to think how to use it.
from chatkit.
Thanks, it worked!
from chatkit.
I already created a PR to allow the users to retrieve the current position of a certain dialog. As soon as it gets merged (if it is) you can get back to relay on the official implementation of this library.
from chatkit.
Hi @mubtadasyed !
Starting from version 0.2.1
you can use OnMessageViewClickListener
and OnMessageViewLongClickListener
, which has the same behavior as previous listeners, but also returns view. Hope it helps you.
Best regards, Alexander.
from chatkit.
Hey @troy379, the main reason for creating the PR was because providing listeners can be very limiting for the developer. For example, how does the developer implement a swipe to delete functionality based on those listeners? IMHO, having the possibility to retrieve the view itself (through RecyclerView and RecyclerView.Adapter methods) is much more flexible than providing a listener itself.
from chatkit.
#32 merged. Thanks @mradzinski
from chatkit.
Related Issues (20)
- get item by id
- message deleting issue HOT 4
- Programmically change the Icon of MessageInput's Button
- Activate submit button on empty EditText field of MessageInput HOT 2
- Message time formatting (not header date formatting)
- MessageListAdapter addToStart method always add message on top of chat (instead of bottom of list) HOT 1
- Unable to create custom holder HOT 1
- Could not GET 'https://google.bintray.com/flexbox-layout/com/google/android/flexbox/1.0.0/flexbox-1.0.0.pom'. HOT 6
- how to apply readmore text?
- How to align bubbles on the top of the screen when there are only a few of them?
- Update flexbox to 3.0.0 HOT 3
- Adding message history through addToStart reverses messages' order
- Display date or "delivered" only on last message
- Can we display sender name on chat message bubble ?
- Could not resolve com.github.stfalcon-studio:Chatkit:v0.4.1. HOT 7
- Strange behavior with Custom Voice ViewHolder HOT 2
- Is it compatible with jetpack compose
- Tg HOT 1
- MessageInput Error: Application Crashes on launching DefaultMessageActivity on setcontentview method
- How to attach images on chat?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatkit.