Repository navigation
Conversation
|
KOReader half is koreader/koreader#16114 (Draft). Please merge this launcher PR first; the main-repo PR will bump the submodule to the official merge commit afterwards. |
| || MODEL == STR_TOLINO && (DEVICE == "tolino_vision2" || DEVICE == STR_NTX) | ||
| -> Id.TOLINO | ||
|
|
||
| // iReader Neo 3 Ultra |
There was a problem hiding this comment.
Will do. The Id enum is already in the right place; I'll move the detection branch to sit after InkPalm Plus and before JDRead.
| if (DeviceInfo.ID == DeviceInfo.Id.IREADER_NEO3_ULTRA) { | ||
| try { | ||
| val cls = Class.forName("android.eink.view.HWSurfaceView") | ||
| val created = cls.getConstructor(Context::class.java).newInstance(this) as SurfaceView | ||
| Log.i(TAG_SURFACE, "Using official HWSurfaceView") | ||
| return created | ||
| } catch (t: Throwable) { | ||
| Log.w(TAG_SURFACE, "HWSurfaceView unavailable, fallback NativeSurfaceView", t) | ||
| } | ||
| } |
There was a problem hiding this comment.
I wouldn't think this belongs in this file but could you briefly explain what it's for first?
There was a problem hiding this comment.
On this device the official PAGE_H ripple is posted with EPDCDevice.nativePostCommand against android.eink.view.HWSurfaceView. KOReader's default NativeSurfaceView is a normal SurfaceView, so the same command never hits the OEM surface and the animation does not run.
That is why the window has to be created as HWSurfaceView (with a fallback if the class is missing). I put the Class.forName call in MainActivity only because that is where the SurfaceView is constructed today.
I agree it should not live as an IREADER_NEO3_ULTRA branch in this file. I'll move construction to IReaderNeo3EPDController (or similar) and have MainActivity call that helper.
There was a problem hiding this comment.
Okay, in that case please add that in a comment when you do. It can be very brief, just something like "HWSurfaceView is needed for EPDCDevice.nativePostCommand PAGE_H ripple"
1063dfe to
ed5c899
Compare
| // The following two lines brings SurfaceView to "top" in order for NGL4 refresh to work, should be compatible with other controllers | ||
| view?.setZOrderOnTop(true) | ||
| view?.holder?.setFormat(PixelFormat.TRANSPARENT) | ||
| if (DeviceInfo.ID == DeviceInfo.Id.IREADER_NEO3_ULTRA) { |
There was a problem hiding this comment.
If many devices require new views, maybe instead of a device.needsView flag, imho it would be better to have something like device.viewType = {0: no view, 1: transparent, 2: opaque, and so forth} and change the interface for all the drivers. @Frenzie
There was a problem hiding this comment.
Sure, sounds good. I'm not sure if any other devices would need it though?
There was a problem hiding this comment.
Theoretically, the new reader product from iReader can reuse this logic if the hardware remains the same. However, I suggest limiting the submission to the Neo3Ultra this time, as I cannot test other devices or know their specific features, nor can I guarantee the effectiveness. If other similar products are added later, only minor modifications for adaptation will be needed. What do you think?
- Detect RM06L as IREADER_NEO3_ULTRA (alphabetical order) - EPD controller using the OEM HWSurfaceView so the PAGE_H water-ripple posted via EPDCDevice.nativePostCommand hits the right surface - Dual-channel LM3630A frontlight controller (A = warm, B = cool) with SystemUI reading-light provider sync - Expose einkPrepareRipple to Lua
ed5c899 to
63c655e
Compare
| import androidx.core.app.ActivityCompat | ||
| import androidx.core.content.ContextCompat | ||
| import org.koreader.launcher.device.Device | ||
| import org.koreader.launcher.device.epd.IReaderNeo3EPDController |
There was a problem hiding this comment.
I think it would be better not to do it this way as it could lead to poor code style.
There was a problem hiding this comment.
Actually, I think so too. Let me make some adjustments.
MainActivity is shared by every device, so it must not reference a single model's EPD controller directly. Move createSurface/usesOpaquePixelFormat/ prepareRipple into EPDInterface as optional methods with neutral defaults, override them in IReaderNeo3EPDController, and call them through device.epd. The redundant DeviceInfo check inside the controller is dropped: EPDFactory only instantiates it for the matching device id.
Add first-party support for the iReader Neo 3 Ultra (RM06L).
This is the launcher half of the device port. A follow-up koreader PR will bump the submodule and add the Lua page-turn menu after this merges.
Device
Changes
DeviceInfoEPDCDevice.nativePostCommandHWSurfaceViewso refreshes go through the official Surface patheinkPrepareRippleFFI hook inandroid.luaKeeping MainActivity device-agnostic
MainActivityis shared by every device, so it must not reference one model's controller directly. The iReader-specific surface and ripple behaviour is exposed as optionalEPDInterfacemethods with neutral defaults:createSurface(context): SurfaceView?→null(falls back toNativeSurfaceView)usesOpaquePixelFormat(): Boolean→falseprepareRipple(effect: Int)→ no-opIReaderNeo3EPDControlleroverrides the three, andMainActivityonly talks todevice.epd. The defaults are exactly what the previous per-device guards returned, so every other controller keeps its behaviour.Tested on a Neo 3 Ultra (RM06L-CKDW). Frontlight, warmth, and PAGE_H ripple work in portrait and landscape.
This does not change other devices.
This change is?