From 0a169ddbcda2df49636b7e39224cdc8ef16ec69e Mon Sep 17 00:00:00 2001 From: Feodor0090 <79257300125@ya.ru> Date: Sun, 10 Oct 2021 21:50:05 +0300 Subject: [PATCH] Use prerendered slider body, if it exists --- njtai/Application Descriptor | 2 +- njtai/build.properties | 1 + njtai/res/slider.png | Bin 0 -> 3925 bytes njtai/src/njtai/m/ui/View.java | 28 +++++++++++++++++++++++++--- 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 njtai/res/slider.png diff --git a/njtai/Application Descriptor b/njtai/Application Descriptor index 053adb1..f9f769d 100644 --- a/njtai/Application Descriptor +++ b/njtai/Application Descriptor @@ -1,6 +1,6 @@ Nokia-MIDlet-Category: Internet Main-Class: njtai.d.NJTAID -MIDlet-Version: 1.1.42 +MIDlet-Version: 1.1.43 Class-Path: . MIDlet-Info-URL: https://github.com/Feodor0090/njtai Nokia-MIDlet-On-Screen-Keypad: no diff --git a/njtai/build.properties b/njtai/build.properties index 54b4b37..1bba5d4 100644 --- a/njtai/build.properties +++ b/njtai/build.properties @@ -27,6 +27,7 @@ S40_5th_Edition_SDK.includes=res/nhentai.png\ ,res/text/page_en.txt\ ,res/text/page_ru.txt\ ,src/njtai/d/Main.java\ +,res/slider.png\ S40_5th_Edition_SDK.excludes=\ diff --git a/njtai/res/slider.png b/njtai/res/slider.png new file mode 100644 index 0000000000000000000000000000000000000000..8992cb544e8b9117d706d4cce96a93011f75e5ac GIT binary patch literal 3925 zcmcIndpJ~iA0HHxc-gSX+Q!f}V(v4T$t4Vt+()9wT+WQi+?pAeaY?#om2HL0N-44B zl1j>5?8>@dc8Mfyq)0SKvetWa@$U0JyZi1x?|Ghc&hMPx=ll77zL)cTo^#U6W1G6_ zdQ}JnqVDQK@d5A7;E8}LgIC9nq$2RPM(7eChCtS8EuRVyS*9KYvbvE&-6h%OzJtsV z@K7|SfDWLdctQ{jfmqu`32BTlKmwx!Y!2TBK3P!%hjExTaDSpZ#$D(LgmPS>MSyR# z2bB>W#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IHVKUw)ocI4Bp{727IyXxvoDY1A(B*1Oyx8~-I% z=d5Z+V7884s!LF=PCzc=6uqWPx4LtQYr}MIoS~R>v%OTGt%(k(P;5t` z__6tKt?;oPL3@XeD^4CwJw-ruslQMeIy7Yb7I6g8n?J9No>U8dZXPU=o<2WHy`Eum4Bs;6VAoZo?PC}A4$FAw@^lzKKBCO2M)j!9 z9ynJzXyn6^4RDuoo}RV2KM;%wX`gkgNz{*x_OOH&o+?2d=+qF^6ZXEn7%u0Xc%3~h zx+6}s{#vi_LBaOQRmY?ogN8S)k!fZi?rCjlR2m;)g;tL~V2qE98%-4v<)xitr*?=9 zT;f%5c?;}`)oOFA4;-%T)*PwOoEJgmF2nmawk;{TKE0-sd0kFh{_%Bn@}LwsgdF-e DVx@P= literal 0 HcmV?d00001 diff --git a/njtai/src/njtai/m/ui/View.java b/njtai/src/njtai/m/ui/View.java index 265d971..9e8d781 100644 --- a/njtai/src/njtai/m/ui/View.java +++ b/njtai/src/njtai/m/ui/View.java @@ -1,10 +1,13 @@ package njtai.m.ui; +import java.io.IOException; + import javax.microedition.lcdui.Alert; import javax.microedition.lcdui.AlertType; import javax.microedition.lcdui.Displayable; import javax.microedition.lcdui.Font; import javax.microedition.lcdui.Graphics; +import javax.microedition.lcdui.Image; import njtai.NJTAI; import njtai.m.NJTAIM; @@ -18,8 +21,16 @@ */ public abstract class View extends ViewBase { + Image slider; + public View(ExtMangaObj emo, Displayable prev, int page) { super(emo, prev, page); + try { + slider = Image.createImage("/slider.png"); + } catch (IOException e) { + e.printStackTrace(); + slider = null; + } } protected void paintHUD(Graphics g, Font f, boolean drawZoom, boolean drawPages) { @@ -109,9 +120,20 @@ private void drawZoomSlider(Graphics g, Font f) { int x = (int) (25 + ((getWidth() - 50) * (zoom - 1) / 4)); // slider's body - for (int i = 0; i < 10; i++) { - g.setColor(NJTAI.blend(touchHoldPos == 8 ? 0x357EDE : 0x444444, 0xffffff, i * 255 / 9)); - g.drawRoundRect(25 - i, 25 - i, getWidth() - 50 + (i * 2), i * 2, i, i); + if (slider == null) { + for (int i = 0; i < 10; i++) { + g.setColor(NJTAI.blend(touchHoldPos == 8 ? 0x357EDE : 0x444444, 0xffffff, i * 255 / 9)); + g.drawRoundRect(25 - i, 25 - i, getWidth() - 50 + (i * 2), i * 2, i, i); + } + } else { + int y = touchHoldPos == 8 ? 20 : 0; + g.drawRegion(slider, 0, y, 35, 20, 0, 0, 15, 0); + g.drawRegion(slider, 35, y, 35, 20, 0, getWidth() - 35, 15, 0); + g.setClip(35, 0, getWidth() - 70, 50); + for (int i = 35; i < getWidth() - 34; i += 20) { + g.drawRegion(slider, 25, y, 20, 20, 0, i, 15, 0); + } + g.setClip(0, 0, getWidth(), getHeight()); } // slider's pin