diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dc00ff3c..fa9a3a33 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -80,7 +80,7 @@ dependencies { coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5") implementation("androidx.appcompat:appcompat:1.4.0-alpha03") - implementation("com.google.android.material:material:1.4.0") + implementation("com.google.android.material:material:1.5.0-alpha03") implementation("androidx.core:core-ktx:1.7.0-alpha02") implementation("androidx.preference:preference-ktx:1.1.1") implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e157a4f8..c3c3136b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -27,10 +27,6 @@ - - 0 && accessToken.isNotBlank() - var vkUser: VkUser? = null + val vkUser = MutableLiveData(null) } \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/VkUtils.kt b/app/src/main/kotlin/com/meloda/fast/api/VkUtils.kt index e714f6da..165ff157 100644 --- a/app/src/main/kotlin/com/meloda/fast/api/VkUtils.kt +++ b/app/src/main/kotlin/com/meloda/fast/api/VkUtils.kt @@ -1,16 +1,30 @@ package com.meloda.fast.api import android.content.Context +import android.graphics.drawable.Drawable +import androidx.core.content.ContextCompat import com.meloda.fast.R import com.meloda.fast.api.model.VkGroup +import com.meloda.fast.api.model.VkGroupCall import com.meloda.fast.api.model.VkMessage import com.meloda.fast.api.model.VkUser import com.meloda.fast.api.model.attachments.* import com.meloda.fast.api.model.base.BaseVkMessage import com.meloda.fast.api.model.base.attachments.BaseVkAttachmentItem +import com.meloda.fast.api.network.VKErrors object VkUtils { + fun isValidationRequired(throwable: Throwable): Boolean { + if (throwable !is VKException) return false + return throwable.error == VKErrors.NEED_VALIDATION + } + + fun isCaptchaRequired(throwable: Throwable): Boolean { + if (throwable !is VKException) return false + return throwable.error == VKErrors.NEED_CAPTCHA + } + fun parseForwards(baseForwards: List?): List? { if (baseForwards.isNullOrEmpty()) return null @@ -114,6 +128,12 @@ object VkUtils { initiatorId = call.initiatorId ) } + BaseVkAttachmentItem.AttachmentType.GROUP_CALL_IN_PROGRESS -> { + val groupCall = baseAttachment.groupCall ?: continue + attachments += VkGroupCall( + initiatorId = groupCall.initiatorId + ) + } else -> continue } } @@ -315,6 +335,52 @@ object VkUtils { } } + fun getAttachmentConversationIcon(context: Context, message: VkMessage): Drawable? { + message.geoType?.let { + return ContextCompat.getDrawable(context, R.drawable.ic_map_marker) + } + + if (message.attachments.isNullOrEmpty()) return null + + return message.attachments?.let { attachments -> + if (attachments.size == 1 || isAttachmentsHaveOneType(attachments)) { + getAttachmentTypeByClass(attachments[0])?.let { + getAttachmentIconByType( + context, + it + ) + } + } else { + ContextCompat.getDrawable(context, R.drawable.ic_baseline_attach_file_24) + } + } + } + + fun getAttachmentIconByType( + context: Context, + attachmentType: BaseVkAttachmentItem.AttachmentType + ): Drawable? { + val resId = when (attachmentType) { + BaseVkAttachmentItem.AttachmentType.PHOTO -> R.drawable.ic_attachment_photo + BaseVkAttachmentItem.AttachmentType.VIDEO -> R.drawable.ic_attachment_video + BaseVkAttachmentItem.AttachmentType.AUDIO -> R.drawable.ic_attachment_audio + BaseVkAttachmentItem.AttachmentType.FILE -> R.drawable.ic_attachment_file + BaseVkAttachmentItem.AttachmentType.LINK -> R.drawable.ic_attachment_link + BaseVkAttachmentItem.AttachmentType.VOICE -> R.drawable.ic_attachment_voice + BaseVkAttachmentItem.AttachmentType.MINI_APP -> R.drawable.ic_attachment_mini_app + BaseVkAttachmentItem.AttachmentType.STICKER -> R.drawable.ic_attachment_sticker + BaseVkAttachmentItem.AttachmentType.GIFT -> R.drawable.ic_attachment_gift + BaseVkAttachmentItem.AttachmentType.WALL -> R.drawable.ic_attachment_wall + BaseVkAttachmentItem.AttachmentType.GRAFFITI -> R.drawable.ic_attachment_graffiti + BaseVkAttachmentItem.AttachmentType.POLL -> R.drawable.ic_attachment_poll + BaseVkAttachmentItem.AttachmentType.WALL_REPLY -> R.drawable.ic_attachment_wall_reply + BaseVkAttachmentItem.AttachmentType.CALL -> R.drawable.ic_attachment_call + BaseVkAttachmentItem.AttachmentType.GROUP_CALL_IN_PROGRESS -> R.drawable.ic_attachment_group_call + } + + return ContextCompat.getDrawable(context, resId) + } + fun isAttachmentsHaveOneType(attachments: List): Boolean { if (attachments.isEmpty()) return true if (attachments.size == 1) return true @@ -344,6 +410,7 @@ object VkUtils { is VkPoll -> BaseVkAttachmentItem.AttachmentType.POLL is VkWallReply -> BaseVkAttachmentItem.AttachmentType.WALL_REPLY is VkCall -> BaseVkAttachmentItem.AttachmentType.CALL + is VkGroupCall -> BaseVkAttachmentItem.AttachmentType.GROUP_CALL_IN_PROGRESS else -> null } } diff --git a/app/src/main/kotlin/com/meloda/fast/api/loader/Loader.kt b/app/src/main/kotlin/com/meloda/fast/api/loader/Loader.kt deleted file mode 100644 index 5c216ed0..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/loader/Loader.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.meloda.fast.api.loader - -abstract class Loader { - - abstract suspend fun load(params: MutableMap): List - abstract suspend fun loadSingle(params: MutableMap): T - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/loader/UsersLoader.kt b/app/src/main/kotlin/com/meloda/fast/api/loader/UsersLoader.kt deleted file mode 100644 index ec246215..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/loader/UsersLoader.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.meloda.fast.api.loader - -import com.meloda.fast.api.model.VkUser - -class UsersLoader : Loader() { - - suspend fun load( - usersIds: List, - fields: String = "" - ) = load( - mutableMapOf( - "usersIds" to usersIds.joinToString { it.toString() }, - "fields" to fields - ) - ) - - override suspend fun load(params: MutableMap): List { - val usersIds: String = params["usersIds"] as String - val fields: String = params["fields"] as String - -// val users = repo.getById( -// UsersGetRequest( -// usersIds = usersIds.split(",").map { it.toInt() }, -// fields = fields -// ) -// ) - - return emptyList() - } - - override suspend fun loadSingle(params: MutableMap): VkUser { - return load(params)[0] - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/VkConversation.kt b/app/src/main/kotlin/com/meloda/fast/api/model/VkConversation.kt index 2c9f450d..e983e03d 100644 --- a/app/src/main/kotlin/com/meloda/fast/api/model/VkConversation.kt +++ b/app/src/main/kotlin/com/meloda/fast/api/model/VkConversation.kt @@ -11,7 +11,14 @@ data class VkConversation( val title: String?, val photo200: String?, val type: String, - val callInProgress: Boolean + val callInProgress: Boolean, + val isPhantom: Boolean, + val lastConversationMessageId: Int, + val inRead: Int, + val outRead: Int, + val isMarkedUnread: Boolean, + val lastMessageId: Int, + val unreadCount: Int? ) { @Ignore var lastMessage: VkMessage? = null @@ -20,4 +27,9 @@ data class VkConversation( fun isUser() = type == "user" fun isGroup() = type == "group" + fun isInUnread() = inRead != lastMessageId + fun isOutUnread() = outRead != lastMessageId + + fun isUnread() = isInUnread() || isOutUnread() + } diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/VkGroupCall.kt b/app/src/main/kotlin/com/meloda/fast/api/model/VkGroupCall.kt new file mode 100644 index 00000000..f7dad5f2 --- /dev/null +++ b/app/src/main/kotlin/com/meloda/fast/api/model/VkGroupCall.kt @@ -0,0 +1,7 @@ +package com.meloda.fast.api.model + +import com.meloda.fast.api.model.attachments.VkAttachment + +data class VkGroupCall( + val initiatorId: Int +) : VkAttachment() \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/base/BaseVkConversation.kt b/app/src/main/kotlin/com/meloda/fast/api/model/base/BaseVkConversation.kt index 444b6cff..fa32c387 100644 --- a/app/src/main/kotlin/com/meloda/fast/api/model/base/BaseVkConversation.kt +++ b/app/src/main/kotlin/com/meloda/fast/api/model/base/BaseVkConversation.kt @@ -33,7 +33,9 @@ data class BaseVkConversation( @SerializedName("chat_settings") val chatSettings: ChatSettings?, @SerializedName("call_in_progress") - val callInProgress: CallInProgress? + val callInProgress: CallInProgress?, + @SerializedName("unread_count") + val unreadCount: Int? ) : Parcelable { fun asVkConversation(lastMessage: VkMessage? = null) = VkConversation( @@ -41,7 +43,14 @@ data class BaseVkConversation( title = chatSettings?.title, photo200 = chatSettings?.photo?.photo200, type = peer.type, - callInProgress = callInProgress != null + callInProgress = callInProgress != null, + isPhantom = chatSettings?.isDisappearing == true, + lastConversationMessageId = lastConversationMessageId, + inRead = inRead, + outRead = outRead, + isMarkedUnread = isMarkedUnread, + lastMessageId = lastMessageId, + unreadCount = unreadCount ).apply { this.lastMessage = lastMessage } @Parcelize diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/base/attachments/BaseVkAttachmentItem.kt b/app/src/main/kotlin/com/meloda/fast/api/model/base/attachments/BaseVkAttachmentItem.kt index f887b3be..5b975b16 100644 --- a/app/src/main/kotlin/com/meloda/fast/api/model/base/attachments/BaseVkAttachmentItem.kt +++ b/app/src/main/kotlin/com/meloda/fast/api/model/base/attachments/BaseVkAttachmentItem.kt @@ -24,7 +24,9 @@ data class BaseVkAttachmentItem( val poll: BaseVkPoll?, @SerializedName("wall_reply") val wallReply: BaseVkWallReply?, - val call: BaseVkCall? + val call: BaseVkCall?, + @SerializedName("group_call_in_progress") + val groupCall: BaseVkGroupCall? ) : Parcelable { fun getPreparedType() = AttachmentType.parse(type) @@ -43,7 +45,8 @@ data class BaseVkAttachmentItem( GRAFFITI("graffiti"), POLL("poll"), WALL_REPLY("wall_reply"), - CALL("call") + CALL("call"), + GROUP_CALL_IN_PROGRESS("group_call_in_progress") ; companion object { diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/base/attachments/BaseVkGroupCall.kt b/app/src/main/kotlin/com/meloda/fast/api/model/base/attachments/BaseVkGroupCall.kt new file mode 100644 index 00000000..72ed5124 --- /dev/null +++ b/app/src/main/kotlin/com/meloda/fast/api/model/base/attachments/BaseVkGroupCall.kt @@ -0,0 +1,22 @@ +package com.meloda.fast.api.model.base.attachments + +import android.os.Parcelable +import com.google.gson.annotations.SerializedName +import kotlinx.parcelize.Parcelize + +@Parcelize +data class BaseVkGroupCall( + @SerializedName("initiator_id") + val initiatorId: Int, + @SerializedName("join_link") + val joinLink: String, + val participants: Participants +) : Parcelable { + + @Parcelize + data class Participants( + val list: List, + val count: Int + ) : Parcelable + +} diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKAttachments.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/VKAttachments.kt deleted file mode 100644 index 6286bb6d..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKAttachments.kt +++ /dev/null @@ -1,76 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONArray -import java.util.* - -object VKAttachments { - - fun parse(array: JSONArray): ArrayList { - val attachments = ArrayList(array.length()) - - for (i in 0 until array.length()) { - var attachment = array.optJSONObject(i) ?: continue - if (attachment.has("attachment")) { - attachment = attachment.optJSONObject("attachment") ?: continue - } - - val type = Type.fromString(attachment.optString("type")) - val jsonObject = attachment.optJSONObject(type.value) ?: continue - - when (type) { -// Type.PHOTO -> attachments.add(oldVKPhoto(jsonObject)) -// Type.AUDIO -> attachments.add(oldVKAudio(jsonObject)) -// Type.VIDEO -> attachments.add(oldVKVideo(jsonObject)) -// Type.DOCUMENT -> attachments.add(oldVKDocument(jsonObject)) -// Type.STICKER -> attachments.add(oldVKSticker(jsonObject)) -// Type.LINK -> attachments.add(oldVKLink(jsonObject)) -// Type.GIFT -> attachments.add(VKGift(jsonObject)) -// Type.VOICE_MESSAGE -> attachments.add(oldVKAudioMessage(jsonObject)) -// Type.GRAFFITI -> attachments.add(VKGraffiti(jsonObject)) - Type.POLL -> attachments.add(oldVKPoll(jsonObject)) - Type.CALL -> attachments.add(VKCall(jsonObject)) -// Type.WALL_POST -> attachments.add(VKWall(jsonObject)) - Type.WALL_REPLY -> attachments.add(oldVKComment(jsonObject)) -// Type.GEOLOCATION -> attachments.add(oldVKGeolocation(jsonObject)) - else -> continue - } - } - - return attachments - } - - enum class Type(val value: String) { - NONE("none"), - PHOTO("photo"), - VIDEO("video"), - AUDIO("audio"), - AUDIO_PLAYLIST("audio_playlist"), - DOCUMENT("doc"), - LINK("link"), - STICKER("sticker"), - GIFT("gift"), - VOICE_MESSAGE("audio_message"), - GRAFFITI("graffiti"), - POLL("poll"), - GEOLOCATION("geo"), - WALL_POST("wall"), - WALL_REPLY("wall_reply"), - CALL("call"), - STORY("story"), - POINT("point"), - MARKET("market"), - ARTICLE("article"), - PODCAST("podcast"), - MONEY_REQUEST("money_request"); - - companion object { - fun fromString(value: String): Type { - for (v in values()) { - if (v.value == value) return v - } - - return NONE - } - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKCall.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/VKCall.kt deleted file mode 100644 index 78e880de..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKCall.kt +++ /dev/null @@ -1,38 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class VKCall() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.CALL - - var initiatorId: Int = 0 - var receiverId: Int = 0 - var state: State = State.NONE - var time: Int = 0 - var duration: Int = 0 - - constructor(o: JSONObject) : this() { - initiatorId = o.optInt("initiator_id", -1) - receiverId = o.optInt("receiver_id", -1) - state = State.fromString(o.optString("state")) - time = o.optInt("time") - duration = o.optInt("duration") - } - - enum class State(val value: String) { - NONE("none"), - REACHED("reached"), - CANCELLED_INITIATOR("canceled_by_initiator"), - CANCELLED_RECEIVER("canceled_by_receiver"); - - companion object { - fun fromString(value: String) = values().first { it.value == value } - } - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKLongPollHistory.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/VKLongPollHistory.kt deleted file mode 100644 index 11219a6b..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKLongPollHistory.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.meloda.fast.api.model.old - -import java.util.* - -class VKLongPollHistory : VKModel() { - - override val attachmentType = VKAttachments.Type.NONE - - private val lpMessages: ArrayList? = null - private val messages: ArrayList? = null - private val profiles: ArrayList? = null - private val groups: ArrayList? = null //TODO: использовать - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKLongPollServer.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/VKLongPollServer.kt deleted file mode 100644 index 3c80e743..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKLongPollServer.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class VKLongPollServer() : VKModel() { - - override val attachmentType = VKAttachments.Type.NONE - - var key: String = "" - var server: String = "" - var ts: Long = 0 - - constructor(o: JSONObject) : this() { - key = o.optString("key") - server = o.optString("server").replace("\\", "") - ts = o.optLong("ts") - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKModel.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/VKModel.kt deleted file mode 100644 index fdc94b7a..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/VKModel.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.meloda.fast.api.model.old - -import com.meloda.fast.api.model.old.VKAttachments -import com.meloda.fast.base.adapter.BaseItem -import java.io.Serializable - -abstract class VKModel : BaseItem(), Serializable { - - abstract val attachmentType: VKAttachments.Type - - companion object { - const val serialVersionUID = 1L - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKAudio.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKAudio.kt deleted file mode 100644 index 8ee77511..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKAudio.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKAudio() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.AUDIO - - var id: Int = 0 - var ownerId: Int = 0 - var artist: String = "" - var title: String = "" - var duration: Int = 0 - var url: String = "" - var date: Int = 0 - - constructor(o: JSONObject) : this() { - id = o.optInt("id", -1) - ownerId = o.optInt("owner_id", -1) - artist = o.optString("artist") - title = o.optString("title") - duration = o.optInt("duration") - url = o.optString("url") - date = o.optInt("date") - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKAudioMessage.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKAudioMessage.kt deleted file mode 100644 index 0d17f961..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKAudioMessage.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKAudioMessage() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.VOICE_MESSAGE - - var duration: Int = 0 - var waveform: ArrayList = arrayListOf() - var linkOgg: String = "" - var linkMp3: String = "" - - constructor(o: JSONObject) : this() { - duration = o.optInt("duration") - linkOgg = o.optString("link_ogg") - linkMp3 = o.optString("link_mp3") - - o.optJSONArray("waveform")?.let { - val waveform = ArrayList() - for (i in 0 until it.length()) { - waveform.add(it.optInt(i)) - } - this.waveform = waveform - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKComment.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKComment.kt deleted file mode 100644 index 9cc11bcc..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKComment.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKComment() : VKModel() { //https://vk.com/dev/objects/comment - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.WALL_REPLY - - constructor(o: JSONObject) : this() {} - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKConversation.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKConversation.kt deleted file mode 100644 index 56f01e67..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKConversation.kt +++ /dev/null @@ -1,156 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKConversation() : VKModel(), Cloneable { - - override val attachmentType = VKAttachments.Type.NONE - - companion object { - const val serialVersionUID: Long = 1L - - var profiles = arrayListOf() - var groups = arrayListOf() - - var conversationsCount: Int = 0 - - var count: Int = 0 - } - - var isAllowed: Boolean = false - var notAllowedReason: Reason = Reason.NULL - - var inReadMessageId: Int = 0 - var outReadMessageId: Int = 0 - var lastMessageId: Int = 0 - var unreadCount: Int = 0 - - var id: Int = 0 - - var intType: Int = 0 - var type: Type = Type.NULL - - var localId: Int = 0 - - var notificationsEnabled: Boolean = false - - var disabledUntil: Int = 0 - var isDisabledForever: Boolean = false - var isNoSound: Boolean = false - - var membersCount: Int = 0 - var title: String? = null - - var pinnedMessage: oldVKMessage? = null - - var intState: Int = 0 - var state: State = State.IN - - var lastMessage: oldVKMessage = oldVKMessage() - - var isGroupChannel: Boolean = false - - var photo50: String = "" - var photo100: String = "" - var photo200: String = "" - - var peerUser: oldVKUser? = null - - var peerGroup: oldVKGroup? = null - - constructor(o: JSONObject) : this() { - inReadMessageId = o.optInt("in_read") - outReadMessageId = o.optInt("out_read") - lastMessageId = o.optInt("last_message_id", -1) - unreadCount = o.optInt("unread_count", 0) - - o.optJSONObject("peer")?.let { - id = it.optInt("id", -1) - type = Type.fromString(it.optString("type")) - localId = it.optInt("local_id") - } - - o.optJSONObject("push_settings")?.let { - disabledUntil = it.optInt("disabled_until") - isDisabledForever = it.optBoolean("disabled_forever") - isNoSound = it.optBoolean("no_sound") - } - - o.optJSONObject("can_write")?.let { - isAllowed = it.optBoolean("allowed") - notAllowedReason = Reason.fromInt(it.optInt("reason", -1)) - } - - o.optJSONObject("chat_settings")?.let { - membersCount = it.optInt("members_count") - title = it.optString("title") - if (title?.isBlank() == true) title = null - - it.optJSONObject("pinned_message")?.let { pinned -> - pinnedMessage = oldVKMessage(pinned) - } - - state = State.fromString(it.optString("state")) - - it.optJSONObject("photo")?.let { photo -> - photo50 = photo.optString("photo_50") - photo100 = photo.optString("photo_100") - photo200 = photo.optString("photo_200") - } - - isGroupChannel = it.optBoolean("is_group_channel") - } - } - - fun isNotificationsDisabled() = (isDisabledForever || disabledUntil > 0 || isNoSound) - - fun isChat() = type == Type.CHAT - - fun isUser() = type == Type.USER - - fun isGroup() = type == Type.GROUP - - override fun toString() = title ?: "" - - public override fun clone() = super.clone() as oldVKConversation - - enum class Type(val value: String) { - NULL("null"), - USER("user"), - CHAT("chat"), - GROUP("group"); - - companion object { - fun fromString(value: String) = values().first { it.value == value } - } - } - - enum class State(val value: String) { - IN("in"), - KICKED("kicked"), - LEFT("left"); - - companion object { - fun fromString(value: String) = values().first { it.value == value } - } - } - - enum class Reason(val value: Int) { - NULL(-1), - U(0), - BLOCKED_DELETED(18), - BLACKLISTED(900), - BLOCKED_GROUP_MESSAGES(901), - PRIVACY_SETTINGS(902), - GROUP_DISABLED_MESSAGES(915), - GROUP_BLOCKED_MESSAGES(916), - NO_ACCESS_CHAT(917), - NO_ACCESS_EMAIL(918), - U1(925), - NO_ACCESS_COMMUNITY(203); - - companion object { - fun fromInt(value: Int) = values().first { it.value == value } - } - } -} diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKDocument.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKDocument.kt deleted file mode 100644 index 88ff6170..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKDocument.kt +++ /dev/null @@ -1,101 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject -import java.io.Serializable -import java.util.* - -class oldVKDocument() : VKModel() { - - override val attachmentType = VKAttachments.Type.DOCUMENT - - companion object { - const val serialVersionUID: Long = 1L - } - - var id: Int = 0 - var ownerId: Int = 0 - var title: String = "" - var size: Int = 0 - var ext: String = "" - var url: String = "" - var date: Int = 0 - var type: Type = Type.UNKNOWN - var preview: Preview? = null - - constructor(o: JSONObject) : this() { - id = o.optInt("id", -1) - ownerId = o.optInt("owner_id", -1) - title = o.optString("title") - size = o.optInt("size") - ext = o.optString("ext") - url = o.optString("url") - date = o.optInt("date") - type = Type.fromInt(o.optInt("type")) - - o.optJSONObject("preview")?.let { - preview = Preview(it) - } - } - - class Preview(o: JSONObject) : Serializable { - companion object { - const val serialVersionUID: Long = 1L - } - - var photo: Photo? = null - var graffiti: Graffiti? = null - - inner class Photo(o: JSONObject) : Serializable { - - var sizes: ArrayList? = null - - init { - o.optJSONArray("sizes")?.let { - val sizes = ArrayList() - for (i in 0 until it.length()) { - sizes.add(oldVKPhotoSize(it.optJSONObject(i))) - } - this.sizes = sizes - } - } - } - - class Graffiti(o: JSONObject) : Serializable { - - companion object { - const val serialVersionUID: Long = 1L - } - - var src: String = o.optString("src") - var width: Int = o.optInt("width") - var height: Int = o.optInt("height") - } - - init { - o.optJSONObject("photo")?.let { - photo = Photo(it) - } - - o.optJSONObject("graffiti")?.let { - graffiti = Graffiti(it) - } - - } - } - - enum class Type(val value: Int) { - NONE(0), - TEXT(1), - ARCHIVE(2), - GIF(3), - IMAGE(4), - AUDIO(5), - VIDEO(6), - BOOK(7), - UNKNOWN(8); - - companion object { - fun fromInt(value: Int) = values().first { it.value == value } - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGeolocation.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGeolocation.kt deleted file mode 100644 index ad912543..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGeolocation.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKGeolocation() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.GEOLOCATION - - constructor(o: JSONObject) : this() {} - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGift.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGift.kt deleted file mode 100644 index 693e1c76..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGift.kt +++ /dev/null @@ -1,25 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKGift() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.GIFT - - var id: Int = 0 - var thumb256: String = "" - var thumb96: String = "" - var thumb48: String = "" - - constructor(o: JSONObject) : this() { - id = o.optInt("id", -1) - thumb256 = o.optString("thumb_256") - thumb96 = o.optString("thumb_96") - thumb48 = o.optString("thumb_48") - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGraffiti.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGraffiti.kt deleted file mode 100644 index d439565b..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGraffiti.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKGraffiti() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.GRAFFITI - - var id: Int = 0 - var ownerId: Int = 0 - var url: String = "" - var width: Int = 0 - var height: Int = 0 - var accessKey: String = "" - - constructor(o: JSONObject) : this() { - id = o.optInt("id", -1) - ownerId = o.optInt("owner_id", -1) - url = o.optString("url") - width = o.optInt("width") - height = o.optInt("height") - accessKey = o.optString("access_key") - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGroup.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGroup.kt deleted file mode 100644 index d2ededfa..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKGroup.kt +++ /dev/null @@ -1,56 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONArray -import org.json.JSONObject - -open class oldVKGroup() : VKModel() { - - override val attachmentType = VKAttachments.Type.NONE - - companion object { - - const val serialVersionUID: Long = 1L - - fun parse(array: JSONArray): ArrayList { - val groups = ArrayList() - - for (i in 0 until array.length()) { - groups.add(oldVKGroup(array.optJSONObject(i))) - } - return groups - } - } - - var id: Int = 0 - var name: String = "" - var screenName: String = "" - var isClosed: Boolean = false - var deactivated: String = "" - var type: Type = Type.NULL - var photo50: String = "" - var photo100: String = "" - var photo200: String = "" - - constructor(o: JSONObject) : this() { - id = o.optInt("id", -1) - name = o.optString("name") - screenName = o.optString("screen_name") - isClosed = o.optInt("is_closed") == 1 - deactivated = o.optString("deactivated") - type = Type.fromString(o.optString("type")) - photo50 = o.optString("photo_50") - photo100 = o.optString("photo_100") - photo200 = o.optString("photo_200") - } - - enum class Type(val value: String) { - NULL("null"), - GROUP("group"), - PAGE("page"), - EVENT("event"); - - companion object { - fun fromString(value: String) = values().first { it.value == value } - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKLink.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKLink.kt deleted file mode 100644 index e11c3ba8..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKLink.kt +++ /dev/null @@ -1,57 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject -import java.io.Serializable - -class oldVKLink() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.LINK - - var url: String = "" - var title: String = "" - var caption: String = "" - var description: String = "" - var previewPage: String = "" - var previewUrl: String = "" - var photo: oldVKPhoto? = null - var button: Button? = null - - constructor(o: JSONObject): this() { - url = o.optString("url") - title = o.optString("title") - caption = o.optString("caption") - description = o.optString("description") - previewPage = o.optString("preview_page") - previewUrl = o.optString("preview_url") - - o.optJSONObject("photo")?.let { - photo = oldVKPhoto(it) - } - - o.optJSONObject("button")?.let { - button = Button(it) - } - } - - class Button(o: JSONObject) : Serializable { - var title: String = o.optString("title") - var action: Action? = null - - init { - o.optJSONObject("action")?.let { - action = Action(it) - } - } - - class Action(o: JSONObject) : Serializable { - - var type: String = o.optString("type") - var url: String = o.optString("url") - - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKMessage.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKMessage.kt deleted file mode 100644 index 00519819..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKMessage.kt +++ /dev/null @@ -1,164 +0,0 @@ -package com.meloda.fast.api.model.old - -import android.util.ArrayMap -import com.meloda.fast.api.oldVKUtil -import org.json.JSONObject - -open class oldVKMessage() : VKModel() { - - override val attachmentType = VKAttachments.Type.NONE - - companion object { - - var profiles = arrayListOf() - var groups = arrayListOf() - var conversations = arrayListOf() - - const val serialVersionUID: Long = 1L - - var lastHistoryCount: Int = 0 - - const val UNREAD = 1 // Оно просто есть - const val OUTBOX = 1 shl 1 // Исходящее сообщение - const val REPLIED = 1 shl 2 // На сообщение был создан ответ - const val IMPORTANT = 1 shl 3 // Важное сообщение - const val FRIENDS = 1 shl 5 // Сообщение в чат друга - const val SPAM = 1 shl 6 // Сообщение помечено как спам - const val DELETED = 1 shl 7 // Удаление сообщения - const val AUDIO_LISTENED = 1 shl 12 // ГС прослушано - const val CHAT = 1 shl 13 // Сообщение отправлено в беседу - const val CANCEL_SPAM = 1 shl 15 // Отмена пометки спама - const val HIDDEN = 1 shl 16 // Приветственное сообщение сообщества - const val DELETE_FOR_ALL = 1 shl 17 // Сообщение удалено для всех - const val CHAT_IN = 1 shl 19 // Входящее сообщение в беседе - const val REPLY_MSG = 1 shl 21 // Ответ на сообщение - - val flags = ArrayMap() - - fun isOut(flags: Int): Boolean { - return OUTBOX and flags > 0 - } - - fun isDeleted(flags: Int): Boolean { - return DELETED and flags > 0 - } - - fun isUnread(flags: Int): Boolean { - return UNREAD and flags > 0 - } - - fun isSpam(flags: Int): Boolean { - return SPAM and flags > 0 - } - - fun isCanceledSpam(flags: Int): Boolean { - return CANCEL_SPAM and flags > 0 - } - - fun isImportant(flags: Int): Boolean { - return IMPORTANT and flags > 0 - } - - fun isDeletedForAll(flags: Int): Boolean { - return DELETE_FOR_ALL and flags > 0 - } - - init { - flags["unread"] = UNREAD - flags["outbox"] = OUTBOX - flags["replied"] = REPLIED - flags["important"] = IMPORTANT - flags["friends"] = FRIENDS - flags["spam"] = SPAM - flags["deleted"] = DELETED - flags["audio_listened"] = AUDIO_LISTENED - flags["chat"] = CHAT - flags["cancel_spam"] = CANCEL_SPAM - flags["hidden"] = HIDDEN - flags["delete_for_all"] = DELETE_FOR_ALL - flags["chat_in"] = CHAT_IN - flags["reply_msg"] = REPLY_MSG - } - } - - var id: Int = 0 - var date: Int = 0 - var peerId: Int = 0 - var fromId: Int = 0 - var editTime: Int = 0 - var isOut: Boolean = false - var text: String = "" - var randomId: Int = 0 - var conversationMessageId: Int = 0 - - var hasEmoji: Boolean = false - var isImportant: Boolean = false - var isRead: Boolean = false - - var attachments: ArrayList = arrayListOf() - - var fwdMessages: ArrayList = arrayListOf() - - var replyMessage: oldVKMessage? = null - - var action: oldVKMessageAction? = null - - var fromUser: oldVKUser? = null - - var fromGroup: oldVKGroup? = null - - constructor(o: JSONObject) : this() { - id = o.optInt("id", -1) - date = o.optInt("date") - peerId = o.optInt("peer_id", -1) - fromId = o.optInt("from_id", -1) - editTime = o.optInt("edit_time", -1) - isOut = o.optInt("out") == 1 - - text = oldVKUtil.prepareMessageText(o.optString("text")) - - randomId = o.optInt("random_id", -1) - conversationMessageId = o.optInt("conversation_message_id", -1) - isImportant = o.optBoolean("important") - - o.optJSONArray("attachments")?.let { - attachments = VKAttachments.parse(it) - } - - o.optJSONArray("fwd_messages")?.let { - val fwdMessages = ArrayList(it.length()) - for (i in 0 until it.length()) { - fwdMessages.add(oldVKMessage(it.optJSONObject(i))) - } - this.fwdMessages = fwdMessages - } - - o.optJSONObject("reply_message")?.let { - replyMessage = oldVKMessage(it) - } - - o.optJSONObject("action")?.let { - action = oldVKMessageAction(it) - } - } - - fun getForwardedMessages() = ArrayList().apply { - for (model in fwdMessages) add(model) - } - - fun isFromUser() = fromId > 0 - - fun isFromGroup() = fromId < 0 - - fun isOutbox() = isOut - - fun isInbox() = !isOutbox() - - override fun toString(): String { - return if (text.isNotEmpty()) { - text - } else { - super.toString() - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKMessageAction.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKMessageAction.kt deleted file mode 100644 index cdd3e473..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKMessageAction.kt +++ /dev/null @@ -1,47 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKMessageAction() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.NONE - - var type: Type = Type.NONE - var memberId = 0 - var message: oldVKMessage? = null - var conversationMessageId: Int = 0 - var text: String = "" - var oldText: String = "" - - //TODO: add photo - - constructor(o: JSONObject) : this() { - type = Type.fromString(o.optString("type")) - memberId = o.optInt("member_id", -1) - text = o.optString("text") - } - - enum class Type(val value: String) { - NONE("none"), - CHAT_CREATE("chat_create"), - PHOTO_UPDATE("chat_photo_update"), - PHOTO_REMOVE("chat_photo_remove"), - TITLE_UPDATE("chat_title_update"), - PIN_MESSAGE("chat_pin_message"), - UNPIN_MESSAGE("chat_unpin_message"), - INVITE_USER("chat_invite_user"), - INVITE_USER_BY_LINK("chat_invite_user_by_link"), - KICK_USER("chat_kick_user"), - SCREENSHOT("chat_screenshot"), - INVITE_USER_BY_CALL("chat_invite_user_by_call"), - INVITE_USER_BY_CALL_LINK("chat_invite_user_by_call_link"); - - companion object { - fun fromString(value: String) = values().first { it.value == value } - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPhoto.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPhoto.kt deleted file mode 100644 index 0e9c8fcb..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPhoto.kt +++ /dev/null @@ -1,40 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject -import java.util.* - -class oldVKPhoto() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.PHOTO - - var id: Int = 0 - var albumId: Int = 0 - var ownerId: Int = 0 - var text: String = "" - var date: Int = 0 - var width: Int = 0 - var height: Int = 0 - var sizes: ArrayList? = null - - constructor(o: JSONObject) : this() { - id = o.optInt("id", -1) - albumId = o.optInt("album_id", -1) - ownerId = o.optInt("owner_id", -1) - text = o.optString("text") - date = o.optInt("date") - width = o.optInt("width") - height = o.optInt("height") - - o.optJSONArray("sizes")?.let { - val sizes = ArrayList() - for (i in 0 until it.length()) { - sizes.add(oldVKPhotoSize(it.optJSONObject(i))) - } - this.sizes = sizes - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPhotoSize.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPhotoSize.kt deleted file mode 100644 index 675bf6b7..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPhotoSize.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKPhotoSize(o: JSONObject) : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.NONE - - var type: String = o.optString("type") - var url: String = o.optString("url") - var height: Int = o.optInt("height") - var width: Int = o.optInt("width") - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPoll.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPoll.kt deleted file mode 100644 index 4427243b..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKPoll.kt +++ /dev/null @@ -1,58 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKPoll() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.POLL - - constructor(o: JSONObject): this() {} - -// var id = o.optInt("id", -1) -// var ownerId = o.optInt("owner_id", -1) -// var created = o.optInt("created") -// var question: String = o.optString("question") -// var votes = o.optInt("votes") -// var answers = ArrayList() -// var isAnonymous = o.optBoolean("anonymous") -// var isMultiple = o.optBoolean("multiple") -// var answerIds = ArrayList() -// var endDate = o.optInt("end_date") -// var isClosed = o.optBoolean("closed") -// var isBoard = o.optBoolean("is_board") -// var isCanEdit = o.optBoolean("can_edit") -// var isCanVote = false -// var isCanReport = false -// var isCanShare = false -// var authorId = 0 -// var background = Color.WHITE - - //TODO: private ArrayList friends - -// init { -// o.optJSONArray("answers")?.let { -// val answers = ArrayList() -// for (i in 0 until it.length()) { -// answers.add(Answer(it.optJSONObject(i))) -// } -// this.answers = answers -// } - -// //setAnswerIds(); - -// // ... -// } - -// class Answer(o: JSONObject) : Serializable { - -// var id = o.optInt("id", -1) -// var text: String = o.optString("text") -// var votes = o.optInt("votes") -// var rate = o.optInt("rate") - -// } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKSticker.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKSticker.kt deleted file mode 100644 index 954340f8..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKSticker.kt +++ /dev/null @@ -1,44 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject -import java.util.* - -class oldVKSticker() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.STICKER - - var productId: Int = 0 - var stickerId: Int = 0 - var images: ArrayList? = null - - constructor(o: JSONObject) : this() { - productId = o.optInt("product_id", -1) - stickerId = o.optInt("sticker_id", -1) - - o.optJSONArray("images")?.let { - val images = ArrayList() - for (i in 0 until it.length()) { - images.add(Image(it.optJSONObject(i))) - } - this.images = images - } - } - - class Image(o: JSONObject) : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.NONE - - var url: String = o.optString("url") - var width = o.optInt("width") - var height = o.optInt("height") - - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKUser.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKUser.kt deleted file mode 100644 index 4cf9446b..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKUser.kt +++ /dev/null @@ -1,80 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONArray -import org.json.JSONObject - -open class oldVKUser() : VKModel() { - - override val attachmentType = VKAttachments.Type.NONE - - companion object { - const val serialVersionUID: Long = 1L - - var friendsCount: Int = 0 - - fun parse(array: JSONArray): ArrayList { - val users = ArrayList() - - for (i in 0 until array.length()) { - users.add(oldVKUser(array.optJSONObject(i))) - } - - return users - } - } - - var sortId: Int = 0 - - var userId: Int = 0 - var firstName: String = "" - var lastName: String = "" - var deactivated: String = "" - var isClosed: Boolean = false - var isCanAccessClosed: Boolean = true - var sex: Int = 0 - var screenName: String = "" - var photo50: String = "" - var photo100: String = "" - var photo200: String = "" - var isOnline: Boolean = false - var isOnlineMobile: Boolean = false - var status: String = "" - - var lastSeen: Int = 0 - var lastSeenPlatform: Int = 0 - - var isVerified: Boolean = false - - constructor(o: JSONObject) : this() { - sortId = 0 - userId = o.optInt("id", -1) - firstName = o.optString("first_name") - lastName = o.optString("last_name") - deactivated = o.optString("deactivated", "") - isClosed = o.optBoolean("is_closed") - isCanAccessClosed = o.optBoolean("can_access_closed") - sex = o.optInt("sex") - screenName = o.optString("screen_name") - photo50 = o.optString("photo_50") - photo100 = o.optString("photo_100") - photo200 = o.optString("photo_200") - isOnline = o.optInt("online") == 1 - isOnlineMobile = isOnline && o.optInt("online_mobile") == 1 - status = o.optString("status") - lastSeen = 0 - lastSeenPlatform = 0 - isVerified = o.optInt("verified") == 1 - - o.optJSONObject("last_seen")?.let { - lastSeen = it.optInt("time") - lastSeenPlatform = it.optInt("platform") - } - - } - - fun isDeactivated() = deactivated.isNotEmpty() - - override fun toString(): String { - return "$firstName $lastName" - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKVideo.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKVideo.kt deleted file mode 100644 index 8423c877..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKVideo.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.meloda.fast.api.model.old - -import com.meloda.fast.api.model.old.VKAttachments -import com.meloda.fast.api.model.old.VKModel -import org.json.JSONObject - -class oldVKVideo() : VKModel() { - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.VIDEO - -// var id = o.optInt("id", -1) -// var ownerId = o.optInt("owner_id", -1) -// var title: String = o.optString("title") -// var description: String = o.optString("description") -// var duration = o.optInt("duration", -1) -// var photo130: String = o.optString("photo_130") -// var photo320: String = o.optString("photo_320") -// var photo640: String = o.optString("photo_640") -// var photo800: String = o.optString("photo_800") -// var photo1280: String = o.optString("photo_1280") -// var firstFrame130: String = o.optString("first_frame_130") -// var firstFrame320: String = o.optString("first_frame_320") -// var firstFrame640: String = o.optString("first_frame_640") -// var firstFrame800: String = o.optString("first_frame_800") -// var firstFrame1280: String = o.optString("first_frame_1280") -// var date = o.optInt("date") -// var views = o.optInt("views") -// var comments = o.optInt("comments") -// var player: String = o.optString("player") -// var isCanEdit = o.optInt("can_edit", 0) == 1 -// var isCanAdd = o.optInt("can_add") == 1 -// var isPrivate = o.optInt("is_private", 0) == 1 -// var accessKey: String = o.optString("access_key") -// var isProcessing = o.optInt("processing", 0) == 1 -// var isLive = o.optInt("live", 0) == 1 -// var isUpcoming = o.optInt("upcoming", 0) == 1 -// var isFavorite = o.optBoolean("favorite") - - constructor(o: JSONObject) : this() {} - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKWall.kt b/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKWall.kt deleted file mode 100644 index 640ffc85..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/model/old/oldVKWall.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.meloda.fast.api.model.old - -import org.json.JSONObject - -class oldVKWall() : VKModel() { //https://vk.com/dev/objects/post - - companion object { - const val serialVersionUID: Long = 1L - } - - override val attachmentType = VKAttachments.Type.WALL_POST - - constructor(o: JSONObject) : this() {} - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/network/response/ConversationsResponse.kt b/app/src/main/kotlin/com/meloda/fast/api/network/response/ConversationsResponse.kt index ce9bc2f6..951e5b55 100644 --- a/app/src/main/kotlin/com/meloda/fast/api/network/response/ConversationsResponse.kt +++ b/app/src/main/kotlin/com/meloda/fast/api/network/response/ConversationsResponse.kt @@ -22,5 +22,5 @@ data class ConversationsGetResponse( data class ConversationsResponseItems( val conversation: BaseVkConversation, @SerializedName("last_message") - val lastMessage: BaseVkMessage + val lastMessage: BaseVkMessage? ) : Parcelable \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/api/oldVKUtil.kt b/app/src/main/kotlin/com/meloda/fast/api/oldVKUtil.kt deleted file mode 100644 index c2bc1aa5..00000000 --- a/app/src/main/kotlin/com/meloda/fast/api/oldVKUtil.kt +++ /dev/null @@ -1,379 +0,0 @@ -package com.meloda.fast.api - -import androidx.annotation.WorkerThread -import com.meloda.fast.api.model.* -import com.meloda.fast.api.model.old.* -import com.meloda.fast.api.network.VKErrors -import org.json.JSONArray -import org.json.JSONObject -import java.text.SimpleDateFormat -import java.util.* - -// TODO: 8/31/2021 review -object oldVKUtil { - - private const val TAG = "VKUtil" - - fun isValidationRequired(throwable: Throwable): Boolean { - if (throwable !is VKException) return false - return throwable.error == VKErrors.NEED_VALIDATION - } - - fun isCaptchaRequired(throwable: Throwable): Boolean { - if (throwable !is VKException) return false - return throwable.error == VKErrors.NEED_CAPTCHA - } - - fun sortMessagesByDate( - values: ArrayList, - firstOnTop: Boolean - ): ArrayList { - values.sortWith { m1, m2 -> - val d1 = m1.date - val d2 = m2.date - - if (firstOnTop) { - d2 - d1 - } else { - d1 - d2 - } - } - - return values - } - - fun sortConversationsByDate( - values: ArrayList, - firstOnTop: Boolean - ): ArrayList { - values.sortWith { c1, c2 -> - val d1 = c1.lastMessage.date - val d2 = c2.lastMessage.date - - return@sortWith if (firstOnTop) { - d2 - d1 - } else { - d1 - d2 - } - } - - return values - } - - fun prepareMessageText(message: String): String { - if (message.isEmpty()) return message - - var newText = message - - val mentions = hashMapOf() - - var startFrom = 0 - - while (true) { - val leftBracketIndex = newText.indexOf('[', startFrom) - val verticalLineIndex = newText.indexOf('|', startFrom) - val rightBracketIndex = newText.indexOf(']', startFrom) - - if (leftBracketIndex == -1 || - verticalLineIndex == -1 || - rightBracketIndex == -1 - ) { - break - } - - val id = newText.substring(leftBracketIndex + 1, verticalLineIndex) - - if (!id.matches(Regex("^id(\\d+)\$")) || rightBracketIndex - verticalLineIndex < 2) { - break - } - - val text = newText.substring(verticalLineIndex + 1, rightBracketIndex) - - val str = "[$id|$text]" - - mentions[str] = text - startFrom = rightBracketIndex + 1 - } - - mentions.forEach { - newText = newText.replace(it.key, it.value) - } - - return newText - } - -// fun removeTime(date: Date): Long { -// return Calendar.getInstance().apply { -// time = date -// this[Calendar.HOUR_OF_DAY] = 0 -// this[Calendar.MINUTE] = 0 -// this[Calendar.SECOND] = 0 -// this[Calendar.MILLISECOND] = 0 -// }.timeInMillis -// } - - - //TODO: нормальное время - fun getLastSeenTime(date: Long): String { - return SimpleDateFormat("HH:mm", Locale.getDefault()).format(date) - } - - - fun getTitle( - conversation: oldVKConversation, - peerUser: oldVKUser?, - peerGroup: oldVKGroup? - ): String { - return when { - conversation.isUser() -> peerUser?.let { return it.toString() } ?: "" - - - conversation.isGroup() -> peerGroup?.let { return it.name } ?: "" - - - conversation.isChat() -> conversation.title ?: "" - - else -> "" - } - } - - fun getMessageTitle( - message: oldVKMessage, - fromUser: oldVKUser?, - fromGroup: oldVKGroup? - ): String { - return when { - message.isFromUser() -> { - fromUser?.let { return it.toString() } ?: "" - } - - message.isFromGroup() -> { - fromGroup?.let { return it.name } ?: "" - } - - else -> "" - } - } - - fun getAvatar( - conversation: oldVKConversation, - peerUser: oldVKUser?, - peerGroup: oldVKGroup? - ): String { - return when { - conversation.isUser() -> { - peerUser?.let { return it.photo200 } ?: "" - } - - conversation.isGroup() -> { - peerGroup?.let { return it.photo200 } ?: "" - } - - conversation.isChat() -> { - conversation.photo200 - } - - else -> "" - } - } - - fun getUserAvatar( - message: oldVKMessage, - fromUser: oldVKUser?, - fromGroup: oldVKGroup? - ): String { - return when { - message.isFromUser() -> { - fromUser?.let { return it.photo100 } ?: "" - } - - message.isFromGroup() -> { - fromGroup?.let { return it.photo100 } ?: "" - } - - else -> "" - } - } - - fun getUserPhoto(user: oldVKUser): String { - if (user.photo200.isEmpty()) { - if (user.photo100.isEmpty()) { - if (user.photo50.isEmpty()) { - return "" - } - } else { - return user.photo100 - } - } else { - return user.photo200 - } - - return "" - } - - fun getGroupPhoto(group: oldVKGroup): String { - if (group.photo200.isEmpty()) { - if (group.photo100.isEmpty()) { - if (group.photo50.isEmpty()) { - return "" - } - } else { - return group.photo100 - } - } else { - return group.photo200 - } - - return "" - } - - - fun parseConversations(array: JSONArray): ArrayList { - val conversations = arrayListOf() - for (i in 0 until array.length()) { - conversations.add(oldVKConversation(array.optJSONObject(i))) - } - - return conversations - } - - fun parseMessages(array: JSONArray): ArrayList { - val messages = arrayListOf() - for (i in 0 until array.length()) { - messages.add(oldVKMessage(array.optJSONObject(i))) - } - - return messages - } - - fun isMessageHasFlag(mask: Int, flagName: String): Boolean { - val o: Any? = oldVKMessage.flags[flagName] - return if (o != null) { //has flag - val flag = o as Int - flag and mask > 0 - } else false - } - - //TODO: rewrite parsing - //fromUser and fromGroup are null - @Deprecated("need to rewrite") - @WorkerThread - fun parseLongPollMessage(array: JSONArray): oldVKMessage { - val message = oldVKMessage() - - val id = array.optInt(1) - val flags = array.optInt(2) - val peerId = array.optInt(3) - val date = array.optInt(4) - val text = array.optString(5) - - message.id = id - message.peerId = peerId - message.date = date - message.text = text - -// val fromId = -// if (isMessageHasFlag(flags, "outbox")) com.meloda.fast.api.UserConfig.userId -// else peerId - - message.fromId = peerId - - array.optJSONObject(6)?.let { - if (it.has("emoji")) message.hasEmoji = true - - if (it.has("from")) { - message.fromId = it.optInt("from", -1) - } - - if (it.has("source_act")) { - message.action = oldVKMessageAction().also { action -> - action.type = - oldVKMessageAction.Type.fromString(it.optString("source_act")) - - when (action.type) { - oldVKMessageAction.Type.CHAT_CREATE -> { - action.text = it.optString("source_text") - } - oldVKMessageAction.Type.TITLE_UPDATE -> { - action.oldText = it.optString("source_old_text") - action.text = it.optString("source_text") - } - oldVKMessageAction.Type.PIN_MESSAGE -> { - action.memberId = it.optInt("source_mid") - action.conversationMessageId = it.optInt("source_chat_local_id") - - it.optJSONObject("source_message")?.let { message -> - action.message = oldVKMessage(message) - } - } - oldVKMessageAction.Type.UNPIN_MESSAGE -> { - action.memberId = it.optInt("source_mid") - action.conversationMessageId = it.optInt("source_chat_local_id") - } - oldVKMessageAction.Type.INVITE_USER, - oldVKMessageAction.Type.KICK_USER, - oldVKMessageAction.Type.SCREENSHOT, - oldVKMessageAction.Type.INVITE_USER_BY_CALL -> { - action.memberId = it.optInt("source_mid") - } - } - } - } - } - - array.optJSONObject(7)?.let { - /** - * - * fwd? reply? attachments_count? attachments? - * - */ - } - - val randomId = array.optInt(8) - message.randomId = randomId - - val conversationMessageId = array.optInt(9) - message.conversationMessageId = conversationMessageId - - val editTime = array.optInt(10) - message.editTime = editTime - -// val out = fromId == com.meloda.fast.api.UserConfig.userId -// message.isOut = out -// -// if (message.isFromUser()) { -// message.fromUser = MemoryCache.getUserById(fromId) -// } else { -// message.fromGroup = MemoryCache.getGroupById(abs(fromId)) -// } - - return message - } - - fun parseJsonPhotos(jsonPhotos: JSONObject): List { - val photos = arrayListOf() - - for (key in jsonPhotos.keys()) { - photos.add(jsonPhotos.getString(key)) - } - - return photos - } - - fun putPhotosToJson(photo50: String, photo100: String, photo200: String): JSONObject { - val json = JSONObject() - - json.put("photo_50", photo50) - json.put("photo_100", photo100) - json.put("photo_200", photo200) - - return json - } - - fun isGroupId(id: Int) = id < 0 - - fun isUserId(id: Int) = id in 1..1999999999 - - fun isChatId(id: Int) = id > 2_000_000_000 - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/base/BaseFullscreenDialog.kt b/app/src/main/kotlin/com/meloda/fast/base/BaseFullscreenDialog.kt deleted file mode 100644 index 489aa388..00000000 --- a/app/src/main/kotlin/com/meloda/fast/base/BaseFullscreenDialog.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.meloda.fast.base - -import android.os.Bundle -import android.view.ViewGroup -import android.view.WindowManager -import androidx.fragment.app.DialogFragment -import com.meloda.fast.R - -abstract class BaseFullscreenDialog : DialogFragment() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - - setStyle(STYLE_NORMAL, R.style.AppTheme_FullScreenDialog) - } - - override fun onStart() { - super.onStart() - - dialog?.let { dialog -> - val width = ViewGroup.LayoutParams.MATCH_PARENT - val height = ViewGroup.LayoutParams.MATCH_PARENT - - dialog.window?.let { - it.setLayout(width, height) - it.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN) - it.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) - - it.setWindowAnimations(R.style.AppTheme_Slide) - } - } - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/common/AppGlobal.kt b/app/src/main/kotlin/com/meloda/fast/common/AppGlobal.kt index 4540bd4f..eb093fdc 100644 --- a/app/src/main/kotlin/com/meloda/fast/common/AppGlobal.kt +++ b/app/src/main/kotlin/com/meloda/fast/common/AppGlobal.kt @@ -1,40 +1,22 @@ package com.meloda.fast.common -import android.annotation.SuppressLint import android.app.Application import android.content.ClipboardManager import android.content.Context import android.content.SharedPreferences import android.content.pm.PackageManager import android.content.res.Resources -import android.database.sqlite.SQLiteDatabase import android.net.ConnectivityManager -import android.os.Handler import android.view.inputmethod.InputMethodManager import androidx.core.content.pm.PackageInfoCompat import androidx.preference.PreferenceManager import androidx.room.Room import com.meloda.fast.BuildConfig -import com.meloda.fast.R import com.meloda.fast.database.AppDatabase -import com.meloda.fast.database.old.DatabaseHelper import com.meloda.fast.util.AndroidUtils import dagger.hilt.android.HiltAndroidApp import org.acra.ACRA -import org.acra.ReportingInteractionMode -import org.acra.annotation.ReportsCrashes -import java.util.* -@SuppressLint("NonConstantResourceId") -@ReportsCrashes( - mailTo = "lischenkodev@gmail.com", - mode = ReportingInteractionMode.DIALOG, - resDialogTitle = R.string.app_has_been_crashed, - resDialogText = R.string.empty, - resDialogTheme = R.style.AppTheme_Dialog, - resDialogPositiveButtonText = R.string.send_crash_report, - resDialogNegativeButtonText = R.string.ok -) @HiltAndroidApp class AppGlobal : Application() { @@ -45,17 +27,12 @@ class AppGlobal : Application() { lateinit var clipboardManager: ClipboardManager lateinit var preferences: SharedPreferences - lateinit var locale: Locale - lateinit var handler: Handler lateinit var resources: Resources lateinit var packageName: String lateinit var instance: AppGlobal lateinit var appDatabase: AppDatabase - lateinit var dbHelper: DatabaseHelper - lateinit var oldDatabase: SQLiteDatabase - lateinit var packageManager: PackageManager var versionName = "" @@ -63,10 +40,6 @@ class AppGlobal : Application() { var screenWidth = 0 var screenHeight = 0 - - fun post(runnable: Runnable) { - handler.post(runnable) - } } override fun onCreate() { @@ -84,11 +57,6 @@ class AppGlobal : Application() { .build() preferences = PreferenceManager.getDefaultSharedPreferences(this) - handler = Handler(mainLooper) - locale = Locale.getDefault() - - dbHelper = DatabaseHelper(this) - oldDatabase = dbHelper.writableDatabase val info = packageManager.getPackageInfo(this.packageName, PackageManager.GET_ACTIVITIES) versionName = info.versionName diff --git a/app/src/main/kotlin/com/meloda/fast/database/AppDatabase.kt b/app/src/main/kotlin/com/meloda/fast/database/AppDatabase.kt index 523e3adf..467d3c21 100644 --- a/app/src/main/kotlin/com/meloda/fast/database/AppDatabase.kt +++ b/app/src/main/kotlin/com/meloda/fast/database/AppDatabase.kt @@ -18,7 +18,7 @@ import com.meloda.fast.database.dao.UsersDao VkUser::class, VkGroup::class ], - version = 8, + version = 11, exportSchema = false ) abstract class AppDatabase : RoomDatabase() { diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/CacheStorage.kt b/app/src/main/kotlin/com/meloda/fast/database/old/CacheStorage.kt deleted file mode 100644 index 7c1e2156..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/CacheStorage.kt +++ /dev/null @@ -1,115 +0,0 @@ -package com.meloda.fast.database.old - -import android.content.ContentValues -import android.database.Cursor -import android.os.Bundle -import com.meloda.fast.common.AppGlobal.Companion.oldDatabase -import com.meloda.fast.database.old.DatabaseUtils.TABLE_CHATS -import com.meloda.fast.database.old.DatabaseUtils.TABLE_FRIENDS -import com.meloda.fast.database.old.DatabaseUtils.TABLE_MESSAGES -import com.meloda.fast.database.old.DatabaseUtils.TABLE_USERS -import com.meloda.fast.database.old.storage.ChatsStorage -import com.meloda.fast.database.old.storage.GroupsStorage -import com.meloda.fast.database.old.storage.MessagesStorage -import com.meloda.fast.database.old.storage.UsersStorage -import com.meloda.fast.api.model.old.oldVKConversation -import com.meloda.fast.api.model.old.oldVKMessage -import com.meloda.fast.api.model.old.oldVKUser -import java.util.* - -object CacheStorage { - - val usersStorage = UsersStorage() - val messagesStorage = MessagesStorage() - val chatsStorage = ChatsStorage() - val groupsStorage = GroupsStorage() - - fun selectCursor(tableName: String): Cursor { - return QueryBuilder.query() - .select("*").from(tableName) - .asCursor(oldDatabase) - } - - fun selectCursor(tableName: String, where: String): Cursor { - return QueryBuilder.query() - .select("*").from(tableName) - .where(where) - .asCursor(oldDatabase) - } - - fun selectCursor(tableName: String, columnName: String, value: Any): Cursor { - return QueryBuilder.query() - .select("*").from(tableName) - .where("$columnName=$value") - .asCursor(oldDatabase) - } - - fun selectCursor(tableName: String, columnName: String, ids: IntArray): Cursor { - val where = StringBuilder(5 * ids.size) - - where.append("$columnName=${ids[0]}") - - for (i in 1 until ids.size) { - where.append(" OR ") - where.append("$columnName=${ids[i]}") - } - - return selectCursor(tableName, where.toString()) - } - - fun getInt(cursor: Cursor, columnName: String) = - cursor.getInt(cursor.getColumnIndexOrThrow(columnName)) - - fun getString(cursor: Cursor, columnName: String) = - cursor.getString(cursor.getColumnIndexOrThrow(columnName)) - - fun getBlob(cursor: Cursor, columnName: String) = - cursor.getBlob(cursor.getColumnIndexOrThrow(columnName)) - - fun insert(tableName: String, values: ArrayList) { - oldDatabase.beginTransaction() - - val contentValues = ContentValues() - - for (value in values) { - when (tableName) { - TABLE_USERS -> { - usersStorage.cacheValue(contentValues, value as oldVKUser) - break - } - TABLE_FRIENDS -> { - usersStorage.cacheValue( - contentValues, - value as oldVKUser, - Bundle().apply { putBoolean("toFriends", true) }) - break - } - TABLE_MESSAGES -> { - messagesStorage.cacheValue(contentValues, value as oldVKMessage) - break - } - TABLE_CHATS -> { - chatsStorage.cacheValue(contentValues, value as oldVKConversation) - break - } - } - - oldDatabase.insert(tableName, null, contentValues) - contentValues.clear() - } - - oldDatabase.setTransactionSuccessful() - oldDatabase.endTransaction() - } - - fun delete(tableName: String, whereClause: String, vararg whereArgs: String) { - oldDatabase.delete(tableName, whereClause, whereArgs) - } - - fun delete(tableName: String) { - oldDatabase.delete(tableName, null, null) - } - - -} - diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseHelper.kt b/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseHelper.kt deleted file mode 100644 index 4c8c868c..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseHelper.kt +++ /dev/null @@ -1,29 +0,0 @@ -package com.meloda.fast.database.old - -import android.content.Context -import android.database.sqlite.SQLiteDatabase -import android.database.sqlite.SQLiteOpenHelper - -class DatabaseHelper constructor(context: Context) : SQLiteOpenHelper( - context, - DB_NAME, - null, - DB_VERSION -) { - companion object { - private const val DB_NAME = "cache.db" - private const val DB_VERSION = 1 - } - - override fun onCreate(db: SQLiteDatabase) { - db.execSQL(DatabaseUtils.createUsersTable()) - db.execSQL(DatabaseUtils.createGroupsTable()) - db.execSQL(DatabaseUtils.createFriendsTable()) - db.execSQL(DatabaseUtils.createMessagesTable()) - db.execSQL(DatabaseUtils.createChatsTable()) - } - - override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) { - - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseKeys.kt b/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseKeys.kt deleted file mode 100644 index 80448159..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseKeys.kt +++ /dev/null @@ -1,95 +0,0 @@ -package com.meloda.fast.database.old - -object DatabaseKeys { - - const val ID = "_id" - - const val SORT_ID = "_sort_id" - - const val USER_ID = "_user_id" - - const val FIRST_NAME = "_first_name" - - const val LAST_NAME = "_last_name" - - const val DEACTIVATED = "_deactivated" - - const val GENDER = "_gender" - - const val SCREEN_NAME = "_screen_name" - - const val PHOTOS = "_photos" - - const val IS_ONLINE = "_is_online" - - const val IS_ONLINE_MOBILE = "_is_online_mobile" - - const val STATUS = "_status" - - const val LAST_SEEN = "_last_seen" - - const val MESSAGE_ID = "_message_id" - - const val DATE = "_date" - - const val PEER_ID = "_peer_id" - - const val FROM_ID = "_from_id" - - const val EDIT_TIME = "_edit_time" - - const val IS_OUT = "_is_out" - - const val TEXT = "_text" - - const val RANDOM_ID = "_random_id" - - const val CONVERSATION_MESSAGE_ID = "_conversation_message_id" - - const val ATTACHMENTS = "_attachments" - - const val FWD_MESSAGES = "_fwd_messages" - - const val REPLY_MESSAGE_ID = "_reply_message_id" - - const val ACTION = "_action" - - const val IS_ALLOWED = "_is_allowed" - - const val NOT_ALLOWED_REASON = "_not_allowed_reason" - - const val IN_READ_MESSAGE_ID = "_in_read_message_id" - - const val OUT_READ_MESSAGE_ID = "_out_read_message_id" - - const val LAST_MESSAGE_ID = "_last_message_id" - - const val UNREAD_COUNT = "_unread_count" - - const val CONVERSATION_ID = "_conversation_id" - - const val TYPE = "_type" - - const val LOCAL_ID = "_local_id" - - const val IS_NOTIFICATIONS_DISABLED = "_is_notifications_disabled" - - const val MEMBERS_COUNT = "_members_count" - - const val TITLE = "_title" - - const val PINNED_MESSAGE_ID = "_pinned_message_id" - - const val CHAT_STATE = "_chat_state" - - const val IS_GROUP_CHANNEL = "_is_group_channel" - - const val FRIEND_ID = "_friend_id" - - const val GROUP_ID = "_group_id" - - const val NAME = "_name" - - const val IS_CLOSED = "_is_closed" - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseUtils.kt b/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseUtils.kt deleted file mode 100644 index 053e2c7d..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/DatabaseUtils.kt +++ /dev/null @@ -1,153 +0,0 @@ -package com.meloda.fast.database.old - -import com.meloda.fast.database.old.DatabaseKeys.ACTION -import com.meloda.fast.database.old.DatabaseKeys.ATTACHMENTS -import com.meloda.fast.database.old.DatabaseKeys.CHAT_STATE -import com.meloda.fast.database.old.DatabaseKeys.CONVERSATION_ID -import com.meloda.fast.database.old.DatabaseKeys.CONVERSATION_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.DATE -import com.meloda.fast.database.old.DatabaseKeys.DEACTIVATED -import com.meloda.fast.database.old.DatabaseKeys.EDIT_TIME -import com.meloda.fast.database.old.DatabaseKeys.FIRST_NAME -import com.meloda.fast.database.old.DatabaseKeys.FRIEND_ID -import com.meloda.fast.database.old.DatabaseKeys.FROM_ID -import com.meloda.fast.database.old.DatabaseKeys.FWD_MESSAGES -import com.meloda.fast.database.old.DatabaseKeys.GENDER -import com.meloda.fast.database.old.DatabaseKeys.GROUP_ID -import com.meloda.fast.database.old.DatabaseKeys.IN_READ_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.IS_ALLOWED -import com.meloda.fast.database.old.DatabaseKeys.IS_CLOSED -import com.meloda.fast.database.old.DatabaseKeys.IS_GROUP_CHANNEL -import com.meloda.fast.database.old.DatabaseKeys.IS_NOTIFICATIONS_DISABLED -import com.meloda.fast.database.old.DatabaseKeys.IS_ONLINE -import com.meloda.fast.database.old.DatabaseKeys.IS_ONLINE_MOBILE -import com.meloda.fast.database.old.DatabaseKeys.IS_OUT -import com.meloda.fast.database.old.DatabaseKeys.LAST_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.LAST_NAME -import com.meloda.fast.database.old.DatabaseKeys.LAST_SEEN -import com.meloda.fast.database.old.DatabaseKeys.LOCAL_ID -import com.meloda.fast.database.old.DatabaseKeys.MEMBERS_COUNT -import com.meloda.fast.database.old.DatabaseKeys.MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.NAME -import com.meloda.fast.database.old.DatabaseKeys.NOT_ALLOWED_REASON -import com.meloda.fast.database.old.DatabaseKeys.OUT_READ_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.PEER_ID -import com.meloda.fast.database.old.DatabaseKeys.PHOTOS -import com.meloda.fast.database.old.DatabaseKeys.PINNED_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.RANDOM_ID -import com.meloda.fast.database.old.DatabaseKeys.REPLY_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.SCREEN_NAME -import com.meloda.fast.database.old.DatabaseKeys.SORT_ID -import com.meloda.fast.database.old.DatabaseKeys.STATUS -import com.meloda.fast.database.old.DatabaseKeys.TEXT -import com.meloda.fast.database.old.DatabaseKeys.TITLE -import com.meloda.fast.database.old.DatabaseKeys.TYPE -import com.meloda.fast.database.old.DatabaseKeys.UNREAD_COUNT -import com.meloda.fast.database.old.DatabaseKeys.USER_ID - -object DatabaseUtils { - - const val TABLE_USERS = "users" - const val TABLE_MESSAGES = "messages" - const val TABLE_CHATS = "chats" - const val TABLE_FRIENDS = "friends" - const val TABLE_GROUPS = "groups" - - private val usersTableMap = HashMap().apply { - this[USER_ID] = "integer primary key on conflict replace" - this[FIRST_NAME] = "varchar(255)" - this[LAST_NAME] = "varchar(255)" - this[DEACTIVATED] = "varchar(255)" - this[GENDER] = "integer default 0" - this[SCREEN_NAME] = "varchar(255)" - this[PHOTOS] = "text" - this[IS_ONLINE] = "integer default 0" - this[IS_ONLINE_MOBILE] = "integer default 0" - this[STATUS] = "varchar(255)" - this[LAST_SEEN] = "integer" - } - - private val groupsTableMap = HashMap().apply { - this[GROUP_ID] = "integer primary key on conflict replace" - this[NAME] = "varchar(255)" - this[SCREEN_NAME] = "varchar(255)" - this[IS_CLOSED] = "integer default 0" - this[DEACTIVATED] = "varchar(255)" - this[TYPE] = "varchar(255)" - this[PHOTOS] = "text" - } - - private val messagesTableMap = HashMap().apply { - this[MESSAGE_ID] = "integer primary key on conflict replace" - this[DATE] = "integer" - this[PEER_ID] = "integer" - this[FROM_ID] = "integer" - this[EDIT_TIME] = "integer" - this[IS_OUT] = "integer default 0" - this[TEXT] = "text" - this[RANDOM_ID] = "integer" - this[CONVERSATION_MESSAGE_ID] = "integer" - this[ATTACHMENTS] = "blob" - this[REPLY_MESSAGE_ID] = "integer" - this[ACTION] = "blob" - - //2,3,4,5 - message_ids - this[FWD_MESSAGES] = "text" - } - - private val chatsTableMap = HashMap().apply { - this[CONVERSATION_ID] = "integer primary key on conflict replace" - this[IS_ALLOWED] = "integer default 1" - this[NOT_ALLOWED_REASON] = "integer" - this[IN_READ_MESSAGE_ID] = "integer" - this[OUT_READ_MESSAGE_ID] = "integer" - this[LAST_MESSAGE_ID] = "integer" - this[UNREAD_COUNT] = "integer" - this[LOCAL_ID] = "integer" - this[IS_NOTIFICATIONS_DISABLED] = "integer default 0" - this[MEMBERS_COUNT] = "integer" - this[TITLE] = "varchar(255)" - this[IS_GROUP_CHANNEL] = "integer default 0" - this[TYPE] = "integer" - this[CHAT_STATE] = "integer" - this[PHOTOS] = "text" - - this[PINNED_MESSAGE_ID] = "integer" - } - - private val friendsTableMap = HashMap().apply { - this[FRIEND_ID] = "integer primary key on conflict replace" - this[SORT_ID] = "integer" - - //id which user friend - this[USER_ID] = "integer" - } - - fun createUsersTable() = createTableQuery(TABLE_USERS, usersTableMap) - fun createGroupsTable() = createTableQuery(TABLE_GROUPS, groupsTableMap) - fun createMessagesTable() = createTableQuery(TABLE_MESSAGES, messagesTableMap) - fun createChatsTable() = createTableQuery(TABLE_CHATS, chatsTableMap) - fun createFriendsTable() = createTableQuery(TABLE_FRIENDS, friendsTableMap) - - private fun createTableQuery(tableName: String, tableData: HashMap): String { - val builder = StringBuilder("create table $tableName (") - - val entry: Map.Entry = tableData.entries.first() - builder.append(entry.key) - builder.append(" ") - builder.append(entry.value) - - tableData.forEach { - if (it == entry) return@forEach - builder.append(", ") - builder.append(it.key) - builder.append(" ") - builder.append(it.value) - } - - builder.append(");") - - return builder.toString(); - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/QueryBuilder.kt b/app/src/main/kotlin/com/meloda/fast/database/old/QueryBuilder.kt deleted file mode 100644 index be524805..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/QueryBuilder.kt +++ /dev/null @@ -1,71 +0,0 @@ -package com.meloda.fast.database.old - -import android.database.Cursor -import android.database.sqlite.SQLiteDatabase - - -class QueryBuilder private constructor() { - - companion object { - fun query(): QueryBuilder { - return QueryBuilder() - } - } - - private val builder: StringBuilder = StringBuilder() - - fun select(column: String): QueryBuilder { - builder.append("SELECT ") - .append(column) - .append(" ") - return this - } - - fun from(table: String): QueryBuilder { - builder.append("FROM ") - .append(table) - .append(" ") - return this - } - - - fun where(clause: String): QueryBuilder { - builder.append("WHERE ") - .append(clause) - .append(" ") - return this - } - - fun leftJoin(table: String): QueryBuilder { - builder.append("LEFT JOIN ") - .append(table) - .append(" ") - return this - } - - fun on(where: String): QueryBuilder { - builder.append("ON ") - .append(where) - .append(" ") - return this - } - - fun and(): QueryBuilder { - builder.append("AND ") - return this - } - - fun or(): QueryBuilder { - builder.append("OR ") - return this - } - - fun asCursor(db: SQLiteDatabase): Cursor { - return db.rawQuery(toString(), null) - } - - override fun toString(): String { - return builder.toString().trim() - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/base/Storage.kt b/app/src/main/kotlin/com/meloda/fast/database/old/base/Storage.kt deleted file mode 100644 index eceb8362..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/base/Storage.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.meloda.fast.database.old.base - -import android.content.ContentValues -import android.database.Cursor -import android.os.Bundle -import androidx.annotation.WorkerThread -import com.meloda.fast.common.AppGlobal - -abstract class Storage { - - abstract val tag: String - - protected var database = AppGlobal.oldDatabase - - @WorkerThread - abstract fun getAllValues(): ArrayList - - @WorkerThread - abstract fun insertValues(values: ArrayList, params: Bundle? = null) - - @WorkerThread - fun insertValue(value: T, params: Bundle? = null) { - insertValues(arrayListOf(value), params) - } - - @WorkerThread - abstract fun cacheValue(values: ContentValues, value: T, params: Bundle? = null) - - @WorkerThread - abstract fun parseValue(cursor: Cursor): T - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/storage/ChatsStorage.kt b/app/src/main/kotlin/com/meloda/fast/database/old/storage/ChatsStorage.kt deleted file mode 100644 index ea799adf..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/storage/ChatsStorage.kt +++ /dev/null @@ -1,141 +0,0 @@ -package com.meloda.fast.database.old.storage - -import android.content.ContentValues -import android.database.Cursor -import android.os.Bundle -import android.util.Log -import androidx.annotation.WorkerThread -import com.meloda.fast.database.old.CacheStorage -import com.meloda.fast.database.old.CacheStorage.messagesStorage -import com.meloda.fast.database.old.DatabaseKeys.CHAT_STATE -import com.meloda.fast.database.old.DatabaseKeys.CONVERSATION_ID -import com.meloda.fast.database.old.DatabaseKeys.IN_READ_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.IS_ALLOWED -import com.meloda.fast.database.old.DatabaseKeys.IS_GROUP_CHANNEL -import com.meloda.fast.database.old.DatabaseKeys.IS_NOTIFICATIONS_DISABLED -import com.meloda.fast.database.old.DatabaseKeys.LAST_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.LOCAL_ID -import com.meloda.fast.database.old.DatabaseKeys.MEMBERS_COUNT -import com.meloda.fast.database.old.DatabaseKeys.NOT_ALLOWED_REASON -import com.meloda.fast.database.old.DatabaseKeys.OUT_READ_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.PHOTOS -import com.meloda.fast.database.old.DatabaseKeys.PINNED_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.TITLE -import com.meloda.fast.database.old.DatabaseKeys.TYPE -import com.meloda.fast.database.old.DatabaseKeys.UNREAD_COUNT -import com.meloda.fast.database.old.DatabaseUtils.TABLE_CHATS -import com.meloda.fast.database.old.base.Storage -import com.meloda.fast.api.model.old.oldVKConversation -import com.meloda.fast.api.oldVKUtil -import org.json.JSONObject - -@WorkerThread -class ChatsStorage : Storage() { - - override val tag = "ChatsStorage" - - override fun getAllValues(): ArrayList { - val cursor = CacheStorage.selectCursor(TABLE_CHATS) - val conversations = ArrayList() - - while (cursor.moveToNext()) conversations.add(parseValue(cursor)) - - cursor.close() - - return conversations - } - - @WorkerThread - override fun insertValues(values: ArrayList, params: Bundle?) { - if (values.isEmpty()) return - - database.beginTransaction() - - val contentValues = ContentValues() - - for (value in values) { - cacheValue(contentValues, value, params) - - database.insert(TABLE_CHATS, null, contentValues) - - contentValues.clear() - } - - database.setTransactionSuccessful() - database.endTransaction() - - Log.d(tag, "Successful cached chats") - } - - @WorkerThread - override fun cacheValue(values: ContentValues, value: oldVKConversation, params: Bundle?) { - values.put(CONVERSATION_ID, value.id) - values.put(IS_ALLOWED, value.isAllowed) - values.put(NOT_ALLOWED_REASON, value.notAllowedReason.value) - values.put(IN_READ_MESSAGE_ID, value.inReadMessageId) - values.put(OUT_READ_MESSAGE_ID, value.outReadMessageId) - values.put(LAST_MESSAGE_ID, value.lastMessageId) - values.put(UNREAD_COUNT, value.unreadCount) - values.put(LOCAL_ID, value.localId) - values.put(IS_NOTIFICATIONS_DISABLED, value.notificationsEnabled) - values.put(MEMBERS_COUNT, value.membersCount) - values.put(TITLE, value.title) - values.put(IS_GROUP_CHANNEL, value.isGroupChannel) - values.put(TYPE, value.intType) - values.put(CHAT_STATE, value.intState) - - values.put( - PHOTOS, - oldVKUtil.putPhotosToJson( - value.photo50, - value.photo100, - value.photo200 - ).toString() - ) - - value.pinnedMessage?.let { - values.put(PINNED_MESSAGE_ID, it.id) - } - } - - @WorkerThread - override fun parseValue(cursor: Cursor): oldVKConversation { - val conversation = oldVKConversation() - - conversation.id = CacheStorage.getInt(cursor, CONVERSATION_ID) - conversation.isAllowed = CacheStorage.getInt(cursor, IS_ALLOWED) == 1 - conversation.notAllowedReason = oldVKConversation.Reason.fromInt( - CacheStorage.getInt(cursor, NOT_ALLOWED_REASON) - ) - conversation.inReadMessageId = CacheStorage.getInt(cursor, IN_READ_MESSAGE_ID) - conversation.outReadMessageId = CacheStorage.getInt(cursor, OUT_READ_MESSAGE_ID) - conversation.unreadCount = CacheStorage.getInt(cursor, UNREAD_COUNT) - conversation.localId = CacheStorage.getInt(cursor, LOCAL_ID) - conversation.notificationsEnabled = - CacheStorage.getInt(cursor, IS_NOTIFICATIONS_DISABLED) == 1 - conversation.membersCount = CacheStorage.getInt(cursor, MEMBERS_COUNT) - conversation.title = CacheStorage.getString(cursor, TITLE) - conversation.isGroupChannel = CacheStorage.getInt(cursor, IS_GROUP_CHANNEL) == 1 - - val pinnedMessageId = CacheStorage.getInt(cursor, PINNED_MESSAGE_ID) - if (pinnedMessageId != -1) { - val pinnedMessage = messagesStorage.getMessageById(pinnedMessageId) - if (pinnedMessage != null) conversation.pinnedMessage = pinnedMessage - } - - conversation.intType = CacheStorage.getInt(cursor, TYPE) - conversation.intState = CacheStorage.getInt(cursor, CHAT_STATE) - - conversation.lastMessageId = CacheStorage.getInt(cursor, LAST_MESSAGE_ID) - val lastMessage = messagesStorage.getMessageById(conversation.lastMessageId) - if (lastMessage != null) conversation.lastMessage = lastMessage - - val photos = oldVKUtil.parseJsonPhotos(JSONObject(CacheStorage.getString(cursor, PHOTOS))) - conversation.photo50 = photos[0] - conversation.photo100 = photos[1] - conversation.photo200 = photos[2] - - return conversation - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/storage/GroupsStorage.kt b/app/src/main/kotlin/com/meloda/fast/database/old/storage/GroupsStorage.kt deleted file mode 100644 index 1c779bcd..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/storage/GroupsStorage.kt +++ /dev/null @@ -1,111 +0,0 @@ -package com.meloda.fast.database.old.storage - -import android.content.ContentValues -import android.database.Cursor -import android.os.Bundle -import android.util.Log -import androidx.annotation.WorkerThread -import com.meloda.fast.database.old.CacheStorage -import com.meloda.fast.database.old.CacheStorage.getInt -import com.meloda.fast.database.old.CacheStorage.getString -import com.meloda.fast.database.old.DatabaseKeys.DEACTIVATED -import com.meloda.fast.database.old.DatabaseKeys.GROUP_ID -import com.meloda.fast.database.old.DatabaseKeys.IS_CLOSED -import com.meloda.fast.database.old.DatabaseKeys.NAME -import com.meloda.fast.database.old.DatabaseKeys.PHOTOS -import com.meloda.fast.database.old.DatabaseKeys.SCREEN_NAME -import com.meloda.fast.database.old.DatabaseKeys.TYPE -import com.meloda.fast.database.old.DatabaseUtils.TABLE_GROUPS -import com.meloda.fast.database.old.base.Storage -import com.meloda.fast.api.model.old.oldVKGroup -import com.meloda.fast.api.oldVKUtil -import org.json.JSONObject - -class GroupsStorage : Storage() { - - override val tag = "GroupsStorage" - - @WorkerThread - fun getGroups(ids: IntArray): ArrayList { - val cursor = CacheStorage.selectCursor(TABLE_GROUPS, GROUP_ID, ids) - - val groups = ArrayList(cursor.count) - while (cursor.moveToNext()) groups.add(parseValue(cursor)) - - cursor.close() - return groups - } - - @WorkerThread - fun getGroup(userId: Int): oldVKGroup? { - val group = getGroups(intArrayOf(userId)) - - return if (group.isNotEmpty()) group[0] else null - } - - override fun getAllValues(): ArrayList { - val cursor = CacheStorage.selectCursor(TABLE_GROUPS) - val groups = ArrayList() - - while (cursor.moveToNext()) groups.add(parseValue(cursor)) - - cursor.close() - - return groups - } - - override fun insertValues(values: ArrayList, params: Bundle?) { - if (values.isEmpty()) return - - database.beginTransaction() - - val contentValues = ContentValues() - - for (value in values) { - cacheValue(contentValues, value, params) - - database.insert(TABLE_GROUPS, null, contentValues) - - contentValues.clear() - } - - database.setTransactionSuccessful() - database.endTransaction() - - Log.d(tag, "Successful cached groups") - } - - override fun cacheValue(values: ContentValues, value: oldVKGroup, params: Bundle?) { - values.put(GROUP_ID, value.id) - values.put(NAME, value.name) - values.put(SCREEN_NAME, value.screenName) - values.put(IS_CLOSED, value.isClosed) - values.put(DEACTIVATED, value.deactivated) - values.put(TYPE, value.type.value) - - val photos = - oldVKUtil.putPhotosToJson(value.photo50, value.photo100, value.photo200).toString() - - values.put(PHOTOS, photos) - } - - override fun parseValue(cursor: Cursor): oldVKGroup { - val group = oldVKGroup() - - group.id = getInt(cursor, GROUP_ID) - group.name = getString(cursor, NAME) - group.screenName = getString(cursor, SCREEN_NAME) - group.isClosed = getInt(cursor, IS_CLOSED) == 1 - group.deactivated = getString(cursor, DEACTIVATED) - group.type = oldVKGroup.Type.fromString(getString(cursor, TYPE)) - - val photos = oldVKUtil.parseJsonPhotos(JSONObject(getString(cursor, PHOTOS))) - - group.photo50 = photos[0] - group.photo100 = photos[1] - group.photo200 = photos[2] - - return group - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/storage/MessagesStorage.kt b/app/src/main/kotlin/com/meloda/fast/database/old/storage/MessagesStorage.kt deleted file mode 100644 index f84f6822..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/storage/MessagesStorage.kt +++ /dev/null @@ -1,178 +0,0 @@ -package com.meloda.fast.database.old.storage - -import android.content.ContentValues -import android.database.Cursor -import android.os.Bundle -import android.util.Log -import androidx.annotation.WorkerThread -import com.meloda.fast.database.old.CacheStorage -import com.meloda.fast.database.old.CacheStorage.selectCursor -import com.meloda.fast.database.old.DatabaseKeys.ACTION -import com.meloda.fast.database.old.DatabaseKeys.ATTACHMENTS -import com.meloda.fast.database.old.DatabaseKeys.CONVERSATION_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.DATE -import com.meloda.fast.database.old.DatabaseKeys.EDIT_TIME -import com.meloda.fast.database.old.DatabaseKeys.FROM_ID -import com.meloda.fast.database.old.DatabaseKeys.FWD_MESSAGES -import com.meloda.fast.database.old.DatabaseKeys.IS_OUT -import com.meloda.fast.database.old.DatabaseKeys.MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.PEER_ID -import com.meloda.fast.database.old.DatabaseKeys.RANDOM_ID -import com.meloda.fast.database.old.DatabaseKeys.REPLY_MESSAGE_ID -import com.meloda.fast.database.old.DatabaseKeys.TEXT -import com.meloda.fast.database.old.DatabaseUtils.TABLE_MESSAGES -import com.meloda.fast.database.old.base.Storage -import com.meloda.fast.util.Utils -import com.meloda.fast.api.model.old.oldVKMessage -import com.meloda.fast.api.model.old.oldVKMessageAction -import com.meloda.fast.api.model.old.VKModel -import java.util.stream.Collectors - -@WorkerThread -@Suppress("UNCHECKED_CAST") -class MessagesStorage : Storage() { - - override val tag = "MessagesStorage" - - @WorkerThread - fun getMessagesHistory(peerId: Int): ArrayList { - val cursor = CacheStorage.selectCursor(TABLE_MESSAGES, PEER_ID, peerId) - - val messages = ArrayList(cursor.count) - while (cursor.moveToNext()) messages.add(parseValue(cursor)) - - cursor.close() - - return messages - } - - @WorkerThread - fun getMessageById(messageId: Int): oldVKMessage? { - val cursor = CacheStorage.selectCursor(TABLE_MESSAGES, MESSAGE_ID, messageId) - - if (cursor.moveToFirst()) { - val message = parseValue(cursor) - cursor.close() - - return message - } - - return null - } - - override fun getAllValues(): ArrayList { - val cursor = selectCursor(TABLE_MESSAGES) - val messages = ArrayList() - - while (cursor.moveToNext()) messages.add(parseValue(cursor)) - - cursor.close() - - return messages - } - - @WorkerThread - override fun insertValues(values: ArrayList, params: Bundle?) { - if (values.isEmpty()) return - - database.beginTransaction() - - val contentValues = ContentValues() - - for (value in values) { - cacheValue(contentValues, value) - - database.insert(TABLE_MESSAGES, null, contentValues) - - contentValues.clear() - } - - database.setTransactionSuccessful() - database.endTransaction() - - Log.d(tag, "Successful cached messages") - } - - @WorkerThread - override fun cacheValue(values: ContentValues, value: oldVKMessage, params: Bundle?) { - values.put(MESSAGE_ID, value.id) - values.put(DATE, value.date) - values.put(PEER_ID, value.peerId) - values.put(FROM_ID, value.fromId) - values.put(EDIT_TIME, value.editTime) - values.put(TEXT, value.text) - values.put(RANDOM_ID, value.randomId) - values.put(CONVERSATION_MESSAGE_ID, value.conversationMessageId) - - value.replyMessage?.let { - values.put(REPLY_MESSAGE_ID, it.id) - } - - value.action?.let { - values.put(ACTION, Utils.serialize(it)) - } - - value.attachments.let { - if (it.isNotEmpty()) { - values.put(ATTACHMENTS, Utils.serialize(it)) - } - } - - value.fwdMessages.let { - if (it.isNotEmpty()) { - val ids = arrayListOf() - it.forEach { message -> ids.add(message.id.toString()) } - - ids.stream().collect(Collectors.joining(",")).let { str -> - values.put(FWD_MESSAGES, str) - } - } - } - } - - @WorkerThread - override fun parseValue(cursor: Cursor): oldVKMessage { - val message = oldVKMessage() - - message.id = CacheStorage.getInt(cursor, MESSAGE_ID) - message.date = CacheStorage.getInt(cursor, DATE) - message.peerId = CacheStorage.getInt(cursor, PEER_ID) - message.fromId = CacheStorage.getInt(cursor, FROM_ID) - message.editTime = CacheStorage.getInt(cursor, EDIT_TIME) - message.isOut = CacheStorage.getInt(cursor, IS_OUT) == 1 - message.text = CacheStorage.getString(cursor, TEXT) - message.randomId = CacheStorage.getInt(cursor, RANDOM_ID) - message.conversationMessageId = CacheStorage.getInt(cursor, CONVERSATION_MESSAGE_ID) - - val blobAttachments = Utils.deserialize(CacheStorage.getBlob(cursor, ATTACHMENTS)) - if (blobAttachments != null) message.attachments = blobAttachments as ArrayList - else message.attachments = arrayListOf() - - val replyMessageId = CacheStorage.getInt(cursor, REPLY_MESSAGE_ID) - val replyMessage = getMessageById(replyMessageId) - if (replyMessage != null) message.replyMessage = replyMessage - - val blobAction = Utils.deserialize(CacheStorage.getBlob(cursor, ACTION)) - if (blobAction != null) message.action = blobAction as oldVKMessageAction - - val stringFwdMessages = CacheStorage.getString(cursor, FWD_MESSAGES) - if (stringFwdMessages != null) { - val split = stringFwdMessages.split(',') - - val ids = arrayListOf() - for (s in split) ids.add(s.toInt()) - - val fwdMessages = arrayListOf() - - ids.forEach { - val fwdMessage = getMessageById(it) - if (fwdMessage != null) fwdMessages.add(fwdMessage) - } - - message.fwdMessages = fwdMessages - } else message.fwdMessages = arrayListOf() - - return message - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/database/old/storage/UsersStorage.kt b/app/src/main/kotlin/com/meloda/fast/database/old/storage/UsersStorage.kt deleted file mode 100644 index 11a7ab96..00000000 --- a/app/src/main/kotlin/com/meloda/fast/database/old/storage/UsersStorage.kt +++ /dev/null @@ -1,171 +0,0 @@ -package com.meloda.fast.database.old.storage - -import android.content.ContentValues -import android.database.Cursor -import android.os.Bundle -import android.util.Log -import androidx.annotation.WorkerThread -import com.meloda.fast.api.UserConfig -import com.meloda.fast.api.oldVKUtil -import com.meloda.fast.api.model.old.oldVKUser -import com.meloda.fast.database.old.CacheStorage -import com.meloda.fast.database.old.DatabaseKeys.DEACTIVATED -import com.meloda.fast.database.old.DatabaseKeys.FIRST_NAME -import com.meloda.fast.database.old.DatabaseKeys.FRIEND_ID -import com.meloda.fast.database.old.DatabaseKeys.GENDER -import com.meloda.fast.database.old.DatabaseKeys.IS_ONLINE -import com.meloda.fast.database.old.DatabaseKeys.IS_ONLINE_MOBILE -import com.meloda.fast.database.old.DatabaseKeys.LAST_NAME -import com.meloda.fast.database.old.DatabaseKeys.LAST_SEEN -import com.meloda.fast.database.old.DatabaseKeys.PHOTOS -import com.meloda.fast.database.old.DatabaseKeys.SCREEN_NAME -import com.meloda.fast.database.old.DatabaseKeys.SORT_ID -import com.meloda.fast.database.old.DatabaseKeys.STATUS -import com.meloda.fast.database.old.DatabaseKeys.USER_ID -import com.meloda.fast.database.old.DatabaseUtils.TABLE_FRIENDS -import com.meloda.fast.database.old.DatabaseUtils.TABLE_USERS -import com.meloda.fast.database.old.QueryBuilder -import com.meloda.fast.database.old.base.Storage -import org.json.JSONObject - -@WorkerThread -class UsersStorage : Storage() { - - override val tag = "UsersStorage" - - @WorkerThread - fun getUsers(ids: IntArray): ArrayList { - val cursor = CacheStorage.selectCursor(TABLE_USERS, USER_ID, ids) - - val users = ArrayList(cursor.count) - while (cursor.moveToNext()) users.add(parseValue(cursor)) - - cursor.close() - return users - } - - @WorkerThread - fun getUser(userId: Int): oldVKUser? { - val user = getUsers(intArrayOf(userId)) - - return if (user.isNotEmpty()) user[0] else null - } - - @WorkerThread - fun getFriends(userId: Int, onlyOnline: Boolean = false): ArrayList { - val cursor = QueryBuilder.query() - .select("*") - .from(TABLE_FRIENDS) - .leftJoin(TABLE_USERS) - .on("friends.${FRIEND_ID} = users.$USER_ID") - .where("friends.${USER_ID} = $userId") - .asCursor(database) - - val users = ArrayList(cursor.count) - - while (cursor.moveToNext()) { - val userOnline = CacheStorage.getInt(cursor, IS_ONLINE) == 1 - if (onlyOnline && !userOnline) continue - - val user = parseValue(cursor) - users.add(user) - } - - cursor.close() - - return users - } - - override fun getAllValues(): ArrayList { - val cursor = CacheStorage.selectCursor(TABLE_USERS) - val users = ArrayList() - - while (cursor.moveToNext()) users.add(parseValue(cursor)) - - cursor.close() - - return users - } - - @WorkerThread - override fun insertValues(values: ArrayList, params: Bundle?) { - if (values.isEmpty()) return - - val toFriends = params?.getBoolean("toFriends") ?: false - - database.beginTransaction() - - val contentValues = ContentValues() - - for (user in values) { - cacheValue(contentValues, user, params) - - database.insert(if (toFriends) TABLE_FRIENDS else TABLE_USERS, null, contentValues) - - contentValues.clear() - } - - database.setTransactionSuccessful() - database.endTransaction() - - Log.d(tag, "Successful cached users. toFriends: $toFriends") - } - - @WorkerThread - override fun cacheValue(values: ContentValues, value: oldVKUser, params: Bundle?) { - val toFriends = params?.getBoolean("toFriends") ?: false - - if (toFriends) { - values.put(USER_ID, UserConfig.userId) - values.put(FRIEND_ID, value.userId) - values.put(SORT_ID, value.sortId) - return - } - - values.put(USER_ID, value.userId) - values.put(FIRST_NAME, value.firstName) - values.put(LAST_NAME, value.lastName) - values.put(DEACTIVATED, value.deactivated) - values.put(GENDER, value.sex) - values.put(SCREEN_NAME, value.screenName) - values.put(IS_ONLINE, value.isOnline) - values.put(IS_ONLINE_MOBILE, value.isOnlineMobile) - values.put(STATUS, value.status) - values.put(LAST_SEEN, value.lastSeen) - - values.put( - PHOTOS, - oldVKUtil.putPhotosToJson( - value.photo50, - value.photo100, - value.photo200 - ).toString() - ) - } - - @WorkerThread - override fun parseValue(cursor: Cursor): oldVKUser { - val user = oldVKUser() - - user.userId = CacheStorage.getInt(cursor, USER_ID) - user.firstName = CacheStorage.getString(cursor, FIRST_NAME) - user.lastName = CacheStorage.getString(cursor, LAST_NAME) - user.deactivated = CacheStorage.getString(cursor, DEACTIVATED) - user.sex = CacheStorage.getInt(cursor, GENDER) - user.screenName = CacheStorage.getString(cursor, SCREEN_NAME) - user.isOnline = CacheStorage.getInt(cursor, IS_ONLINE) == 1 - user.isOnlineMobile = CacheStorage.getInt(cursor, IS_ONLINE_MOBILE) == 1 - user.status = CacheStorage.getString(cursor, STATUS) - user.lastSeen = CacheStorage.getInt(cursor, LAST_SEEN) - - val photos = - oldVKUtil.parseJsonPhotos(JSONObject(CacheStorage.getString(cursor, PHOTOS))) - - user.photo50 = photos[0] - user.photo100 = photos[1] - user.photo200 = photos[2] - - return user - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/extensions/Extensions.kt b/app/src/main/kotlin/com/meloda/fast/extensions/Extensions.kt index c93ae89c..9c308106 100644 --- a/app/src/main/kotlin/com/meloda/fast/extensions/Extensions.kt +++ b/app/src/main/kotlin/com/meloda/fast/extensions/Extensions.kt @@ -1 +1,73 @@ -package com.meloda.fast.extensions \ No newline at end of file +package com.meloda.fast.extensions + +import android.graphics.* +import kotlin.math.min + +fun Bitmap.borderedCircularBitmap( + borderColor: Int = 0, + borderWidth: Int = 0 +): Bitmap? { + val bitmap = Bitmap.createBitmap( + width, // width in pixels + height, // height in pixels + Bitmap.Config.ARGB_8888 + ) + + // canvas to draw circular bitmap + val canvas = Canvas(bitmap) + + // get the maximum radius + val radius = min(width / 2f, height / 2f) + + // create a path to draw circular bitmap border + val borderPath = Path().apply { + addCircle( + width / 2f, + height / 2f, + radius, + Path.Direction.CCW + ) + } + + // draw border on circular bitmap + canvas.clipPath(borderPath) + canvas.drawColor(borderColor) + + + // create a path for circular bitmap + val bitmapPath = Path().apply { + addCircle( + width / 2f, + height / 2f, + radius - borderWidth, + Path.Direction.CCW + ) + } + + canvas.clipPath(bitmapPath) + val paint = Paint().apply { + xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR) + isAntiAlias = true + } + + // clear the circular bitmap drawing area + // it will keep bitmap transparency + canvas.drawBitmap(this, 0f, 0f, paint) + + // now draw the circular bitmap + canvas.drawBitmap(this, 0f, 0f, null) + + + val diameter = (radius * 2).toInt() + val x = (width - diameter) / 2 + val y = (height - diameter) / 2 + + // return cropped circular bitmap with border + return Bitmap.createBitmap( + bitmap, // source bitmap + x, // x coordinate of the first pixel in source + y, // y coordinate of the first pixel in source + diameter, // width + diameter // height + ) +} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/screens/friends/FriendsFragment.kt b/app/src/main/kotlin/com/meloda/fast/screens/friends/FriendsFragment.kt deleted file mode 100644 index 77333572..00000000 --- a/app/src/main/kotlin/com/meloda/fast/screens/friends/FriendsFragment.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.meloda.fast.screens.friends - -import android.os.Bundle -import android.view.View -import android.viewbinding.library.fragment.viewBinding -import com.meloda.fast.R -import com.meloda.fast.base.BaseFragment -import com.meloda.fast.databinding.FragmentFriendsBinding -import dagger.hilt.android.AndroidEntryPoint - -@AndroidEntryPoint -class FriendsFragment : BaseFragment(R.layout.fragment_friends) { - - private val binding: FragmentFriendsBinding by viewBinding() - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/screens/important/ImportantFragment.kt b/app/src/main/kotlin/com/meloda/fast/screens/important/ImportantFragment.kt deleted file mode 100644 index e52e4e70..00000000 --- a/app/src/main/kotlin/com/meloda/fast/screens/important/ImportantFragment.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.meloda.fast.screens.important - -import android.os.Bundle -import android.view.View -import android.viewbinding.library.fragment.viewBinding -import com.meloda.fast.R -import com.meloda.fast.base.BaseFragment -import com.meloda.fast.databinding.FragmentImportantBinding -import dagger.hilt.android.AndroidEntryPoint - -@AndroidEntryPoint -class ImportantFragment : BaseFragment(R.layout.fragment_important) { - - private val binding: FragmentImportantBinding by viewBinding() - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - - } - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/screens/login/LoginFragment.kt b/app/src/main/kotlin/com/meloda/fast/screens/login/LoginFragment.kt index d0291586..f1f5dc25 100644 --- a/app/src/main/kotlin/com/meloda/fast/screens/login/LoginFragment.kt +++ b/app/src/main/kotlin/com/meloda/fast/screens/login/LoginFragment.kt @@ -26,7 +26,6 @@ import com.meloda.fast.base.viewmodel.VKEvent import com.meloda.fast.databinding.DialogCaptchaBinding import com.meloda.fast.databinding.DialogValidationBinding import com.meloda.fast.databinding.FragmentLoginBinding -import com.meloda.fast.screens.main.MainFragment import com.meloda.fast.util.KeyboardUtils import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.Dispatchers @@ -52,8 +51,6 @@ class LoginFragment : BaseViewModelFragment(R.layout.fragment_lo override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - (parentFragment?.parentFragment as? MainFragment)?.bottomBar?.isVisible = false - prepareViews() binding.loginInput.clearFocus() diff --git a/app/src/main/kotlin/com/meloda/fast/screens/login/LoginViewModel.kt b/app/src/main/kotlin/com/meloda/fast/screens/login/LoginViewModel.kt index 23b6ff06..cc443ec5 100644 --- a/app/src/main/kotlin/com/meloda/fast/screens/login/LoginViewModel.kt +++ b/app/src/main/kotlin/com/meloda/fast/screens/login/LoginViewModel.kt @@ -5,7 +5,7 @@ import androidx.lifecycle.viewModelScope import com.meloda.fast.api.UserConfig import com.meloda.fast.api.VKConstants import com.meloda.fast.api.VKException -import com.meloda.fast.api.oldVKUtil +import com.meloda.fast.api.VkUtils import com.meloda.fast.api.datasource.AuthDataSource import com.meloda.fast.api.network.request.RequestAuthDirect import com.meloda.fast.base.viewmodel.BaseViewModel @@ -61,13 +61,13 @@ class LoginViewModel @Inject constructor( twoFaCode?.let { sendEvent(CodeSent) } - if (oldVKUtil.isValidationRequired(it)) { + if (VkUtils.isValidationRequired(it)) { it.validationSid?.let { sid -> sendEvent(ValidationRequired(validationSid = sid)) sendSms(sid) } - } else if (oldVKUtil.isCaptchaRequired(it)) { + } else if (VkUtils.isCaptchaRequired(it)) { it.captcha?.let { captcha -> sendEvent(CaptchaRequired(captcha.first to captcha.second)) } diff --git a/app/src/main/kotlin/com/meloda/fast/screens/main/MainFragment.kt b/app/src/main/kotlin/com/meloda/fast/screens/main/MainFragment.kt index ccdeaece..90f97be7 100644 --- a/app/src/main/kotlin/com/meloda/fast/screens/main/MainFragment.kt +++ b/app/src/main/kotlin/com/meloda/fast/screens/main/MainFragment.kt @@ -29,8 +29,6 @@ class MainFragment : BaseViewModelFragment(R.layout.fragment_main private fun setupBottomBar() { val navGraphIds = listOf( R.navigation.messages, - R.navigation.friends, - R.navigation.important, R.navigation.login ) @@ -45,7 +43,5 @@ class MainFragment : BaseViewModelFragment(R.layout.fragment_main } } - val bottomBar get() = binding.bottomBar - } \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsAdapter.kt b/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsAdapter.kt index b09f9b19..d6e19a47 100644 --- a/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsAdapter.kt +++ b/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsAdapter.kt @@ -1,8 +1,6 @@ package com.meloda.fast.screens.messages import android.content.Context -import android.graphics.Color -import android.graphics.drawable.ColorDrawable import android.text.SpannableString import android.text.style.ForegroundColorSpan import android.view.ViewGroup @@ -36,12 +34,30 @@ class ConversationsAdapter constructor( inner class ItemHolder(binding: ItemConversationBinding) : BindingHolder(binding) { - private val dateColor = ContextCompat.getColor(context, R.color.date) + private val dateColor = ContextCompat.getColor(context, R.color.n2_500) private val youPrefix = context.getString(R.string.you_message_prefix) override fun bind(position: Int) { val conversation = getItem(position) - val message = conversation.lastMessage ?: return + + binding.service.isVisible = conversation.isPhantom || conversation.callInProgress + binding.callIcon.isVisible = conversation.callInProgress + binding.phantomIcon.isVisible = conversation.isPhantom + + val message = if (conversation.lastMessage != null) conversation.lastMessage!! + else { + binding.title.text = conversation.title + val text = context.getString( + if (conversation.isPhantom) R.string.messages_self_destructed + else R.string.no_messages + ) + + val span = SpannableString(text) + span.setSpan(ForegroundColorSpan(dateColor), 0, text.length, 0) + + binding.message.text = span + return + } val chatUser: VkUser? = if (conversation.isUser()) { profiles[conversation.id] @@ -70,8 +86,11 @@ class ConversationsAdapter constructor( else -> null } + binding.avatar.isVisible = avatar != null + binding.avatarPlaceholder.isVisible = avatar == null + if (avatar == null) { - binding.avatar.setImageDrawable(ColorDrawable(Color.RED)) + binding.avatar.setImageDrawable(null) } else { binding.avatar.load(avatar) { crossfade(200) } } @@ -87,23 +106,38 @@ class ConversationsAdapter constructor( messageGroup = messageGroup ) - val attachmentsMessage = VkUtils.getAttachmentConversationText( - context = context, - message = message - ) + val attachmentIcon = + if (message.text == null) null + else if (!message.forwards.isNullOrEmpty()) ContextCompat.getDrawable( + context, + if (message.forwards?.size == 1) R.drawable.ic_attachment_forwarded_message + else R.drawable.ic_attachment_forwarded_messages + ) + else VkUtils.getAttachmentConversationIcon( + context = context, + message = message + ) - val forwardsMessage = VkUtils.getForwardsConversationText( + binding.textAttachment.isVisible = attachmentIcon != null + binding.textAttachment.setImageDrawable(attachmentIcon) + + val attachmentText = if (attachmentIcon == null) VkUtils.getAttachmentConversationText( context = context, message = message - ) + ) else null + + val forwardsMessage = if (message.text == null) VkUtils.getForwardsConversationText( + context = context, + message = message + ) else null val messageText = if (actionMessage != null || - attachmentsMessage != null || - forwardsMessage != null + forwardsMessage != null || + attachmentText != null ) "" - else message.text ?: "no_message" + else message.text ?: "[no_message]" - val coloredMessage = actionMessage ?: attachmentsMessage ?: forwardsMessage ?: "" + val coloredMessage = actionMessage ?: attachmentText ?: forwardsMessage ?: "" var prefix = when { actionMessage != null -> "" @@ -114,11 +148,11 @@ class ConversationsAdapter constructor( else -> "" } - if (!conversation.isChat() && !message.isOut || conversation.id == UserConfig.userId) prefix = - "" + if (!conversation.isChat() && !message.isOut || conversation.id == UserConfig.userId) + prefix = "" // if (conversation.isChat() || message.isOut) { - val spanText = "$prefix$coloredMessage $messageText".trim() + val spanText = "$prefix$coloredMessage$messageText" val spanMessage = SpannableString(spanText) spanMessage.setSpan( @@ -135,6 +169,22 @@ class ConversationsAdapter constructor( getItem(position).title ?: chatUser?.toString() ?: chatGroup?.name ?: "..." binding.date.text = SimpleDateFormat("HH:mm").format(message.date * 1000) + + binding.container.background = if (conversation.isUnread()) ContextCompat.getDrawable( + context, + R.drawable.ic_message_unread + ) else null + + + binding.counter.isVisible = conversation.isInUnread() + if (conversation.isInUnread()) { + conversation.unreadCount?.let { + val count = if (it > 999) "${it / 1000}K" else it.toString() + binding.counter.text = count + } + } else { + binding.counter.text = "" + } } } diff --git a/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsFragment.kt b/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsFragment.kt index 65d88939..be09a244 100644 --- a/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsFragment.kt +++ b/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsFragment.kt @@ -5,7 +5,10 @@ import android.view.View import android.viewbinding.library.fragment.viewBinding import androidx.core.view.isVisible import androidx.fragment.app.viewModels +import coil.load +import com.google.android.material.snackbar.Snackbar import com.meloda.fast.R +import com.meloda.fast.api.UserConfig import com.meloda.fast.api.model.VkConversation import com.meloda.fast.base.BaseViewModelFragment import com.meloda.fast.base.viewmodel.StartProgressEvent @@ -40,6 +43,16 @@ class ConversationsFragment : binding.recyclerView.adapter = adapter viewModel.loadConversations() + + binding.createChat.setOnClickListener { + Snackbar.make(it, "Test Snackbar with action", Snackbar.LENGTH_LONG) + .setAction("Action") {}.show() + + } + + UserConfig.vkUser.observe(viewLifecycleOwner) { + it?.let { user -> binding.avatar.load(user.photo200) { crossfade(100) } } + } } override fun onEvent(event: VKEvent) { diff --git a/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsViewModel.kt b/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsViewModel.kt index 59030797..08b8e150 100644 --- a/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsViewModel.kt +++ b/app/src/main/kotlin/com/meloda/fast/screens/messages/ConversationsViewModel.kt @@ -58,7 +58,7 @@ class ConversationsViewModel @Inject constructor( unreadCount = response.unreadCount ?: 0, conversations = response.items.map { items -> items.conversation.asVkConversation( - items.lastMessage.asVkMessage() + items.lastMessage?.asVkMessage() ) }, profiles = profiles, @@ -88,7 +88,7 @@ class ConversationsViewModel @Inject constructor( val users = r.map { u -> u.asVkUser() } usersDataSource.storeUsers(users) - UserConfig.vkUser = users[0] + UserConfig.vkUser.value = users[0] } }) } @@ -100,4 +100,4 @@ data class ConversationsLoaded( val conversations: List, val profiles: HashMap, val groups: HashMap -) : VKEvent() \ No newline at end of file +) : VKEvent() diff --git a/app/src/main/kotlin/com/meloda/fast/service/LongPollService.kt b/app/src/main/kotlin/com/meloda/fast/service/LongPollService.kt deleted file mode 100644 index e77a9f2f..00000000 --- a/app/src/main/kotlin/com/meloda/fast/service/LongPollService.kt +++ /dev/null @@ -1,132 +0,0 @@ -package com.meloda.fast.service - -import android.app.Service -import android.content.Intent -import android.os.IBinder -import android.util.Log -import androidx.annotation.WorkerThread -import com.meloda.fast.api.UserConfig -import com.meloda.fast.api.model.old.VKLongPollServer -import com.meloda.fast.util.AndroidUtils -import org.json.JSONArray -import org.json.JSONObject - -// TODO: 8/31/2021 rewrite, use job -@Deprecated("Absolutely obsolete") -class LongPollService : Service() { - private var thread: Thread? = null - private var running = false - - override fun onCreate() { - super.onCreate() - running = false - -// thread = LowThread(Updater()) - } - - override fun onBind(intent: Intent?): IBinder? { - return null - } - - override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int { - if (flags and START_FLAG_RETRY == 0) { - Log.w(TAG, "Retry launch!") - } else { - Log.d(TAG, "Simple launch") - } - if (running) return START_STICKY - running = true - - try { - thread?.start() - } catch (e: Exception) { - e.printStackTrace() - } - - return START_STICKY - } - - override fun onDestroy() { - super.onDestroy() - - running = false - - thread?.interrupt() - } - - private inner class Updater : Runnable { - override fun run() { - - var server: VKLongPollServer? = null - - while (running && UserConfig.isLoggedIn()) { - if (!AndroidUtils.hasConnection()) { - try { - Thread.sleep(5000) - } catch (e: InterruptedException) { - e.printStackTrace() - } - continue - } - try { - if (server == null) { - server = null -// server = VKApi.messages().getLongPollServer() -// .execute(VKLongPollServer::class.java)!![0] - } - - val response = getResponse(server) - if (response.has("failed")) { - Log.w(TAG, "Failed get response") - Thread.sleep(1000) - server = null - continue - } - - val tsResponse = response.optLong("ts") - val updates = response.getJSONArray("updates") - - Log.i(TAG, "updates: $updates") - - server?.ts = tsResponse - - if (updates.length() != 0) { - process(updates) - } - } catch (e: Exception) { - e.printStackTrace() - try { - Thread.sleep(5000) - server = null - } catch (e1: InterruptedException) { - e1.printStackTrace() - } - } - } - } - - @Throws(Exception::class) - private fun getResponse(server: VKLongPollServer?): JSONObject { - return JSONObject("") -// val params = arrayMapOf() -// params["act"] = "a_check" -// params["key"] = server.key -// params["ts"] = server.ts.toString() -// params["wait"] = "10" -// params["mode"] = "490" -// params["version"] = "9" -// -// val buffer = HttpRequest["https://" + server.server, params].asString() -// -// return JSONObject(buffer) - } - - @WorkerThread - private fun process(updates: JSONArray) { - } - } - - companion object { - private const val TAG = "LongPollService" - } -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/util/VKUtils.kt b/app/src/main/kotlin/com/meloda/fast/util/VKUtils.kt deleted file mode 100644 index a3b4aa6f..00000000 --- a/app/src/main/kotlin/com/meloda/fast/util/VKUtils.kt +++ /dev/null @@ -1,296 +0,0 @@ -package com.meloda.fast.util - -import android.content.Context -import android.graphics.drawable.Drawable -import androidx.core.content.ContextCompat -import com.meloda.fast.R -import com.meloda.fast.api.oldVKUtil -import com.meloda.fast.api.model.old.* -import com.meloda.fast.common.AppGlobal -import com.meloda.fast.extensions.ContextExtensions.color -import com.meloda.fast.extensions.ContextExtensions.drawable -import com.meloda.fast.extensions.DrawableExtensions.tint -import com.meloda.fast.extensions.StringExtensions.lowerCase -import java.text.SimpleDateFormat -import java.util.* -import kotlin.math.abs - -object VKUtils { - - fun getUserOnline(user: oldVKUser): String { - val r = AppGlobal.resources - return if (user.isOnline) { - if (user.isOnlineMobile) { - r.getString(R.string.user_online_mobile) - } else { - r.getString(R.string.user_online) - } - } else { - if (user.lastSeen == 0) { - r.getString(R.string.user_last_seen_recently) - } else { - r.getString( - R.string.user_last_seen_at, - oldVKUtil.getLastSeenTime(user.lastSeen * 1000L) - ) - } - } - } - - fun getUserOnlineIcon( - context: Context, - conversation: oldVKConversation?, - peerUser: oldVKUser? - ): Drawable? { - return if (conversation != null) { - if (conversation.isUser() && peerUser != null) { - if (!peerUser.isOnline) { - null - } else { - ContextCompat.getDrawable( - context, - if (peerUser.isOnlineMobile) R.drawable.ic_online_mobile else R.drawable.ic_online_pc - ) - } - } else null - } else { - if (peerUser!!.isOnline) { - ContextCompat.getDrawable( - context, - if (peerUser.isOnlineMobile) R.drawable.ic_online_mobile else R.drawable.ic_online_pc - ) - } else { - null - } - } - } - - fun getUserOnlineIcon(context: Context, user: oldVKUser): Drawable? { - return getUserOnlineIcon(context, null, user) - } - - // fun getAvatarPlaceholder(context: Context, dialogTitle: String): TextDrawable { -// return TextDrawable.builder().buildRound( -// if (dialogTitle.isEmpty()) "" else { -// TextUtils.getFirstLetterFromString(dialogTitle) -// }, -// context.color(R.color.accent) -// ) -// } - - - fun getAttachmentText(context: Context, attachments: List): String { - val resId: Int - - if (attachments.isNotEmpty()) { - if (attachments.size > 1) { - var oneType = true - - val firstType = attachments[0].attachmentType - -// val className = attachments[0].javaClass.simpleName - - for (model in attachments) { -// if (model.javaClass.simpleName != className) { - if (model.attachmentType != firstType) { - oneType = false - break - } - } - - return if (oneType) { -// val objectClass: Class = attachments[0].javaClass - - resId = when (firstType) { - VKAttachments.Type.PHOTO -> { - R.string.message_attachment_photos - } - VKAttachments.Type.VIDEO -> { - R.string.message_attachment_videos - } - VKAttachments.Type.AUDIO -> { - R.string.message_attachment_audios - } - VKAttachments.Type.DOCUMENT -> { - R.string.message_attachment_docs - } - else -> -1 - - } - if (resId == -1) "Unknown attachments" else context.getString( - resId, - attachments.size - ).lowerCase() - } else { - context.getString(R.string.message_attachments_many) - } - } else { -// val objectClass: Class = attachments[0].javaClass - val firstType = attachments[0].attachmentType - - resId = when (firstType) { - VKAttachments.Type.PHOTO -> R.string.message_attachment_photo - VKAttachments.Type.AUDIO -> R.string.message_attachment_audio - VKAttachments.Type.VIDEO -> R.string.message_attachment_video - VKAttachments.Type.DOCUMENT -> R.string.message_attachment_doc - VKAttachments.Type.GRAFFITI -> R.string.message_attachment_graffiti - VKAttachments.Type.VOICE_MESSAGE -> R.string.message_attachment_voice - VKAttachments.Type.STICKER -> R.string.message_attachment_sticker - VKAttachments.Type.GIFT -> R.string.message_attachment_gift - VKAttachments.Type.LINK -> R.string.message_attachment_link - VKAttachments.Type.POLL -> R.string.message_attachment_poll - VKAttachments.Type.CALL -> R.string.message_attachment_call - VKAttachments.Type.WALL_POST -> R.string.message_attachment_wall_post - VKAttachments.Type.WALL_REPLY -> R.string.message_attachment_wall_reply - else -> return "Unknown" - } - } - } else { - return "" - } - return context.getString(resId) - } - - fun getAttachmentDrawable(context: Context, attachments: List): Drawable? { - if (attachments.isEmpty() || attachments.size > 1) return null - - val resId = when (attachments[0].attachmentType) { - VKAttachments.Type.PHOTO -> R.drawable.ic_message_attachment_camera - VKAttachments.Type.AUDIO -> R.drawable.ic_message_attachment_audio - VKAttachments.Type.VIDEO -> R.drawable.ic_message_attachment_video - VKAttachments.Type.DOCUMENT -> R.drawable.ic_message_attachment_doc - VKAttachments.Type.GRAFFITI -> R.drawable.ic_message_attachment_graffiti - VKAttachments.Type.VOICE_MESSAGE -> R.drawable.ic_message_attachment_audio_message - VKAttachments.Type.STICKER -> R.drawable.ic_message_attachment_sticker - VKAttachments.Type.GIFT -> R.drawable.ic_message_attachment_gift - VKAttachments.Type.LINK -> R.drawable.ic_message_attachment_link - VKAttachments.Type.POLL -> R.drawable.ic_message_attachment_poll - VKAttachments.Type.CALL -> R.drawable.ic_message_attachment_call - - else -> null - } - - resId?.let { return context.drawable(it).tint(context.color(R.color.accent)) } - - return null - } - - fun getFwdText(context: Context, forwardedMessages: List): String { - return if (forwardedMessages.isNotEmpty()) { - if (forwardedMessages.size > 1) { - context.getString(R.string.message_fwd_many, forwardedMessages.size).lowerCase() - } else { - context.getString(R.string.message_fwd_one) - } - } else "" - } - - @Deprecated("need to rewrite") - fun getActionText( - context: Context, - lastMessage: oldVKMessage - ) { - - lastMessage.action?.let { - var result = "" - - when (it.type) { - oldVKMessageAction.Type.CHAT_CREATE -> result = context.getString( - R.string.message_action_created_chat, - "" - ) - oldVKMessageAction.Type.INVITE_USER -> result = - if (lastMessage.fromId == lastMessage.action!!.memberId) { - context.getString(R.string.message_action_returned_to_chat, "") - } else { - "" -// val invited = MemoryCache.getUserById(lastMessage.action!!.memberId) -// context.getString(R.string.message_action_invited_user, invited) - } - oldVKMessageAction.Type.INVITE_USER_BY_LINK -> result = context.getString( - R.string.message_action_invited_by_link, - "" - ) - oldVKMessageAction.Type.KICK_USER -> result = - if (lastMessage.fromId == lastMessage.action!!.memberId) { - context.getString(R.string.message_action_left_from_chat, "") - } else { - "" -// val kicked = MemoryCache.getUserById(lastMessage.action!!.memberId) -// context.getString(R.string.message_action_kicked_user, kicked) - } - oldVKMessageAction.Type.PHOTO_REMOVE -> result = context.getString( - R.string.message_action_removed_photo, - "" - ) - oldVKMessageAction.Type.PHOTO_UPDATE -> result = context.getString( - R.string.message_action_updated_photo, - "" - ) - oldVKMessageAction.Type.PIN_MESSAGE -> result = context.getString( - R.string.message_action_pinned_message, - "" - ) - oldVKMessageAction.Type.UNPIN_MESSAGE -> result = context.getString( - R.string.message_action_unpinned_message, - "" - ) - oldVKMessageAction.Type.TITLE_UPDATE -> result = context.getString( - R.string.message_action_updated_title, - "" - ) - } - - - } - } - - fun getTime(context: Context, lastMessage: oldVKMessage): String { - val then = lastMessage.date * 1000L - val now = System.currentTimeMillis() - - val change = abs(now - then) - - val seconds = change / 1000 - - if (seconds == 0L) { - return context.getString(R.string.time_format_now) - } - - val minutes = seconds / 60 - - if (minutes == 0L) { - return context.getString(R.string.time_format_second, seconds) - } - - val hours = minutes / 60 - - if (hours == 0L) { - return context.getString(R.string.time_format_minute, minutes) - } - - val days = hours / 24 - - if (days == 0L) { - return context.getString(R.string.time_format_hour, hours) - } - - val months = days / 30 - - if (months == 0L) { - return context.getString(R.string.time_format_day, days) - } - - val years = months / 12 - - if (years == 0L) { - return context.getString(R.string.time_format_month, months) - } else if (years > 0L) { - return context.getString(R.string.time_format_year, years) - } - - return SimpleDateFormat("HH:mm", Locale.getDefault()).format(then) - } - - -} \ No newline at end of file diff --git a/app/src/main/kotlin/com/meloda/fast/util/ViewUtils.kt b/app/src/main/kotlin/com/meloda/fast/util/ViewUtils.kt deleted file mode 100644 index 5a046b5d..00000000 --- a/app/src/main/kotlin/com/meloda/fast/util/ViewUtils.kt +++ /dev/null @@ -1,54 +0,0 @@ -package com.meloda.fast.util - -import android.content.Context -import android.graphics.drawable.ColorDrawable -import android.text.TextUtils -import android.view.View -import android.widget.TextView -import android.widget.Toast -import com.google.android.material.snackbar.Snackbar -import com.meloda.fast.extensions.ContextExtensions.color -import com.meloda.fast.R -import com.meloda.fast.widget.CircleImageView -import com.meloda.fast.api.model.old.oldVKUser - - -object ViewUtils { - - fun showErrorSnackbar(view: View, t: Throwable) { - Snackbar.make( - view, - Utils.getLocalizedThrowable(view.context, t), - Snackbar.LENGTH_LONG - ).show() - } - - fun showErrorToast(context: Context, t: Throwable) { - Toast.makeText( - context, - Utils.getLocalizedThrowable(context, t), - Toast.LENGTH_LONG - ).show() - } - - fun prepareNavigationHeader(view: View, user: oldVKUser) { - val profileName = view.findViewById(R.id.headerName) - - profileName.text = user.toString() - - val profileStatus = view.findViewById(R.id.headerStatus) - - val statusText = if (TextUtils.isEmpty(user.status)) "@id${user.userId}" else user.status - - profileStatus.text = statusText - - val profileAvatar: CircleImageView = view.findViewById(R.id.headerAvatar) - - if (AndroidUtils.hasConnection()) { -// Picasso.get().load(VKUtil.getUserPhoto(user)).into(profileAvatar) - } else { - profileAvatar.setImageDrawable(ColorDrawable(view.context.color(R.color.accent))) - } - } - -} \ No newline at end of file diff --git a/app/src/main/res/anim/slide_down.xml b/app/src/main/res/anim/slide_down.xml deleted file mode 100644 index 4e536ca3..00000000 --- a/app/src/main/res/anim/slide_down.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/anim/slide_up.xml b/app/src/main/res/anim/slide_up.xml deleted file mode 100644 index 35b523d8..00000000 --- a/app/src/main/res/anim/slide_up.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-nodpi/face.jpg b/app/src/main/res/drawable-nodpi/face.jpg deleted file mode 100644 index 05000a14..00000000 Binary files a/app/src/main/res/drawable-nodpi/face.jpg and /dev/null differ diff --git a/app/src/main/res/drawable-v21/ic_account_circle_outline.xml b/app/src/main/res/drawable-v21/ic_account_circle_outline.xml deleted file mode 100644 index 6e430808..00000000 --- a/app/src/main/res/drawable-v21/ic_account_circle_outline.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_arrow_back.xml b/app/src/main/res/drawable-v21/ic_arrow_back.xml deleted file mode 100644 index e3ff9579..00000000 --- a/app/src/main/res/drawable-v21/ic_arrow_back.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_close.xml b/app/src/main/res/drawable-v21/ic_close.xml deleted file mode 100644 index c8204159..00000000 --- a/app/src/main/res/drawable-v21/ic_close.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_dialog_type_conversation.xml b/app/src/main/res/drawable-v21/ic_dialog_type_conversation.xml deleted file mode 100644 index 03ce6730..00000000 --- a/app/src/main/res/drawable-v21/ic_dialog_type_conversation.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_email.xml b/app/src/main/res/drawable-v21/ic_email.xml deleted file mode 100644 index 462d9124..00000000 --- a/app/src/main/res/drawable-v21/ic_email.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_error.xml b/app/src/main/res/drawable-v21/ic_error.xml deleted file mode 100644 index 7ff1ad7a..00000000 --- a/app/src/main/res/drawable-v21/ic_error.xml +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable-v21/ic_exit_to_app.xml b/app/src/main/res/drawable-v21/ic_exit_to_app.xml deleted file mode 100644 index e233f593..00000000 --- a/app/src/main/res/drawable-v21/ic_exit_to_app.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_file_download.xml b/app/src/main/res/drawable-v21/ic_file_download.xml deleted file mode 100644 index a243261e..00000000 --- a/app/src/main/res/drawable-v21/ic_file_download.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_format_size.xml b/app/src/main/res/drawable-v21/ic_format_size.xml deleted file mode 100644 index e64060ed..00000000 --- a/app/src/main/res/drawable-v21/ic_format_size.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_info_outline.xml b/app/src/main/res/drawable-v21/ic_info_outline.xml deleted file mode 100644 index af0d4d06..00000000 --- a/app/src/main/res/drawable-v21/ic_info_outline.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_lock.xml b/app/src/main/res/drawable-v21/ic_lock.xml deleted file mode 100644 index 58daccc5..00000000 --- a/app/src/main/res/drawable-v21/ic_lock.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_lock_outline.xml b/app/src/main/res/drawable-v21/ic_lock_outline.xml deleted file mode 100644 index e876745f..00000000 --- a/app/src/main/res/drawable-v21/ic_lock_outline.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_menu.xml b/app/src/main/res/drawable-v21/ic_menu.xml deleted file mode 100644 index 1cad3ddf..00000000 --- a/app/src/main/res/drawable-v21/ic_menu.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_audio.xml b/app/src/main/res/drawable-v21/ic_message_attachment_audio.xml deleted file mode 100644 index c565ad12..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_audio.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_audio_message.xml b/app/src/main/res/drawable-v21/ic_message_attachment_audio_message.xml deleted file mode 100644 index 848de634..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_audio_message.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_call.xml b/app/src/main/res/drawable-v21/ic_message_attachment_call.xml deleted file mode 100644 index d7d4a4e3..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_call.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_camera.xml b/app/src/main/res/drawable-v21/ic_message_attachment_camera.xml deleted file mode 100644 index 33d3947a..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_camera.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_gift.xml b/app/src/main/res/drawable-v21/ic_message_attachment_gift.xml deleted file mode 100644 index 080918cd..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_gift.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_link.xml b/app/src/main/res/drawable-v21/ic_message_attachment_link.xml deleted file mode 100644 index 3766173c..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_link.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_poll.xml b/app/src/main/res/drawable-v21/ic_message_attachment_poll.xml deleted file mode 100644 index 322dd6fa..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_poll.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_video.xml b/app/src/main/res/drawable-v21/ic_message_attachment_video.xml deleted file mode 100644 index c1e846be..00000000 --- a/app/src/main/res/drawable-v21/ic_message_attachment_video.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_mic.xml b/app/src/main/res/drawable-v21/ic_mic.xml deleted file mode 100644 index b1ea93c9..00000000 --- a/app/src/main/res/drawable-v21/ic_mic.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable-v21/ic_no_internet.xml b/app/src/main/res/drawable-v21/ic_no_internet.xml deleted file mode 100644 index 6f31b586..00000000 --- a/app/src/main/res/drawable-v21/ic_no_internet.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable-v21/ic_no_items.xml b/app/src/main/res/drawable-v21/ic_no_items.xml deleted file mode 100644 index 2c25c5f7..00000000 --- a/app/src/main/res/drawable-v21/ic_no_items.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable-v21/ic_online_mobile.xml b/app/src/main/res/drawable-v21/ic_online_mobile.xml deleted file mode 100644 index 4a878387..00000000 --- a/app/src/main/res/drawable-v21/ic_online_mobile.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable-v21/ic_online_mobile_dark.xml b/app/src/main/res/drawable-v21/ic_online_mobile_dark.xml deleted file mode 100644 index 1ed5ea8c..00000000 --- a/app/src/main/res/drawable-v21/ic_online_mobile_dark.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/app/src/main/res/drawable-v21/ic_outline_format_paint.xml b/app/src/main/res/drawable-v21/ic_outline_format_paint.xml deleted file mode 100644 index a1bbe431..00000000 --- a/app/src/main/res/drawable-v21/ic_outline_format_paint.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_outline_menu_24.xml b/app/src/main/res/drawable-v21/ic_outline_menu_24.xml deleted file mode 100644 index 470db520..00000000 --- a/app/src/main/res/drawable-v21/ic_outline_menu_24.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_palette_swatch_outline.xml b/app/src/main/res/drawable-v21/ic_palette_swatch_outline.xml deleted file mode 100644 index 11bc5a0a..00000000 --- a/app/src/main/res/drawable-v21/ic_palette_swatch_outline.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_phone_android.xml b/app/src/main/res/drawable-v21/ic_phone_android.xml deleted file mode 100644 index 97509f3f..00000000 --- a/app/src/main/res/drawable-v21/ic_phone_android.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_refresh.xml b/app/src/main/res/drawable-v21/ic_refresh.xml deleted file mode 100644 index 9e4f8dfc..00000000 --- a/app/src/main/res/drawable-v21/ic_refresh.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_send.xml b/app/src/main/res/drawable-v21/ic_send.xml deleted file mode 100644 index 742495e6..00000000 --- a/app/src/main/res/drawable-v21/ic_send.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_settings.xml b/app/src/main/res/drawable-v21/ic_settings.xml deleted file mode 100644 index 833f05cf..00000000 --- a/app/src/main/res/drawable-v21/ic_settings.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_settings_outline.xml b/app/src/main/res/drawable-v21/ic_settings_outline.xml deleted file mode 100644 index 1f264d7f..00000000 --- a/app/src/main/res/drawable-v21/ic_settings_outline.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_start_bottom.xml b/app/src/main/res/drawable-v21/ic_start_bottom.xml deleted file mode 100644 index b82b2d49..00000000 --- a/app/src/main/res/drawable-v21/ic_start_bottom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable-v21/ic_system_update.xml b/app/src/main/res/drawable-v21/ic_system_update.xml deleted file mode 100644 index 900763c8..00000000 --- a/app/src/main/res/drawable-v21/ic_system_update.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-v21/ic_vkm.xml b/app/src/main/res/drawable-v21/ic_vkm.xml deleted file mode 100644 index 2505b97f..00000000 --- a/app/src/main/res/drawable-v21/ic_vkm.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - diff --git a/app/src/main/res/drawable-xhdpi/ic_start_screen_background.png b/app/src/main/res/drawable-xhdpi/ic_start_screen_background.png deleted file mode 100644 index 0b046380..00000000 Binary files a/app/src/main/res/drawable-xhdpi/ic_start_screen_background.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_start_screen_background.png b/app/src/main/res/drawable-xxhdpi/ic_start_screen_background.png deleted file mode 100644 index 53bdf266..00000000 Binary files a/app/src/main/res/drawable-xxhdpi/ic_start_screen_background.png and /dev/null differ diff --git a/app/src/main/res/drawable-xxxhdpi/ic_start_screen_background.png b/app/src/main/res/drawable-xxxhdpi/ic_start_screen_background.png deleted file mode 100644 index aab60e8a..00000000 Binary files a/app/src/main/res/drawable-xxxhdpi/ic_start_screen_background.png and /dev/null differ diff --git a/app/src/main/res/drawable/chat_panel_background.xml b/app/src/main/res/drawable/chat_panel_background.xml deleted file mode 100644 index 50d98a33..00000000 --- a/app/src/main/res/drawable/chat_panel_background.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/chat_panel_background_blocked.xml b/app/src/main/res/drawable/chat_panel_background_blocked.xml deleted file mode 100644 index ad8234b6..00000000 --- a/app/src/main/res/drawable/chat_panel_background_blocked.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/edit_text_box_background.xml b/app/src/main/res/drawable/edit_text_box_background.xml deleted file mode 100644 index d70c9f09..00000000 --- a/app/src/main/res/drawable/edit_text_box_background.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/edittext_filled_background.xml b/app/src/main/res/drawable/edittext_filled_background.xml deleted file mode 100644 index 7261210c..00000000 --- a/app/src/main/res/drawable/edittext_filled_background.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_account_circle_cut.xml b/app/src/main/res/drawable/ic_account_circle_cut.xml new file mode 100644 index 00000000..c5a6b15b --- /dev/null +++ b/app/src/main/res/drawable/ic_account_circle_cut.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable-v21/ic_trash_outline.xml b/app/src/main/res/drawable/ic_attachment_audio.xml similarity index 66% rename from app/src/main/res/drawable-v21/ic_trash_outline.xml rename to app/src/main/res/drawable/ic_attachment_audio.xml index a465f3c6..17708598 100644 --- a/app/src/main/res/drawable-v21/ic_trash_outline.xml +++ b/app/src/main/res/drawable/ic_attachment_audio.xml @@ -6,5 +6,5 @@ android:viewportHeight="24"> + android:pathData="M12 3V13.55C11.41 13.21 10.73 13 10 13C7.79 13 6 14.79 6 17S7.79 21 10 21 14 19.21 14 17V7H18V3H12Z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_attachment_call.xml b/app/src/main/res/drawable/ic_attachment_call.xml new file mode 100644 index 00000000..06d12089 --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_call.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_done.xml b/app/src/main/res/drawable/ic_attachment_file.xml similarity index 70% rename from app/src/main/res/drawable-v21/ic_done.xml rename to app/src/main/res/drawable/ic_attachment_file.xml index 8b757ba7..7962438f 100644 --- a/app/src/main/res/drawable-v21/ic_done.xml +++ b/app/src/main/res/drawable/ic_attachment_file.xml @@ -6,5 +6,5 @@ android:viewportHeight="24"> + android:pathData="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_attachment_forwarded_message.xml b/app/src/main/res/drawable/ic_attachment_forwarded_message.xml new file mode 100644 index 00000000..d7e0cb1e --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_forwarded_message.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable-v21/ic_dialog_type_channel.xml b/app/src/main/res/drawable/ic_attachment_forwarded_messages.xml similarity index 68% rename from app/src/main/res/drawable-v21/ic_dialog_type_channel.xml rename to app/src/main/res/drawable/ic_attachment_forwarded_messages.xml index 35d1f13b..d27bfe6f 100644 --- a/app/src/main/res/drawable-v21/ic_dialog_type_channel.xml +++ b/app/src/main/res/drawable/ic_attachment_forwarded_messages.xml @@ -6,5 +6,5 @@ android:viewportHeight="24"> + android:pathData="M13,9V5L6,12L13,19V14.9C18,14.9 21.5,16.5 24,20C23,15 20,10 13,9M7,8V5L0,12L7,19V16L3,12L7,8Z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_attachment_gift.xml b/app/src/main/res/drawable/ic_attachment_gift.xml new file mode 100644 index 00000000..0565794c --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_gift.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_graffiti.xml b/app/src/main/res/drawable/ic_attachment_graffiti.xml similarity index 89% rename from app/src/main/res/drawable-v21/ic_message_attachment_graffiti.xml rename to app/src/main/res/drawable/ic_attachment_graffiti.xml index d237c079..9f0e4c44 100644 --- a/app/src/main/res/drawable-v21/ic_message_attachment_graffiti.xml +++ b/app/src/main/res/drawable/ic_attachment_graffiti.xml @@ -1,7 +1,7 @@ + + diff --git a/app/src/main/res/drawable/ic_attachment_link.xml b/app/src/main/res/drawable/ic_attachment_link.xml new file mode 100644 index 00000000..223a7101 --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_link.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_edit.xml b/app/src/main/res/drawable/ic_attachment_mini_app.xml similarity index 51% rename from app/src/main/res/drawable-v21/ic_edit.xml rename to app/src/main/res/drawable/ic_attachment_mini_app.xml index 2173930d..26c6d396 100644 --- a/app/src/main/res/drawable-v21/ic_edit.xml +++ b/app/src/main/res/drawable/ic_attachment_mini_app.xml @@ -6,5 +6,5 @@ android:viewportHeight="24"> + android:pathData="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M7,7V9H9V7H7M11,7V9H13V7H11M15,7V9H17V7H15M7,11V13H9V11H7M11,11V13H13V11H11M15,11V13H17V11H15M7,15V17H9V15H7M11,15V17H13V15H11M15,15V17H17V15H15Z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_attachment_photo.xml b/app/src/main/res/drawable/ic_attachment_photo.xml new file mode 100644 index 00000000..cffc7970 --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_photo.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_attachment_poll.xml b/app/src/main/res/drawable/ic_attachment_poll.xml new file mode 100644 index 00000000..175877d1 --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_poll.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_sticker.xml b/app/src/main/res/drawable/ic_attachment_sticker.xml similarity index 94% rename from app/src/main/res/drawable-v21/ic_message_attachment_sticker.xml rename to app/src/main/res/drawable/ic_attachment_sticker.xml index 212d6e8b..e5b96be8 100644 --- a/app/src/main/res/drawable-v21/ic_message_attachment_sticker.xml +++ b/app/src/main/res/drawable/ic_attachment_sticker.xml @@ -1,7 +1,7 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_attachment_voice.xml b/app/src/main/res/drawable/ic_attachment_voice.xml new file mode 100644 index 00000000..695d3a62 --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_voice.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v21/ic_message_attachment_doc.xml b/app/src/main/res/drawable/ic_attachment_wall.xml similarity index 51% rename from app/src/main/res/drawable-v21/ic_message_attachment_doc.xml rename to app/src/main/res/drawable/ic_attachment_wall.xml index 253e03d4..e87a4dea 100644 --- a/app/src/main/res/drawable-v21/ic_message_attachment_doc.xml +++ b/app/src/main/res/drawable/ic_attachment_wall.xml @@ -1,10 +1,10 @@ + android:pathData="M3,16H12V21H3V16M2,10H8V15H2V10M9,10H15V15H9V10M16,10H22V15H16V10M13,16H21V21H13V16M3,4H11V9H3V4M12,4H21V9H12V4Z" /> \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_attachment_wall_reply.xml b/app/src/main/res/drawable/ic_attachment_wall_reply.xml new file mode 100644 index 00000000..046dec85 --- /dev/null +++ b/app/src/main/res/drawable/ic_attachment_wall_reply.xml @@ -0,0 +1,10 @@ + + + + diff --git a/app/src/main/res/drawable/ic_conversations_counter_background.xml b/app/src/main/res/drawable/ic_back.xml similarity index 50% rename from app/src/main/res/drawable/ic_conversations_counter_background.xml rename to app/src/main/res/drawable/ic_back.xml index a28ba1db..07ad6413 100644 --- a/app/src/main/res/drawable/ic_conversations_counter_background.xml +++ b/app/src/main/res/drawable/ic_back.xml @@ -1,9 +1,7 @@ - + - - - + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_baseline_attach_file_24.xml b/app/src/main/res/drawable/ic_baseline_attach_file_24.xml new file mode 100644 index 00000000..72956185 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_attach_file_24.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_baseline_create_24.xml b/app/src/main/res/drawable/ic_baseline_create_24.xml new file mode 100644 index 00000000..efc5ae47 --- /dev/null +++ b/app/src/main/res/drawable/ic_baseline_create_24.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_logo_fast_border.xml b/app/src/main/res/drawable/ic_logo_fast_border.xml deleted file mode 100644 index e1f3c02e..00000000 --- a/app/src/main/res/drawable/ic_logo_fast_border.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_map_marker.xml b/app/src/main/res/drawable/ic_map_marker.xml new file mode 100644 index 00000000..df416cc9 --- /dev/null +++ b/app/src/main/res/drawable/ic_map_marker.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_message_bubble_in_simple.xml b/app/src/main/res/drawable/ic_message_bubble_in_simple.xml deleted file mode 100644 index a3c8ca6b..00000000 --- a/app/src/main/res/drawable/ic_message_bubble_in_simple.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_message_bubble_out_simple.xml b/app/src/main/res/drawable/ic_message_bubble_out_simple.xml deleted file mode 100644 index bb2dae4f..00000000 --- a/app/src/main/res/drawable/ic_message_bubble_out_simple.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_message_timestamp.xml b/app/src/main/res/drawable/ic_message_timestamp.xml deleted file mode 100644 index a5f04c5c..00000000 --- a/app/src/main/res/drawable/ic_message_timestamp.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_message_unread.xml b/app/src/main/res/drawable/ic_message_unread.xml new file mode 100644 index 00000000..341a6369 --- /dev/null +++ b/app/src/main/res/drawable/ic_message_unread.xml @@ -0,0 +1,10 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_outline_bug_report_24.xml b/app/src/main/res/drawable/ic_outline_bug_report_24.xml deleted file mode 100644 index 5d3845da..00000000 --- a/app/src/main/res/drawable/ic_outline_bug_report_24.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_phantom.xml b/app/src/main/res/drawable/ic_phantom.xml new file mode 100644 index 00000000..3bc9d504 --- /dev/null +++ b/app/src/main/res/drawable/ic_phantom.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/item_divider.xml b/app/src/main/res/drawable/item_divider.xml deleted file mode 100644 index 0102df45..00000000 --- a/app/src/main/res/drawable/item_divider.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/navigation_view_item_background_active.xml b/app/src/main/res/drawable/navigation_view_item_background_active.xml deleted file mode 100644 index 329088d9..00000000 --- a/app/src/main/res/drawable/navigation_view_item_background_active.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/drawable/navigation_view_item_background_normal.xml b/app/src/main/res/drawable/navigation_view_item_background_normal.xml deleted file mode 100644 index 31529d0f..00000000 --- a/app/src/main/res/drawable/navigation_view_item_background_normal.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/drawable/navigation_view_item_background_selector.xml b/app/src/main/res/drawable/navigation_view_item_background_selector.xml deleted file mode 100644 index 6dc493b9..00000000 --- a/app/src/main/res/drawable/navigation_view_item_background_selector.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/navigation_view_item_icon_colors.xml b/app/src/main/res/drawable/navigation_view_item_icon_colors.xml deleted file mode 100644 index 5b3daf0c..00000000 --- a/app/src/main/res/drawable/navigation_view_item_icon_colors.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/navigation_view_item_text_colors.xml b/app/src/main/res/drawable/navigation_view_item_text_colors.xml deleted file mode 100644 index 7b504faf..00000000 --- a/app/src/main/res/drawable/navigation_view_item_text_colors.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/navigation_view_items_colors.xml b/app/src/main/res/drawable/navigation_view_items_colors.xml deleted file mode 100644 index d11eaf0b..00000000 --- a/app/src/main/res/drawable/navigation_view_items_colors.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/toolbar_background.xml b/app/src/main/res/drawable/toolbar_background.xml deleted file mode 100644 index adb66b4b..00000000 --- a/app/src/main/res/drawable/toolbar_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/toolbar_background_ripple.xml b/app/src/main/res/drawable/toolbar_background_ripple.xml deleted file mode 100644 index 9ce8eb1b..00000000 --- a/app/src/main/res/drawable/toolbar_background_ripple.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml deleted file mode 100644 index 64508c8d..00000000 --- a/app/src/main/res/layout/activity_login.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_login_custom_data.xml b/app/src/main/res/layout/activity_login_custom_data.xml deleted file mode 100644 index 4b937509..00000000 --- a/app/src/main/res/layout/activity_login_custom_data.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main_drawer_header.xml b/app/src/main/res/layout/activity_main_drawer_header.xml deleted file mode 100644 index f53e8c57..00000000 --- a/app/src/main/res/layout/activity_main_drawer_header.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_messages.xml b/app/src/main/res/layout/activity_messages.xml deleted file mode 100644 index 0e84e254..00000000 --- a/app/src/main/res/layout/activity_messages.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml deleted file mode 100644 index 348f426b..00000000 --- a/app/src/main/res/layout/activity_settings.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_start.xml b/app/src/main/res/layout/activity_start.xml deleted file mode 100644 index 741f3d33..00000000 --- a/app/src/main/res/layout/activity_start.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_update.xml b/app/src/main/res/layout/activity_update.xml deleted file mode 100644 index 338b9f50..00000000 --- a/app/src/main/res/layout/activity_update.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_account.xml b/app/src/main/res/layout/dialog_account.xml deleted file mode 100644 index 445cd9b4..00000000 --- a/app/src/main/res/layout/dialog_account.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_captcha.xml b/app/src/main/res/layout/dialog_captcha.xml index 4d407940..3bd72f72 100644 --- a/app/src/main/res/layout/dialog_captcha.xml +++ b/app/src/main/res/layout/dialog_captcha.xml @@ -25,7 +25,6 @@ @@ -65,10 +63,9 @@ android:layout_height="wrap_content" android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_weight="1" + android:backgroundTint="@color/a1_600" android:text="@android:string/cancel" - android:textColor="?colorAction" - app:elevation="0dp" - app:rippleColor="?colorActionRipple" /> + app:elevation="0dp" /> + app:elevation="0dp" /> diff --git a/app/src/main/res/layout/dialog_profile_bottom.xml b/app/src/main/res/layout/dialog_profile_bottom.xml deleted file mode 100644 index 16223db8..00000000 --- a/app/src/main/res/layout/dialog_profile_bottom.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_validation.xml b/app/src/main/res/layout/dialog_validation.xml index 9e24ba07..eada421a 100644 --- a/app/src/main/res/layout/dialog_validation.xml +++ b/app/src/main/res/layout/dialog_validation.xml @@ -1,7 +1,6 @@ + xmlns:app="http://schemas.android.com/apk/res-auto"> @@ -59,10 +56,9 @@ android:layout_height="wrap_content" android:layout_marginEnd="@dimen/activity_horizontal_margin" android:layout_weight="1" + android:backgroundTint="@color/n1_900" android:text="@android:string/cancel" - android:textColor="?colorAction" - app:elevation="0dp" - app:rippleColor="?colorActionRipple" /> + app:elevation="0dp" /> + app:elevation="0dp" /> diff --git a/app/src/main/res/layout/error_view.xml b/app/src/main/res/layout/error_view.xml deleted file mode 100644 index d685a0fe..00000000 --- a/app/src/main/res/layout/error_view.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_conversations.xml b/app/src/main/res/layout/fragment_conversations.xml index 7681f86b..26216d18 100644 --- a/app/src/main/res/layout/fragment_conversations.xml +++ b/app/src/main/res/layout/fragment_conversations.xml @@ -5,10 +5,68 @@ android:layout_width="match_parent" android:layout_height="match_parent"> + + + + + + + + + + + + + + + + + + + + + + android:layout_height="match_parent" + app:layout_behavior="@string/appbar_scrolling_view_behavior"> + tools:listitem="@layout/item_conversation" /> @@ -29,4 +87,20 @@ android:visibility="gone" tools:visibility="visible" /> + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_friends.xml b/app/src/main/res/layout/fragment_friends.xml deleted file mode 100644 index c33f81ce..00000000 --- a/app/src/main/res/layout/fragment_friends.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_important.xml b/app/src/main/res/layout/fragment_important.xml deleted file mode 100644 index d5ad0418..00000000 --- a/app/src/main/res/layout/fragment_important.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_login.xml b/app/src/main/res/layout/fragment_login.xml index f418a5ca..9378d007 100644 --- a/app/src/main/res/layout/fragment_login.xml +++ b/app/src/main/res/layout/fragment_login.xml @@ -26,8 +26,7 @@ android:id="@+id/logoContainer" android:layout_width="140dp" android:layout_height="140dp" - android:layout_gravity="center_horizontal" - android:background="@drawable/ic_logo_fast_border"> + android:layout_gravity="center_horizontal"> @@ -91,7 +88,6 @@ + app:iconGravity="end" /> diff --git a/app/src/main/res/layout/fragment_main.xml b/app/src/main/res/layout/fragment_main.xml index 1441837d..6bd3be14 100644 --- a/app/src/main/res/layout/fragment_main.xml +++ b/app/src/main/res/layout/fragment_main.xml @@ -19,8 +19,6 @@ android:visibility="gone" app:backgroundTint="?colorSurface" app:elevation="0.5dp" - app:itemIconTint="@drawable/navigation_view_items_colors" - app:itemTextColor="@drawable/navigation_view_items_colors" app:labelVisibilityMode="unlabeled" app:menu="@menu/activity_main_bottom" /> diff --git a/app/src/main/res/layout/item_conversation.xml b/app/src/main/res/layout/item_conversation.xml index 0d65f247..de60be02 100644 --- a/app/src/main/res/layout/item_conversation.xml +++ b/app/src/main/res/layout/item_conversation.xml @@ -3,101 +3,223 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"> - + android:background="?selectableItemBackground" + android:orientation="horizontal" + android:paddingVertical="4dp"> - - - + + android:layout_width="56dp" + android:layout_height="56dp"> + + + + + + + + + + + + android:layout_gravity="end|top" + android:visibility="gone" + tools:visibility="visible"> + + + + + + + + + + + + + + + + - - - - - - + android:layout_marginStart="24dp" + android:orientation="vertical"> - + + + + + + + + + + + + + + + + + + + + android:orientation="horizontal"> + + + + + - - - - - - - - - + \ No newline at end of file diff --git a/app/src/main/res/layout/item_conversation_light.xml b/app/src/main/res/layout/item_conversation_light.xml deleted file mode 100644 index 6f01341c..00000000 --- a/app/src/main/res/layout/item_conversation_light.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_conversation_old.xml b/app/src/main/res/layout/item_conversation_old.xml deleted file mode 100644 index 236c3e6d..00000000 --- a/app/src/main/res/layout/item_conversation_old.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_message.xml b/app/src/main/res/layout/item_message.xml deleted file mode 100644 index efa1e213..00000000 --- a/app/src/main/res/layout/item_message.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_action.xml b/app/src/main/res/layout/item_message_action.xml deleted file mode 100644 index f188c91a..00000000 --- a/app/src/main/res/layout/item_message_action.xml +++ /dev/null @@ -1,14 +0,0 @@ - - diff --git a/app/src/main/res/layout/item_message_attachment_in.xml b/app/src/main/res/layout/item_message_attachment_in.xml deleted file mode 100644 index 53219f01..00000000 --- a/app/src/main/res/layout/item_message_attachment_in.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_attachment_out.xml b/app/src/main/res/layout/item_message_attachment_out.xml deleted file mode 100644 index e46be79f..00000000 --- a/app/src/main/res/layout/item_message_attachment_out.xml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_channel.xml b/app/src/main/res/layout/item_message_channel.xml deleted file mode 100644 index 58d4aba1..00000000 --- a/app/src/main/res/layout/item_message_channel.xml +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_normal_in.xml b/app/src/main/res/layout/item_message_normal_in.xml deleted file mode 100644 index c62d46d8..00000000 --- a/app/src/main/res/layout/item_message_normal_in.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_normal_out.xml b/app/src/main/res/layout/item_message_normal_out.xml deleted file mode 100644 index d19785d5..00000000 --- a/app/src/main/res/layout/item_message_normal_out.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_message_timestamp.xml b/app/src/main/res/layout/item_message_timestamp.xml deleted file mode 100644 index e264d1da..00000000 --- a/app/src/main/res/layout/item_message_timestamp.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_simple_menu.xml b/app/src/main/res/layout/item_simple_menu.xml deleted file mode 100644 index cb8de4a7..00000000 --- a/app/src/main/res/layout/item_simple_menu.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_user.xml b/app/src/main/res/layout/item_user.xml deleted file mode 100644 index a1ef4c43..00000000 --- a/app/src/main/res/layout/item_user.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/no_internet_view.xml b/app/src/main/res/layout/no_internet_view.xml deleted file mode 100644 index 8883a21a..00000000 --- a/app/src/main/res/layout/no_internet_view.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/no_items_view.xml b/app/src/main/res/layout/no_items_view.xml deleted file mode 100644 index 06aefad1..00000000 --- a/app/src/main/res/layout/no_items_view.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/recycler_view.xml b/app/src/main/res/layout/recycler_view.xml deleted file mode 100644 index 1295140e..00000000 --- a/app/src/main/res/layout/recycler_view.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/toolbar.xml b/app/src/main/res/layout/toolbar.xml deleted file mode 100644 index 3ab5718b..00000000 --- a/app/src/main/res/layout/toolbar.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/toolbar_floating.xml b/app/src/main/res/layout/toolbar_floating.xml deleted file mode 100644 index 9eeda9a4..00000000 --- a/app/src/main/res/layout/toolbar_floating.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_bottom.xml b/app/src/main/res/menu/activity_main_bottom.xml index d66816f2..75c5f768 100644 --- a/app/src/main/res/menu/activity_main_bottom.xml +++ b/app/src/main/res/menu/activity_main_bottom.xml @@ -1,19 +1,9 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml deleted file mode 100644 index 0d29edef..00000000 --- a/app/src/main/res/menu/activity_main_drawer.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/activity_messages.xml b/app/src/main/res/menu/activity_messages.xml deleted file mode 100644 index 6f72c973..00000000 --- a/app/src/main/res/menu/activity_messages.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/empty.xml b/app/src/main/res/menu/empty.xml deleted file mode 100644 index f156b75b..00000000 --- a/app/src/main/res/menu/empty.xml +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/app/src/main/res/menu/fragment_conversations.xml b/app/src/main/res/menu/fragment_conversations.xml index ca900c3c..aab207c3 100644 --- a/app/src/main/res/menu/fragment_conversations.xml +++ b/app/src/main/res/menu/fragment_conversations.xml @@ -1,8 +1,6 @@ - + - \ No newline at end of file diff --git a/app/src/main/res/menu/fragment_friends.xml b/app/src/main/res/menu/fragment_friends.xml deleted file mode 100644 index fe187c0c..00000000 --- a/app/src/main/res/menu/fragment_friends.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png deleted file mode 100644 index bdd6be92..00000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png deleted file mode 100644 index 2eb4ff41..00000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png deleted file mode 100644 index 30b88aa3..00000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png deleted file mode 100644 index b07c785e..00000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png deleted file mode 100644 index 99a34029..00000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png and /dev/null differ diff --git a/app/src/main/res/navigation/friends.xml b/app/src/main/res/navigation/friends.xml deleted file mode 100644 index 1f8d3a90..00000000 --- a/app/src/main/res/navigation/friends.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/navigation/important.xml b/app/src/main/res/navigation/important.xml deleted file mode 100644 index 4301a41a..00000000 --- a/app/src/main/res/navigation/important.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index 097c40e0..4edb3e22 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,29 +1,15 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values-v31/colors.xml b/app/src/main/res/values-v31/colors.xml index 1f96aee1..fa98ede9 100644 --- a/app/src/main/res/values-v31/colors.xml +++ b/app/src/main/res/values-v31/colors.xml @@ -1,63 +1,21 @@ - @android:color/system_neutral1_50 - @android:color/system_neutral1_50 - @android:color/system_neutral1_50 - @android:color/system_accent1_500 - @android:color/system_accent3_500 - @android:color/system_accent3_200 - @android:color/system_accent1_10 + @android:color/system_accent1_0 + @android:color/system_accent1_500 + @android:color/system_accent1_600 - @android:color/system_accent3_200 - @android:color/system_neutral2_500 - @android:color/system_neutral1_900 + @android:color/system_accent2_200 + @android:color/system_accent2_700 - @android:color/system_neutral1_50 + @android:color/system_accent3_200 - #E0E0E0 + @android:color/system_neutral1_50 + @android:color/system_neutral1_100 + @android:color/system_neutral1_900 - #99000000 - - #ff000000 - #DE000000 - #99000000 - - #ffffff - #DEFFFFFF - #99FFFFFF - - #666666 - - #F5F5F5 - - #5c5c5c - #e8e8e8 - #ffffff - - @color/accent - - #ffffff - #000000 - - - @android:color/system_accent1_1000 - @android:color/system_accent1_1000 - @android:color/system_accent1_1000 - @android:color/system_accent1_400 - @android:color/system_accent3_300 - @android:color/system_accent3_50 - @android:color/system_accent3_1000 - - @android:color/system_accent1_900 - - #292929 - - #99FFFFFF - - #272727 - - #000000 - #ffffff + @android:color/system_neutral2_0 + @android:color/system_neutral2_10 + @android:color/system_neutral2_500 \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 2ce146b3..0d2c4cc4 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -1,42 +1,4 @@ - - @string/message_attachment_audio - @string/message_attachment_doc - @string/message_attachment_gift - @string/message_attachment_graffiti - @string/message_attachment_link - @string/message_attachment_photo - @string/message_attachment_poll - @string/message_attachment_sticker - @string/message_attachment_video - @string/message_attachment_voice - - - - Minimal - Normal - Extended - - - - 0 - 1 - 2 - - - - @string/theme_light - @string/theme_dark - @string/theme_power_saving - @string/theme_system - - - - 0 - 1 - 2 - 3 - \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 3bae8bfa..9a6c0402 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -1,22 +1,8 @@ - - - - - - - - - - - - - - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 70ece8a2..5f37ab99 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -1,65 +1,23 @@ - #ffffff - #ffffff - #ffffff - #4284F4 - #4E8CF6 - #95BBFB - #ffffff + #FFFFFF + #3771DF + #2559BC - @color/accent + #C0C6DA + #414757 - #E0E0E0 + #DEBAE5 - #99000000 - - #00ff00 - #212121 - #000000 - - - #ff000000 - #DE000000 - #99000000 - - #ffffff - #DEFFFFFF - #99FFFFFF - - #666666 - - #F5F5F5 - - #5c5c5c - #e8e8e8 - #ffffff - - @color/accent - - #ffffff - #000000 + #F1F1F1 + #E2E1E5 + #1B1B1D + #FFFFFF + #FDFBFE + #74767D - #000000 - #000000 - #000000 - #63ACFF - #56A5FF - #2E90FF - #000000 - - #000000 - - #292929 - - #99FFFFFF - - #272727 - - #000000 - #ffffff diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1d7613d4..b84398c2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,167 +1,37 @@ Fast - Fast Messenger - - Created chat %s - Invited %s to chat - Kicked %s from chat - %s Returned to chat - %s Left from chat - %s Updated chat photo - %s Removed chat photo - %s Updated chat title - %s Pinned message - %s Unpinned message - %s Invited by link - - Forwarded message - %d Forwarded messages Attachments - Photo - Video - Audio - Document - Link - Sticker - Gift - Graffiti - Voice message - Poll - Call - Wall post - Wall reply - %d Photos - %d Videos - %d Audios - %d Documents - - Login - - Search Chats - Friends - Important - Settings - - Yesterday - Name Surname - Status - Logout - - now - %ds - %dm - %dh - %dd - %dmo - %dy - Application version - Tap to check updates - Application chiefs and helpers - About - Account - Type… - Token - Custom data - User Id - Appearance - Conversations type - Loading… - - Online - Online from mobile - Offline - Last seen at %s - Last seen recently - - %d members - - Channel • %d members - Press & hold to record voice - No connection - Update - Project.VKM - Enter - No access - - Dialog is empty - List is empty - - Downloading… - Checking… - No updates - Current version: %s (%d) - Last update check in %s - Changelog: %s - Check updates - Update is available - New version: %s (%d) - Download - Refresh - - Today - Login settings - In progress - - Yesterday - - Refresh - - Edited - - No conversations - No friends :( - - General - Hide the keyboard while scrolling up - App has been crashed - - Light - Dark - By power saving - By system - Theme - Send report - OK - - @null - Clear conversations cache - Search - An error has occurred - Account - Debug - Clear users and groups cache - Error - Error loading message. Try again? - Retry Error: %s - I can\'t see anything… - Oops… - There is something unexpected… - - Warning - Yes - No - Installing apk\'s is disabled in settings. Open settings screen to enable it? Password - E-mail or phone number + Log in + Captcha code + Input code from picture Login - Conversations Code + Input code from sms + You + Geolocation + Point + Message Messages + No messages + + Messages self-destructed + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 20390357..0bd32543 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -8,21 +8,25 @@ @anim/activity_close_exit - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index ccaa1221..fffc5c4b 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,29 +1,16 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/fragment_settings.xml b/app/src/main/res/xml/fragment_settings.xml deleted file mode 100644 index f4822042..00000000 --- a/app/src/main/res/xml/fragment_settings.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/fragment_settings_about.xml b/app/src/main/res/xml/fragment_settings_about.xml deleted file mode 100644 index 02cdb701..00000000 --- a/app/src/main/res/xml/fragment_settings_about.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/fragment_settings_account.xml b/app/src/main/res/xml/fragment_settings_account.xml deleted file mode 100644 index c4576be2..00000000 --- a/app/src/main/res/xml/fragment_settings_account.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/fragment_settings_appearance.xml b/app/src/main/res/xml/fragment_settings_appearance.xml deleted file mode 100644 index e53cb814..00000000 --- a/app/src/main/res/xml/fragment_settings_appearance.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/fragment_settings_debug.xml b/app/src/main/res/xml/fragment_settings_debug.xml deleted file mode 100644 index 0cd1f045..00000000 --- a/app/src/main/res/xml/fragment_settings_debug.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/xml/fragment_settings_general.xml b/app/src/main/res/xml/fragment_settings_general.xml deleted file mode 100644 index 1bf518f9..00000000 --- a/app/src/main/res/xml/fragment_settings_general.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - \ No newline at end of file