Commit Graph

160 Commits

Author SHA1 Message Date
Julian Winkler
960930a348 Add some stubs needed by android material library 2023-08-23 12:39:49 +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
faf4a3281e add initial support for fragments
Fragments are not added to the View hierarchy yet. Only the lifecycle
callbacks are implemented
2023-08-22 22:30:06 +02:00
Julian Winkler
83cc2e5991 load the default Application theme on startup 2023-08-22 22:30:06 +02:00
Julian Winkler
34d214e9ae AssetManager.java: fill indices array when loading TypedArray
This is needed for TypedArray.getIndexCount() and related functions
2023-08-22 22:30:03 +02:00
Julian Winkler
9bd5593657 Activity: make startActivityForResult() functional 2023-08-22 22:29:20 +02:00
Julian Winkler
3399c84e84 fix multi Activity support
jobjects have to be compared with env->IsSameObject()
and each Activity needs its own Window instance.
The GtkWindow is still shared between all Activities
2023-08-22 22:29:20 +02:00
Julian Winkler
3fd81baeaf AssetManager: fix loading without merge
use cookie values to find correct StringPool
2023-08-22 22:29:03 +02:00
Julian Winkler
2b97e3bd57 AssetManager.java: iterate tableBlocks instead of merging
The merging process is too slow
2023-08-22 19:44:09 +02:00
Julian Winkler
6547e66d4f implement android.app.AlertDialog using GtkDialog 2023-08-22 19:39:57 +02:00
Julian Winkler
fac8e6e7b5 fix Build.SDK constant 2023-08-22 19:39:57 +02:00
Julian Winkler
447041066e add StatFs class from AOSP 2023-08-22 19:39:57 +02:00
Julian Winkler
44be3ff197 copy Color.parseColor() from AOSP 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
a8e39cd613 get Application class from AndroidManifest.xml and call onCreate() 2023-08-22 15:53:09 +02:00
Julian Winkler
c60e97f13f implement obtainStyledAttributes() functions properly 2023-08-22 15:51:13 +02:00
Mis012
aa5d9b16df api-impl/android/media/AudioTrack: make this a stub again for now, it's kinda broken 2023-08-12 13:10:34 +02:00
Mis012
4a1159f5cb api-impl: add misc stubs 2023-08-12 13:09:33 +02:00
Mis012
a1aa38c7b8 api-impl/android/content/pm/PackageInfo: make some items not stubs 2023-08-12 13:06:10 +02:00
Mis012
c936333c74 src/main-executable: show actual package name as window title, preparation for showing app icon, re-add some missing stuff 2023-08-12 13:05:34 +02:00