Skip to content

Commit 74e91e7

Browse files
committed
document some unlisted methods
1 parent e3ffbf3 commit 74e91e7

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

app/src/main/java/com/geode/launcher/utils/GeodeUtils.kt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ object GeodeUtils {
390390
return ""
391391
}
392392

393+
/**
394+
* Returns the current version code of the launcher.
395+
*/
393396
@JvmStatic
394397
fun getLauncherVersion(): Int {
395398
return BuildConfig.VERSION_CODE
@@ -461,9 +464,16 @@ object GeodeUtils {
461464
}
462465

463466
// vibration
467+
468+
/**
469+
* If vibration is supported on the device.
470+
*/
464471
@JvmStatic
465472
fun vibrateSupported(): Boolean = getVibrator()?.hasVibrator() == true
466473

474+
/**
475+
* Vibrates for the given amount of time.
476+
*/
467477
@JvmStatic
468478
fun vibrate(ms: Long) {
469479
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -474,6 +484,10 @@ object GeodeUtils {
474484
}
475485
}
476486

487+
/**
488+
* Vibrates with the given pattern.
489+
* @see android.os.VibrationEffect.createWaveform
490+
*/
477491
@JvmStatic
478492
fun vibratePattern(pattern: LongArray, repeat: Int) {
479493
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
@@ -535,6 +549,10 @@ object GeodeUtils {
535549
capabilityListener = WeakReference(listener)
536550
}
537551

552+
/**
553+
* Reports that the game client supports a feature.
554+
* These features typically require callbacks into the game, so ensure that the required methods are registered first.
555+
*/
538556
@JvmStatic
539557
fun reportPlatformCapability(capability: String?): Boolean {
540558
if (capability.isNullOrEmpty()) {
@@ -558,6 +576,10 @@ object GeodeUtils {
558576
external fun nativeActionScroll(scrollX: Float, scrollY: Float)
559577
external fun resizeSurface(width: Int, height: Int)
560578

561-
// represents the timestamp of the next input callback, in nanoseconds (most events don't send it, but it's there)
579+
/**
580+
* Gives the timestamp of the next input callback, in nanoseconds.
581+
* Enable this by sending the "timestamp_inputs" platform capability.
582+
* @see reportPlatformCapability
583+
*/
562584
external fun setNextInputTimestamp(timestamp: Long)
563585
}

0 commit comments

Comments
 (0)