Julian Winkler
4bce3544dd
WrapperWidget: handle View.computeScroll()
...
Currently the scrolling is purely visual.
2023-11-02 23:30:21 +01:00
Julian Winkler
0a8b8a3874
use AndroidLayout class also in View implementation
...
drop the onMeasure hack from WrapperWidget
2023-11-02 08:20:19 +01:00
Julian Winkler
3c03223085
android_layout_measure(): refactor to respect LayoutParams
...
This is needed when a Java widget gets measured from GTK
2023-11-02 08:20:13 +01:00
Julian Winkler
8b6de0e83a
move AndroidLayout class to own file
2023-11-01 17:55:02 +01:00
Julian Winkler
3de842b1d8
enable onTouchEvent for ViewGroups and add some stubs
2023-11-01 17:54:59 +01:00
Mis012
065fd96308
api-impl-jni: make invalidate() work inside the draw callback
...
this lets us remove the tick callback, and only call onDraw
when it's actually necessary
2023-10-31 23:14:52 +01:00
Mis012
bcd588446d
api-impl-jni/views/android_view_View.c: handle replacing existing onclick/ontouch listener
2023-10-31 16:00:35 +01:00
Mis012
0fc90e39c7
api-impl-jni/views/android_view_ViewGroup.c: set GTK_OVERFLOW_HIDDEN by default
2023-10-31 13:39:39 +01:00
Mis012
b714dad281
api-impl/android/view/View: apply background from attrs
2023-10-30 20:45:08 +01:00
Mis012
fb3149b088
api-impl/android/content/res/Resources: fix trailing whitespace
2023-10-30 18:49:32 +01:00
Mis012
d483828236
android/view/View: naive implementation for setBackgroundColor
2023-10-30 17:28:38 +01:00
Mis012
0b0cfed345
misc: fix stuff up to make SDL example work again
...
it still behaves weirdly, should probably find some
other example since I don't trust my own code.
2023-10-29 22:48:02 +01:00
Julian Winkler
9025142bdd
AssetManager: speed up XML inflation using HashMap caching
...
This makes XML inflation around 10 times faster. Inflating a layout XML
with one TextView and one ImageView now takes 4 ms instead of 40 ms
2023-10-29 15:28:06 +01:00
Julian Winkler
3bdffe7ce9
View: prevent redundant measuring for performance reasons
...
No need to remeasure or relayout when nothing has changed
2023-10-29 15:28:06 +01:00
Julian Winkler
4f9e672819
View: handle all invalidate methods
2023-10-29 15:28:06 +01:00
Julian Winkler
e23516ee43
fix invalid cast warning when calling setTextColor() on EditText
...
the implementation works fine for all kind of GtkWidgets no need to cast
to GtkLabel class
2023-10-29 15:28:06 +01:00
Julian Winkler
3e7f07ec71
onTouchEvent: pass return value to GTK
...
This allows to propagate unhandled events to the next handler
2023-10-29 15:28:06 +01:00
Julian Winkler
469d47091c
Window: fix issue with multi Activity support
...
each Activity has its own Window object. Therefore the check if the
contentView has changed needs to be in the common native window
2023-10-29 15:28:06 +01:00
Julian Winkler
a2381f4721
fix compiler warnings in WrapperWidget and View
2023-10-29 15:23:11 +01:00
Mis012
9ef2151c5e
GLSurfaceView: remove old implementation, import the one from AOSP
...
Now that we have a reasonably well working SurfaceView implementation,
it is actually cleaner to just implement GLSurfaceView the way AOSP
does. In fact, their code doesn't have any weird dependencies, and
can mostly be used as-is.
The AOSP code is pure Java, which means we had to implement some
EGL wrappers.
This change fixes issues with Wayland (it only ever worked because
the pbuffers were allocated using an XWayland EGLDisplay), and
with resizing (which we simply didn't support), all while getting
rid of quite some (arguably not very readable) LoC.
2023-10-20 20:54:37 +02:00
Mis012
621cb866c1
api-impl{-jni}: fix code style issues missed during review
2023-10-17 21:57:48 +02:00
Mis012
4a0755c6e0
api-impl{-jni}: make view.onTouchEvent work, misc stuff to make input work for Unity games
...
onTouchEvent was previously incorrectly handled in GLSurfaceView; move it
to View so that it works properly with any of it's descendants.
This is done by reusing the existing setOnTouchListener implementation
and changing it to use GtkEventControllerLegacy which provides motion
events.
Technically some of the code is in WrapperWidget.c since every widget
calls wrapper_widget_set_jobject and we already have related code
there.
2023-10-17 21:33:59 +02:00
Mis012
58fa4b5590
api-impl/android/widget/Toolbar: add a stub widget
2023-10-16 20:19:05 +02:00
Mis012
9a78412155
api-impl-jni/audio/android_media_AudioTrack.c: 'default' as a PCM device seems to work nicely
...
also get rid of broken case for !PCM_DEVICE
2023-10-15 20:21:08 +02:00
Julian Winkler
4130e252cc
fixes to make Picasso Image Loader work
...
This library is used by newer NewPipe versions
2023-10-14 18:29:33 +02:00