Merge pull request #4278 from nextcloud/set_empty_status_message

Set empty status message
This commit is contained in:
Sowjanya Kota 2024-09-27 12:40:20 +02:00 committed by GitHub
commit f44885bd78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 12 deletions

View File

@ -58,7 +58,7 @@ data class Conversation(
@JsonField(name = ["actorType"])
var actorType: String = "",
var password: String? = null, //check if this can be removed.Does not belong to api response but is used internally?
var password: String? = null, // check if this can be removed.Does not belong to api response but is used internally?
@JsonField(name = ["isFavorite"])
var favorite: Boolean = false,

View File

@ -22,7 +22,6 @@ import android.widget.AdapterView.OnItemSelectedListener
import android.widget.ArrayAdapter
import android.widget.ImageView
import android.widget.TextView
import androidx.core.widget.doAfterTextChanged
import androidx.fragment.app.DialogFragment
import androidx.recyclerview.widget.LinearLayoutManager
import autodagger.AutoInjector
@ -177,6 +176,10 @@ class SetStatusDialogFragment :
setupGeneralStatusOptions()
if (currentStatus?.icon == null) {
binding.emoji.setText(getString(R.string.default_emoji))
}
binding.clearStatus.setOnClickListener { clearStatus() }
binding.setStatus.setOnClickListener { setStatusMessage() }
binding.emoji.setOnClickListener { openEmojiPopup() }
@ -214,10 +217,6 @@ class SetStatusDialogFragment :
viewThemeUtils.material.colorMaterialButtonPrimaryTonal(binding.setStatus)
viewThemeUtils.material.colorTextInputLayout(binding.customStatusInputContainer)
binding.customStatusInput.doAfterTextChanged { text ->
binding.setStatus.isEnabled = !text.isNullOrEmpty()
}
}
private fun setupCurrentStatus() {
@ -225,7 +224,6 @@ class SetStatusDialogFragment :
binding.emoji.setText(it.icon)
binding.customStatusInput.text?.clear()
binding.customStatusInput.setText(it.message?.trim())
binding.setStatus.isEnabled = it.message?.isEmpty() == false
visualizeStatus(it.status)
if (it.clearAt > 0) {

View File

@ -51,7 +51,7 @@ class ConversationConversionTest(
val conversationEntity = conversationJson.asEntity(1)
assertNotNull(conversationEntity)
val apiVersion : Int = jsonFileName.substringAfterLast("APIv").first().digitToInt()
val apiVersion: Int = jsonFileName.substringAfterLast("APIv").first().digitToInt()
checkConversationEntity(conversationEntity, apiVersion)
@ -61,10 +61,7 @@ class ConversationConversionTest(
checkConversationEntity(conversationEntityConvertedBack, apiVersion)
}
private fun checkConversationEntity(
conversationEntity: ConversationEntity,
apiVersion: Int
) {
private fun checkConversationEntity(conversationEntity: ConversationEntity, apiVersion: Int) {
assertEquals("1@juwd77g6", conversationEntity.internalId)
assertEquals(1, conversationEntity.accountId)