Merge pull request #1362 from falih-mulyana/feature/text-selection-action
Feature/text selection action
This commit is contained in:
commit
b473d9d6d8
|
@ -72,7 +72,7 @@ PayPal: http://paypal.me/yisiliu2
|
||||||
|
|
||||||
AliPay: `String.format("%s@%s", "mariotaku.lee", "gmail.com");`
|
AliPay: `String.format("%s@%s", "mariotaku.lee", "gmail.com");`
|
||||||
|
|
||||||
Bitcoin: `1FHAVAzge7cj1LfCTMfnLL49DgA3mVUCuW`
|
Bitcoin: `3CzmxZa6jseNCYVvM2phs3jmiqNgVBwD7P`
|
||||||
|
|
||||||
Ethereum & ERC20 Tokens: `0x6ff82FC45aff81D4081DA7B257fb8ee5F71A2CeC`
|
Ethereum & ERC20 Tokens: `0x6ff82FC45aff81D4081DA7B257fb8ee5F71A2CeC`
|
||||||
|
|
||||||
|
|
|
@ -249,6 +249,13 @@
|
||||||
<data android:mimeType="image/*"/>
|
<data android:mimeType="image/*"/>
|
||||||
<data android:mimeType="text/plain"/>
|
<data android:mimeType="text/plain"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<intent-filter android:label="@string/title_compose">
|
||||||
|
<action android:name="android.intent.action.PROCESS_TEXT" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
|
|
||||||
|
<data android:mimeType="text/plain"/>
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="android.support.PARENT_ACTIVITY"
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
|
|
@ -32,6 +32,7 @@ import android.graphics.Canvas
|
||||||
import android.graphics.Rect
|
import android.graphics.Rect
|
||||||
import android.location.*
|
import android.location.*
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import androidx.core.app.ActivityCompat
|
import androidx.core.app.ActivityCompat
|
||||||
import androidx.core.widget.TextViewCompat
|
import androidx.core.widget.TextViewCompat
|
||||||
|
@ -1145,6 +1146,12 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
|
||||||
} else {
|
} else {
|
||||||
editText.setSelection(selection.coerceIn(0..editText.length()))
|
editText.setSelection(selection.coerceIn(0..editText.length()))
|
||||||
}
|
}
|
||||||
|
if (intent.hasExtra(Intent.EXTRA_PROCESS_TEXT) && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
|
||||||
|
val charSequences = intent.getCharSequenceExtra(Intent.EXTRA_PROCESS_TEXT)
|
||||||
|
charSequences?.let {
|
||||||
|
editText.setText(it.toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
editText.requestFocus()
|
editText.requestFocus()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue