-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the recycler view library. Added a simple realization of 'rec…
…yclerview-selection' library.| #793
- Loading branch information
Showing
9 changed files
with
160 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
FlowCrypt/src/main/java/com/flowcrypt/email/ui/adapter/selection/MsgItemDetailsLookup.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* © 2016-2020 FlowCrypt Limited. Limitations apply. Contact [email protected] | ||
* Contributors: DenBond7 | ||
*/ | ||
|
||
package com.flowcrypt.email.ui.adapter.selection | ||
|
||
import android.view.MotionEvent | ||
import androidx.recyclerview.selection.ItemDetailsLookup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.flowcrypt.email.ui.adapter.MsgsPagedListAdapter | ||
|
||
/** | ||
* @author Denis Bondarenko | ||
* Date: 1/5/20 | ||
* Time: 2:48 PM | ||
* E-mail: [email protected] | ||
*/ | ||
class MsgItemDetailsLookup(private val recyclerView: RecyclerView) : ItemDetailsLookup<Long>() { | ||
override fun getItemDetails(e: MotionEvent): ItemDetails<Long>? { | ||
return recyclerView.findChildViewUnder(e.x, e.y)?.let { | ||
(recyclerView.getChildViewHolder(it) as? MsgsPagedListAdapter.BaseViewHolder)?.getItemDetails() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ © 2016-2019 FlowCrypt Limited. Limitations apply. Contact [email protected] | ||
~ Contributors: DenBond7 | ||
--> | ||
|
||
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:drawable="@color/silver" android:state_activated="true" /> | ||
</selector> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters