mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-06 22:29:09 +00:00
resolve warnings
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
ab007fc444
commit
3dca00bac0
@ -3404,9 +3404,7 @@ class ChatActivity :
|
||||
if (message.isTemporary) {
|
||||
TempMessageActionsDialog(
|
||||
this,
|
||||
message,
|
||||
conversationUser,
|
||||
currentConversation
|
||||
message
|
||||
).show()
|
||||
} else if (hasVisibleItems(message) &&
|
||||
!isSystemMessage(message)
|
||||
@ -4028,7 +4026,6 @@ class ChatActivity :
|
||||
private const val CONTENT_TYPE_LINK_PREVIEW: Byte = 7
|
||||
private const val CONTENT_TYPE_DECK_CARD: Byte = 8
|
||||
private const val UNREAD_MESSAGES_MARKER_ID = -1
|
||||
private const val CALL_STARTED_ID = -2
|
||||
private const val GET_ROOM_INFO_DELAY_NORMAL: Long = 30000
|
||||
private const val GET_ROOM_INFO_DELAY_LOBBY: Long = 5000
|
||||
private const val AGE_THRESHOLD_FOR_DELETE_MESSAGE: Int = 21600000 // (6 hours in millis = 6 * 3600 * 1000)
|
||||
|
@ -29,7 +29,6 @@ import com.nextcloud.talk.models.json.chat.ChatOverallSingleMessage
|
||||
import com.nextcloud.talk.utils.bundle.BundleKeys
|
||||
import com.nextcloud.talk.utils.database.user.CurrentUserProviderNew
|
||||
import com.nextcloud.talk.utils.message.SendMessageUtils
|
||||
import com.nextcloud.talk.utils.preferences.AppPreferences
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@ -52,9 +51,8 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
private val chatDao: ChatMessagesDao,
|
||||
private val chatBlocksDao: ChatBlocksDao,
|
||||
private val network: ChatNetworkDataSource,
|
||||
private val datastore: AppPreferences,
|
||||
private val monitor: NetworkMonitor,
|
||||
private val userProvider: CurrentUserProviderNew
|
||||
userProvider: CurrentUserProviderNew
|
||||
) : ChatMessageRepository {
|
||||
|
||||
val currentUser: User = userProvider.currentUser.blockingGet()
|
||||
@ -941,6 +939,7 @@ class OfflineFirstChatRepository @Inject constructor(
|
||||
_removeMessageFlow.emit(chatMessage)
|
||||
}
|
||||
|
||||
@Suppress("Detekt.TooGenericExceptionCaught")
|
||||
override suspend fun addTemporaryMessage(
|
||||
message: CharSequence,
|
||||
displayName: String,
|
||||
|
@ -651,7 +651,7 @@ class ChatViewModel @Inject constructor(
|
||||
chatRepository.handleChatOnBackPress()
|
||||
}
|
||||
|
||||
suspend fun getMessageById(url: String, conversationModel: ConversationModel, messageId: Long): Flow<ChatMessage> =
|
||||
fun getMessageById(url: String, conversationModel: ConversationModel, messageId: Long): Flow<ChatMessage> =
|
||||
flow {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(BundleKeys.KEY_CHAT_URL, url)
|
||||
|
@ -22,7 +22,6 @@ import com.nextcloud.talk.chat.data.io.MediaPlayerManager
|
||||
import com.nextcloud.talk.chat.data.model.ChatMessage
|
||||
import com.nextcloud.talk.models.json.chat.ChatOverallSingleMessage
|
||||
import com.nextcloud.talk.utils.message.SendMessageUtils
|
||||
import com.nextcloud.talk.utils.preferences.AppPreferences
|
||||
import com.stfalcon.chatkit.commons.models.IMessage
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.coroutines.launch
|
||||
@ -31,8 +30,7 @@ import javax.inject.Inject
|
||||
class MessageInputViewModel @Inject constructor(
|
||||
private val audioRecorderManager: AudioRecorderManager,
|
||||
private val mediaPlayerManager: MediaPlayerManager,
|
||||
private val audioFocusRequestManager: AudioFocusRequestManager,
|
||||
private val appPreferences: AppPreferences
|
||||
private val audioFocusRequestManager: AudioFocusRequestManager
|
||||
) : ViewModel(),
|
||||
DefaultLifecycleObserver {
|
||||
|
||||
@ -197,13 +195,7 @@ class MessageInputViewModel @Inject constructor(
|
||||
chatRepository.editTempChatMessage(
|
||||
message,
|
||||
editedMessageText
|
||||
).collect { result ->
|
||||
if (true) {
|
||||
// _editMessageViewState.value = EditMessageSuccessState(result)
|
||||
} else {
|
||||
// _editMessageViewState.value = EditMessageErrorState
|
||||
}
|
||||
}
|
||||
).collect {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -262,6 +254,5 @@ class MessageInputViewModel @Inject constructor(
|
||||
|
||||
companion object {
|
||||
private val TAG = MessageInputViewModel::class.java.simpleName
|
||||
private const val DELAY_BETWEEN_QUEUED_MESSAGES: Long = 1000
|
||||
}
|
||||
}
|
||||
|
@ -19,9 +19,7 @@ import com.nextcloud.talk.application.NextcloudTalkApplication
|
||||
import com.nextcloud.talk.chat.ChatActivity
|
||||
import com.nextcloud.talk.chat.data.model.ChatMessage
|
||||
import com.nextcloud.talk.data.network.NetworkMonitor
|
||||
import com.nextcloud.talk.data.user.model.User
|
||||
import com.nextcloud.talk.databinding.DialogTempMessageActionsBinding
|
||||
import com.nextcloud.talk.models.domain.ConversationModel
|
||||
import com.nextcloud.talk.ui.theme.ViewThemeUtils
|
||||
import com.nextcloud.talk.utils.ApiUtils
|
||||
import com.nextcloud.talk.utils.DateUtils
|
||||
@ -32,9 +30,7 @@ import javax.inject.Inject
|
||||
@AutoInjector(NextcloudTalkApplication::class)
|
||||
class TempMessageActionsDialog(
|
||||
private val chatActivity: ChatActivity,
|
||||
private val message: ChatMessage,
|
||||
private val user: User?,
|
||||
private val currentConversation: ConversationModel?
|
||||
private val message: ChatMessage
|
||||
) : BottomSheetDialog(chatActivity) {
|
||||
|
||||
@Inject
|
||||
|
@ -29,8 +29,4 @@ class SendMessageUtils {
|
||||
val second = calendar.get(Calendar.SECOND)
|
||||
return (month * 1000000) + (day * 10000) + (hour * 100) + (minute * 10) + second
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val TAG = SendMessageUtils::class.java.simpleName
|
||||
}
|
||||
}
|
||||
|
@ -584,13 +584,7 @@ class AppPreferencesImpl(val context: Context) : AppPreferences {
|
||||
@Suppress("UnusedPrivateProperty")
|
||||
private val TAG = AppPreferencesImpl::class.simpleName
|
||||
private val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings")
|
||||
private const val ID: Int = 0
|
||||
private const val MESSAGE_INDEX: Int = 1
|
||||
private const val REPLY_TO_INDEX: Int = 2
|
||||
private const val DISPLAY_NAME_INDEX: Int = 3
|
||||
private const val SILENT_INDEX: Int = 4
|
||||
const val PROXY_TYPE = "proxy_type"
|
||||
const val PROXY_SERVER = "proxy_server"
|
||||
const val PROXY_HOST = "proxy_host"
|
||||
const val PROXY_PORT = "proxy_port"
|
||||
const val PROXY_CRED = "proxy_credentials"
|
||||
@ -615,7 +609,6 @@ class AppPreferencesImpl(val context: Context) : AppPreferences {
|
||||
const val DB_ROOM_MIGRATED = "db_room_migrated"
|
||||
const val PHONE_BOOK_INTEGRATION_LAST_RUN = "phone_book_integration_last_run"
|
||||
const val TYPING_STATUS = "typing_status"
|
||||
const val MESSAGE_QUEUE = "@message_queue"
|
||||
const val VOICE_MESSAGE_PLAYBACK_SPEEDS = "voice_message_playback_speeds"
|
||||
const val SHOW_REGULAR_NOTIFICATION_WARNING = "show_regular_notification_warning"
|
||||
const val LAST_NOTIFICATION_WARNING = "last_notification_warning"
|
||||
|
@ -1,5 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#000000" android:viewportWidth="24" android:viewportHeight="24">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M12,5V1L7,6l5,5V7c3.31,0 6,2.69 6,6s-2.69,6 -6,6 -6,-2.69 -6,-6H4c0,4.42 3.58,8 8,8s8,-3.58 8,-8 -3.58,-8 -8,-8z"/>
|
||||
|
||||
</vector>
|
@ -1,5 +1,16 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#000000" android:viewportWidth="24" android:viewportHeight="24">
|
||||
|
||||
<path android:fillColor="@android:color/white" android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z"/>
|
||||
|
||||
<!--
|
||||
~ Nextcloud Talk - Android Client
|
||||
~
|
||||
~ SPDX-FileCopyrightText: 2021-2024 Google LLC
|
||||
~ SPDX-License-Identifier: Apache-2.0
|
||||
-->
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#000000"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z"/>
|
||||
</vector>
|
||||
|
@ -1,90 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Nextcloud Talk - Android Client
|
||||
~
|
||||
~ SPDX-FileCopyrightText: 2024 Julius Linus <juliuslinus1@gmail.com>
|
||||
~ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginBottom="2dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/temp_msg_actions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_below="@id/bubble"
|
||||
android:layout_alignParentEnd="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/temp_msg_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_edit"
|
||||
android:paddingHorizontal="@dimen/standard_half_padding"
|
||||
android:layout_marginEnd="@dimen/standard_quarter_margin" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/temp_msg_delete"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_delete"
|
||||
android:paddingHorizontal="@dimen/standard_half_padding"
|
||||
android:layout_marginStart="@dimen/standard_quarter_margin" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/temp_msg_resend"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/standard_quarter_margin"
|
||||
android:contentDescription="@null"
|
||||
android:paddingHorizontal="@dimen/standard_half_padding"
|
||||
android:src="@drawable/baseline_replay_24" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
android:id="@id/bubble"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginStart="@dimen/message_outcoming_bubble_margin_left"
|
||||
app:alignContent="stretch"
|
||||
app:alignItems="stretch"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="flex_end">
|
||||
|
||||
<include
|
||||
android:id="@+id/message_quote"
|
||||
layout="@layout/item_message_quote"
|
||||
android:visibility="gone"
|
||||
tools:visibility="gone"/>
|
||||
|
||||
<androidx.emoji2.widget.EmojiTextView
|
||||
android:id="@id/messageText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:lineSpacingMultiplier="1.2"
|
||||
android:textAlignment="viewStart"
|
||||
android:textColorHighlight="@color/nc_grey"
|
||||
android:textIsSelectable="false"
|
||||
tools:text="Talk to you later!" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/message_edit"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
</RelativeLayout>
|
Loading…
Reference in New Issue
Block a user