mirror of
https://github.com/oxen-io/session-android.git
synced 2023-12-14 02:53:01 +01:00
* feat: Menu redesign * Add bottomsheet * Handle default peek height * Smooth out setting peek height * Move contacts prep to util * Dialog layout tweaks * Contact grouping tweaks * Add new message dialog * Add public key input delegate * Add create group dialog * Add join community dialog * Handle dialog back navigation * Enter community url tab tweaks * Scan QR code tab refactor * Scan qr code refactor * Direct and community tabs refactor * Add session id copy context menu item * Set dialog background colours * Set full dialog background colour * Minor tweaks * Add closed group contact search * Cleanup * Add content descriptions * Resize community chips * Fix new conversation screen paddings * Fix fade in/out of join community screen * Prevent creating conversation with empty public key * Resize and position create group loader * Fix back nav after creating direct message conversation * Fix inter-screen transitions * Fix new conversation background colours * Fix background colours * Rename contact list header for clarity * Bug fixes * Enable scrolling of Enter Session ID tab of the new message dialog * Minor refactor * Switch to child fragment manager * Fix member search on create group screen Co-authored-by: charles <charles@oxen.io>
24 lines
907 B
Kotlin
24 lines
907 B
Kotlin
package org.thoughtcrime.securesms.dms
|
|
|
|
import androidx.fragment.app.Fragment
|
|
import androidx.viewpager2.adapter.FragmentStateAdapter
|
|
import org.thoughtcrime.securesms.util.ScanQRCodeWrapperFragment
|
|
import org.thoughtcrime.securesms.util.ScanQRCodeWrapperFragmentDelegate
|
|
|
|
class NewMessageFragmentAdapter(
|
|
private val parentFragment: Fragment,
|
|
private val enterPublicKeyDelegate: EnterPublicKeyDelegate,
|
|
private val scanPublicKeyDelegate: ScanQRCodeWrapperFragmentDelegate
|
|
) : FragmentStateAdapter(parentFragment) {
|
|
|
|
override fun getItemCount(): Int = 2
|
|
|
|
override fun createFragment(position: Int): Fragment {
|
|
return when (position) {
|
|
0 -> EnterPublicKeyFragment().apply { delegate = enterPublicKeyDelegate }
|
|
1 -> ScanQRCodeWrapperFragment().apply { delegate = scanPublicKeyDelegate }
|
|
else -> throw IllegalStateException()
|
|
}
|
|
}
|
|
|
|
} |