mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 04:55:29 +03:00
further improve formatting
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
502a3f1f59
commit
984c8bff5c
5 changed files with 39 additions and 43 deletions
|
@ -244,13 +244,14 @@ class ConversationItem(
|
|||
} else {
|
||||
model.lastMessage!!.activeUser = user
|
||||
|
||||
val text = if (model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType
|
||||
.REGULAR_TEXT_MESSAGE
|
||||
) {
|
||||
calculateRegularLastMessageText(appContext)
|
||||
} else {
|
||||
model.lastMessage!!.lastMessageDisplayText
|
||||
}
|
||||
val text =
|
||||
if (
|
||||
model.lastMessage!!.getCalculateMessageType() === ChatMessage.MessageType.REGULAR_TEXT_MESSAGE
|
||||
) {
|
||||
calculateRegularLastMessageText(appContext)
|
||||
} else {
|
||||
model.lastMessage!!.lastMessageDisplayText
|
||||
}
|
||||
holder.binding.dialogLastMessage.text = text
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -79,10 +79,12 @@ import javax.inject.Inject
|
|||
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
class AccountVerificationController(args: Bundle? = null) : BaseController(
|
||||
R.layout.controller_account_verification, args
|
||||
R.layout.controller_account_verification,
|
||||
args
|
||||
) {
|
||||
private val binding: ControllerAccountVerificationBinding? by
|
||||
viewBinding(ControllerAccountVerificationBinding::bind)
|
||||
private val binding: ControllerAccountVerificationBinding? by viewBinding(
|
||||
ControllerAccountVerificationBinding::bind
|
||||
)
|
||||
|
||||
@Inject
|
||||
lateinit var ncApi: NcApi
|
||||
|
@ -289,10 +291,8 @@ class AccountVerificationController(args: Bundle? = null) : BaseController(
|
|||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onError(e: Throwable) {
|
||||
binding?.progressText?.text =
|
||||
""" ${binding?.progressText?.text}
|
||||
"""
|
||||
.trimIndent() + resources!!.getString(R.string.nc_display_name_not_stored)
|
||||
binding?.progressText?.text = """ ${binding?.progressText?.text}""".trimIndent() +
|
||||
resources!!.getString(R.string.nc_display_name_not_stored)
|
||||
abortVerification()
|
||||
}
|
||||
|
||||
|
|
|
@ -451,40 +451,26 @@ class ContactAddressBookWorker(val context: Context, workerParameters: WorkerPar
|
|||
const val DELETE_ALL = "DELETE_ALL"
|
||||
|
||||
fun run(context: Context) {
|
||||
if (ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
Manifest.permission.WRITE_CONTACTS
|
||||
) == PackageManager.PERMISSION_GRANTED &&
|
||||
ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
Manifest.permission.READ_CONTACTS
|
||||
) == PackageManager.PERMISSION_GRANTED
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) ==
|
||||
PackageManager.PERMISSION_GRANTED &&
|
||||
ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) ==
|
||||
PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
WorkManager
|
||||
.getInstance()
|
||||
.enqueue(
|
||||
OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java)
|
||||
.setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build())
|
||||
.build()
|
||||
)
|
||||
WorkManager.getInstance().enqueue(
|
||||
OneTimeWorkRequest.Builder(ContactAddressBookWorker::class.java)
|
||||
.setInputData(Data.Builder().putBoolean(KEY_FORCE, false).build()).build()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun checkPermission(activity: Activity, context: Context): Boolean {
|
||||
if (ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
Manifest.permission.WRITE_CONTACTS
|
||||
) != PackageManager.PERMISSION_GRANTED ||
|
||||
ContextCompat.checkSelfPermission(
|
||||
context,
|
||||
Manifest.permission.READ_CONTACTS
|
||||
) != PackageManager.PERMISSION_GRANTED
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.WRITE_CONTACTS) !=
|
||||
PackageManager.PERMISSION_GRANTED ||
|
||||
ContextCompat.checkSelfPermission(context, Manifest.permission.READ_CONTACTS) !=
|
||||
PackageManager.PERMISSION_GRANTED
|
||||
) {
|
||||
activity.requestPermissions(
|
||||
arrayOf(
|
||||
Manifest.permission.WRITE_CONTACTS,
|
||||
Manifest.permission.READ_CONTACTS
|
||||
),
|
||||
arrayOf(Manifest.permission.WRITE_CONTACTS, Manifest.permission.READ_CONTACTS),
|
||||
REQUEST_PERMISSION
|
||||
)
|
||||
return false
|
||||
|
|
|
@ -37,7 +37,15 @@ data class SpreedCapability(
|
|||
@JsonField(name = ["features"])
|
||||
var features: List<String>?,
|
||||
@JsonField(name = ["config"])
|
||||
var config: HashMap<String, HashMap<String, @RawValue @Contextual Any>>?
|
||||
var config: HashMap<
|
||||
String,
|
||||
HashMap<
|
||||
String,
|
||||
@RawValue
|
||||
@Contextual
|
||||
Any
|
||||
>
|
||||
>?
|
||||
) : Parcelable {
|
||||
// This constructor is added to work with the 'com.bluelinelabs.logansquare.annotation.JsonObject'
|
||||
constructor() : this(null, null)
|
||||
|
|
|
@ -298,7 +298,8 @@ class ProfileActivity : BaseActivity() {
|
|||
}
|
||||
binding.loadingContent.visibility = View.VISIBLE
|
||||
adapter!!.setData(createUserInfoDetails(userInfo))
|
||||
if (isAllEmpty(
|
||||
if (
|
||||
isAllEmpty(
|
||||
arrayOf(
|
||||
userInfo?.displayName,
|
||||
userInfo?.phone,
|
||||
|
|
Loading…
Reference in a new issue