forked from gedoor/MyBookshelf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# This is a combination of 4 commits.
# This is the 1st commit message: 添加 E-Ink 模式 # This is the commit message gedoor#2: 去除页面跳转动画 # This is the commit message gedoor#3: 开启E-Ink模式后自动设置阅读文字为白底黑字 # This is the commit message gedoor#4: 去除退出页面动画
- Loading branch information
1 parent
d8b349a
commit 6d2c036
Showing
9 changed files
with
95 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.kunfei.bookshelf.utils; | ||
|
||
import android.content.Context; | ||
import android.content.SharedPreferences; | ||
import android.util.Log; | ||
|
||
import com.kunfei.bookshelf.help.ReadBookControl; | ||
|
||
public class Prefs { | ||
|
||
public static final String PREFS_KEY_E_INK_MODE = "prefs_key_e_ink_mode"; | ||
public static boolean isEInkMode = false; | ||
|
||
public static void init(Context context) { | ||
isEInkMode = getConfigStorage(context).getBoolean(PREFS_KEY_E_INK_MODE, false); | ||
} | ||
|
||
public static void setEInkModeStatus(Context context, boolean enable) { | ||
isEInkMode = enable; | ||
getConfigStorage(context).edit().putBoolean(PREFS_KEY_E_INK_MODE, enable).apply(); | ||
ReadBookControl.getInstance().setPageMode(4); | ||
ReadBookControl.getInstance().setTextColor(1,0xFF000000); | ||
ReadBookControl.getInstance().setBgColor(1,0xFFFFFFFF); | ||
ReadBookControl.getInstance().setTextDrawableIndex(0); | ||
ReadBookControl.getInstance().initTextDrawableIndex(); | ||
} | ||
|
||
public static SharedPreferences getConfigStorage(Context context) { | ||
return getStorage(context, "CONFIG"); | ||
} | ||
|
||
public static SharedPreferences getStorage(Context context, String storage) { | ||
return context.getSharedPreferences(storage, Context.MODE_PRIVATE); | ||
} | ||
} |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<set xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</set> |
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