Commit Graph

113 Commits

Author SHA1 Message Date
Julian Winkler
f968bcd7c4 add menu APIs and use Activity as Window.Callbacks implementation 2023-09-01 12:34:57 +02:00
Julian Winkler
ad83271080 add more Animation APIs and call onAnimationEnd()
Directly calling onAnimationEnd() skips the animation and directly sets
the target values
2023-09-01 12:30:27 +02:00
Julian Winkler
fb1a07967e copy android.widget.Scroller from AOSP and implement missing scroll APIs
This is needed to make ViewPager functional
2023-09-01 12:13:24 +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
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
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
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
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
Mis012
4a1159f5cb api-impl: add misc stubs 2023-08-12 13:09:33 +02:00
Julian Winkler
952df5d1fd LayoutParams: actually parse attributes 2023-08-08 14:18:20 +02:00
Julian Winkler
5c6b83e8f1 LayoutInflator: support <include/> tags 2023-08-08 14:18:20 +02:00
Julian Winkler
6b79adb2c3 add missing Context attribute to all View constructors 2023-08-08 14:18:20 +02:00
Julian Winkler
520569f7c7 implement View.invalidate() 2023-08-08 13:35:47 +02:00
Julian Winkler
def2804a85 add AccelerateInterpolator based on AOSP version 2023-08-08 13:35:47 +02:00
Mis012
ffb2855a05 api-impl: add misc stuff needed by Teeter
note that Teeter still needs more stuff before it will work
2023-07-25 14:29:50 +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
Mis012
7ac5587fca api-impl/android/view/LayoutInflater.java: load layout XMLs directly from apk 2023-06-23 18:35:00 +02:00
Mis012
0a9591c474 src/api-impl: fix up code style, mainly for code imported from AOSP
used the following (plus manual edits):
`clang-format --style="{BasedOnStyle: LLVM, IndentWidth: 8, UseTab: Always, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: true, ColumnLimit: 0}`
2023-06-22 11:45:46 +02:00
Julian Winkler
3709e30f64 load layout XMLs directly from apk file 2023-06-21 22:38:08 +02:00
Julian Winkler
0454dcbfd5 stub some APIs for Flappy Bird, mostly webview related 2023-06-18 11:28:40 +02:00
Mis012
4dd31731f9 src/api-impl: misc stubbing 2023-01-09 12:07:57 +01:00