Commit Graph

35 Commits

Author SHA1 Message Date
Mis012
4628cfc66d /api-impl-jni: remove remains of experimental ninepatch implementation, will use skia 2023-09-16 16:30:14 +02:00
Mis012
897a1e68a4 TextView: implement setTextColor
also uncomment Resources.getCachedColorStateList
2023-09-12 13:37:41 +02:00
Mis012
1e47824a79 src/api-impl: use skia instead of cairo
Using the C API provided by SkiaSharp's skia fork instead of using cairo
significantly improves performance. The API is also closer to the android
Canvas API, which makes the implementation more straightforward.
2023-09-12 13:37:41 +02:00
Julian Winkler
255eed3e59 setLayoutParams(): better match Androids behaviour
View.setGravity() specifies gravity of children, not of the view itself
LayoutParams.weight > 0 should cause expansion of widget
2023-09-08 20:10:45 +02:00
Julian Winkler
a27cb27638 ScrollView: use GtkScrolledWindow for implementation 2023-09-08 18:31:02 +02:00
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
30b990f60a EditText: implement addTextChangedListener() 2023-09-01 16:05:26 +02:00
Julian Winkler
071538de02 FrameLayout: add missing removeView JNI function 2023-09-01 16:05:26 +02:00
Julian Winkler
6c2a3adae6 LinearLayout: default to horizontal orientation 2023-09-01 12:46:02 +02:00
Julian Winkler
295d9dfda3 LinearLayout: handle overwritten performClick() method
This is needed to make TabLayout functional
2023-09-01 12:19:45 +02:00
Julian Winkler
b861c86f0d FrameLayout: fix inserting child at last index 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
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
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
def91a688d handle overwritten onDraw function in WrapperWidget
This makes it easy to support for example ImageView with custom
onDraw function
2023-08-08 14:18:20 +02:00
Julian Winkler
8c1e98b09c GLSurfaceView: fix eglGetDisplay for Wayland only sessions
EGL_DEFAULT_DISPLAY always tries to use X11
2023-08-08 10:54:20 +02:00
Julian Winkler
1a8e198e05 make RelativeLayout vertical by default and vexpand GLSurfaceView 2023-06-18 11:31:03 +02:00
Julian Winkler
c21d8532bc ImageView: use GtkPicture and actually show the image
GtkImage is intended for icons GtkPicture fits better
2023-06-18 11:28:40 +02:00