Skip to content

Commit e3fd71d

Browse files
committed
fix to be able to enter open conversation name
without this change the continue button was broken (no room token -> response 404 for getRoom. But for creating an open conversation getRoom should not be executed at all) and the emoji button was missing Signed-off-by: Marcel Hibbe <[email protected]>
1 parent 25908eb commit e3fd71d

File tree

1 file changed

+37
-25
lines changed

1 file changed

+37
-25
lines changed

app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.kt

+37-25
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,28 @@ class EntryMenuController(args: Bundle) :
105105
binding?.okButton?.alpha = OPACITY_BUTTON_DISABLED
106106
}
107107
}
108+
109+
emojiPopup = binding?.let {
110+
EmojiPopup(
111+
rootView = view,
112+
editText = it.textEdit,
113+
onEmojiPopupShownListener = {
114+
viewThemeUtils.platform.colorImageView(it.smileyButton, ColorRole.PRIMARY)
115+
},
116+
onEmojiPopupDismissListener = {
117+
it.smileyButton.imageTintList = ColorStateList.valueOf(
118+
ResourcesCompat.getColor(
119+
resources!!,
120+
R.color.medium_emphasis_text,
121+
context.theme
122+
)
123+
)
124+
},
125+
onEmojiClickListener = {
126+
binding?.textEdit?.editableText?.append(" ")
127+
}
128+
)
129+
}
108130
}
109131

110132
override fun onViewBound(view: View) {
@@ -113,16 +135,28 @@ class EntryMenuController(args: Bundle) :
113135
currentUser = userManager.currentUser.blockingGet()
114136

115137
if (operation == ConversationOperationEnum.OPS_CODE_GET_AND_JOIN_ROOM) {
116-
var labelText = ""
117-
labelText = resources!!.getString(R.string.nc_conversation_link)
118138
binding?.textEdit?.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_URI
119139

120140
textEditAddChangedListener()
121141

122142
binding?.textInputLayout?.let { viewThemeUtils.material.colorTextInputLayout(it) }
123143
binding?.okButton?.let { viewThemeUtils.material.colorMaterialButtonText(it) }
124144

125-
binding?.textInputLayout?.hint = labelText
145+
binding?.textInputLayout?.hint = resources!!.getString(R.string.nc_conversation_link)
146+
147+
binding?.textInputLayout?.requestFocus()
148+
149+
binding?.smileyButton?.setOnClickListener { onSmileyClick() }
150+
binding?.okButton?.setOnClickListener { onOkButtonClick() }
151+
} else if (operation == ConversationOperationEnum.OPS_CODE_INVITE_USERS) {
152+
binding?.textEdit?.inputType = InputType.TYPE_CLASS_TEXT
153+
154+
textEditAddChangedListener()
155+
binding?.smileyButton?.visibility = View.VISIBLE
156+
157+
binding?.textInputLayout?.let { viewThemeUtils.material.colorTextInputLayout(it) }
158+
binding?.okButton?.let { viewThemeUtils.material.colorMaterialButtonText(it) }
159+
126160
binding?.textInputLayout?.requestFocus()
127161

128162
binding?.smileyButton?.setOnClickListener { onSmileyClick() }
@@ -162,32 +196,10 @@ class EntryMenuController(args: Bundle) :
162196

163197
var labelText = ""
164198
when (operation) {
165-
ConversationOperationEnum.OPS_CODE_INVITE_USERS,
166199
ConversationOperationEnum.OPS_CODE_RENAME_ROOM -> {
167200
labelText = resources!!.getString(R.string.nc_call_name)
168201
binding?.textEdit?.inputType = InputType.TYPE_CLASS_TEXT
169202
binding?.smileyButton?.visibility = View.VISIBLE
170-
emojiPopup = binding?.let {
171-
EmojiPopup(
172-
rootView = view,
173-
editText = it.textEdit,
174-
onEmojiPopupShownListener = {
175-
viewThemeUtils.platform.colorImageView(it.smileyButton, ColorRole.PRIMARY)
176-
},
177-
onEmojiPopupDismissListener = {
178-
it.smileyButton.imageTintList = ColorStateList.valueOf(
179-
ResourcesCompat.getColor(
180-
resources!!,
181-
R.color.medium_emphasis_text,
182-
context.theme
183-
)
184-
)
185-
},
186-
onEmojiClickListener = {
187-
binding?.textEdit?.editableText?.append(" ")
188-
}
189-
)
190-
}
191203
}
192204

193205
ConversationOperationEnum.OPS_CODE_JOIN_ROOM -> {

0 commit comments

Comments
 (0)