Commit Graph

868 Commits

Author SHA1 Message Date
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
Julian Winkler
520d153c55 call View.onAttachedToWindow() method 2023-10-14 18:29:33 +02:00
Julian Winkler
f4251af2a2 Add more AudioTrack APIs needed for exoplayer.
Also fix compiler warnings
2023-10-14 18:29:33 +02:00
Julian Winkler
b340032e9f impement android.media.MediaCodec using libavcodec
The current implementation requires a VA-API driver and a Wayland
compositor with YUV-buffer support. GNOME supports YUV-buffers
since the recent version 45 release
2023-10-14 18:29:33 +02:00
Julian Winkler
23c0b006ef use handle_cache for Looper methods
These methods need to be called very often
2023-10-14 18:29:33 +02:00
Julian Winkler
a29ba61f30 implement SystemClock.elapsedRealtime() 2023-10-14 18:29:33 +02:00
Julian Winkler
b88707592a add more stubs to make exoplayer not crash 2023-10-14 18:29:33 +02:00
Julian Winkler
c830abc5f3 add more API stubs for NewPipe 2023-10-14 18:29:33 +02:00
Julian Winkler
2013024971 Context: implement startService() and bindService() 2023-10-14 18:29:33 +02:00
Julian Winkler
299a474aa0 move startActivity function to Context class
This way it can also be called on Application Context
2023-10-14 18:29:33 +02:00
Julian Winkler
55a1ff2cc5 create ContentProvider from AndroidManifest.xml
This is required for androidx startup library.
Only onCreate method is called for now.
2023-10-14 18:29:33 +02:00
Julian Winkler
f5fc993484 add APIs needed for non legacy NewPipe version 2023-10-14 18:29:33 +02:00
Julian Winkler
399cf87254 fix some NullPointerExceptions with Flower Finder test apk 2023-10-14 10:01:01 +00:00
Julian Winkler
37d9b13470 View.onMeasure: handle MEASURE_SPEC_AT_MOST properly
We decide between simple widgets which handles MEASURE_SPEC_AT_MOST the same way as
MEASURE_SPEC_EXACTLY, and complex widgets which handles MEASURE_SPEC_AT_MOST by measuring the content
2023-10-14 10:01:01 +00:00