Source code for enamlnative.android.android_utils
"""
Copyright (c) 2017-2022, CodeLV.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE, distributed with this software.
Created on May 20, 2017
"""
from .android_content import Context, SystemService
from .app import AndroidApplication
from .bridge import JavaBridgeObject, JavaMethod, JavaStaticMethod
class HashMap(JavaBridgeObject):
__nativeclass__ = "java.util.HashMap"
get = JavaMethod(object, returns=object)
set = JavaMethod(object, object)
class AttributeSet(JavaBridgeObject):
__nativeclass__ = "android.util.AttributeSet"
class ArrayList(JavaBridgeObject):
__nativeclass__ = "java.util.ArrayList"
add = JavaMethod(int, object)
addAll = JavaMethod("java.util.Collection")
remove = JavaMethod(int)
removeAll = JavaMethod("java.util.Collection")
clear = JavaMethod()
class Executor(JavaBridgeObject):
__nativeclass__ = "java.util.concurrent.Executor"
execute = JavaMethod("java.lang.Runnable")
class Executors(JavaBridgeObject):
__nativeclass__ = "java.util.concurrent.Executors"
newSingleThreadExecutor = JavaStaticMethod(returns="java.util.concurrent.Executor")
class ColorDrawable(JavaBridgeObject):
__nativeclass__ = "android.graphics.drawable.ColorDrawable"
__signature__ = ["android.graphics.Color"]
class Uri(JavaBridgeObject):
__nativeclass__ = "android.net.Uri"
parse = JavaStaticMethod(str, returns="android.net.Uri")
class Handler(JavaBridgeObject):
__nativeclass__ = "android.os.Handler"
__signature__ = ["android.os.Looper"]
class HandlerThread(JavaBridgeObject):
__nativeclass__ = "android.os.HandlerThread"
__signature__ = [str]
getLooper = JavaMethod(returns="android.os.Looper")
getThreadId = JavaMethod(int)
quit = JavaMethod(returns=bool)
quitSafely = JavaMethod(returns=bool)
run = JavaMethod()
join = JavaMethod()
interrupt = JavaMethod()
start = JavaMethod()