diff --git a/app/src/main/java/com/nextcloud/talk/activities/FullScreenTextViewerActivity.kt b/app/src/main/java/com/nextcloud/talk/activities/FullScreenTextViewerActivity.kt index e0dd0d35d..e8e7375f8 100644 --- a/app/src/main/java/com/nextcloud/talk/activities/FullScreenTextViewerActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/activities/FullScreenTextViewerActivity.kt @@ -104,7 +104,7 @@ class FullScreenTextViewerActivity : AppCompatActivity() { supportActionBar?.title = fileName supportActionBar?.setDisplayHomeAsUpEnabled(true) - viewThemeUtils.platform.themeStatusBar(this, binding.textviewToolbar) + viewThemeUtils.platform.themeStatusBar(this) viewThemeUtils.material.themeToolbar(binding.textviewToolbar) viewThemeUtils.material.colorToolbarOverflowIcon(binding.textviewToolbar) 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 9e952d634..26b5d22b5 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 @@ -148,7 +148,7 @@ class ConversationItem( model.status, model.statusIcon, size, - context.resources.getColor(R.color.bg_default), + context.resources.getColor(R.color.bg_default, null), appContext ) ) 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 0a0a17ddd..264515c8b 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 @@ -180,7 +180,7 @@ class IncomingLinkPreviewMessageViewHolder(incomingView: View, payload: Any) : M .setTextColor(ContextCompat.getColor(context, R.color.textColorMaxContrast)) if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) { - viewThemeUtils.platform.colorPrimaryView(binding.messageQuote.quoteColoredView) + viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView) } else { binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast) } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt index 214ad12f4..1355efb66 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingLocationMessageViewHolder.kt @@ -178,10 +178,10 @@ class IncomingLocationMessageViewHolder(incomingView: View, payload: Any) : Mess binding.messageQuote.quotedMessage.text = parentChatMessage.text binding.messageQuote.quotedMessageAuthor - .setTextColor(context!!.resources.getColor(R.color.textColorMaxContrast)) + .setTextColor(context!!.resources.getColor(R.color.textColorMaxContrast, null)) if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) { - viewThemeUtils.platform.colorPrimaryView(binding.messageQuote.quoteColoredView) + viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView) } else { binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast) } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt index 4960daf89..061926fd6 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingPollMessageViewHolder.kt @@ -205,7 +205,7 @@ class IncomingPollMessageViewHolder(incomingView: View, payload: Any) : MessageH .setTextColor(ContextCompat.getColor(context, R.color.textColorMaxContrast)) if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) { - viewThemeUtils.platform.colorPrimaryView(binding.messageQuote.quoteColoredView) + viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView) } else { binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast) } 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 5c8c73dbe..7d685410e 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 @@ -192,7 +192,7 @@ class IncomingTextMessageViewHolder(itemView: View, payload: Any) : MessageHolde binding.messageQuote.quotedMessage.text = parentChatMessage.text if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) { - viewThemeUtils.platform.colorPrimaryView(binding.messageQuote.quoteColoredView) + viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView) } else { binding.messageQuote.quoteColoredView.setBackgroundColor( ContextCompat.getColor(binding.messageQuote.quoteColoredView.context, R.color.high_emphasis_text) diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt index 439d88964..346a3ef65 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/IncomingVoiceMessageViewHolder.kt @@ -39,6 +39,7 @@ import androidx.work.WorkManager import autodagger.AutoInjector import coil.load import com.amulyakhare.textdrawable.TextDrawable +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication @@ -99,7 +100,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message updateDownloadState(message) binding.seekbar.max = message.voiceMessageDuration viewThemeUtils.platform.themeHorizontalSeekBar(binding.seekbar) - viewThemeUtils.platform.colorCircularProgressBarOnSurfaceVariant(binding.progressBar) + viewThemeUtils.platform.colorCircularProgressBar(binding.progressBar, ColorRole.ON_SURFACE_VARIANT) if (message.isPlayingVoiceMessage) { showPlayButton() @@ -291,7 +292,7 @@ class IncomingVoiceMessageViewHolder(incomingView: View, payload: Any) : Message .setTextColor(ContextCompat.getColor(context!!, R.color.textColorMaxContrast)) if (parentChatMessage.actorId?.equals(message.activeUser!!.userId) == true) { - viewThemeUtils.platform.colorPrimaryView(binding.messageQuote.quoteColoredView) + viewThemeUtils.platform.colorViewBackground(binding.messageQuote.quoteColoredView) } else { binding.messageQuote.quoteColoredView.setBackgroundResource(R.color.textColorMaxContrast) } diff --git a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt index 086d8a896..f8b79fb63 100644 --- a/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt +++ b/app/src/main/java/com/nextcloud/talk/adapters/messages/OutcomingVoiceMessageViewHolder.kt @@ -35,6 +35,7 @@ import androidx.work.WorkInfo import androidx.work.WorkManager import autodagger.AutoInjector import coil.load +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication @@ -96,7 +97,7 @@ class OutcomingVoiceMessageViewHolder(outcomingView: View) : MessageHolders updateDownloadState(message) binding.seekbar.max = message.voiceMessageDuration viewThemeUtils.platform.themeHorizontalSeekBar(binding.seekbar) - viewThemeUtils.platform.colorCircularProgressBarOnSurfaceVariant(binding.progressBar) + viewThemeUtils.platform.colorCircularProgressBar(binding.progressBar, ColorRole.ON_SURFACE_VARIANT) handleIsPlayingVoiceMessageState(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 86dff93c7..47f71972c 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 @@ -45,6 +45,7 @@ import androidx.core.content.ContextCompat import androidx.emoji2.widget.EmojiTextView import autodagger.AutoInjector import com.google.android.material.card.MaterialCardView +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication @@ -109,7 +110,7 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) : time.text = dateUtils.getLocalTimeStringFromTimestamp(message.timestamp) - viewThemeUtils!!.platform.colorCircularProgressBar(progressBar!!) + viewThemeUtils!!.platform.colorCircularProgressBar(progressBar!!, ColorRole.PRIMARY) clickView = image messageText.visibility = View.VISIBLE if (message.getCalculateMessageType() === ChatMessage.MessageType.SINGLE_NC_ATTACHMENT_MESSAGE) { @@ -211,7 +212,10 @@ abstract class PreviewMessageViewHolder(itemView: View?, payload: Any?) : clickView = previewContactContainer viewThemeUtils!!.talk.colorContactChatItemBackground(previewContactContainer) viewThemeUtils!!.talk.colorContactChatItemName(previewContactName) - viewThemeUtils!!.platform.colorCircularProgressBarOnPrimaryContainer(previewContactProgressBar!!) + viewThemeUtils!!.platform.colorCircularProgressBar( + previewContactProgressBar!!, + ColorRole.ON_PRIMARY_CONTAINER + ) if (message.selectedIndividualHashMap!!.containsKey(KEY_CONTACT_PHOTO)) { image = previewContactPhoto diff --git a/app/src/main/java/com/nextcloud/talk/call/ReactionAnimator.kt b/app/src/main/java/com/nextcloud/talk/call/ReactionAnimator.kt index 80b2a2e90..3c9c263e0 100644 --- a/app/src/main/java/com/nextcloud/talk/call/ReactionAnimator.kt +++ b/app/src/main/java/com/nextcloud/talk/call/ReactionAnimator.kt @@ -145,7 +145,7 @@ class ReactionAnimator( nameView.layoutParams = nameViewParams nameView.text = " " + callReaction.userName + " " - nameView.setTextColor(context.resources.getColor(R.color.white)) + nameView.setTextColor(context.resources.getColor(R.color.white, null)) val backgroundColor = ContextCompat.getColor( context, diff --git a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt index ab60e6b73..633e86794 100644 --- a/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt @@ -98,6 +98,7 @@ import coil.target.Target import coil.transform.CircleCropTransformation import com.google.android.flexbox.FlexboxLayout import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.BuildConfig import com.nextcloud.talk.R import com.nextcloud.talk.activities.BaseActivity @@ -598,7 +599,7 @@ class ChatActivity : binding?.messageInputView?.button?.contentDescription = resources?.getString(R.string.nc_description_send_message_button) - binding?.messageInputView?.button?.let { viewThemeUtils.platform.colorImageView(it) } + binding?.messageInputView?.button?.let { viewThemeUtils.platform.colorImageView(it, ColorRole.PRIMARY) } if (currentConversation != null && currentConversation?.roomId != null) { loadAvatarForStatusBar() @@ -615,7 +616,7 @@ class ChatActivity : } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent, null))) setActionBarTitle() viewThemeUtils.material.themeToolbar(binding.chatToolbar) } @@ -2087,7 +2088,7 @@ class ChatActivity : private fun setupMentionAutocomplete() { val elevation = MENTION_AUTO_COMPLETE_ELEVATION resources?.let { - val backgroundDrawable = ColorDrawable(it.getColor(R.color.bg_default)) + val backgroundDrawable = ColorDrawable(it.getColor(R.color.bg_default, null)) val presenter = MentionAutocompletePresenter(this, roomToken) val callback = MentionAutocompleteCallback( this, diff --git a/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt index 06ead7226..b26ba20df 100644 --- a/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/contacts/ContactsActivity.kt @@ -192,7 +192,7 @@ class ContactsActivity : } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent, null))) supportActionBar?.title = when { isAddingParticipantsView -> { resources!!.getString(R.string.nc_add_participants) @@ -669,7 +669,9 @@ class ContactsActivity : PorterDuff.Mode.SRC_IN ) - binding?.conversationPrivacyToggle?.let { viewThemeUtils.platform.colorImageViewButton(it.publicCallLink) } + binding?.conversationPrivacyToggle?.let { + viewThemeUtils.platform.colorImageViewBackgroundAndIcon(it.publicCallLink) + } disengageProgressBar() } diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.kt b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.kt index 6ad338fdb..78c71b40d 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/EntryMenuController.kt @@ -38,6 +38,7 @@ import autodagger.AutoInjector import com.bluelinelabs.conductor.RouterTransaction import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler import com.google.android.material.textfield.TextInputLayout +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication @@ -125,7 +126,7 @@ class EntryMenuController(args: Bundle) : rootView = view, editText = it.textEdit, onEmojiPopupShownListener = { - viewThemeUtils.platform.colorImageView(it.smileyButton) + viewThemeUtils.platform.colorImageView(it.smileyButton, ColorRole.PRIMARY) }, onEmojiPopupDismissListener = { it.smileyButton.imageTintList = ColorStateList.valueOf( diff --git a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.kt b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.kt index 197c3eab7..0c98fcc43 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.kt +++ b/app/src/main/java/com/nextcloud/talk/controllers/bottomsheet/OperationsMenuController.kt @@ -30,6 +30,7 @@ import android.view.View import autodagger.AutoInjector import com.bluelinelabs.conductor.RouterTransaction import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.api.NcApi import com.nextcloud.talk.application.NextcloudTalkApplication @@ -117,7 +118,7 @@ class OperationsMenuController(args: Bundle) : BaseController( sharedApplication!!.componentApplication.inject(this) currentUser = userManager.currentUser.blockingGet() - binding?.progressBar?.let { viewThemeUtils.platform.colorCircularProgressBar(it) } + binding?.progressBar?.let { viewThemeUtils.platform.colorCircularProgressBar(it, ColorRole.PRIMARY) } if (!TextUtils.isEmpty(callUrl) && callUrl.contains("/call")) { conversationToken = callUrl.substring(callUrl.lastIndexOf("/") + 1) @@ -517,7 +518,7 @@ class OperationsMenuController(args: Bundle) : BaseController( if (everythingOK) { binding?.resultTextView?.setText(R.string.nc_all_ok_operation) } else { - binding?.resultTextView?.setTextColor(resources!!.getColor(R.color.nc_darkRed)) + binding?.resultTextView?.setTextColor(resources!!.getColor(R.color.nc_darkRed, null)) if (!isGuestSupportError) { binding?.resultTextView?.setText(R.string.nc_failed_to_perform_operation) } else { diff --git a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt index 4b5502ffc..0727c909d 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationinfo/ConversationInfoActivity.kt @@ -50,6 +50,7 @@ import com.afollestad.materialdialogs.MaterialDialog import com.afollestad.materialdialogs.bottomsheets.BottomSheet import com.afollestad.materialdialogs.datetime.dateTimePicker import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.activities.BaseActivity import com.nextcloud.talk.activities.MainActivity @@ -186,7 +187,7 @@ class ConversationInfoActivity : binding.addParticipantsAction.visibility = GONE - binding.progressBar.let { viewThemeUtils.platform.colorCircularProgressBar(it) } + binding.progressBar.let { viewThemeUtils.platform.colorCircularProgressBar(it, ColorRole.PRIMARY) } } private fun setupActionBar() { @@ -196,7 +197,7 @@ class ConversationInfoActivity : } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent, null))) supportActionBar?.title = if (hasAvatarSpacing) { " " + resources!!.getString(R.string.nc_conversation_menu_conversation_info) } else { diff --git a/app/src/main/java/com/nextcloud/talk/conversationinfoedit/ConversationInfoEditActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationinfoedit/ConversationInfoEditActivity.kt index fd72a5736..ca836c839 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationinfoedit/ConversationInfoEditActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationinfoedit/ConversationInfoEditActivity.kt @@ -153,7 +153,7 @@ class ConversationInfoEditActivity : } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent, null))) supportActionBar?.title = resources!!.getString(R.string.nc_conversation_menu_conversation_info) viewThemeUtils.material.themeToolbar(binding.conversationInfoEditToolbar) diff --git a/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt b/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt index 41f8e714f..ab137f1e1 100644 --- a/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt @@ -248,7 +248,7 @@ class ConversationsListActivity : } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent, null))) supportActionBar?.title = resources!!.getString(R.string.nc_app_product_name) viewThemeUtils.material.themeToolbar(binding.conversationListToolbar) } @@ -386,7 +386,7 @@ class ConversationsListActivity : } binding.searchText.setOnClickListener { showSearchView(searchView, searchItem) - viewThemeUtils.platform.themeStatusBar(this, searchView!!) + viewThemeUtils.platform.themeStatusBar(this) } searchView!!.setOnCloseListener { if (TextUtils.isEmpty(searchView!!.query.toString())) { diff --git a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt index 36b45d371..de8f6eb68 100644 --- a/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt +++ b/app/src/main/java/com/nextcloud/talk/jobs/NotificationWorker.kt @@ -441,7 +441,7 @@ class NotificationWorker(context: Context, workerParams: WorkerParameters) : Wor .setShowWhen(true) .setContentIntent(pendingIntent) .setAutoCancel(autoCancelOnClick) - .setColor(context!!.resources.getColor(R.color.colorPrimary)) + .setColor(context!!.resources.getColor(R.color.colorPrimary, null)) val notificationInfoBundle = Bundle() notificationInfoBundle.putLong(KEY_INTERNAL_USER_ID, signatureVerification.user!!.id!!) diff --git a/app/src/main/java/com/nextcloud/talk/location/GeocodingActivity.kt b/app/src/main/java/com/nextcloud/talk/location/GeocodingActivity.kt index 2611620f1..0f43ecad0 100644 --- a/app/src/main/java/com/nextcloud/talk/location/GeocodingActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/location/GeocodingActivity.kt @@ -127,7 +127,7 @@ class GeocodingActivity : } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent, null))) supportActionBar?.title = "" viewThemeUtils.material.themeToolbar(binding.geocodingToolbar) } diff --git a/app/src/main/java/com/nextcloud/talk/location/LocationPickerActivity.kt b/app/src/main/java/com/nextcloud/talk/location/LocationPickerActivity.kt index 55368b3b0..48d4ced50 100644 --- a/app/src/main/java/com/nextcloud/talk/location/LocationPickerActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/location/LocationPickerActivity.kt @@ -179,7 +179,7 @@ class LocationPickerActivity : } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent, null))) supportActionBar?.title = context.getString(R.string.nc_share_location) viewThemeUtils.material.themeToolbar(binding.locationPickerToolbar) } diff --git a/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt b/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt index e318f8f14..ed7c1ce4c 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/ui/PollCreateDialogFragment.kt @@ -101,9 +101,9 @@ class PollCreateDialogFragment : DialogFragment(), PollCreateOptionsItemListener } private fun themeDialog() { - viewThemeUtils.platform.colorPrimaryTextViewElement(binding.pollQuestion) - viewThemeUtils.platform.colorPrimaryTextViewElement(binding.pollOptions) - viewThemeUtils.platform.colorPrimaryTextViewElement(binding.pollSettings) + viewThemeUtils.platform.colorTextView(binding.pollQuestion) + viewThemeUtils.platform.colorTextView(binding.pollOptions) + viewThemeUtils.platform.colorTextView(binding.pollSettings) viewThemeUtils.material.colorTextInputLayout(binding.pollCreateQuestionTextInputLayout) diff --git a/app/src/main/java/com/nextcloud/talk/polls/ui/PollLoadingFragment.kt b/app/src/main/java/com/nextcloud/talk/polls/ui/PollLoadingFragment.kt index 9dd1e026b..80b8a62c6 100644 --- a/app/src/main/java/com/nextcloud/talk/polls/ui/PollLoadingFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/polls/ui/PollLoadingFragment.kt @@ -27,6 +27,7 @@ import android.view.ViewGroup import androidx.core.os.bundleOf import androidx.fragment.app.Fragment import autodagger.AutoInjector +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.databinding.DialogPollLoadingBinding import com.nextcloud.talk.ui.theme.ViewThemeUtils @@ -55,7 +56,7 @@ class PollLoadingFragment : Fragment() { ): View { binding = DialogPollLoadingBinding.inflate(inflater, container, false) binding.root.layoutParams.height = fragmentHeight - viewThemeUtils.platform.colorCircularProgressBar(binding.pollLoadingProgressbar) + viewThemeUtils.platform.colorCircularProgressBar(binding.pollLoadingProgressbar, ColorRole.PRIMARY) return binding.root } diff --git a/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt b/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt index 1f2586e81..893ffe63a 100644 --- a/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/profile/ProfileActivity.kt @@ -47,6 +47,7 @@ import androidx.recyclerview.widget.RecyclerView import autodagger.AutoInjector import com.github.dhaval2404.imagepicker.ImagePicker import com.github.dhaval2404.imagepicker.ImagePicker.Companion.getError +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.activities.BaseActivity import com.nextcloud.talk.api.NcApi @@ -188,7 +189,7 @@ class ProfileActivity : BaseActivity() { } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent, null))) supportActionBar?.title = context.getString(R.string.nc_profile_personal_info_title) viewThemeUtils.material.themeToolbar(binding.profileToolbar) } @@ -651,7 +652,7 @@ class ProfileActivity : BaseActivity() { initUserInfoEditText(holder, item) holder.binding.icon.contentDescription = item.hint - viewThemeUtils.platform.colorImageView(holder.binding.icon) + viewThemeUtils.platform.colorImageView(holder.binding.icon, ColorRole.PRIMARY) if (!TextUtils.isEmpty(item.text) || controller.edit) { holder.binding.userInfoDetailContainer.visibility = View.VISIBLE controller.viewThemeUtils.material.colorTextInputLayout(holder.binding.userInfoInputLayout) diff --git a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt index 9f03e3f00..688845917 100644 --- a/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/remotefilebrowser/activities/RemoteFileBrowserActivity.kt @@ -88,7 +88,7 @@ class RemoteFileBrowserActivity : AppCompatActivity(), SelectionInterface, Swipe binding.pathNavigationBackButton.iconTint = ColorStateList.valueOf(scheme.onSurface) binding.pathNavigationBackButton.setTextColor(scheme.onSurface) viewThemeUtils.material.colorMaterialTextButton(binding.pathNavigationBackButton) - viewThemeUtils.platform.themeStatusBar(this, binding.remoteFileBrowserItemsToolbar) + viewThemeUtils.platform.themeStatusBar(this) setContentView(binding.root) DisplayUtils.applyColorToNavigationBar( diff --git a/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt b/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt index 55a0f9385..c27e19d6c 100644 --- a/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/settings/SettingsActivity.kt @@ -61,6 +61,7 @@ import androidx.work.WorkManager import autodagger.AutoInjector import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.textfield.TextInputLayout +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.BuildConfig import com.nextcloud.talk.R import com.nextcloud.talk.activities.BaseActivity @@ -249,7 +250,7 @@ class SettingsActivity : BaseActivity() { } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(android.R.color.transparent, null))) supportActionBar?.title = context.getString(R.string.nc_settings) viewThemeUtils.material.themeToolbar(binding.settingsToolbar) } @@ -532,9 +533,7 @@ class SettingsActivity : BaseActivity() { when (ApplicationWideMessageHolder.getInstance().messageType) { ApplicationWideMessageHolder.MessageType.ACCOUNT_UPDATED_NOT_ADDED -> { binding.messageText.let { - it.setTextColor( - viewThemeUtils.getScheme(it.context).primary - ) + viewThemeUtils.platform.colorTextView(it, ColorRole.PRIMARY) it.text = resources!!.getString(R.string.nc_settings_account_updated) binding.messageView.visibility = View.VISIBLE } @@ -542,12 +541,10 @@ class SettingsActivity : BaseActivity() { ApplicationWideMessageHolder.MessageType.SERVER_WITHOUT_TALK -> { binding.messageText.let { - it.setTextColor(resources!!.getColor(R.color.nc_darkRed)) + it.setTextColor(resources!!.getColor(R.color.nc_darkRed, null)) it.text = resources!!.getString(R.string.nc_settings_wrong_account) binding.messageView.visibility = View.VISIBLE - it.setTextColor( - viewThemeUtils.getScheme(it.context).primary - ) + viewThemeUtils.platform.colorTextView(it, ColorRole.PRIMARY) it.text = resources!!.getString(R.string.nc_Server_account_imported) binding.messageView.visibility = View.VISIBLE } @@ -555,9 +552,7 @@ class SettingsActivity : BaseActivity() { ApplicationWideMessageHolder.MessageType.ACCOUNT_WAS_IMPORTED -> { binding.messageText.let { - it.setTextColor( - viewThemeUtils.getScheme(it.context).primary - ) + viewThemeUtils.platform.colorTextView(it, ColorRole.PRIMARY) it.text = resources!!.getString(R.string.nc_Server_account_imported) binding.messageView.visibility = View.VISIBLE } @@ -565,7 +560,7 @@ class SettingsActivity : BaseActivity() { ApplicationWideMessageHolder.MessageType.FAILED_TO_IMPORT_ACCOUNT -> { binding.messageText.let { - it.setTextColor(resources!!.getColor(R.color.nc_darkRed)) + it.setTextColor(resources!!.getColor(R.color.nc_darkRed, null)) it.text = resources!!.getString(R.string.nc_server_failed_to_import_account) binding.messageView.visibility = View.VISIBLE } @@ -915,7 +910,9 @@ class SettingsActivity : BaseActivity() { phoneNumberLayoutWrapper.setPadding(PHONE_NUMBER_SIDE_PADDING, 0, PHONE_NUMBER_SIDE_PADDING, 0) val phoneNumberInputLayout = TextInputLayout(context) val phoneNumberField = EditText(context) - phoneNumberInputLayout.setHelperTextColor(ColorStateList.valueOf(resources!!.getColor(R.color.nc_darkRed))) + phoneNumberInputLayout.setHelperTextColor( + ColorStateList.valueOf(resources!!.getColor(R.color.nc_darkRed, null)) + ) phoneNumberField.inputType = InputType.TYPE_CLASS_PHONE phoneNumberField.setText("+") phoneNumberField.addTextChangedListener(object : TextWatcher { diff --git a/app/src/main/java/com/nextcloud/talk/shareditems/activities/SharedItemsActivity.kt b/app/src/main/java/com/nextcloud/talk/shareditems/activities/SharedItemsActivity.kt index b149d660c..ee5b34583 100644 --- a/app/src/main/java/com/nextcloud/talk/shareditems/activities/SharedItemsActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/shareditems/activities/SharedItemsActivity.kt @@ -75,7 +75,7 @@ class SharedItemsActivity : AppCompatActivity() { setSupportActionBar(binding.sharedItemsToolbar) setContentView(binding.root) - viewThemeUtils.platform.themeStatusBar(this, binding.sharedItemsToolbar) + viewThemeUtils.platform.themeStatusBar(this) viewThemeUtils.material.themeToolbar(binding.sharedItemsToolbar) viewThemeUtils.material.themeTabLayoutOnSurface(binding.sharedItemsTabs) diff --git a/app/src/main/java/com/nextcloud/talk/translate/ui/TranslateActivity.kt b/app/src/main/java/com/nextcloud/talk/translate/ui/TranslateActivity.kt index a73671824..7a5aef723 100644 --- a/app/src/main/java/com/nextcloud/talk/translate/ui/TranslateActivity.kt +++ b/app/src/main/java/com/nextcloud/talk/translate/ui/TranslateActivity.kt @@ -131,7 +131,7 @@ class TranslateActivity : BaseActivity() { } supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayShowHomeEnabled(true) - supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent))) + supportActionBar?.setIcon(ColorDrawable(resources!!.getColor(R.color.transparent, null))) supportActionBar?.title = resources!!.getString(R.string.translation) viewThemeUtils.material.themeToolbar(binding.translationToolbar) } diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/AudioOutputDialog.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/AudioOutputDialog.kt index 8833fd2a6..c0bdbe923 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/AudioOutputDialog.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/AudioOutputDialog.kt @@ -27,6 +27,7 @@ import android.view.ViewGroup import autodagger.AutoInjector import com.google.android.material.bottomsheet.BottomSheetBehavior import com.google.android.material.bottomsheet.BottomSheetDialog +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.activities.CallActivity import com.nextcloud.talk.application.NextcloudTalkApplication @@ -92,26 +93,35 @@ class AudioOutputDialog(val callActivity: CallActivity) : BottomSheetDialog(call private fun highlightActiveOutputChannel() { when (callActivity.audioManager?.currentAudioDevice) { WebRtcAudioManager.AudioDevice.BLUETOOTH -> { - viewThemeUtils.platform.colorImageView(dialogAudioOutputBinding.audioOutputBluetoothIcon) + viewThemeUtils.platform.colorImageView( + dialogAudioOutputBinding.audioOutputBluetoothIcon, + ColorRole.PRIMARY + ) viewThemeUtils.platform .colorPrimaryTextViewElementDarkMode(dialogAudioOutputBinding.audioOutputBluetoothText) } WebRtcAudioManager.AudioDevice.SPEAKER_PHONE -> { - viewThemeUtils.platform.colorImageView(dialogAudioOutputBinding.audioOutputSpeakerIcon) + viewThemeUtils.platform.colorImageView( + dialogAudioOutputBinding.audioOutputSpeakerIcon, + ColorRole.PRIMARY + ) viewThemeUtils.platform .colorPrimaryTextViewElementDarkMode(dialogAudioOutputBinding.audioOutputSpeakerText) } WebRtcAudioManager.AudioDevice.EARPIECE -> { - viewThemeUtils.platform.colorImageView(dialogAudioOutputBinding.audioOutputEarspeakerIcon) + viewThemeUtils.platform.colorImageView( + dialogAudioOutputBinding.audioOutputEarspeakerIcon, + ColorRole.PRIMARY + ) viewThemeUtils.platform .colorPrimaryTextViewElementDarkMode(dialogAudioOutputBinding.audioOutputEarspeakerText) } WebRtcAudioManager.AudioDevice.WIRED_HEADSET -> { viewThemeUtils.platform - .colorImageView(dialogAudioOutputBinding.audioOutputWiredHeadsetIcon) + .colorImageView(dialogAudioOutputBinding.audioOutputWiredHeadsetIcon, ColorRole.PRIMARY) viewThemeUtils.platform .colorPrimaryTextViewElementDarkMode(dialogAudioOutputBinding.audioOutputWiredHeadsetText) } diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountShareToDialogFragment.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountShareToDialogFragment.kt index 3f0250eaa..3fe01b131 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountShareToDialogFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/ChooseAccountShareToDialogFragment.kt @@ -34,6 +34,7 @@ import androidx.fragment.app.DialogFragment import androidx.recyclerview.widget.LinearLayoutManager import autodagger.AutoInjector import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.adapters.items.AdvancedUserItem import com.nextcloud.talk.application.NextcloudTalkApplication import com.nextcloud.talk.application.NextcloudTalkApplication.Companion.sharedApplication @@ -90,7 +91,7 @@ class ChooseAccountShareToDialogFragment : DialogFragment() { binding!!.currentAccount.userName.text = user.displayName binding!!.currentAccount.ticker.visibility = View.GONE binding!!.currentAccount.account.text = Uri.parse(user.baseUrl).host - viewThemeUtils!!.platform.colorImageView(binding!!.currentAccount.accountMenu) + viewThemeUtils!!.platform.colorImageView(binding!!.currentAccount.accountMenu, ColorRole.PRIMARY) if (user.baseUrl != null && (user.baseUrl!!.startsWith("http://") || user.baseUrl!!.startsWith("https://")) ) { diff --git a/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt b/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt index a8baeed06..071bfb2b9 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/dialog/SetStatusDialogFragment.kt @@ -43,6 +43,7 @@ import autodagger.AutoInjector import com.bluelinelabs.logansquare.LoganSquare import com.google.android.material.card.MaterialCardView import com.google.android.material.dialog.MaterialAlertDialogBuilder +import com.nextcloud.android.common.ui.theme.utils.ColorRole import com.nextcloud.talk.R import com.nextcloud.talk.adapters.PredefinedStatusClickListener import com.nextcloud.talk.adapters.PredefinedStatusListAdapter @@ -424,15 +425,15 @@ class SetStatusDialogFragment : } } views.first.isChecked = true - viewThemeUtils.platform.colorOnSecondaryContainerTextViewElement(views.second) + viewThemeUtils.platform.colorTextView(views.second, ColorRole.ON_SECONDARY_CONTAINER) } private fun clearTopStatus() { context?.let { - binding.onlineHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text)) - binding.awayHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text)) - binding.dndHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text)) - binding.invisibleHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text)) + binding.onlineHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text, null)) + binding.awayHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text, null)) + binding.dndHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text, null)) + binding.invisibleHeadline.setTextColor(resources.getColor(R.color.high_emphasis_text, null)) binding.onlineIcon.imageTintList = null binding.awayIcon.imageTintList = null diff --git a/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt b/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt index 93e833f7c..30bc3fc43 100644 --- a/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt +++ b/app/src/main/java/com/nextcloud/talk/ui/theme/TalkSpecificViewThemeUtils.kt @@ -74,13 +74,13 @@ class TalkSpecificViewThemeUtils @Inject constructor( } val bgBubbleColor = if (deleted) { - resources.getColor(R.color.bg_message_list_incoming_bubble_deleted) + resources.getColor(R.color.bg_message_list_incoming_bubble_deleted, null) } else { - resources.getColor(R.color.bg_message_list_incoming_bubble) + resources.getColor(R.color.bg_message_list_incoming_bubble, null) } val bubbleDrawable = DisplayUtils.getMessageSelector( bgBubbleColor, - resources.getColor(R.color.transparent), + resources.getColor(R.color.transparent, null), bgBubbleColor, bubbleResource )