Get rid of some Detekt complaints

Adam Novak 2 years ago
parent b11ff2a8bb
commit 5557adbbcb

@ -56,7 +56,6 @@ private const val VIEW_HOLDER_TYPE_ADDON = 2
* @property addonsManagerDelegate Delegate that will provides method for handling the add-on items.
* @param addons The list of add-on based on the AMO store.
* @property style Indicates how items should look like.
* @property excludedAddonIDs A list of add-on IDs we could exclude. Currently ignored.
*/
@Suppress("TooManyFunctions", "LargeClass")
// We have an extra "Lint" Android Studio linter pass that Android Components
@ -68,7 +67,6 @@ class PagedAddonsManagerAdapter(
private val addonsManagerDelegate: AddonsManagerAdapterDelegate,
addons: List<Addon>,
private val style: Style? = null,
private val excludedAddonIDs: List<String> = emptyList()
) : ListAdapter<Any, CustomViewHolder>(DifferCallback) {
private val scope = CoroutineScope(Dispatchers.IO)
private val logger = Logger("PagedAddonsManagerAdapter")

@ -146,6 +146,11 @@ class Components(private val context: Context) {
AddonManager(core.store, core.engine, addonCollectionProvider, addonUpdater)
}
/**
* Tell the addon-finding logic that it needs to go download the list of
* addons, from a source that may have changed.
*/
fun updateAddonManager() {
addonCollectionProvider.deleteCacheFile(context)

@ -819,6 +819,9 @@ class TopSheetBehavior<V : View?>
return behavior as TopSheetBehavior<V>
}
/**
* Constrain a number between limits.
*/
fun constrain(amount: Int, low: Int, high: Int): Int {
return if (amount < low) low else if (amount > high) high else amount
}

Loading…
Cancel
Save