mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-14 06:45:38 +00:00
Clean up join open group screen
This commit is contained in:
@@ -40,6 +40,7 @@ import org.thoughtcrime.securesms.loki.fragments.ScanQRCodeWrapperFragmentDelega
|
||||
import org.thoughtcrime.securesms.loki.protocol.MultiDeviceProtocol
|
||||
import org.thoughtcrime.securesms.loki.viewmodel.DefaultGroupsViewModel
|
||||
import org.thoughtcrime.securesms.loki.viewmodel.State
|
||||
import java.util.*
|
||||
|
||||
class JoinPublicChatActivity : PassphraseRequiredActionBarActivity(), ScanQRCodeWrapperFragmentDelegate {
|
||||
private val adapter = JoinPublicChatActivityAdapter(this)
|
||||
@@ -179,6 +180,7 @@ class EnterChatURLFragment : Fragment() {
|
||||
joinPublicChatButton.setOnClickListener { joinPublicChatIfPossible() }
|
||||
viewModel.defaultRooms.observe(viewLifecycleOwner) { state ->
|
||||
defaultRoomsContainer.isVisible = state is State.Success
|
||||
defaultRoomsLoaderContainer.isVisible = state is State.Loading
|
||||
defaultRoomsLoader.isVisible = state is State.Loading
|
||||
when (state) {
|
||||
State.Loading -> {
|
||||
@@ -210,7 +212,6 @@ class EnterChatURLFragment : Fragment() {
|
||||
chip.setOnClickListener {
|
||||
(requireActivity() as JoinPublicChatActivity).joinPublicChatIfPossible(defaultGroup.joinURL)
|
||||
}
|
||||
|
||||
defaultRoomsGridLayout.addView(chip)
|
||||
}
|
||||
if ((groups.size and 1) != 0) { // This checks that the number of rooms is even
|
||||
@@ -222,7 +223,7 @@ class EnterChatURLFragment : Fragment() {
|
||||
private fun joinPublicChatIfPossible() {
|
||||
val inputMethodManager = requireContext().getSystemService(BaseActionBarActivity.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
inputMethodManager.hideSoftInputFromWindow(chatURLEditText.windowToken, 0)
|
||||
val chatURL = chatURLEditText.text.trim().toString().toLowerCase()
|
||||
val chatURL = chatURLEditText.text.trim().toString().toLowerCase(Locale.US)
|
||||
(requireActivity() as JoinPublicChatActivity).joinPublicChatIfPossible(chatURL)
|
||||
}
|
||||
// endregion
|
||||
|
||||
Reference in New Issue
Block a user