diff --git a/.drone.yml b/.drone.yml index 5fd2aa73e..1b90ffa6c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,7 @@ name: generic steps: - name: generic - image: ghcr.io/nextcloud/continuous-integration-android8:2 + image: ghcr.io/nextcloud/continuous-integration-android8:3 commands: - ./gradlew --console=plain assembleGeneric @@ -23,7 +23,7 @@ name: gplay steps: - name: gplay - image: ghcr.io/nextcloud/continuous-integration-android8:2 + image: ghcr.io/nextcloud/continuous-integration-android8:3 commands: - ./gradlew --console=plain assembleGplay @@ -42,7 +42,7 @@ name: tests steps: - name: all - image: ghcr.io/nextcloud/continuous-integration-android8:2 + image: ghcr.io/nextcloud/continuous-integration-android8:3 privileged: true commands: - emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 & diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 66dccebda..38e86bf34 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -32,11 +32,11 @@ jobs: with: repository: ${{ steps.get-vars.outputs.repo }} ref: ${{ steps.get-vars.outputs.branch }} - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: distribution: "temurin" - java-version: 11 + java-version: 17 - name: Install dependencies run: | python3 -m pip install defusedxml diff --git a/.github/workflows/assembleFlavors.yml b/.github/workflows/assembleFlavors.yml index 30a012487..1cc146743 100644 --- a/.github/workflows/assembleFlavors.yml +++ b/.github/workflows/assembleFlavors.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: distribution: "temurin" - java-version: 11 + java-version: 17 - name: Build ${{ matrix.flavor }} run: | echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" >> gradle.properties diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 7cbaf09b5..2db86b26d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -16,10 +16,10 @@ jobs: task: [ detekt, ktlintCheck ] steps: - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: distribution: "temurin" - java-version: 11 + java-version: 17 - name: Check ${{ matrix.task }} run: ./gradlew ${{ matrix.task }} diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 83ea2c1c2..df2991f05 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -39,7 +39,7 @@ jobs: uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 with: distribution: "temurin" - java-version: 11 + java-version: 17 - name: Assemble run: | mkdir -p "$HOME/.gradle" diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 6ea028214..bfb191c11 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -17,12 +17,12 @@ jobs: id: check-secrets - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0 if: ${{ steps.check-secrets.outputs.ok == 'true' }} - - name: set up JDK 11 + - name: set up JDK 17 uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0 if: ${{ steps.check-secrets.outputs.ok == 'true' }} with: distribution: "temurin" - java-version: 11 + java-version: 17 - name: Build QA if: ${{ steps.check-secrets.outputs.ok == 'true' }} env: diff --git a/app/build.gradle b/app/build.gradle index bad51aa8c..4ce34d3ca 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -122,8 +122,8 @@ android { check.dependsOn 'spotbugsGplayDebug', 'lint', 'ktlintCheck', 'detekt' compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } buildFeatures { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt index b9fa030cb..069464cb0 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/ConversationItem.kt @@ -339,7 +339,7 @@ class ConversationItem( } companion object { - const val VIEW_TYPE = R.layout.rv_item_conversation_with_last_message + const val VIEW_TYPE = FlexibleItemViewType.CONVERSATION_ITEM private const val MILLIES = 1000L private const val STATUS_SIZE_IN_DP = 9f private const val UNREAD_BUBBLE_STROKE_WIDTH = 6.0f diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/FlexibleItemViewType.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/FlexibleItemViewType.kt new file mode 100644 index 000000000..c740df965 --- /dev/null +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/FlexibleItemViewType.kt @@ -0,0 +1,33 @@ +/* + * Nextcloud Talk application + * + * @author Andy Scherzinger + * Copyright (C) 2023 Andy Scherzinger + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.nextcloud.talk.adapters.items + +class FlexibleItemViewType { + companion object { + const val CONVERSATION_ITEM: Int = 1120391230 + const val LOAD_MORE_RESULTS_ITEM: Int = 1120391231 + const val MESSAGE_RESULT_ITEM: Int = 1120391232 + const val MESSAGES_TEXT_HEADER_ITEM: Int = 1120391233 + const val POLL_RESULT_HEADER_ITEM: Int = 1120391234 + const val POLL_RESULT_VOTER_ITEM: Int = 1120391235 + const val POLL_RESULT_VOTERS_OVERVIEW_ITEM: Int = 1120391236 + } +} diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/LoadMoreResultsItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/LoadMoreResultsItem.kt index 5ae33ee15..4a023a20f 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/LoadMoreResultsItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/LoadMoreResultsItem.kt @@ -36,7 +36,7 @@ object LoadMoreResultsItem : IFilterable { // layout is used as view type for uniqueness - const val VIEW_TYPE: Int = R.layout.rv_item_load_more + const val VIEW_TYPE = FlexibleItemViewType.LOAD_MORE_RESULTS_ITEM class ViewHolder(view: View, adapter: FlexibleAdapter<*>) : FlexibleViewHolder(view, adapter) { diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/MessageResultItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/MessageResultItem.kt index fe2424125..c9384ce2a 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/MessageResultItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/MessageResultItem.kt @@ -92,8 +92,7 @@ data class MessageResultItem constructor( } companion object { - // layout is used as view type for uniqueness - const val VIEW_TYPE: Int = R.layout.rv_item_search_message + const val VIEW_TYPE = FlexibleItemViewType.MESSAGE_RESULT_ITEM } override fun getHeader(): GenericTextHeaderItem = MessagesTextHeaderItem(context, viewThemeUtils) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/items/MessagesTextHeaderItem.kt b/app/src/main/java/com/nextcloud/talk/adapters/items/MessagesTextHeaderItem.kt index 3ade534b6..5d6a997ca 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/items/MessagesTextHeaderItem.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/items/MessagesTextHeaderItem.kt @@ -28,10 +28,7 @@ import com.nextcloud.talk.ui.theme.ViewThemeUtils class MessagesTextHeaderItem(context: Context, viewThemeUtils: ViewThemeUtils) : GenericTextHeaderItem(context.getString(R.string.messages), viewThemeUtils) { companion object { - /** - * "Random" value, just has to be different than other view types - */ - const val VIEW_TYPE = 1120391230 + const val VIEW_TYPE = FlexibleItemViewType.MESSAGES_TEXT_HEADER_ITEM } override fun getItemViewType(): Int = VIEW_TYPE diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt index 147ae5a82..0a0a17ddd 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLinkPreviewMessageViewHolder.kt @@ -37,7 +37,6 @@ import com.nextcloud.talk.databinding.ItemCustomIncomingLinkPreviewMessageBindin import com.nextcloud.talk.extensions.loadBotsAvatar import com.nextcloud.talk.extensions.loadChangelogBotAvatar import com.nextcloud.talk.models.json.chat.ChatMessage -import com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DateUtils @@ -98,7 +97,7 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) : M true } - itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.replyable) + itemView.setTag(R.string.replyable_message_view_tag, message.replyable) Reaction().showReactions( message, diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt index 7e9b67356..99d84a9b3 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingTextMessageViewHolder.kt @@ -45,7 +45,6 @@ import com.nextcloud.talk.databinding.ItemCustomIncomingTextMessageBinding import com.nextcloud.talk.extensions.loadBotsAvatar import com.nextcloud.talk.extensions.loadChangelogBotAvatar import com.nextcloud.talk.models.json.chat.ChatMessage -import com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DateUtils @@ -111,7 +110,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) : MessageHolde binding.messageQuote.quotedChatMessageView.visibility = View.GONE } - itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.replyable) + itemView.setTag(R.string.replyable_message_view_tag, message.replyable) Reaction().showReactions( message, diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt index 05664f69f..b6f94b88d 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingLinkPreviewMessageViewHolder.kt @@ -36,7 +36,6 @@ import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedA import com.nextcloud.talk.databinding.ItemCustomOutcomingLinkPreviewMessageBinding import com.nextcloud.talk.models.json.chat.ChatMessage import com.nextcloud.talk.models.json.chat.ReadStatus -import com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DateUtils @@ -121,7 +120,7 @@ class OutcomingLinkPreviewMessageViewHolder(outcomingView: View, payload: Any) : true } - itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.replyable) + itemView.setTag(R.string.replyable_message_view_tag, message.replyable) Reaction().showReactions( message, diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt index 7f5176137..6e4826228 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingTextMessageViewHolder.kt @@ -42,7 +42,6 @@ import com.nextcloud.talk.chat.ChatActivity import com.nextcloud.talk.databinding.ItemCustomOutcomingTextMessageBinding import com.nextcloud.talk.models.json.chat.ChatMessage import com.nextcloud.talk.models.json.chat.ReadStatus -import com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.ApiUtils import com.nextcloud.talk.utils.DateUtils @@ -127,7 +126,7 @@ class OutcomingTextMessageViewHolder(itemView: View) : OutcomingTextMessageViewH binding.checkMark.setContentDescription(readStatusContentDescriptionString) - itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.replyable) + itemView.setTag(R.string.replyable_message_view_tag, message.replyable) Reaction().showReactions( message, diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt index 8fd492f53..86dff93c7 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/PreviewMessageViewHolder.kt @@ -54,7 +54,6 @@ import com.nextcloud.talk.data.user.model.User import com.nextcloud.talk.databinding.ReactionsInsideMessageBinding import com.nextcloud.talk.extensions.loadChangelogBotAvatar import com.nextcloud.talk.models.json.chat.ChatMessage -import com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback import com.nextcloud.talk.ui.theme.ViewThemeUtils import com.nextcloud.talk.utils.DateUtils import com.nextcloud.talk.utils.DisplayUtils @@ -159,7 +158,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) : } messageText.text = "" } - itemView.setTag(MessageSwipeCallback.REPLYABLE_VIEW_TAG, message.replyable) + itemView.setTag(R.string.replyable_message_view_tag, message.replyable) Reaction().showReactions( message, ::clickOnReaction, diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/SystemMessageViewHolder.java b/app/src/main/java/com/nextcloud/talk/adapters/messages/SystemMessageViewHolder.java index 571f621af..1dc095e09 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/SystemMessageViewHolder.java +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/SystemMessageViewHolder.java @@ -43,8 +43,6 @@ import javax.inject.Inject; import androidx.core.view.ViewCompat; import autodagger.AutoInjector; -import static com.nextcloud.talk.ui.recyclerview.MessageSwipeCallback.REPLYABLE_VIEW_TAG; - @AutoInjector(NextcloudTalkApplication.class) public class SystemMessageViewHolder extends MessageHolders.IncomingTextMessageViewHolder { @@ -109,6 +107,6 @@ public class SystemMessageViewHolder extends MessageHolders.IncomingTextMessageV time.setText(dateUtils.getLocalTimeStringFromTimestamp(message.getTimestamp())); } - itemView.setTag(REPLYABLE_VIEW_TAG, message.getReplyable()); + itemView.setTag(R.string.replyable_message_view_tag, message.getReplyable()); } } diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderItem.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderItem.kt index b8f14bc90..436e14b0a 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderItem.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultHeaderItem.kt @@ -20,7 +20,7 @@ package com.nextcloud.talk.polls.adapters -import com.nextcloud.talk.R +import com.nextcloud.talk.adapters.items.FlexibleItemViewType data class PollResultHeaderItem( val name: String, @@ -33,7 +33,6 @@ data class PollResultHeaderItem( } companion object { - // layout is used as view type for uniqueness - const val VIEW_TYPE: Int = R.layout.poll_result_header_item + const val VIEW_TYPE = FlexibleItemViewType.POLL_RESULT_HEADER_ITEM } } diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterItem.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterItem.kt index 3512b4c88..99d70102b 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterItem.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVoterItem.kt @@ -20,7 +20,7 @@ package com.nextcloud.talk.polls.adapters -import com.nextcloud.talk.R +import com.nextcloud.talk.adapters.items.FlexibleItemViewType import com.nextcloud.talk.polls.model.PollDetails data class PollResultVoterItem( @@ -32,7 +32,6 @@ data class PollResultVoterItem( } companion object { - // layout is used as view type for uniqueness - const val VIEW_TYPE: Int = R.layout.poll_result_voter_item + const val VIEW_TYPE = FlexibleItemViewType.POLL_RESULT_VOTER_ITEM } } diff --git a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewItem.kt b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewItem.kt index ffb3065f3..f65ed1256 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewItem.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/adapters/PollResultVotersOverviewItem.kt @@ -20,7 +20,7 @@ package com.nextcloud.talk.polls.adapters -import com.nextcloud.talk.R +import com.nextcloud.talk.adapters.items.FlexibleItemViewType import com.nextcloud.talk.polls.model.PollDetails data class PollResultVotersOverviewItem( @@ -33,6 +33,6 @@ data class PollResultVotersOverviewItem( companion object { // layout is used as view type for uniqueness - const val VIEW_TYPE: Int = R.layout.poll_result_voters_overview_item + const val VIEW_TYPE = FlexibleItemViewType.POLL_RESULT_VOTERS_OVERVIEW_ITEM } } diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/SortingOrderDialogFragment.java b/app/src/main/java/com/nextcloud/talk/ui/dialog/SortingOrderDialogFragment.java index ac75659df..30b03ebde 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/SortingOrderDialogFragment.java +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/SortingOrderDialogFragment.java @@ -39,6 +39,9 @@ import com.nextcloud.talk.ui.theme.ViewThemeUtils; import com.nextcloud.talk.utils.FileSortOrder; import com.nextcloud.talk.utils.preferences.AppPreferences; +import java.util.ArrayList; +import java.util.List; + import javax.inject.Inject; import androidx.annotation.NonNull; @@ -65,7 +68,7 @@ public class SortingOrderDialogFragment extends DialogFragment implements View.O private SortingOrderFragmentBinding binding; private View dialogView; - private View[] taggedViews; + private List taggedViews; private String currentSortOrderName; public static SortingOrderDialogFragment newInstance(@NonNull FileSortOrder sortOrder) { @@ -121,31 +124,32 @@ public class SortingOrderDialogFragment extends DialogFragment implements View.O viewThemeUtils.platform.themeDialog(binding.root); viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(binding.cancel); - taggedViews = new View[12]; - taggedViews[0] = binding.sortByNameAscending; - taggedViews[0].setTag(FileSortOrder.Companion.getSort_a_to_z()); - taggedViews[1] = binding.sortByNameAZText; - taggedViews[1].setTag(FileSortOrder.Companion.getSort_a_to_z()); - taggedViews[2] = binding.sortByNameDescending; - taggedViews[2].setTag(FileSortOrder.Companion.getSort_z_to_a()); - taggedViews[3] = binding.sortByNameZAText; - taggedViews[3].setTag(FileSortOrder.Companion.getSort_z_to_a()); - taggedViews[4] = binding.sortByModificationDateAscending; - taggedViews[4].setTag(FileSortOrder.Companion.getSort_old_to_new()); - taggedViews[5] = binding.sortByModificationDateOldestFirstText; - taggedViews[5].setTag(FileSortOrder.Companion.getSort_old_to_new()); - taggedViews[6] = binding.sortByModificationDateDescending; - taggedViews[6].setTag(FileSortOrder.Companion.getSort_new_to_old()); - taggedViews[7] = binding.sortByModificationDateNewestFirstText; - taggedViews[7].setTag(FileSortOrder.Companion.getSort_new_to_old()); - taggedViews[8] = binding.sortBySizeAscending; - taggedViews[8].setTag(FileSortOrder.Companion.getSort_small_to_big()); - taggedViews[9] = binding.sortBySizeSmallestFirstText; - taggedViews[9].setTag(FileSortOrder.Companion.getSort_small_to_big()); - taggedViews[10] = binding.sortBySizeDescending; - taggedViews[10].setTag(FileSortOrder.Companion.getSort_big_to_small()); - taggedViews[11] = binding.sortBySizeBiggestFirstText; - taggedViews[11].setTag(FileSortOrder.Companion.getSort_big_to_small()); + taggedViews = new ArrayList<>(12); + + binding.sortByNameAscending.setTag(FileSortOrder.Companion.getSort_a_to_z()); + taggedViews.add(binding.sortByNameAscending); + binding.sortByNameAZText.setTag(FileSortOrder.Companion.getSort_a_to_z()); + taggedViews.add(binding.sortByNameAZText); + binding.sortByNameDescending.setTag(FileSortOrder.Companion.getSort_z_to_a()); + taggedViews.add(binding.sortByNameDescending); + binding.sortByNameZAText.setTag(FileSortOrder.Companion.getSort_z_to_a()); + taggedViews.add(binding.sortByNameZAText); + binding.sortByModificationDateAscending.setTag(FileSortOrder.Companion.getSort_old_to_new()); + taggedViews.add(binding.sortByModificationDateAscending); + binding.sortByModificationDateOldestFirstText.setTag(FileSortOrder.Companion.getSort_old_to_new()); + taggedViews.add(binding.sortByModificationDateOldestFirstText); + binding.sortByModificationDateDescending.setTag(FileSortOrder.Companion.getSort_new_to_old()); + taggedViews.add(binding.sortByModificationDateDescending); + binding.sortByModificationDateNewestFirstText.setTag(FileSortOrder.Companion.getSort_new_to_old()); + taggedViews.add(binding.sortByModificationDateNewestFirstText); + binding.sortBySizeAscending.setTag(FileSortOrder.Companion.getSort_small_to_big()); + taggedViews.add(binding.sortBySizeAscending); + binding.sortBySizeSmallestFirstText.setTag(FileSortOrder.Companion.getSort_small_to_big()); + taggedViews.add(binding.sortBySizeSmallestFirstText); + binding.sortBySizeDescending.setTag(FileSortOrder.Companion.getSort_big_to_small()); + taggedViews.add(binding.sortBySizeDescending); + binding.sortBySizeBiggestFirstText.setTag(FileSortOrder.Companion.getSort_big_to_small()); + taggedViews.add(binding.sortBySizeBiggestFirstText); setupActiveOrderSelection(); } diff --git a/app/src/main/java/com/nextcloud/talk/ui/recyclerview/MessageSwipeCallback.kt b/app/src/main/java/com/nextcloud/talk/ui/recyclerview/MessageSwipeCallback.kt index 0c31db97d..da17eebdd 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/recyclerview/MessageSwipeCallback.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/recyclerview/MessageSwipeCallback.kt @@ -74,8 +74,8 @@ class MessageSwipeCallback(private val context: Context, private val messageSwip override fun getMovementFlags(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder): Int { view = viewHolder.itemView - if (viewHolder.itemView.getTag(REPLYABLE_VIEW_TAG) != null && - viewHolder.itemView.getTag(REPLYABLE_VIEW_TAG) as Boolean + if (viewHolder.itemView.getTag(R.string.replyable_message_view_tag) != null && + viewHolder.itemView.getTag(R.string.replyable_message_view_tag) as Boolean ) { imageDrawable = AppCompatResources.getDrawable(context, R.drawable.ic_reply)!! shareRound = AppCompatResources.getDrawable(context, R.drawable.round_bgnd)!! @@ -291,6 +291,5 @@ class MessageSwipeCallback(private val context: Context, private val messageSwip const val ICON_BOUNDS_PIXEL_TOP: Int = 13 const val ICON_BOUNDS_PIXEL_RIGHT: Int = 12 const val ICON_BOUNDS_PIXEL_BOTTOM: Int = 11 - const val REPLYABLE_VIEW_TAG: Int = R.string.replyable_message_view_tag } } diff --git a/build.gradle b/build.gradle index a294409ea..aac9bac34 100644 --- a/build.gradle +++ b/build.gradle @@ -34,7 +34,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' + classpath 'com.android.tools.build:gradle:8.0.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}" classpath "org.jetbrains.kotlin:kotlin-serialization:${kotlinVersion}" classpath 'com.github.spotbugs.snom:spotbugs-gradle-plugin:5.0.14' diff --git a/gradle.properties b/gradle.properties index bed2185e4..8c1fae948 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,6 +35,9 @@ org.gradle.jvmargs=-XX:MaxHeapSize\=2048m -Xmx2048m android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false # org.gradle.parallel=true org.gradle.daemon=true @@ -44,4 +47,4 @@ org.gradle.parallel=true NC_TEST_SERVER_BASEURL=http://server NC_TEST_SERVER_USERNAME=user1 -NC_TEST_SERVER_PASSWORD=user1 \ No newline at end of file +NC_TEST_SERVER_PASSWORD=user1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0e9a61051..128177bf1 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip