Julian Winkler
3b6e4dc217
Always use addView() and removeView() implementation from ViewGroup
...
This makes sure, that the index argument is handled correctly everywhere
2023-09-01 16:05:26 +02:00
Julian Winkler
a35879c633
RelativeLayout: copy AOSP implementation
...
As we already support custom ViewGroups, there is no need to reimplement
this highly complex class.
2023-09-01 16:05:26 +02:00
Julian Winkler
ceb5df9d39
implement BitmapFactory.decodeStream() using gdk_pixbuf_new_from_stream
...
The java InputStream is wrapped into a custom GInputStream
implementation
2023-09-01 16:05:26 +02:00
Julian Winkler
30b990f60a
EditText: implement addTextChangedListener()
2023-09-01 16:05:26 +02:00
Julian Winkler
f968bcd7c4
add menu APIs and use Activity as Window.Callbacks implementation
2023-09-01 12:34:57 +02:00
Julian Winkler
253932f985
rewrite android.database.CursorWindow in pure java
...
there is no need to implement it in native code, as we don't want to
pass this between processes
2023-08-27 11:17:33 +02:00
Julian Winkler
2e0c18d755
add complete java side of sqlite implementation
...
Mostly taken from https://www.sqlite.org/android which is forked from
AOSPs implementation
2023-08-27 11:17:33 +02:00
Julian Winkler
0f7548f189
refactor Dialog implementation to support custom content
2023-08-23 14:52:56 +02:00
Julian Winkler
ca975a0e7c
add support for ViewGroups with custom onLayout()
...
A custom GtkLayoutManager is set to these objects, which calls into the
java handlers when measure or layout is requested.
Androids onMeasure method is quite different from GTKs measure method,
because Android already defines the final size during onMeasure.
Therefore, we call onMeasure from GTKs allocate callback instead of the
measure callback.
2023-08-23 12:39:10 +02:00
Julian Winkler
4434de4a58
implement android.widget.EditText using GtkEntry
2023-08-23 11:47:05 +02:00
Julian Winkler
f9a85017c1
implement android.widget.ImageButton using GtkButton
2023-08-23 11:47:05 +02:00
Julian Winkler
f2e71cd50f
implement android.widget.Button using GtkButton
2023-08-23 11:47:05 +02:00
Julian Winkler
36b6132324
fix reference counting for GtkWidgets created from java
...
GtkWidgets extend GInitiallyUnowned and are automatically freed when
removing from parent widget. We need to add an extra reference, to make
sure the object keeps alive as long as the java widget has a reference
to it
2023-08-23 11:47:05 +02:00
Julian Winkler
6547e66d4f
implement android.app.AlertDialog using GtkDialog
2023-08-22 19:39:57 +02:00
Julian Winkler
4d90002ec6
Simplify native interface of widget implementations
...
Makes it easier to overwrite behavior in subclasses. Have a fallback
implementation for ViewGroup.
Save some _GET_LONG_FIELD / _SET_LONG_FIELD calls by directly passing
the native pointers to and from native methods.
2023-08-22 15:53:09 +02:00
Julian Winkler
82744e9e5e
add bunch of new java APIs: mostly stubs or copied from AOSP
...
Many of these classes are only needed to be subclassed by androidx
support library, which is used in many android apps
2023-08-22 15:53:09 +02:00
Julian Winkler
c60e97f13f
implement obtainStyledAttributes() functions properly
2023-08-22 15:51:13 +02:00
Mis012
4a1159f5cb
api-impl: add misc stubs
2023-08-12 13:09:33 +02:00
Julian Winkler
18ca242096
support multiple Activities
2023-08-11 18:15:19 +02:00
Julian Winkler
4491de7f63
MessageQueue: integrate with glib main loop
...
Adds a special treatment for the main Looper to not block in java code,
but instead return to glib managed thread loop. Timeouts in the mainloop
are now handled using g_timeout_add_full().
Also defer Activity construction, so that every thing is set up properly
when the constructor runs.
2023-08-08 14:18:20 +02:00
Julian Winkler
77459e34e0
add AssetManager.getArrayIntResource and Context.getString
2023-08-08 14:18:20 +02:00
Julian Winkler
696e0ce714
implement LocationManager and orientation sensor using libportal
2023-08-08 14:18:20 +02:00
Julian Winkler
c72f3ba7d2
Canvas: use correct destination width and height
2023-08-08 14:18:20 +02:00
Julian Winkler
520569f7c7
implement View.invalidate()
2023-08-08 13:35:47 +02:00
Mis012
08998b0076
make Looper, Handler, and MessageQueue work properly
...
this for example makes Unity apps not steal the main thread,
hanging Gtk.
2023-07-25 14:27:21 +02:00