run lint-native:fix (#8836)
This commit is contained in:
@@ -88,7 +88,7 @@ class ViewController: UIViewController, WKScriptMessageHandler, WKNavigationDele
|
|||||||
switch host {
|
switch host {
|
||||||
case "bsky.app":
|
case "bsky.app":
|
||||||
if url.pathComponents.count == 4,
|
if url.pathComponents.count == 4,
|
||||||
(url.pathComponents[1] == "start" || url.pathComponents[1] == "starter-pack") {
|
url.pathComponents[1] == "start" || url.pathComponents[1] == "starter-pack" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|||||||
+5
-5
@@ -19,7 +19,6 @@ import expo.modules.kotlin.AppContext
|
|||||||
import expo.modules.kotlin.viewevent.EventDispatcher
|
import expo.modules.kotlin.viewevent.EventDispatcher
|
||||||
import expo.modules.kotlin.views.ExpoView
|
import expo.modules.kotlin.views.ExpoView
|
||||||
|
|
||||||
|
|
||||||
class BottomSheetView(
|
class BottomSheetView(
|
||||||
context: Context,
|
context: Context,
|
||||||
appContext: AppContext,
|
appContext: AppContext,
|
||||||
@@ -31,7 +30,9 @@ class BottomSheetView(
|
|||||||
private lateinit var dialogRootViewGroup: DialogRootViewGroup
|
private lateinit var dialogRootViewGroup: DialogRootViewGroup
|
||||||
private var eventDispatcher: EventDispatcher? = null
|
private var eventDispatcher: EventDispatcher? = null
|
||||||
|
|
||||||
private val rawScreenHeight = context.resources.displayMetrics.heightPixels.toFloat()
|
private val rawScreenHeight =
|
||||||
|
context.resources.displayMetrics.heightPixels
|
||||||
|
.toFloat()
|
||||||
private val safeScreenHeight = (rawScreenHeight - getNavigationBarHeight()).toFloat()
|
private val safeScreenHeight = (rawScreenHeight - getNavigationBarHeight()).toFloat()
|
||||||
|
|
||||||
private fun getNavigationBarHeight(): Int {
|
private fun getNavigationBarHeight(): Int {
|
||||||
@@ -157,8 +158,8 @@ class BottomSheetView(
|
|||||||
|
|
||||||
// Presentation
|
// Presentation
|
||||||
|
|
||||||
private fun getHalfExpandedRatio(contentHeight: Float): Float {
|
private fun getHalfExpandedRatio(contentHeight: Float): Float =
|
||||||
return when {
|
when {
|
||||||
// Full height sheets
|
// Full height sheets
|
||||||
contentHeight >= safeScreenHeight -> 0.99f
|
contentHeight >= safeScreenHeight -> 0.99f
|
||||||
// Medium height sheets (>50% but <100%)
|
// Medium height sheets (>50% but <100%)
|
||||||
@@ -168,7 +169,6 @@ class BottomSheetView(
|
|||||||
else ->
|
else ->
|
||||||
this.clampRatio(this.getTargetHeight() / rawScreenHeight)
|
this.clampRatio(this.getTargetHeight() / rawScreenHeight)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private fun present() {
|
private fun present() {
|
||||||
if (this.isOpen || this.isOpening || this.isClosing) return
|
if (this.isOpen || this.isOpening || this.isClosing) return
|
||||||
|
|||||||
+4
-1
@@ -139,7 +139,10 @@ class DialogRootViewGroup(
|
|||||||
return super.onHoverEvent(event)
|
return super.onHoverEvent(event)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onChildStartedNativeGesture(childView: View?, ev: MotionEvent) {
|
override fun onChildStartedNativeGesture(
|
||||||
|
childView: View?,
|
||||||
|
ev: MotionEvent,
|
||||||
|
) {
|
||||||
eventDispatcher?.let { jSTouchDispatcher.onChildStartedNativeGesture(ev, it) }
|
eventDispatcher?.let { jSTouchDispatcher.onChildStartedNativeGesture(ev, it) }
|
||||||
jSPointerDispatcher?.onChildStartedNativeGesture(childView, ev, eventDispatcher)
|
jSPointerDispatcher?.onChildStartedNativeGesture(childView, ev, eventDispatcher)
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -82,7 +82,8 @@ class GifView(
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.webpRequest =
|
this.webpRequest =
|
||||||
glide.load(source)
|
glide
|
||||||
|
.load(source)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.DATA)
|
.diskCacheStrategy(DiskCacheStrategy.DATA)
|
||||||
.skipMemoryCache(false)
|
.skipMemoryCache(false)
|
||||||
.listener(
|
.listener(
|
||||||
@@ -92,7 +93,7 @@ class GifView(
|
|||||||
model: Any,
|
model: Any,
|
||||||
target: Target<Drawable>?,
|
target: Target<Drawable>?,
|
||||||
dataSource: DataSource,
|
dataSource: DataSource,
|
||||||
isFirstResource: Boolean
|
isFirstResource: Boolean,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
placeholderRequest?.let { glide.clear(it) }
|
placeholderRequest?.let { glide.clear(it) }
|
||||||
return false
|
return false
|
||||||
@@ -102,15 +103,15 @@ class GifView(
|
|||||||
e: GlideException?,
|
e: GlideException?,
|
||||||
model: Any?,
|
model: Any?,
|
||||||
target: Target<Drawable>,
|
target: Target<Drawable>,
|
||||||
isFirstResource: Boolean
|
isFirstResource: Boolean,
|
||||||
): Boolean = true
|
): Boolean = true
|
||||||
}
|
},
|
||||||
)
|
).into(this.imageView)
|
||||||
.into(this.imageView)
|
|
||||||
|
|
||||||
if (this.imageView.drawable == null || this.imageView.drawable !is Animatable) {
|
if (this.imageView.drawable == null || this.imageView.drawable !is Animatable) {
|
||||||
this.placeholderRequest =
|
this.placeholderRequest =
|
||||||
glide.load(placeholderSource)
|
glide
|
||||||
|
.load(placeholderSource)
|
||||||
.diskCacheStrategy(DiskCacheStrategy.DATA)
|
.diskCacheStrategy(DiskCacheStrategy.DATA)
|
||||||
// Let's not bloat the memory cache with placeholders
|
// Let's not bloat the memory cache with placeholders
|
||||||
.skipMemoryCache(true)
|
.skipMemoryCache(true)
|
||||||
@@ -121,7 +122,7 @@ class GifView(
|
|||||||
model: Any,
|
model: Any,
|
||||||
target: Target<Drawable>?,
|
target: Target<Drawable>?,
|
||||||
dataSource: DataSource,
|
dataSource: DataSource,
|
||||||
isFirstResource: Boolean
|
isFirstResource: Boolean,
|
||||||
): Boolean {
|
): Boolean {
|
||||||
// Incase this request finishes after the webp, let's just not set
|
// Incase this request finishes after the webp, let's just not set
|
||||||
// the drawable. This shouldn't happen because the request should
|
// the drawable. This shouldn't happen because the request should
|
||||||
@@ -136,11 +137,10 @@ class GifView(
|
|||||||
e: GlideException?,
|
e: GlideException?,
|
||||||
model: Any?,
|
model: Any?,
|
||||||
target: Target<Drawable>,
|
target: Target<Drawable>,
|
||||||
isFirstResource: Boolean
|
isFirstResource: Boolean,
|
||||||
): Boolean = true
|
): Boolean = true
|
||||||
},
|
},
|
||||||
)
|
).submit()
|
||||||
.submit()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -5,7 +5,8 @@ import expo.modules.kotlin.modules.ModuleDefinition
|
|||||||
import java.net.URL
|
import java.net.URL
|
||||||
|
|
||||||
class EmojiPickerModule : Module() {
|
class EmojiPickerModule : Module() {
|
||||||
override fun definition() = ModuleDefinition {
|
override fun definition() =
|
||||||
|
ModuleDefinition {
|
||||||
Name("EmojiPicker")
|
Name("EmojiPicker")
|
||||||
|
|
||||||
View(EmojiPickerModuleView::class) {
|
View(EmojiPickerModuleView::class) {
|
||||||
|
|||||||
+8
-6
@@ -8,10 +8,11 @@ import expo.modules.kotlin.AppContext
|
|||||||
import expo.modules.kotlin.viewevent.EventDispatcher
|
import expo.modules.kotlin.viewevent.EventDispatcher
|
||||||
import expo.modules.kotlin.views.ExpoView
|
import expo.modules.kotlin.views.ExpoView
|
||||||
|
|
||||||
|
|
||||||
@SuppressLint("ViewConstructor")
|
@SuppressLint("ViewConstructor")
|
||||||
class EmojiPickerModuleView(context: Context, appContext: AppContext) :
|
class EmojiPickerModuleView(
|
||||||
ExpoView(context, appContext) {
|
context: Context,
|
||||||
|
appContext: AppContext,
|
||||||
|
) : ExpoView(context, appContext) {
|
||||||
private var emojiView: EmojiPickerView = EmojiPickerView(context)
|
private var emojiView: EmojiPickerView = EmojiPickerView(context)
|
||||||
private val onEmojiSelected by EventDispatcher()
|
private val onEmojiSelected by EventDispatcher()
|
||||||
|
|
||||||
@@ -21,10 +22,11 @@ class EmojiPickerModuleView(context: Context, appContext: AppContext) :
|
|||||||
|
|
||||||
private fun setupView() {
|
private fun setupView() {
|
||||||
addView(
|
addView(
|
||||||
emojiView, LayoutParams(
|
emojiView,
|
||||||
|
LayoutParams(
|
||||||
LayoutParams.MATCH_PARENT,
|
LayoutParams.MATCH_PARENT,
|
||||||
LayoutParams.MATCH_PARENT
|
LayoutParams.MATCH_PARENT,
|
||||||
)
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
emojiView.setOnEmojiPickedListener { emoji ->
|
emojiView.setOnEmojiPickedListener { emoji ->
|
||||||
|
|||||||
Reference in New Issue
Block a user