You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
Dialog: some fixes for CTS
Most Dialog test still fail, because we don't handle KeyEvents
This commit is contained in:
@@ -50,3 +50,9 @@ JNIEXPORT void JNICALL Java_android_app_Dialog_nativeClose(JNIEnv *env, jobject
|
||||
GtkWindow *dialog = GTK_WINDOW(_PTR(ptr));
|
||||
gtk_window_close(dialog);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_android_app_Dialog_nativeIsShowing(JNIEnv *env, jobject this, jlong ptr)
|
||||
{
|
||||
GtkWindow *dialog = GTK_WINDOW(_PTR(ptr));
|
||||
return gtk_widget_is_visible(GTK_WIDGET(dialog));
|
||||
}
|
||||
|
||||
@@ -47,6 +47,14 @@ JNIEXPORT void JNICALL Java_android_app_Dialog_nativeShow
|
||||
JNIEXPORT void JNICALL Java_android_app_Dialog_nativeClose
|
||||
(JNIEnv *, jobject, jlong);
|
||||
|
||||
/*
|
||||
* Class: android_app_Dialog
|
||||
* Method: nativeIsShowing
|
||||
* Signature: (J)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL Java_android_app_Dialog_nativeIsShowing
|
||||
(JNIEnv *, jobject, jlong);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
package android.app;
|
||||
|
||||
public class DatePickerDialog {
|
||||
import android.content.Context;
|
||||
|
||||
public class DatePickerDialog extends Dialog {
|
||||
|
||||
public DatePickerDialog(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public interface OnDateSetListener {}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ public class Dialog implements Window.Callback, DialogInterface {
|
||||
private native void nativeSetContentView(long ptr, long widget);
|
||||
private native void nativeShow(long ptr);
|
||||
private native void nativeClose(long ptr);
|
||||
private native boolean nativeIsShowing(long ptr);
|
||||
|
||||
private Context context;
|
||||
private Window window;
|
||||
@@ -90,7 +91,7 @@ public class Dialog implements Window.Callback, DialogInterface {
|
||||
}
|
||||
|
||||
public boolean isShowing() {
|
||||
return false;
|
||||
return nativeIsShowing(nativePtr);
|
||||
}
|
||||
|
||||
public void dismiss() {
|
||||
|
||||
Reference in New Issue
Block a user