大约有 850 项符合查询结果(耗时:0.0220秒) [XML]
Fragment over another fragment issue
...
Kotlin version: root.setOnTouchListener { _, _ -> true}
– Gal Rom
Oct 29 '19 at 19:57
add a comme...
Regular expression to find URLs within a string
...
Kotlin val urlRegex = "(?:(?:https?|ftp):\\/\\/)?[\\w/\\-?=%.]+\\.[\\w/\\-?=%.]+"
– Akshay Nandwana
Feb 27 '19 at 6:32
...
What is the best way to tell if a character is a letter or number in Java without using regexes?
...
On Kotlin it is much simpler if (c in 'a'..'z' || с in 'A'..'Z' || c in '0'..'9')
– Vlad
Jul 14 at 7:58
...
Android - get children inside a View?
...pdate for those who come across this question after 2018, if you are using Kotlin, you can simply use the Android KTX extension property ViewGroup.children to get a sequence of the View's immediate children.
share
|...
Android; Check if file exists without creating a new one
...
Kotlin Extension Properties
No file will be create when you make a File object, it is only an interface.
To make working with files easier, there is an existing .toFile function on Uri
You can also add an extension propert...
How do I get the file extension of a file in Java?
...;
Gradle Groovy DSL
implementation 'commons-io:commons-io:2.6'
Gradle Kotlin DSL
implementation("commons-io:commons-io:2.6")
Others https://search.maven.org/artifact/commons-io/commons-io/2.6/jar
share
|
...
How do I detect if I am in release or debug mode?
... ( getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE ) );
Kotlin:
val isDebuggable = 0 != applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE
It is taken from bundells post from here
share
...
How to run a method every X seconds
...
With Kotlin, we can now make a generic function for this!
object RepeatHelper {
fun repeatDelayed(delay: Long, todo: () -> Unit) {
val handler = Handler()
handler.postDelayed(object : Runnable {
...
How to get the build/version number of your Android application?
... your app as "1.0" or "2.5" or "2 Alpha EXTREME!" or whatever.
Example:
Kotlin:
val manager = this.packageManager
val info = manager.getPackageInfo(this.packageName, PackageManager.GET_ACTIVITIES)
toast("PackageName = " + info.packageName + "\nVersionCode = "
+ info.versionCode + "\n...
To draw an Underline below the TextView in Android
...
5 Amazing Ways To Underline A TextView In Android - Kotlin/Java & XML
String html = "<u>Underline using Html.fromHtml()</u>";
textview.setText(Html.fromHtml(html));
But Html.fromHtml(String resource) was deprecated in API 24.
So you can use the latest andr...