-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
134 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** RK3368, tested on a Boyue Likebook Mimas */ | ||
|
||
package org.koreader.device.rockchip; | ||
|
||
import android.view.View; | ||
|
||
import org.koreader.device.EPDController; | ||
|
||
/** we don't care about view on this driver */ | ||
@SuppressWarnings("unused") | ||
public class RK3368EPDController extends RK33xxEPDController implements EPDController { | ||
@Override | ||
public void setEpdMode(View targetView, String epdMode) { | ||
requestEpdMode(epdMode); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* minimal rk33xx interface for boyue mimas and maybe others, | ||
* based on https://github.com/koreader/koreader/issues/4595 | ||
* | ||
*/ | ||
|
||
package org.koreader.device.rockchip; | ||
|
||
import android.util.Log; | ||
|
||
|
||
@SuppressWarnings("unchecked") | ||
public abstract class RK33xxEPDController { | ||
private static final String TAG = "luajit-launcher"; | ||
public static final int EPD_FULL = 1; | ||
public static final int EPD_A2 = 2; | ||
public static final int EPD_PART = 3; | ||
public static final int EPD_BLACK_WHITE = 6; | ||
public static final int EPD_FORCE_FULL = 11; | ||
public static final int EPD_REGAL = 15; | ||
public static final int EPD_ADAPTATIVE = 17; | ||
public static final int EPD_FAST = 18; | ||
public static final int EPD_DITHER = 100; | ||
|
||
public static boolean requestEpdMode(String epdMode) { | ||
try { | ||
Class.forName("android.view.View").getMethod("setByEinkUpdateMode", | ||
new Class[] { Integer.TYPE }).invoke(null, new Object[] { getEpdMode(epdMode) }); | ||
return true; | ||
} catch (Exception e) { | ||
Log.e(TAG, e.toString()); | ||
return false; | ||
} | ||
} | ||
|
||
private static int getEpdMode(String epdMode) { | ||
/** only full mode was tested, so return that. | ||
* device owners will want to expand this | ||
* to return other well known modes | ||
*/ | ||
int mode = EPD_FULL; | ||
Log.v(TAG, String.format("Requesting %s: %d", epdMode, mode)); | ||
return mode; | ||
} | ||
} |