mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-29 01:48:53 +03:00
Merge pull request #3041 from nextcloud/chore/noid/migrateThemingCalls
Migrate theme API calls
This commit is contained in:
commit
0f9c109b5a
31 changed files with 87 additions and 64 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
)
|
||||
)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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())) {
|
||||
|
|
|
@ -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!!)
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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://"))
|
||||
) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue