New user registration is currently disabled due to spam abuse / Регистрация новых пользователей в настоящее время приостановлена из-за злоупотреблений спаммерами

Suggestions for making GoldenDict e-ink Friendly

Mobile version discussion

Suggestions for making GoldenDict e-ink Friendly

Postby crusherjoe2000 » Sat Mar 24, 2012 6:16 pm

GoldenDict is a great program and I use it quite extensively on my Sony e-book reader.

It can be made even better by making it more friendly for e-ink display devices by doing the following:

1. Reduce screen refresh: GoldenDict currently does a animated scrolling when jumping between dictionaries. This looks nice on regular LCD screens but introduces some slow screen refresh on e-ink devices. It would be great if there can be an option to turn it off by jumping to the next dictionary directly. This can be done quite easily by passing a parameter to gdNextArticle() and gdPreviousArticle() so that if it is set to true, jump directly instead of doing the incremental animated scrolling.

2. Making use of the next page/previous page keys on the Sony and Nook e-book reader to allow full page scrolling. Once again, this is to reduce slow screen flicker. Here is the code to do it (lifted off the aardict-android project):

public static final int NOOK_KEY_PREV_LEFT = 92;
public static final int NOOK_KEY_NEXT_LEFT = 93;
public static final int NOOK_KEY_PREV_RIGHT = 94;
public static final int NOOK_KEY_NEXT_RIGHT = 95;

// [TST] Mon Feb 27 00:23:07 2012
// d:/ebook/sony_backup/EbookReader/smali/com/sony/drbd/ebook/reader/Constants.smali
protected static final int SONY_SCANCODE_PREVKEY = 105; // 0x69
protected static final int SONY_SCANCODE_NEXTKEY = 106; // 0x70

.....

@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getAction() != KeyEvent.ACTION_DOWN) {
// Use Key down rather than up so that we can hold it
// down to repeat
return super.dispatchKeyEvent(event);
}
int keyCode = event.getKeyCode();
Log.w(TAG, "dispatchKeyEvent("+ keyCode +", "+ event.getScanCode()+")");
if (keyCode == 0) {
int scanCode = event.getScanCode();
if (scanCode == SONY_SCANCODE_PREVKEY) {
keyCode = NOOK_KEY_PREV_LEFT:
}
else if (event.getScanCode() == SONY_SCANCODE_NEXTKEY) {
keyCode = NOOK_KEY_NEXT_LEFT:
}
}

switch (keyCode) {
// D:\android\docs\reference\android\view\KeyEvent.html
case KeyEvent.KEYCODE_BACK:
goBack();
break;
case NOOK_KEY_PREV_LEFT:
case NOOK_KEY_PREV_RIGHT:
case KeyEvent.KEYCODE_VOLUME_UP:
articleView.pageUp(false);
break;
case KeyEvent.KEYCODE_VOLUME_DOWN:
case NOOK_KEY_NEXT_LEFT:
case NOOK_KEY_NEXT_RIGHT:
articleView.pageDown(false);
break;
default:
return super.dispatchKeyEvent(event);
}
return true;
}

Thank you for your consideration,

ST
crusherjoe2000
 
Posts: 2
Joined: Sat Mar 24, 2012 5:59 pm

Re: Suggestions for making GoldenDict e-ink Friendly

Postby ikm » Sat Mar 24, 2012 7:06 pm

Thanks, I'll consider adding that.
ikm
Автор GoldenDict
 
Posts: 1592
Joined: Wed Feb 04, 2009 10:40 am

Re: Suggestions for making GoldenDict e-ink Friendly

Postby crusherjoe2000 » Wed Mar 28, 2012 2:00 am

Hi,

Thank you for the quick reply. The following information may also be useful to you (also lifted off aarddict):

MANUFACTURER = getBuildField("MANUFACTURER");
MODEL = getBuildField("MODEL");
DEVICE = getBuildField("DEVICE");

EINK_NOOK = MANUFACTURER.toLowerCase().contentEquals("barnesandnoble")&&
MODEL.contentEquals("NOOK") &&
DEVICE.toLowerCase().contentEquals("zoom2");
EINK_SONY = MANUFACTURER.toLowerCase().contentEquals("sony") &&
MODEL.contentEquals("PRS-T1");
EINK_SCREEN = EINK_SONY || EINK_NOOK;

private static String getBuildField(String fieldName) {
try {
return (String)Build.class.getField(fieldName).get(null);
} catch (Exception e) {
Log.e("aarddict",
"Exception while trying to check Build." + fieldName);
return "";
}
}


Regards,
ST
crusherjoe2000
 
Posts: 2
Joined: Sat Mar 24, 2012 5:59 pm

Re: Suggestions for making GoldenDict e-ink Friendly

Postby ikm » Wed Mar 28, 2012 6:47 am

I believe NOOKs are not exclusively e-ink - some models use color TFT displays. I wonder whether a more precise check is needed. In any case, this is also useful, thanks.
ikm
Автор GoldenDict
 
Posts: 1592
Joined: Wed Feb 04, 2009 10:40 am

Re: Suggestions for making GoldenDict e-ink Friendly

Postby vjjustin » Sun Jul 21, 2013 7:24 am

Can you please consider adding these changes into Goldendict?
The scrolling looks very bad in the eink screen.

It will be suffice to add it just as an option (in case you are worried about nook tablets etc.) .
vjjustin
 
Posts: 45
Joined: Wed Feb 08, 2012 7:59 pm

Re: Suggestions for making GoldenDict e-ink Friendly

Postby crafunzio » Sun Sep 22, 2013 9:06 pm

Hello,
I second that request. Thanks!
crafunzio
 
Posts: 2
Joined: Sun Sep 22, 2013 9:04 pm


Return to Mobile

Who is online

Users browsing this forum: No registered users and 2 guests