further improve formatting

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
Andy Scherzinger 2023-05-24 10:04:47 +02:00
parent 502a3f1f59
commit 984c8bff5c
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
5 changed files with 39 additions and 43 deletions

View file

@ -244,13 +244,14 @@ class ConversationItem(
} else { } else {
model.lastMessage!!.activeUser = user model.lastMessage!!.activeUser = user
val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType val text =
.REGULAR_TEXT_MESSAGE if (
) { model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType.REGULAR_TEXT_MESSAGE
calculateRegularLastMessageText(appContext) ) {
} else { calculateRegularLastMessageText(appContext)
model.lastMessage!!.lastMessageDisplayText } else {
} model.lastMessage!!.lastMessageDisplayText
}
holder.binding.dialogLastMessage.text = text holder.binding.dialogLastMessage.text = text
} }
} else { } else {

View file

@ -79,10 +79,12 @@ import javax.inject.Inject
@AutoInjector(NextcloudTalkApplication::class) @AutoInjector(NextcloudTalkApplication::class)
class AccountVerificationController(args: Bundle? = null) : BaseController( class AccountVerificationController(args: Bundle? = null) : BaseController(
R.layout.controller_account_verification, args R.layout.controller_account_verification,
args
) { ) {
private val binding: ControllerAccountVerificationBinding? by private val binding: ControllerAccountVerificationBinding? by viewBinding(
viewBinding(ControllerAccountVerificationBinding::bind) ControllerAccountVerificationBinding::bind
)
@Inject @Inject
lateinit var ncApi: NcApi lateinit var ncApi: NcApi
@ -289,10 +291,8 @@ class AccountVerificationController(args: Bundle? = null) : BaseController(
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
binding?.progressText?.text = binding?.progressText?.text = """ ${binding?.progressText?.text}""".trimIndent() +
""" ${binding?.progressText?.text} resources!!.getString(R.string.nc_display_name_not_stored)
"""
.trimIndent() + resources!!.getString(R.string.nc_display_name_not_stored)
abortVerification() abortVerification()
} }

View file

@ -451,40 +451,26 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
const val DELETE_ALL = "DELETE_ALL" const val DELETE_ALL = "DELETE_ALL"
fun run(context: Context) { fun run(context: Context) {
if (ContextCompat.checkSelfPermission( if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) ==
context, PackageManager.PERMISSION_GRANTED &&
Manifest.permission.WRITE_CONTACTS ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) ==
) == PackageManager.PERMISSION_GRANTED && PackageManager.PERMISSION_GRANTED
ContextCompat.checkSelfPermission(
context,
Manifest.permission.READ_CONTACTS
) == PackageManager.PERMISSION_GRANTED
) { ) {
WorkManager WorkManager.getInstance().enqueue(
.getInstance() OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java)
.enqueue( .setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build()).build()
OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java) )
.setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build())
.build()
)
} }
} }
fun checkPermission(activity: Activity, context: Context): Boolean { fun checkPermission(activity: Activity, context: Context): Boolean {
if (ContextCompat.checkSelfPermission( if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) !=
context, PackageManager.PERMISSION_GRANTED ||
Manifest.permission.WRITE_CONTACTS ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) !=
) != PackageManager.PERMISSION_GRANTED || PackageManager.PERMISSION_GRANTED
ContextCompat.checkSelfPermission(
context,
Manifest.permission.READ_CONTACTS
) != PackageManager.PERMISSION_GRANTED
) { ) {
activity.requestPermissions( activity.requestPermissions(
arrayOf( arrayOf(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS),
Manifest.permission.WRITE_CONTACTS,
Manifest.permission.READ_CONTACTS
),
REQUEST_PERMISSION REQUEST_PERMISSION
) )
return false return false

View file

@ -37,7 +37,15 @@ data class SpreedCapability(
@JsonField(name = ["features"]) @JsonField(name = ["features"])
var features: List<String>?, var features: List<String>?,
@JsonField(name = ["config"]) @JsonField(name = ["config"])
var config: HashMap<String, HashMap<String, @RawValue @Contextual Any>>? var config: HashMap<
String,
HashMap<
String,
@RawValue
@Contextual
Any
>
>?
) : Parcelable { ) : Parcelable {
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject' // This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
constructor() : this(null, null) constructor() : this(null, null)

View file

@ -298,7 +298,8 @@ class ProfileActivity : BaseActivity() {
} }
binding.loadingContent.visibility = View.VISIBLE binding.loadingContent.visibility = View.VISIBLE
adapter!!.setData(createUserInfoDetails(userInfo)) adapter!!.setData(createUserInfoDetails(userInfo))
if (isAllEmpty( if (
isAllEmpty(
arrayOf( arrayOf(
userInfo?.displayName, userInfo?.displayName,
userInfo?.phone, userInfo?.phone,