Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthew Finkel
fenix
Commits
e318cd7d
Commit
e318cd7d
authored
Feb 06, 2020
by
Harshal Lele
Committed by
Emily Kager
Mar 02, 2020
Browse files
fix #8135 - remove getColorFromAttr
parent
8e06933e
Changes
43
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/addons/AddonsManagementFragment.kt
View file @
e318cd7d
...
...
@@ -13,21 +13,21 @@ import androidx.navigation.Navigation
import
androidx.recyclerview.widget.LinearLayoutManager
import
kotlinx.android.synthetic.main.fragment_add_ons_management.*
import
kotlinx.android.synthetic.main.fragment_add_ons_management.view.*
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers.IO
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.flow.collect
import
kotlinx.coroutines.CoroutineScope
import
mozilla.components.lib.state.ext.flowScoped
import
mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
import
kotlinx.coroutines.ExperimentalCoroutinesApi
import
kotlinx.coroutines.cancel
import
kotlinx.coroutines.flow.collect
import
kotlinx.coroutines.launch
import
mozilla.components.feature.addons.Addon
import
mozilla.components.feature.addons.AddonManagerException
import
mozilla.components.feature.addons.ui.AddonsManagerAdapter
import
mozilla.components.feature.addons.ui.AddonsManagerAdapterDelegate
import
mozilla.components.feature.addons.ui.PermissionsDialogFragment
import
mozilla.components.feature.addons.ui.translatedName
import
mozilla.components.lib.state.ext.flowScoped
import
mozilla.components.support.ktx.kotlinx.coroutines.flow.ifChanged
import
org.mozilla.fenix.R
import
org.mozilla.fenix.ext.components
import
org.mozilla.fenix.ext.getRootView
...
...
app/src/main/java/org/mozilla/fenix/collections/CollectionCreationView.kt
View file @
e318cd7d
...
...
@@ -11,6 +11,7 @@ import android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
android.view.inputmethod.EditorInfo
import
androidx.appcompat.content.res.AppCompatResources
import
androidx.constraintlayout.widget.ConstraintSet
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.LinearLayoutManager
...
...
@@ -18,7 +19,6 @@ import androidx.recyclerview.widget.RecyclerView
import
androidx.transition.AutoTransition
import
androidx.transition.Transition
import
androidx.transition.TransitionManager
import
androidx.appcompat.content.res.AppCompatResources
import
kotlinx.android.extensions.LayoutContainer
import
kotlinx.android.synthetic.main.component_collection_creation.*
import
kotlinx.android.synthetic.main.component_collection_creation.view.*
...
...
app/src/main/java/org/mozilla/fenix/components/AccountAbnormalities.kt
View file @
e318cd7d
...
...
@@ -17,7 +17,6 @@ import mozilla.components.concept.sync.OAuthAccount
import
mozilla.components.lib.crash.CrashReporter
import
mozilla.components.service.fxa.manager.FxaAccountManager
import
mozilla.components.support.base.log.logger.Logger
import
java.lang.Exception
import
kotlin.coroutines.CoroutineContext
/**
...
...
app/src/main/java/org/mozilla/fenix/components/FirebasePushService.kt
View file @
e318cd7d
...
...
@@ -5,12 +5,12 @@
package
org.mozilla.fenix.components
import
android.annotation.SuppressLint
import
com.google.firebase.messaging.RemoteMessage
import
com.google.firebase.messaging.FirebaseMessagingService
import
com.google.firebase.messaging.RemoteMessage
import
com.leanplum.LeanplumPushFirebaseMessagingService
import
mozilla.components.concept.push.PushService
import
mozilla.components.lib.push.firebase.AbstractFirebasePushService
import
mozilla.components.feature.push.AutoPushFeature
import
mozilla.components.lib.push.firebase.AbstractFirebasePushService
/**
* A wrapper class that only exists to delegate to [FirebaseMessagingService] instances.
...
...
app/src/main/java/org/mozilla/fenix/components/InflationAwareFeature.kt
View file @
e318cd7d
...
...
@@ -3,8 +3,8 @@ package org.mozilla.fenix.components
import
android.view.View
import
android.view.ViewStub
import
androidx.annotation.UiThread
import
mozilla.components.support.base.feature.UserInteractionHandler
import
mozilla.components.support.base.feature.LifecycleAwareFeature
import
mozilla.components.support.base.feature.UserInteractionHandler
import
java.lang.ref.WeakReference
/**
...
...
app/src/main/java/org/mozilla/fenix/components/IntentProcessorType.kt
View file @
e318cd7d
...
...
@@ -7,8 +7,8 @@ package org.mozilla.fenix.components
import
android.content.Intent
import
mozilla.components.feature.intent.processing.IntentProcessor
import
org.mozilla.fenix.HomeActivity
import
org.mozilla.fenix.migration.MigrationProgressActivity
import
org.mozilla.fenix.customtabs.ExternalAppBrowserActivity
import
org.mozilla.fenix.migration.MigrationProgressActivity
enum
class
IntentProcessorType
{
EXTERNAL_APP
,
NEW_TAB
,
MIGRATION
,
OTHER
;
...
...
app/src/main/java/org/mozilla/fenix/components/metrics/ActivationPing.kt
View file @
e318cd7d
...
...
@@ -8,16 +8,16 @@ import android.content.Context
import
android.content.SharedPreferences
import
android.util.Base64
import
androidx.annotation.VisibleForTesting
import
mozilla.components.support.base.log.logger.Logger
import
org.mozilla.fenix.GleanMetrics.Activation
import
org.mozilla.fenix.GleanMetrics.Pings
import
com.google.android.gms.ads.identifier.AdvertisingIdClient
import
com.google.android.gms.common.GooglePlayServicesNotAvailableException
import
com.google.android.gms.common.GooglePlayServicesRepairableException
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.withContext
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.withContext
import
mozilla.components.support.base.log.logger.Logger
import
org.mozilla.fenix.GleanMetrics.Activation
import
org.mozilla.fenix.GleanMetrics.Pings
import
java.io.IOException
import
java.security.NoSuchAlgorithmException
import
java.security.spec.InvalidKeySpecException
...
...
app/src/main/java/org/mozilla/fenix/components/metrics/GleanMetricsService.kt
View file @
e318cd7d
...
...
@@ -6,8 +6,8 @@ package org.mozilla.fenix.components.metrics
import
android.content.Context
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.MainScope
import
kotlinx.coroutines.launch
import
mozilla.components.service.glean.Glean
import
mozilla.components.service.glean.private.NoExtraKeys
import
mozilla.components.support.base.log.logger.Logger
...
...
app/src/main/java/org/mozilla/fenix/components/metrics/LeanplumMetricsService.kt
View file @
e318cd7d
...
...
@@ -10,15 +10,15 @@ import com.leanplum.Leanplum
import
com.leanplum.LeanplumActivityHelper
import
com.leanplum.annotations.Parser
import
com.leanplum.internal.LeanplumInternal
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.withContext
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.Dispatchers.Main
import
kotlinx.coroutines.Job
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.withContext
import
mozilla.components.support.locale.LocaleManager
import
org.mozilla.fenix.components.metrics.MozillaProductDetector.MozillaProducts
import
org.mozilla.fenix.BuildConfig
import
org.mozilla.fenix.components.metrics.MozillaProductDetector.MozillaProducts
import
org.mozilla.fenix.ext.settings
import
java.util.Locale
import
java.util.UUID.randomUUID
...
...
app/src/main/java/org/mozilla/fenix/components/searchengine/CustomSearchEngineStore.kt
View file @
e318cd7d
...
...
@@ -15,7 +15,6 @@ import mozilla.components.browser.search.provider.SearchEngineProvider
import
mozilla.components.support.ktx.android.content.PreferencesHolder
import
mozilla.components.support.ktx.android.content.stringSetPreference
import
org.mozilla.fenix.ext.components
import
java.lang.Exception
/**
* SearchEngineProvider implementation to load user entered custom search engines.
...
...
app/src/main/java/org/mozilla/fenix/components/searchengine/SearchEngineWriter.kt
View file @
e318cd7d
...
...
@@ -5,8 +5,10 @@
package
org.mozilla.fenix.components.searchengine
import
android.graphics.Bitmap
import
android.util.Base64
import
android.util.Log
import
org.w3c.dom.Document
import
java.io.ByteArrayOutputStream
import
java.io.StringWriter
import
javax.xml.parsers.DocumentBuilderFactory
import
javax.xml.parsers.ParserConfigurationException
...
...
@@ -16,8 +18,6 @@ import javax.xml.transform.TransformerException
import
javax.xml.transform.TransformerFactory
import
javax.xml.transform.dom.DOMSource
import
javax.xml.transform.stream.StreamResult
import
android.util.Base64
import
java.io.ByteArrayOutputStream
private
const
val
BITMAP_COMPRESS_QUALITY
=
100
private
fun
Bitmap
.
toBase64
():
String
{
...
...
app/src/main/java/org/mozilla/fenix/components/toolbar/DefaultToolbarMenu.kt
View file @
e318cd7d
...
...
@@ -22,6 +22,7 @@ import mozilla.components.browser.menu.item.BrowserMenuItemToolbar
import
mozilla.components.browser.session.Session
import
mozilla.components.browser.session.SessionManager
import
mozilla.components.concept.storage.BookmarksStorage
import
mozilla.components.support.ktx.android.content.getColorFromAttr
import
org.mozilla.fenix.Config
import
org.mozilla.fenix.HomeActivity
import
org.mozilla.fenix.R
...
...
@@ -29,7 +30,6 @@ import org.mozilla.fenix.ReleaseChannel
import
org.mozilla.fenix.browser.browsingmode.BrowsingMode
import
org.mozilla.fenix.ext.asActivity
import
org.mozilla.fenix.ext.components
import
org.mozilla.fenix.ext.getColorFromAttr
import
org.mozilla.fenix.theme.ThemeManager
import
org.mozilla.fenix.utils.Settings
...
...
app/src/main/java/org/mozilla/fenix/ext/Context.kt
View file @
e318cd7d
...
...
@@ -15,14 +15,11 @@ import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import
android.view.ContextThemeWrapper
import
android.view.View
import
android.view.ViewGroup
import
androidx.annotation.AttrRes
import
androidx.annotation.ColorInt
import
androidx.annotation.StringRes
import
androidx.fragment.app.FragmentActivity
import
mozilla.components.browser.search.SearchEngineManager
import
mozilla.components.support.base.log.Log
import
mozilla.components.support.base.log.Log.Priority.WARN
import
mozilla.components.support.ktx.android.content.getColorFromAttr
import
org.mozilla.fenix.BuildConfig
import
org.mozilla.fenix.Config
import
org.mozilla.fenix.FenixApplication
...
...
@@ -101,11 +98,5 @@ fun Context.share(text: String, subject: String = ""): Boolean {
fun
Context
.
getRootView
():
View
?
=
asActivity
()
?.
window
?.
decorView
?.
findViewById
<
View
>(
android
.
R
.
id
.
content
)
as
?
ViewGroup
/**
* Returns the color int corresponding to the attribute.
*/
@ColorInt
fun
Context
.
getColorFromAttr
(
@AttrRes
attr
:
Int
)
=
getColorFromAttr
(
attr
)
fun
Context
.
settings
(
isCrashReportEnabledInBuild
:
Boolean
=
BuildConfig
.
CRASH_REPORTING
&&
Config
.
channel
.
isReleased
)
=
Settings
.
getInstance
(
this
,
isCrashReportEnabledInBuild
)
app/src/main/java/org/mozilla/fenix/ext/Fragment.kt
View file @
e318cd7d
...
...
@@ -12,7 +12,6 @@ import androidx.navigation.NavDirections
import
androidx.navigation.NavOptions
import
androidx.navigation.Navigator
import
androidx.navigation.fragment.NavHostFragment.findNavController
import
kotlinx.android.synthetic.main.fragment_home.*
import
org.mozilla.fenix.HomeActivity
import
org.mozilla.fenix.components.Components
...
...
app/src/main/java/org/mozilla/fenix/ext/Resources.kt
View file @
e318cd7d
...
...
@@ -12,8 +12,6 @@ import android.text.SpannableString
import
android.text.Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
import
androidx.annotation.StringRes
import
java.util.Formatter
import
kotlin.collections.ArrayList
import
kotlin.collections.HashMap
// Credit to Michael Spitsin https://medium.com/@programmerr47/working-with-spans-in-android-ca4ab1327bc4
@Suppress
(
"SpreadOperator"
)
...
...
app/src/main/java/org/mozilla/fenix/home/HomeMenu.kt
View file @
e318cd7d
...
...
@@ -12,9 +12,9 @@ import mozilla.components.browser.menu.item.BrowserMenuCategory
import
mozilla.components.browser.menu.item.BrowserMenuDivider
import
mozilla.components.browser.menu.item.BrowserMenuHighlightableItem
import
mozilla.components.browser.menu.item.BrowserMenuImageText
import
mozilla.components.support.ktx.android.content.getColorFromAttr
import
org.mozilla.fenix.R
import
org.mozilla.fenix.ext.components
import
org.mozilla.fenix.ext.getColorFromAttr
import
org.mozilla.fenix.theme.ThemeManager
import
org.mozilla.fenix.utils.Settings
import
org.mozilla.fenix.whatsnew.WhatsNew
...
...
app/src/main/java/org/mozilla/fenix/home/PrivateBrowsingButtonView.kt
View file @
e318cd7d
...
...
@@ -6,9 +6,9 @@ package org.mozilla.fenix.home
import
android.view.View
import
androidx.annotation.StringRes
import
org.mozilla.fenix.R
import
org.mozilla.fenix.browser.browsingmode.BrowsingMode
import
org.mozilla.fenix.browser.browsingmode.BrowsingModeManager
import
org.mozilla.fenix.R
/**
* Sets up the private browsing toggle button on the [HomeFragment].
...
...
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/SwipeToDeleteCallback.kt
View file @
e318cd7d
...
...
@@ -10,8 +10,8 @@ import android.graphics.drawable.Drawable
import
androidx.appcompat.content.res.AppCompatResources
import
androidx.recyclerview.widget.ItemTouchHelper
import
androidx.recyclerview.widget.RecyclerView
import
mozilla.components.support.ktx.android.content.getColorFromAttr
import
org.mozilla.fenix.R
import
org.mozilla.fenix.ext.getColorFromAttr
import
org.mozilla.fenix.home.sessioncontrol.viewholders.TabInCollectionViewHolder
import
org.mozilla.fenix.home.sessioncontrol.viewholders.TabViewHolder
...
...
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/CollectionViewHolder.kt
View file @
e318cd7d
...
...
@@ -17,11 +17,11 @@ import mozilla.components.browser.menu.BrowserMenuBuilder
import
mozilla.components.browser.menu.item.SimpleBrowserMenuItem
import
mozilla.components.feature.tab.collections.TabCollection
import
org.mozilla.fenix.R
import
org.mozilla.fenix.theme.ThemeManager
import
org.mozilla.fenix.components.description
import
org.mozilla.fenix.ext.getIconColor
import
org.mozilla.fenix.ext.increaseTapArea
import
org.mozilla.fenix.home.sessioncontrol.CollectionInteractor
import
org.mozilla.fenix.theme.ThemeManager
class
CollectionViewHolder
(
val
view
:
View
,
...
...
app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/NoContentMessageWithActionViewHolder.kt
View file @
e318cd7d
...
...
@@ -8,9 +8,7 @@ import android.view.View
import
androidx.annotation.DrawableRes
import
androidx.annotation.StringRes
import
androidx.core.view.isVisible
import
kotlinx.android.synthetic.main.no_content_message_with_action.view.button_icon
import
kotlinx.android.synthetic.main.no_content_message_with_action.view.button_layout
import
kotlinx.android.synthetic.main.no_content_message_with_action.view.button_text
import
kotlinx.android.synthetic.main.no_content_message_with_action.view.*
import
org.mozilla.fenix.R
class
NoContentMessageWithActionViewHolder
(
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment