ktlintFormat

Signed-off-by: sowjanyakch <sowjanya.kch@gmail.com>
This commit is contained in:
sowjanyakch 2024-11-20 16:05:35 +01:00 committed by Marcel Hibbe
parent 9b3a11569a
commit f1d03e235a
No known key found for this signature in database
GPG Key ID: C793F8B59F43CE7B
10 changed files with 96 additions and 114 deletions

View File

@ -166,10 +166,7 @@ class ContactItem(
} }
} }
private fun setGenericAvatar( private fun setGenericAvatar(holder: ContactItemViewHolder, roundPlaceholderDrawable: Int) {
holder: ContactItemViewHolder,
roundPlaceholderDrawable: Int
) {
val avatar = val avatar =
viewThemeUtils.talk.themePlaceholderAvatar( viewThemeUtils.talk.themePlaceholderAvatar(
holder.binding.avatarView, holder.binding.avatarView,

View File

@ -206,7 +206,6 @@ fun ImageView.loadThumbnail(url: String, user: User): io.reactivex.disposables.D
.target(this) .target(this)
.transformations(CircleCropTransformation()) .transformations(CircleCropTransformation())
val layers = arrayOfNulls<Drawable>(2) val layers = arrayOfNulls<Drawable>(2)
layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background) layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background)
layers[1] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_foreground) layers[1] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_foreground)
@ -271,7 +270,6 @@ fun ImageView.loadUserAvatar(any: Any?): io.reactivex.disposables.Disposable {
} }
fun ImageView.loadSystemAvatar(): io.reactivex.disposables.Disposable { fun ImageView.loadSystemAvatar(): io.reactivex.disposables.Disposable {
val layers = arrayOfNulls<Drawable>(2) val layers = arrayOfNulls<Drawable>(2)
layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background) layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background)
layers[1] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_foreground) layers[1] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_foreground)
@ -286,14 +284,12 @@ fun ImageView.loadSystemAvatar(): io.reactivex.disposables.Disposable {
} }
fun ImageView.loadNoteToSelfAvatar(): io.reactivex.disposables.Disposable { fun ImageView.loadNoteToSelfAvatar(): io.reactivex.disposables.Disposable {
val layers = arrayOfNulls<Drawable>(2) val layers = arrayOfNulls<Drawable>(2)
layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background) layers[0] = ContextCompat.getDrawable(context, R.drawable.ic_launcher_background)
layers[1] = ContextCompat.getDrawable(context, R.drawable.ic_note_to_self) layers[1] = ContextCompat.getDrawable(context, R.drawable.ic_note_to_self)
val layerDrawable = LayerDrawable(layers) val layerDrawable = LayerDrawable(layers)
val data: Any = layerDrawable val data: Any = layerDrawable
return DisposableWrapper( return DisposableWrapper(
load(data) { load(data) {
transformations(CircleCropTransformation()) transformations(CircleCropTransformation())
@ -306,7 +302,6 @@ fun ImageView.loadChangelogBotAvatar(): io.reactivex.disposables.Disposable {
} }
fun ImageView.loadBotsAvatar(): io.reactivex.disposables.Disposable { fun ImageView.loadBotsAvatar(): io.reactivex.disposables.Disposable {
val layers = arrayOfNulls<Drawable>(2) val layers = arrayOfNulls<Drawable>(2)
layers[0] = ColorDrawable(context.getColor(R.color.black)) layers[0] = ColorDrawable(context.getColor(R.color.black))
layers[1] = TextDrawable(context, ">") layers[1] = TextDrawable(context, ">")

View File

@ -378,7 +378,6 @@ class SettingsActivity : BaseActivity(), SetPhoneNumberDialogFragment.SetPhoneNu
) )
startActivity(intent) startActivity(intent)
} }
} }
private fun setTroubleshootingClickListenersIfNecessary() { private fun setTroubleshootingClickListenersIfNecessary() {
@ -860,10 +859,8 @@ class SettingsActivity : BaseActivity(), SetPhoneNumberDialogFragment.SetPhoneNu
private fun setupCheckables() { private fun setupCheckables() {
binding.settingsScreenSecuritySwitch.isChecked = appPreferences.isScreenSecured binding.settingsScreenSecuritySwitch.isChecked = appPreferences.isScreenSecured
binding.settingsIncognitoKeyboardSwitch.isChecked = appPreferences.isKeyboardIncognito binding.settingsIncognitoKeyboardSwitch.isChecked = appPreferences.isKeyboardIncognito
if (CapabilitiesUtil.isReadStatusAvailable(currentUser!!.capabilities!!.spreedCapability!!)) { if (CapabilitiesUtil.isReadStatusAvailable(currentUser!!.capabilities!!.spreedCapability!!)) {
binding.settingsReadPrivacySwitch.isChecked = !CapabilitiesUtil.isReadStatusPrivate(currentUser!!) binding.settingsReadPrivacySwitch.isChecked = !CapabilitiesUtil.isReadStatusPrivate(currentUser!!)
} else { } else {

View File

@ -101,7 +101,6 @@ object FileUtils {
val aboveOrEqualAPI26Check = val aboveOrEqualAPI26Check =
!cachedFile.toPath().normalize().startsWith(context.cacheDir.toPath()) !cachedFile.toPath().normalize().startsWith(context.cacheDir.toPath())
val isOutsideCacheDir = aboveOrEqualAPI26Check val isOutsideCacheDir = aboveOrEqualAPI26Check
if (isOutsideCacheDir) { if (isOutsideCacheDir) {

View File

@ -54,7 +54,6 @@ object NotificationUtils {
const val KEY_UPLOAD_GROUP = "com.nextcloud.talk.utils.KEY_UPLOAD_GROUP" const val KEY_UPLOAD_GROUP = "com.nextcloud.talk.utils.KEY_UPLOAD_GROUP"
const val GROUP_SUMMARY_NOTIFICATION_ID = -1 const val GROUP_SUMMARY_NOTIFICATION_ID = -1
private fun createNotificationChannel( private fun createNotificationChannel(
context: Context, context: Context,
notificationChannel: Channel, notificationChannel: Channel,
@ -151,7 +150,6 @@ object NotificationUtils {
} }
fun removeOldNotificationChannels(context: Context) { fun removeOldNotificationChannels(context: Context) {
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
// Current version does not use notification channel groups - delete all groups // Current version does not use notification channel groups - delete all groups
@ -167,10 +165,8 @@ object NotificationUtils {
notificationManager.deleteNotificationChannel(channel.id) notificationManager.deleteNotificationChannel(channel.id)
} }
} }
} }
private fun getNotificationChannel(context: Context, channelId: String): NotificationChannel? { private fun getNotificationChannel(context: Context, channelId: String): NotificationChannel? {
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
return notificationManager.getNotificationChannel(channelId) return notificationManager.getNotificationChannel(channelId)
@ -283,7 +279,6 @@ object NotificationUtils {
defaultRingtoneUri: String, defaultRingtoneUri: String,
channelId: String channelId: String
): Uri? { ): Uri? {
val channel = getNotificationChannel(context, channelId) val channel = getNotificationChannel(context, channelId)
if (channel != null) { if (channel != null) {
return channel.sound return channel.sound

View File

@ -7,7 +7,6 @@
package com.nextcloud.talk.utils package com.nextcloud.talk.utils
import android.content.Context import android.content.Context
import android.os.Build
import android.os.VibrationEffect import android.os.VibrationEffect
import android.os.Vibrator import android.os.Vibrator