[fenix] For https://github.com/mozilla-mobile/fenix/issues/21776 - Remove unused symbols
parent
759194a625
commit
45e9bf6693
@ -1,29 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.components
|
||||
|
||||
import android.annotation.TargetApi
|
||||
import android.appwidget.AppWidgetManager
|
||||
import android.content.ComponentName
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import org.mozilla.gecko.search.SearchWidgetProvider
|
||||
|
||||
/**
|
||||
* Handles the creation of the pinning search widget dialog.
|
||||
*/
|
||||
object SearchWidgetCreator {
|
||||
|
||||
/**
|
||||
* Attempts to display a prompt requesting the user pin the search widget
|
||||
* Returns true if the prompt is displayed successfully, and false otherwise.
|
||||
*/
|
||||
@TargetApi(Build.VERSION_CODES.O)
|
||||
fun createSearchWidget(context: Context): Boolean {
|
||||
val appWidgetManager: AppWidgetManager = context.getSystemService(AppWidgetManager::class.java)
|
||||
val myProvider = ComponentName(context, SearchWidgetProvider::class.java)
|
||||
return appWidgetManager.requestPinAppWidget(myProvider, null, null)
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.home
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import androidx.appcompat.widget.AppCompatImageView
|
||||
|
||||
class ImageViewTopCrop(context: Context, attrs: AttributeSet) : AppCompatImageView(context, attrs) {
|
||||
override fun setFrame(l: Int, t: Int, r: Int, b: Int): Boolean {
|
||||
val scaleFactor = width / drawable.intrinsicWidth.toFloat()
|
||||
val matrix = imageMatrix
|
||||
|
||||
matrix.setScale(scaleFactor, scaleFactor, 0f, 0f)
|
||||
imageMatrix = matrix
|
||||
|
||||
return super.setFrame(l, t, r, b)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue