android :: NativeActivity :: content_view=
Set the main layout of this activityandroid :: NativeActivity :: defaultinit
android :: NativeActivity :: finish
Notify the OS that this activity is done and should be closedandroid :: NativeActivity :: insert_root_layout
Insert a single layout as the root of the activity windowandroid :: NativeActivity :: orientation
android :: NativeActivity :: run_on_ui_thread
Executetask.main
on the UI thread when possible
android :: NativeActivity :: show_fragment
Replace the currently visible fragment, if any, withnative_fragment
android $ NativeActivity :: SELF
Type of this instance, automatically specialized in every classcore :: Pointer :: address_is_null
Is the address behind this Object at NULL?jvm :: JavaObject :: as_exception
jvm :: JavaObject :: as_http_response
android :: NativeContext :: assets
Get the native AssetsManager of the application, used to initialize the nit's AssetManagercore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
android :: NativeActivity :: content_view=
Set the main layout of this activityandroid :: NativeActivity :: defaultinit
android :: NativeContext :: defaultinit
core :: Pointer :: defaultinit
core :: Object :: defaultinit
jvm :: JavaObject :: defaultinit
android :: NativeActivity :: finish
Notify the OS that this activity is done and should be closedandroid :: NativeActivity :: insert_root_layout
Insert a single layout as the root of the activity windowjvm :: JavaObject :: is_exception
jvm :: JavaObject :: is_http_response
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Pointer :: native_equals
jvm :: JavaObject :: new_global_ref
Returns a global reference to the Java object behind this referenceandroid :: NativeActivity :: orientation
core :: Object :: output_class_name
Display class name on stdout (debug only).android :: NativeContext :: package_name
Get the package name of the applicationjvm :: JavaObject :: pop_from_local_frame
Pops the current local reference frame and return a valid reference to selfjvm :: JavaObject :: pop_from_local_frame_with_env
Java implementation ofpop_from_local_frame
core :: Pointer :: premultiply_alpha
Multiply RGB values by their alpha valueandroid :: NativeContext :: resources
Get the native ResourceManager of the application, used to initialize the nit's ResourceManagerandroid :: NativeActivity :: run_on_ui_thread
Executetask.main
on the UI thread when possible
android :: NativeActivity :: show_fragment
Replace the currently visible fragment, if any, withnative_fragment
android :: NativeContext :: stop_service
jvm :: JavaObject :: to_java_string
JavaString
representation of self
using Java's toString
android :: NativeContext :: wifi_manager
Handle to the WiFi system serviceandroid :: NativeNativeActivity
Android SDK'sandroid.app.NativeActivity
.
# An activity, a single, focused thing a user can do on Android
extern class NativeActivity in "Java" `{ android.app.Activity `}
super NativeContextWrapper
# HACK for bug #845
redef fun new_global_ref: SELF import sys, Sys.jni_env `{
Sys sys = NativeActivity_sys(self);
JNIEnv *env = Sys_jni_env(sys);
return (*env)->NewGlobalRef(env, self);
`}
# Notify the OS that this activity is done and should be closed
fun finish in "Java" `{ self.finish(); `}
# Execute `task.main` on the UI thread when possible
fun run_on_ui_thread(task: Task) import Task.main in "Java" `{
final nit.app.NitObject final_task = task;
Runnable runnable = new Runnable() {
@Override
public void run() {
Task_main(final_task);
}
};
self.runOnUiThread(runnable);
`}
end
lib/android/activities.nit:30,1--55,3
redef extern class NativeActivity
# Set the main layout of this activity
fun content_view=(layout: NativeViewGroup) in "Java" `{
self.setContentView(layout);
`}
end
lib/android/ui/native_ui.nit:40,1--46,3
redef class NativeActivity
private fun remove_title_bar in "Java" `{
self.requestWindowFeature(android.view.Window.FEATURE_NO_TITLE);
`}
# Insert a single layout as the root of the activity window
private fun insert_root_layout(root_layout_id: Int)
in "Java" `{
android.widget.FrameLayout layout = new android.widget.FrameLayout(self);
layout.setId((int)root_layout_id);
self.setContentView(layout);
`}
# Replace the currently visible fragment, if any, with `native_fragment`
private fun show_fragment(root_layout_id: Int, native_fragment: Android_app_Fragment)
in "Java" `{
android.app.FragmentTransaction transaction = self.getFragmentManager().beginTransaction();
transaction.replace((int)root_layout_id, native_fragment);
transaction.commit();
`}
end
lib/android/ui/ui.nit:43,1--64,3
redef class NativeActivity
private fun window_height: Int in "Java" `{
android.view.View view = self.getWindow().getDecorView();
return view.getBottom() - view.getTop();
`}
private fun window_width: Int in "Java" `{
android.view.View view = self.getWindow().getDecorView();
return view.getRight() - view.getLeft();
`}
private fun orientation: Int in "Java" `{
return self.getResources().getConfiguration().orientation;
`}
end
lib/gamnit/gamnit_android.nit:292,1--307,3