-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
415 changed files
with
2,854 additions
and
1,867 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 0 additions & 78 deletions
78
...e-status/android/src/main/java/im/status/ethereum/module/RNSelectableTextInputModule.java
This file was deleted.
Oops, something went wrong.
72 changes: 72 additions & 0 deletions
72
...ive-status/android/src/main/java/im/status/ethereum/module/RNSelectableTextInputModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package im.status.ethereum.module | ||
|
||
import android.view.ActionMode | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule | ||
import com.facebook.react.bridge.ReactMethod | ||
import com.facebook.react.uimanager.NativeViewHierarchyManager | ||
import com.facebook.react.uimanager.UIBlock | ||
import com.facebook.react.uimanager.UIManagerModule | ||
import com.facebook.react.views.textinput.ReactEditText | ||
|
||
class RNSelectableTextInputModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) { | ||
|
||
private var lastActionMode: ActionMode? = null | ||
|
||
override fun getName(): String { | ||
return "RNSelectableTextInputManager" | ||
} | ||
|
||
@ReactMethod | ||
fun setupMenuItems(selectableTextViewReactTag: Int?, textInputReactTag: Int?) { | ||
val reactContext = reactApplicationContext | ||
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java) | ||
selectableTextViewReactTag?.let { selectableTag -> | ||
textInputReactTag?.let { inputTag -> | ||
uiManager?.addUIBlock(UIBlock { nvhm: NativeViewHierarchyManager -> | ||
val rnSelectableTextManager = nvhm.resolveViewManager(selectableTag) as RNSelectableTextInputViewManager | ||
val reactTextView = nvhm.resolveView(inputTag) as ReactEditText | ||
rnSelectableTextManager.registerSelectionListener(reactTextView) | ||
}) | ||
} | ||
} | ||
} | ||
|
||
@ReactMethod | ||
fun startActionMode(textInputReactTag: Int?) { | ||
val reactContext = reactApplicationContext | ||
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java) | ||
textInputReactTag?.let { inputTag -> | ||
uiManager?.addUIBlock(UIBlock { nvhm: NativeViewHierarchyManager -> | ||
val reactTextView = nvhm.resolveView(inputTag) as ReactEditText | ||
lastActionMode = reactTextView.startActionMode(reactTextView.customSelectionActionModeCallback, ActionMode.TYPE_FLOATING) | ||
}) | ||
} | ||
} | ||
|
||
@ReactMethod | ||
fun hideLastActionMode() { | ||
val reactContext = reactApplicationContext | ||
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java) | ||
uiManager?.addUIBlock(UIBlock { _ -> | ||
lastActionMode?.finish() | ||
lastActionMode = null | ||
}) | ||
} | ||
|
||
@ReactMethod | ||
fun setSelection(textInputReactTag: Int?, start: Int?, end: Int?) { | ||
val reactContext = reactApplicationContext | ||
val uiManager = reactContext.getNativeModule(UIManagerModule::class.java) | ||
textInputReactTag?.let { inputTag -> | ||
start?.let { s -> | ||
end?.let { e -> | ||
uiManager?.addUIBlock(UIBlock { nvhm: NativeViewHierarchyManager -> | ||
val reactTextView = nvhm.resolveView(inputTag) as ReactEditText | ||
reactTextView.setSelection(s, e) | ||
}) | ||
} | ||
} | ||
} | ||
} | ||
} |
102 changes: 0 additions & 102 deletions
102
...tus/android/src/main/java/im/status/ethereum/module/RNSelectableTextInputViewManager.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.