Commit Graph

946 Commits

Author SHA1 Message Date
Julian Winkler
eac22aaa64 Resources.getSystem(): just return application resoources 2023-08-27 23:14:00 +02:00
Julian Winkler
d81c6800b2 add JNI implementation of android.database.SQLiteConnection
This is based on the implementation from https://www.sqlite.org/android,
which is equal to the AOSP implementation besides not depending private
Android APIs.
The code has been rewritten from C++ to C.
2023-08-27 11:40:46 +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
b861c86f0d FrameLayout: fix inserting child at last index 2023-08-23 14:52:56 +02:00
Julian Winkler
0f7548f189 refactor Dialog implementation to support custom content 2023-08-23 14:52:56 +02:00
Julian Winkler
029b26beb2 main.c: window size needs to be set before calling set_up_handle_cache()
the Context class init creates a static DisplayMetric
2023-08-23 14:52:56 +02:00
Julian Winkler
e694973a1f ViewGroup: add child View at correct index 2023-08-23 14:52:56 +02:00
Julian Winkler
28cd0006bc some fixes to make NewPipe not crash when layouting 2023-08-23 14:52:56 +02:00
Julian Winkler
1474d8d3e1 TextView: get textSize from attributes 2023-08-23 12:39:55 +02:00
Julian Winkler
c4b7bdc63d ViewGroup: handle scroll events 2023-08-23 12:39:55 +02:00
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