mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-22 08:42:38 +00:00
document some unlisted methods
This commit is contained in:
1 file changed
+23
-1
@@ -390,6 +390,9 @@ object GeodeUtils {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current version code of the launcher.
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun getLauncherVersion(): Int {
|
fun getLauncherVersion(): Int {
|
||||||
return BuildConfig.VERSION_CODE
|
return BuildConfig.VERSION_CODE
|
||||||
@@ -461,9 +464,16 @@ object GeodeUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// vibration
|
// vibration
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If vibration is supported on the device.
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun vibrateSupported(): Boolean = getVibrator()?.hasVibrator() == true
|
fun vibrateSupported(): Boolean = getVibrator()?.hasVibrator() == true
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vibrates for the given amount of time.
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun vibrate(ms: Long) {
|
fun vibrate(ms: Long) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
@@ -474,6 +484,10 @@ object GeodeUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vibrates with the given pattern.
|
||||||
|
* @see android.os.VibrationEffect.createWaveform
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun vibratePattern(pattern: LongArray, repeat: Int) {
|
fun vibratePattern(pattern: LongArray, repeat: Int) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
@@ -535,6 +549,10 @@ object GeodeUtils {
|
|||||||
capabilityListener = WeakReference(listener)
|
capabilityListener = WeakReference(listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reports that the game client supports a feature.
|
||||||
|
* These features typically require callbacks into the game, so ensure that the required methods are registered first.
|
||||||
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun reportPlatformCapability(capability: String?): Boolean {
|
fun reportPlatformCapability(capability: String?): Boolean {
|
||||||
if (capability.isNullOrEmpty()) {
|
if (capability.isNullOrEmpty()) {
|
||||||
@@ -558,6 +576,10 @@ object GeodeUtils {
|
|||||||
external fun nativeActionScroll(scrollX: Float, scrollY: Float)
|
external fun nativeActionScroll(scrollX: Float, scrollY: Float)
|
||||||
external fun resizeSurface(width: Int, height: Int)
|
external fun resizeSurface(width: Int, height: Int)
|
||||||
|
|
||||||
// represents the timestamp of the next input callback, in nanoseconds (most events don't send it, but it's there)
|
/**
|
||||||
|
* Gives the timestamp of the next input callback, in nanoseconds.
|
||||||
|
* Enable this by sending the "timestamp_inputs" platform capability.
|
||||||
|
* @see reportPlatformCapability
|
||||||
|
*/
|
||||||
external fun setNextInputTimestamp(timestamp: Long)
|
external fun setNextInputTimestamp(timestamp: Long)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user