mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-23 21:45:42 +03:00
reformat kotlin
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
This commit is contained in:
parent
297ece8e7b
commit
2b71d30637
5 changed files with 30 additions and 30 deletions
|
@ -335,21 +335,17 @@ class IncomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
|||
try {
|
||||
for (workInfo in workers.get()) {
|
||||
if (workInfo.state == WorkInfo.State.RUNNING || workInfo.state == WorkInfo.State.ENQUEUED) {
|
||||
Log.d(
|
||||
TAG, "Download worker for " + fileId + " is already running or " +
|
||||
"scheduled"
|
||||
)
|
||||
Log.d(TAG, "Download worker for " + fileId + " is already running or scheduled")
|
||||
return
|
||||
}
|
||||
}
|
||||
} catch (e: ExecutionException) {
|
||||
Log.e(TAG, "Error when checking if worker already exsists", e)
|
||||
Log.e(TAG, "Error when checking if worker already exists", e)
|
||||
} catch (e: InterruptedException) {
|
||||
Log.e(TAG, "Error when checking if worker already exsists", e)
|
||||
Log.e(TAG, "Error when checking if worker already exists", e)
|
||||
}
|
||||
val data: Data
|
||||
val downloadWorker: OneTimeWorkRequest
|
||||
data = Data.Builder()
|
||||
|
||||
val data: Data = Data.Builder()
|
||||
.putString(DownloadFileToCacheWorker.KEY_BASE_URL, baseUrl)
|
||||
.putString(DownloadFileToCacheWorker.KEY_USER_ID, userId)
|
||||
.putString(DownloadFileToCacheWorker.KEY_ATTACHMENT_FOLDER, attachmentFolder)
|
||||
|
@ -357,10 +353,12 @@ class IncomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
|||
.putString(DownloadFileToCacheWorker.KEY_FILE_PATH, path)
|
||||
.putInt(DownloadFileToCacheWorker.KEY_FILE_SIZE, fileSize)
|
||||
.build()
|
||||
downloadWorker = OneTimeWorkRequest.Builder(DownloadFileToCacheWorker::class.java)
|
||||
|
||||
val downloadWorker: OneTimeWorkRequest = OneTimeWorkRequest.Builder(DownloadFileToCacheWorker::class.java)
|
||||
.setInputData(data)
|
||||
.addTag(fileId)
|
||||
.build()
|
||||
|
||||
WorkManager.getInstance().enqueue(downloadWorker)
|
||||
|
||||
WorkManager.getInstance(context!!).getWorkInfoByIdLiveData(downloadWorker.id)
|
||||
|
|
|
@ -311,21 +311,17 @@ class OutcomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
|||
try {
|
||||
for (workInfo in workers.get()) {
|
||||
if (workInfo.state == WorkInfo.State.RUNNING || workInfo.state == WorkInfo.State.ENQUEUED) {
|
||||
Log.d(
|
||||
TAG, "Download worker for " + fileId + " is already running or " +
|
||||
"scheduled"
|
||||
)
|
||||
Log.d(TAG, "Download worker for " + fileId + " is already running or scheduled")
|
||||
return
|
||||
}
|
||||
}
|
||||
} catch (e: ExecutionException) {
|
||||
Log.e(TAG, "Error when checking if worker already exsists", e)
|
||||
Log.e(TAG, "Error when checking if worker already exists", e)
|
||||
} catch (e: InterruptedException) {
|
||||
Log.e(TAG, "Error when checking if worker already exsists", e)
|
||||
Log.e(TAG, "Error when checking if worker already exists", e)
|
||||
}
|
||||
val data: Data
|
||||
val downloadWorker: OneTimeWorkRequest
|
||||
data = Data.Builder()
|
||||
|
||||
val data: Data = Data.Builder()
|
||||
.putString(DownloadFileToCacheWorker.KEY_BASE_URL, baseUrl)
|
||||
.putString(DownloadFileToCacheWorker.KEY_USER_ID, userId)
|
||||
.putString(DownloadFileToCacheWorker.KEY_ATTACHMENT_FOLDER, attachmentFolder)
|
||||
|
@ -333,10 +329,12 @@ class OutcomingVoiceMessageViewHolder(incomingView: View) : MessageHolders
|
|||
.putString(DownloadFileToCacheWorker.KEY_FILE_PATH, path)
|
||||
.putInt(DownloadFileToCacheWorker.KEY_FILE_SIZE, fileSize)
|
||||
.build()
|
||||
downloadWorker = OneTimeWorkRequest.Builder(DownloadFileToCacheWorker::class.java)
|
||||
|
||||
val downloadWorker: OneTimeWorkRequest = OneTimeWorkRequest.Builder(DownloadFileToCacheWorker::class.java)
|
||||
.setInputData(data)
|
||||
.addTag(fileId)
|
||||
.build()
|
||||
|
||||
WorkManager.getInstance().enqueue(downloadWorker)
|
||||
|
||||
WorkManager.getInstance(context!!).getWorkInfoByIdLiveData(downloadWorker.id)
|
||||
|
|
|
@ -1031,15 +1031,19 @@ class ChatController(args: Bundle) :
|
|||
uploadFiles(filesToUpload, false)
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(context, context?.getString(R.string.read_storage_no_permission), Toast.LENGTH_LONG)
|
||||
Toast
|
||||
.makeText(context, context?.getString(R.string.read_storage_no_permission), Toast.LENGTH_LONG)
|
||||
.show()
|
||||
}
|
||||
} else if (requestCode == REQUEST_RECORD_AUDIO_PERMISSION) {
|
||||
if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||
// do nothing. user will tap on the microphone again if he wants to record audio..
|
||||
} else {
|
||||
Toast.makeText(context, context!!.getString(R.string.nc_voice_message_missing_audio_permission), Toast
|
||||
.LENGTH_LONG).show()
|
||||
Toast.makeText(
|
||||
context,
|
||||
context!!.getString(R.string.nc_voice_message_missing_audio_permission),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1181,11 +1185,13 @@ class ChatController(args: Bundle) :
|
|||
EmojiPopup.Builder.fromRootView(view).setOnEmojiPopupShownListener {
|
||||
if (resources != null) {
|
||||
smileyButton?.setImageDrawable(
|
||||
ContextCompat.getDrawable(context!!, R.drawable.ic_baseline_keyboard_24))
|
||||
ContextCompat.getDrawable(context!!, R.drawable.ic_baseline_keyboard_24)
|
||||
)
|
||||
}
|
||||
}.setOnEmojiPopupDismissListener {
|
||||
smileyButton?.setImageDrawable(
|
||||
ContextCompat.getDrawable(context!!, R.drawable.ic_insert_emoticon_black_24dp))
|
||||
ContextCompat.getDrawable(context!!, R.drawable.ic_insert_emoticon_black_24dp)
|
||||
)
|
||||
}.setOnEmojiClickListener { emoji,
|
||||
imageView ->
|
||||
binding.messageInputView.inputEditText?.editableText?.append(" ")
|
||||
|
|
|
@ -239,10 +239,7 @@ class LocationPickerController(args: Bundle) :
|
|||
MIN_LOCATION_UPDATE_DISTANCE,
|
||||
this
|
||||
)
|
||||
Log.d(
|
||||
TAG, "Using LocationManager.GPS_PROVIDER because LocationManager.NETWORK_PROVIDER" +
|
||||
" was not available"
|
||||
)
|
||||
Log.d(TAG, "LocationManager.NETWORK_PROVIDER falling back to LocationManager.GPS_PROVIDER")
|
||||
}
|
||||
else -> {
|
||||
Log.e(
|
||||
|
|
|
@ -182,7 +182,8 @@ class UploadAndShareFilesWorker(val context: Context, workerParameters: WorkerPa
|
|||
currentUser: UserEntity,
|
||||
ncTargetpath: String?,
|
||||
filename: String?,
|
||||
metaData: String?) {
|
||||
metaData: String?
|
||||
) {
|
||||
|
||||
val paths: MutableList<String> = ArrayList()
|
||||
paths.add("$ncTargetpath/$filename")
|
||||
|
|
Loading…
Reference in a new issue