working on txt import
This commit is contained in:
parent
f1f1c6ecc8
commit
afe62ea40e
|
@ -10,6 +10,7 @@ public class Config {
|
||||||
private final static String BOOK_BG_KEY = "bookbg";
|
private final static String BOOK_BG_KEY = "bookbg";
|
||||||
private final static String FONT_TYPE_KEY = "fonttype";
|
private final static String FONT_TYPE_KEY = "fonttype";
|
||||||
private final static String FONT_SIZE_KEY = "fontsize";
|
private final static String FONT_SIZE_KEY = "fontsize";
|
||||||
|
private final static String LINE_SPACE_KEY = "linespace";
|
||||||
private final static String NIGHT_KEY = "night";
|
private final static String NIGHT_KEY = "night";
|
||||||
private final static String LIGHT_KEY = "light";
|
private final static String LIGHT_KEY = "light";
|
||||||
private final static String SYSTEM_LIGHT_KEY = "systemlight";
|
private final static String SYSTEM_LIGHT_KEY = "systemlight";
|
||||||
|
@ -41,6 +42,9 @@ public class Config {
|
||||||
private Typeface typeface;
|
private Typeface typeface;
|
||||||
//字体大小
|
//字体大小
|
||||||
private float mFontSize = 0;
|
private float mFontSize = 0;
|
||||||
|
|
||||||
|
//行间距
|
||||||
|
private float mLineSpace =0;
|
||||||
//亮度值
|
//亮度值
|
||||||
private float light = 0;
|
private float light = 0;
|
||||||
private int bookBG;
|
private int bookBG;
|
||||||
|
@ -118,7 +122,17 @@ public class Config {
|
||||||
mFontSize = fontSize;
|
mFontSize = fontSize;
|
||||||
sp.edit().putFloat(FONT_SIZE_KEY,fontSize).commit();
|
sp.edit().putFloat(FONT_SIZE_KEY,fontSize).commit();
|
||||||
}
|
}
|
||||||
|
public float getLineSpace(){
|
||||||
|
if (mLineSpace == 0){
|
||||||
|
mLineSpace = sp.getFloat(LINE_SPACE_KEY, mContext.getResources().getDimension(R.dimen.reading_line_spacing));
|
||||||
|
}
|
||||||
|
return mLineSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLineSpace(float lineSpace){
|
||||||
|
mLineSpace = lineSpace;
|
||||||
|
sp.edit().putFloat(LINE_SPACE_KEY,lineSpace).commit();
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 获取夜间还是白天阅读模式,true为夜晚,false为白天
|
* 获取夜间还是白天阅读模式,true为夜晚,false为白天
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -139,8 +139,10 @@ public abstract class BasicFragment extends Fragment {
|
||||||
//从新从数据库抓取该书的最新阅读进度
|
//从新从数据库抓取该书的最新阅读进度
|
||||||
|
|
||||||
Book book1 = (Book)LitePal.find(Book.class,book.getId());
|
Book book1 = (Book)LitePal.find(Book.class,book.getId());
|
||||||
book.setBegin(book1.getBegin());
|
if(book1!=null) { //读取本地最新进度
|
||||||
book.setBiginChapt(book1.getBiginChapt());
|
book.setBegin(book1.getBegin());
|
||||||
|
book.setBiginChapt(book1.getBiginChapt());
|
||||||
|
}
|
||||||
Toast.makeText(activity, book.getBookname() + "加载", Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, book.getBookname() + "加载", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
final String path = book.getBookpath();
|
final String path = book.getBookpath();
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class BookMarkFragment extends BasicFragment {
|
||||||
lv_bookmark.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
lv_bookmark.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
pageFactory.changeChapter(bookMarksList.get(position).getBegin());
|
pageFactory.changeChapter(position+1);
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class CatalogFragment extends BasicFragment {
|
||||||
lv_catalogue.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
lv_catalogue.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
pageFactory.changeChapter(catalogueList.get(position).getBookChapterStartPos());
|
pageFactory.changeChapter(position+1);
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.deiniu.zhuike.Fragments;
|
package com.deiniu.zhuike.Fragments;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -51,7 +52,7 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
LinearLayout llShelfBottom;
|
LinearLayout llShelfBottom;
|
||||||
@BindView(R.id.id_recyclerview)
|
@BindView(R.id.id_recyclerview)
|
||||||
RecyclerView mRecyclerView;
|
RecyclerView mRecyclerView;
|
||||||
private List<Book> mDatas;
|
// private List<Book> mDatas;
|
||||||
private BookListAdapter mAdapter;
|
private BookListAdapter mAdapter;
|
||||||
|
|
||||||
private List<Book> bookLists;
|
private List<Book> bookLists;
|
||||||
|
@ -82,7 +83,7 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
public void initData() {
|
public void initData() {
|
||||||
|
|
||||||
flag = new boolean[100];
|
flag = new boolean[100];
|
||||||
mDatas = initData(mDatas,'X');
|
// mDatas = initData(mDatas,'X');
|
||||||
|
|
||||||
bookLists = LitePal.findAll(Book.class);
|
bookLists = LitePal.findAll(Book.class);
|
||||||
|
|
||||||
|
@ -120,8 +121,32 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
initData();
|
initData();
|
||||||
initReceyleView();
|
initReceyleView();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
@Override
|
||||||
|
public void onHiddenChanged(boolean hidden) {
|
||||||
|
super.onHiddenChanged(hidden);
|
||||||
|
if(hidden){
|
||||||
|
//pause
|
||||||
|
}else{
|
||||||
|
bookLists = LitePal.findAll(Book.class);
|
||||||
|
mAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setUserVisibleHint(boolean isVisibleToUser) {
|
||||||
|
super.setUserVisibleHint(isVisibleToUser);
|
||||||
|
if (isVisibleToUser) {
|
||||||
|
//相当于Fragment的onResume,为true时,Fragment已经可见
|
||||||
|
bookLists = LitePal.findAll(Book.class);
|
||||||
|
mAdapter.notifyDataSetChanged();
|
||||||
|
} else {
|
||||||
|
//相当于Fragment的onPause,为false时,Fragment不可见
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
public void initReceyleView() {
|
public void initReceyleView() {
|
||||||
|
|
||||||
// mRecyclerView.setLayoutManager(new LinearLayoutManager(this.activity));
|
// mRecyclerView.setLayoutManager(new LinearLayoutManager(this.activity));
|
||||||
|
@ -152,17 +177,21 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
bottomSheetDialog.dismiss();
|
bottomSheetDialog.dismiss();
|
||||||
Intent intent = new Intent(activity, FileChooserActivity.class);
|
Intent intent = new Intent(activity, FileChooserActivity.class);
|
||||||
startActivity(intent);
|
startActivityForResult(intent, Activity.RESULT_FIRST_USER);
|
||||||
|
// startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bottomSheetDialog.show();
|
bottomSheetDialog.show();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, Intent data){
|
||||||
|
// bookLists = LitePal.findAll(Book.class);
|
||||||
|
// mAdapter.notifyDataSetChanged();
|
||||||
|
initViews();
|
||||||
|
}
|
||||||
|
|
||||||
private void initDialog(int position) {
|
private void initDialog(int position) {
|
||||||
|
|
||||||
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this.activity);
|
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(this.activity);
|
||||||
|
@ -172,7 +201,7 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
.setBackgroundColor(getResources().getColor(android.R.color.transparent));
|
.setBackgroundColor(getResources().getColor(android.R.color.transparent));
|
||||||
|
|
||||||
TextView tv =(TextView) bottomSheetDialog.findViewById(R.id.bdTitle);
|
TextView tv =(TextView) bottomSheetDialog.findViewById(R.id.bdTitle);
|
||||||
tv.setText(mDatas.get(position).getBookname());
|
tv.setText(bookLists.get(position).getBookname());
|
||||||
|
|
||||||
bottomSheetDialog.show();
|
bottomSheetDialog.show();
|
||||||
}
|
}
|
||||||
|
@ -199,9 +228,10 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
isSelectAll =!isSelectAll;
|
isSelectAll =!isSelectAll;
|
||||||
mChkAdapter.notifyDataSetChanged();
|
mChkAdapter.notifyDataSetChanged();
|
||||||
}else if(view.getId()== R.id.btnDelete){
|
}else if(view.getId()== R.id.btnDelete){
|
||||||
for (int i = 0; i < mDatas.size(); i++) {
|
for (int i = 0; i < bookLists.size(); i++) {
|
||||||
if(flag[i] ){
|
if(flag[i] ){
|
||||||
mDatas.remove(i);
|
bookLists.get(i).delete();
|
||||||
|
bookLists.remove(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mChkAdapter.notifyDataSetChanged();
|
mChkAdapter.notifyDataSetChanged();
|
||||||
|
@ -266,8 +296,8 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
// initData();
|
// bookLists = LitePal.findAll(Book.class);
|
||||||
// mAdapter.notifyDataSetChanged();
|
// mAdapter.notifyDataSetChanged();
|
||||||
// synchronized (mAdapter) {
|
// synchronized (mAdapter) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -284,7 +314,7 @@ public class Fragment_Shelf extends BasicFragment {
|
||||||
|
|
||||||
CheckAdapter mChkAdapter;
|
CheckAdapter mChkAdapter;
|
||||||
void zhengliShelf(){
|
void zhengliShelf(){
|
||||||
mChkAdapter = new CheckAdapter(activity,mDatas,R.layout.recycle_list_item,new OnItemClickListener()
|
mChkAdapter = new CheckAdapter(activity,bookLists,R.layout.recycle_list_item,new OnItemClickListener()
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -51,6 +51,7 @@ public class Main2Activity extends AppCompatActivity
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
app =(MyApp) getApplicationContext();
|
||||||
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
|
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
|
||||||
setContentView(R.layout.activity_main2);
|
setContentView(R.layout.activity_main2);
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
@ -392,6 +393,7 @@ private int bottomSelectedIndex;
|
||||||
long firstTime =0;
|
long firstTime =0;
|
||||||
@Override
|
@Override
|
||||||
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
public boolean onKeyUp(int keyCode, KeyEvent event) {
|
||||||
|
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
if (keyCode == KeyEvent.KEYCODE_BACK) {
|
||||||
if( navigationView.isShown()){
|
if( navigationView.isShown()){
|
||||||
|
|
||||||
|
@ -407,9 +409,11 @@ private int bottomSelectedIndex;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
// return super.onKeyUp(keyCode, event);
|
||||||
app.exit();
|
app.exit();
|
||||||
return false;
|
// return super.onKeyUp(keyCode, event);
|
||||||
|
// return false;
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.deiniu.zhuike;
|
package com.deiniu.zhuike;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.app.AlertDialog;
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -96,6 +97,9 @@ public class ReadActivity extends Activity_base implements SpeechSynthesizerLis
|
||||||
@BindView(R.id.appbar)
|
@BindView(R.id.appbar)
|
||||||
AppBarLayout appbar;
|
AppBarLayout appbar;
|
||||||
|
|
||||||
|
@BindView(R.id.llTopAd)
|
||||||
|
LinearLayout llTopAd;
|
||||||
|
|
||||||
private Config config;
|
private Config config;
|
||||||
private WindowManager.LayoutParams lp;
|
private WindowManager.LayoutParams lp;
|
||||||
private Book book;
|
private Book book;
|
||||||
|
@ -110,6 +114,12 @@ public class ReadActivity extends Activity_base implements SpeechSynthesizerLis
|
||||||
private SpeechSynthesizer mSpeechSynthesizer;
|
private SpeechSynthesizer mSpeechSynthesizer;
|
||||||
private boolean isSpeaking = false;
|
private boolean isSpeaking = false;
|
||||||
|
|
||||||
|
public void showTopAd(boolean show){
|
||||||
|
llTopAd.setVisibility(show? View.VISIBLE:View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 接收电池信息更新的广播
|
// 接收电池信息更新的广播
|
||||||
private BroadcastReceiver myReceiver = new BroadcastReceiver(){
|
private BroadcastReceiver myReceiver = new BroadcastReceiver(){
|
||||||
@Override
|
@Override
|
||||||
|
@ -279,6 +289,11 @@ public class ReadActivity extends Activity_base implements SpeechSynthesizerLis
|
||||||
public void changeBookBg(int type) {
|
public void changeBookBg(int type) {
|
||||||
pageFactory.changeBookBg(type);
|
pageFactory.changeBookBg(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void changeLineHeight(int lineHeight) {
|
||||||
|
pageFactory.changeLineHight(lineHeight);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
pageFactory.setPageEvent(new PageFactory.PageEvent() {
|
pageFactory.setPageEvent(new PageFactory.PageEvent() {
|
||||||
|
@ -398,11 +413,47 @@ public class ReadActivity extends Activity_base implements SpeechSynthesizerLis
|
||||||
mPageModeDialog.hide();
|
mPageModeDialog.hide();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
finish();
|
|
||||||
|
showNormalDialog();//finish();
|
||||||
}
|
}
|
||||||
return super.onKeyDown(keyCode, event);
|
return super.onKeyDown(keyCode, event);
|
||||||
}
|
}
|
||||||
|
private void showNormalDialog(){
|
||||||
|
/* @setIcon 设置对话框图标
|
||||||
|
* @setTitle 设置对话框标题
|
||||||
|
* @setMessage 设置对话框消息提示
|
||||||
|
* setXXX方法返回Dialog对象,因此可以链式设置属性
|
||||||
|
*/
|
||||||
|
final AlertDialog.Builder normalDialog =
|
||||||
|
new AlertDialog.Builder(ReadActivity.this);
|
||||||
|
|
||||||
|
normalDialog.setTitle("退出阅读");
|
||||||
|
normalDialog.setMessage("确定退出阅读吗?");
|
||||||
|
normalDialog.setPositiveButton("继续阅读",
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
hideSystemUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
normalDialog.setNegativeButton("退出阅读",
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
normalDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
|
@Override
|
||||||
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
hideSystemUI();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 显示
|
||||||
|
normalDialog.show();
|
||||||
|
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
|
|
@ -62,6 +62,8 @@ public class SettingDialog extends Dialog {
|
||||||
TextView tv_fzkatong;
|
TextView tv_fzkatong;
|
||||||
@BindView(R.id.tv_bysong)
|
@BindView(R.id.tv_bysong)
|
||||||
TextView tv_bysong;
|
TextView tv_bysong;
|
||||||
|
@BindView(R.id.tv_lhsize)
|
||||||
|
TextView tv_lineSpace;
|
||||||
|
|
||||||
|
|
||||||
private Config config;
|
private Config config;
|
||||||
|
@ -71,6 +73,11 @@ public class SettingDialog extends Dialog {
|
||||||
private int FONT_SIZE_MAX;
|
private int FONT_SIZE_MAX;
|
||||||
private int currentFontSize;
|
private int currentFontSize;
|
||||||
|
|
||||||
|
private int LINE_SPACE_MIN;
|
||||||
|
private int LINE_SPACE_MAX;
|
||||||
|
private int currentLineSpace;
|
||||||
|
|
||||||
|
|
||||||
private SettingDialog(Context context, boolean flag, OnCancelListener listener) {
|
private SettingDialog(Context context, boolean flag, OnCancelListener listener) {
|
||||||
super(context, flag, listener);
|
super(context, flag, listener);
|
||||||
}
|
}
|
||||||
|
@ -101,6 +108,8 @@ public class SettingDialog extends Dialog {
|
||||||
FONT_SIZE_MIN = (int) getContext().getResources().getDimension(R.dimen.reading_min_text_size);
|
FONT_SIZE_MIN = (int) getContext().getResources().getDimension(R.dimen.reading_min_text_size);
|
||||||
FONT_SIZE_MAX = (int) getContext().getResources().getDimension(R.dimen.reading_max_text_size);
|
FONT_SIZE_MAX = (int) getContext().getResources().getDimension(R.dimen.reading_max_text_size);
|
||||||
|
|
||||||
|
LINE_SPACE_MAX =60;
|
||||||
|
LINE_SPACE_MIN =10;
|
||||||
config = Config.getInstance();
|
config = Config.getInstance();
|
||||||
|
|
||||||
//初始化亮度
|
//初始化亮度
|
||||||
|
@ -112,6 +121,10 @@ public class SettingDialog extends Dialog {
|
||||||
currentFontSize = (int) config.getFontSize();
|
currentFontSize = (int) config.getFontSize();
|
||||||
tv_size.setText(currentFontSize + "");
|
tv_size.setText(currentFontSize + "");
|
||||||
|
|
||||||
|
//初始化行间距
|
||||||
|
currentLineSpace =(int) config.getLineSpace();
|
||||||
|
tv_lineSpace.setText(currentLineSpace+"");
|
||||||
|
|
||||||
//初始化字体
|
//初始化字体
|
||||||
tv_default.setTypeface(config.getTypeface(Config.FONTTYPE_DEFAULT));
|
tv_default.setTypeface(config.getTypeface(Config.FONTTYPE_DEFAULT));
|
||||||
tv_qihei.setTypeface(config.getTypeface(Config.FONTTYPE_QIHEI));
|
tv_qihei.setTypeface(config.getTypeface(Config.FONTTYPE_QIHEI));
|
||||||
|
@ -281,7 +294,7 @@ public class SettingDialog extends Dialog {
|
||||||
|
|
||||||
|
|
||||||
@OnClick({R.id.tv_dark, R.id.tv_bright, R.id.tv_xitong, R.id.tv_subtract, R.id.tv_add, R.id.tv_size_default, R.id.tv_qihei, R.id.tv_fzxinghei, R.id.tv_fzkatong,R.id.tv_bysong,
|
@OnClick({R.id.tv_dark, R.id.tv_bright, R.id.tv_xitong, R.id.tv_subtract, R.id.tv_add, R.id.tv_size_default, R.id.tv_qihei, R.id.tv_fzxinghei, R.id.tv_fzkatong,R.id.tv_bysong,
|
||||||
R.id.tv_default, R.id.iv_bg_default, R.id.iv_bg_1, R.id.iv_bg_2, R.id.iv_bg_3, R.id.iv_bg_4})
|
R.id.tv_default, R.id.iv_bg_default, R.id.iv_bg_1, R.id.iv_bg_2, R.id.iv_bg_3, R.id.iv_bg_4,R.id.tv_lhadd,R.id.tv_lhreduct,R.id.tv_lhsize_default})
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
case R.id.tv_dark:
|
case R.id.tv_dark:
|
||||||
|
@ -355,8 +368,49 @@ public class SettingDialog extends Dialog {
|
||||||
setBookBg(Config.BOOK_BG_4);
|
setBookBg(Config.BOOK_BG_4);
|
||||||
selectBg(Config.BOOK_BG_4);
|
selectBg(Config.BOOK_BG_4);
|
||||||
break;
|
break;
|
||||||
|
case R.id.tv_lhadd:
|
||||||
|
addLineSpace();
|
||||||
|
break;
|
||||||
|
case R.id.tv_lhreduct:
|
||||||
|
subtractLineSpace();
|
||||||
|
break;
|
||||||
|
case R.id.tv_lhsize_default:
|
||||||
|
defaultLineSpace();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//变大行间距
|
||||||
|
private void addLineSpace() {
|
||||||
|
if (currentLineSpace < LINE_SPACE_MAX) {
|
||||||
|
currentLineSpace += 1;
|
||||||
|
tv_lineSpace.setText(currentLineSpace + "");
|
||||||
|
config.setLineSpace(currentLineSpace);
|
||||||
|
if (mSettingListener != null) {
|
||||||
|
mSettingListener.changeLineHeight(currentLineSpace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//默认行间距
|
||||||
|
private void defaultLineSpace() {
|
||||||
|
currentLineSpace = (int) getContext().getResources().getDimension(R.dimen.reading_line_spacing);
|
||||||
|
tv_lineSpace.setText(currentLineSpace + "");
|
||||||
|
config.setLineSpace(currentLineSpace);
|
||||||
|
if (mSettingListener != null) {
|
||||||
|
mSettingListener.changeLineHeight(currentLineSpace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//变小行间距
|
||||||
|
private void subtractLineSpace() {
|
||||||
|
if (currentLineSpace > LINE_SPACE_MIN) {
|
||||||
|
currentLineSpace -= 1;
|
||||||
|
tv_lineSpace.setText(currentLineSpace + "");
|
||||||
|
config.setLineSpace(currentLineSpace);
|
||||||
|
if (mSettingListener != null) {
|
||||||
|
mSettingListener.changeLineHeight(currentLineSpace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//变大书本字体
|
//变大书本字体
|
||||||
private void addFontSize() {
|
private void addFontSize() {
|
||||||
|
@ -414,6 +468,8 @@ public class SettingDialog extends Dialog {
|
||||||
void changeTypeFace(Typeface typeface);
|
void changeTypeFace(Typeface typeface);
|
||||||
|
|
||||||
void changeBookBg(int type);
|
void changeBookBg(int type);
|
||||||
|
|
||||||
|
void changeLineHeight(int lineHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -261,7 +261,7 @@ public class BookUtil {
|
||||||
// Log.e(TAG,String.format("缓存的内容是\n %s",bufStr));
|
// Log.e(TAG,String.format("缓存的内容是\n %s",bufStr));
|
||||||
bufStr = bufStr.replaceAll("\r\n","\n");
|
bufStr = bufStr.replaceAll("\r\n","\n");
|
||||||
// bufStr = bufStr.replaceAll("\u3000\u3000+[ ]*","\u3000\u3000");
|
// bufStr = bufStr.replaceAll("\u3000\u3000+[ ]*","\u3000\u3000");
|
||||||
bufStr = bufStr.replaceAll("\n+\\s*","\n\u3000");// bufStr = bufStr.replaceAll("\r\n+\\s*","\r\n\u3000\u3000");
|
bufStr = bufStr.replaceAll("\n+\\s*","\n\u3000\u3000");// bufStr = bufStr.replaceAll("\r\n+\\s*","\r\n\u3000\u3000");
|
||||||
// bufStr = bufStr.replaceAll("\r\n[ {0,}]","\r\n\u3000\u3000");
|
// bufStr = bufStr.replaceAll("\r\n[ {0,}]","\r\n\u3000\u3000");
|
||||||
// bufStr = bufStr.replaceAll(" ","");
|
// bufStr = bufStr.replaceAll(" ","");
|
||||||
bufStr = bufStr.replaceAll("\u0000","");
|
bufStr = bufStr.replaceAll("\u0000","");
|
||||||
|
|
|
@ -165,6 +165,14 @@ public class PageFactory {
|
||||||
while(length <chars.length ) {
|
while(length <chars.length ) {
|
||||||
pageNo++;
|
pageNo++;
|
||||||
TRPage page = getNextChapterPage(length);
|
TRPage page = getNextChapterPage(length);
|
||||||
|
Log.e(TAG,"page.getBegin :" + page.getBegin()+ ",chapter length "+ mBookUtil.getBookLen());
|
||||||
|
|
||||||
|
if(page.getBegin() == mBookUtil.getBookLen() ){ //最后一页空白的情况。。。
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
page.setPageNo(pageNo);
|
page.setPageNo(pageNo);
|
||||||
chaptPages.add(page);
|
chaptPages.add(page);
|
||||||
length= page.getEnd();
|
length= page.getEnd();
|
||||||
|
@ -186,6 +194,8 @@ public class PageFactory {
|
||||||
|
|
||||||
private static Status mStatus = Status.OPENING;
|
private static Status mStatus = Status.OPENING;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public enum Status {
|
public enum Status {
|
||||||
OPENING,
|
OPENING,
|
||||||
FINISH,
|
FINISH,
|
||||||
|
@ -228,6 +238,8 @@ public class PageFactory {
|
||||||
|
|
||||||
typeface = config.getTypeface();
|
typeface = config.getTypeface();
|
||||||
m_fontSize = config.getFontSize();
|
m_fontSize = config.getFontSize();
|
||||||
|
lineSpace =config.getLineSpace();
|
||||||
|
paragraphSpace = (long)(1.15 * lineSpace);
|
||||||
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);// 画笔
|
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);// 画笔
|
||||||
mPaint.setTextAlign(Paint.Align.LEFT);// 左对齐
|
mPaint.setTextAlign(Paint.Align.LEFT);// 左对齐
|
||||||
mPaint.setTextSize(m_fontSize);// 字体大小
|
mPaint.setTextSize(m_fontSize);// 字体大小
|
||||||
|
@ -294,7 +306,10 @@ public class PageFactory {
|
||||||
private void calculateLineCount(){
|
private void calculateLineCount(){
|
||||||
mLineCount = (int) (mVisibleHeight / (m_fontSize + lineSpace));// 可显示的行数
|
mLineCount = (int) (mVisibleHeight / (m_fontSize + lineSpace));// 可显示的行数
|
||||||
}
|
}
|
||||||
|
private void calculateLineCount(float paragrapheight){
|
||||||
|
mLineCount = (int) ((mVisibleHeight - paragrapheight ) / (m_fontSize + lineSpace));// 可显示的行数
|
||||||
|
Log.e(TAG,"line count is " + mLineCount +" paragrapheight is " +paragrapheight);
|
||||||
|
}
|
||||||
private void drawStatus(Bitmap bitmap){
|
private void drawStatus(Bitmap bitmap){
|
||||||
String status = "";
|
String status = "";
|
||||||
switch (mStatus){
|
switch (mStatus){
|
||||||
|
@ -335,10 +350,11 @@ public class PageFactory {
|
||||||
super.run();
|
super.run();
|
||||||
values.put("begin",currentPage.getBegin());
|
values.put("begin",currentPage.getBegin());
|
||||||
values.put("biginChapt",currentChapter);
|
values.put("biginChapt",currentChapter);
|
||||||
|
Log.e(TAG,String.format("begin to update book %s chapter%s bigin %s ",bookList.getBookname(),currentChapter, currentPage.getBegin() ) );
|
||||||
int rows = LitePal.update(Book.class,values,bookList.getId());
|
int rows = LitePal.update(Book.class,values,bookList.getId());
|
||||||
Log.e(TAG,String.format("update book %s bigin %s, result %s",bookList.getBookname(),currentPage.getBegin(),rows) );
|
Log.e(TAG,String.format("update book %s chapter%s bigin %s, result %s",bookList.getBookname(),currentChapter, currentPage.getBegin(),rows) );
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
Canvas c = new Canvas(bitmap);
|
Canvas c = new Canvas(bitmap);
|
||||||
|
@ -350,11 +366,24 @@ public class PageFactory {
|
||||||
if (m_lines.size() == 0) {
|
if (m_lines.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
float space =m_fontSize + lineSpace;
|
||||||
if (m_lines.size() > 0) {
|
if (m_lines.size() > 0) {
|
||||||
float y = marginHeight;
|
float y = marginHeight;
|
||||||
for (String strLine : m_lines) {
|
for (String strLine : m_lines) {
|
||||||
y += m_fontSize + lineSpace;
|
// if(strLine.endsWith("\n")) {
|
||||||
|
// if(strLine.charAt(strLine.length()-1) == ('\n' )) {
|
||||||
|
// Log.e("TAG", strLine);
|
||||||
|
// Log.e("TAG","最后字符 。。。" +strLine.charAt(strLine.length()-1) + "");
|
||||||
|
if(( strLine.charAt(strLine.length()-1) + "" ).equals("\n")){
|
||||||
|
strLine =strLine.replace("\n","");
|
||||||
|
y += space;
|
||||||
|
space =m_fontSize + paragraphSpace;
|
||||||
|
Log.e("TAG",String.format("开始新段落 %s, y plus is %s" ,strLine, m_fontSize + paragraphSpace));
|
||||||
|
}else{
|
||||||
|
y += space;
|
||||||
|
space =m_fontSize + lineSpace;
|
||||||
|
Log.e("TAG",String.format("%s,y plus is %s" ,strLine, m_fontSize + lineSpace));
|
||||||
|
}
|
||||||
c.drawText(strLine, measureMarginWidth, y, mPaint);
|
c.drawText(strLine, measureMarginWidth, y, mPaint);
|
||||||
// word.append(strLine);
|
// word.append(strLine);
|
||||||
}
|
}
|
||||||
|
@ -362,13 +391,15 @@ public class PageFactory {
|
||||||
|
|
||||||
//画进度及时间
|
//画进度及时间
|
||||||
int dateWith = (int) (mBatterryPaint.measureText(date)+mBorderWidth);//时间宽度
|
int dateWith = (int) (mBatterryPaint.measureText(date)+mBorderWidth);//时间宽度
|
||||||
float fPercent = (float) (currentPage.getBegin() * 1.0 / mBookUtil.getBookLen());//进度
|
// float fPercent = (float) (currentPage.getBegin() * 1.0 / mBookUtil.getBookLen());//进度
|
||||||
|
float fPercent = (float) (currentPage.getPageNo() * 1.0 /currentChaptPages.size());//进度
|
||||||
currentProgress = fPercent;
|
currentProgress = fPercent;
|
||||||
if (mPageEvent != null){
|
if (mPageEvent != null){
|
||||||
mPageEvent.changeProgress(fPercent);
|
mPageEvent.changeProgress(fPercent);
|
||||||
}
|
}
|
||||||
String strPercent = df.format(fPercent * 100) + "%";//进度文字
|
// String strPercent = df.format(fPercent * 100) + "%";//进度文字
|
||||||
int nPercentWidth = (int) mBatterryPaint.measureText("999.9%") + 1; //Paint.measureText直接返回參數字串所佔用的寬度
|
String strPercent = String.format("%s/%s",currentPage.getPageNo(),currentChaptPages.size()) + "页";//进度文字
|
||||||
|
int nPercentWidth = (int) mBatterryPaint.measureText("10/25页") + 50; //Paint.measureText直接返回參數字串所佔用的寬度
|
||||||
c.drawText(strPercent, mWidth - nPercentWidth, mHeight - statusMarginBottom, mBatterryPaint);//x y为坐标值
|
c.drawText(strPercent, mWidth - nPercentWidth, mHeight - statusMarginBottom, mBatterryPaint);//x y为坐标值
|
||||||
c.drawText(date, marginWidth ,mHeight - statusMarginBottom, mBatterryPaint);
|
c.drawText(date, marginWidth ,mHeight - statusMarginBottom, mBatterryPaint);
|
||||||
// 画电池
|
// 画电池
|
||||||
|
@ -498,7 +529,7 @@ public class PageFactory {
|
||||||
// m_mbBufLen = mBookUtil.getBookLen();
|
// m_mbBufLen = mBookUtil.getBookLen();
|
||||||
mBookUtil.setChapterNo((int)chapter);
|
mBookUtil.setChapterNo((int)chapter);
|
||||||
currentChaptPages = loadCurrentChapt((int)chapter);
|
currentChaptPages = loadCurrentChapt((int)chapter);
|
||||||
currentPage = currentChaptPages.get(0);
|
currentPage = getPageForBegin(begin) ;// currentChaptPages.get(0);
|
||||||
// currentPage = getPageForBegin(begin);
|
// currentPage = getPageForBegin(begin);
|
||||||
if (mBookPageWidget != null) {
|
if (mBookPageWidget != null) {
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
|
@ -574,7 +605,8 @@ public class PageFactory {
|
||||||
return trPage;
|
return trPage;
|
||||||
*/
|
*/
|
||||||
int prePageNo =currentPage.getPageNo()-1;
|
int prePageNo =currentPage.getPageNo()-1;
|
||||||
if(prePageNo ==0){
|
Log.d(TAG,String.format("currentPageno %s,total pagno %s",currentPage.getPageNo(),currentChaptPages.size()));
|
||||||
|
if(prePageNo <=0){
|
||||||
nextChaptPages =currentChaptPages;
|
nextChaptPages =currentChaptPages;
|
||||||
currentChapter--;
|
currentChapter--;
|
||||||
if(currentChapter ==0) {
|
if(currentChapter ==0) {
|
||||||
|
@ -614,6 +646,10 @@ public class PageFactory {
|
||||||
float width = 0;
|
float width = 0;
|
||||||
float height = 0;
|
float height = 0;
|
||||||
String line = "";
|
String line = "";
|
||||||
|
if(mBookUtil.getPosition()==0) {
|
||||||
|
lines.add("\n");lines.add("\n");
|
||||||
|
}
|
||||||
|
calculateLineCount();
|
||||||
while (mBookUtil.next(true) != -1){
|
while (mBookUtil.next(true) != -1){
|
||||||
char word = (char) mBookUtil.next(false);
|
char word = (char) mBookUtil.next(false);
|
||||||
//判断是否换行
|
//判断是否换行
|
||||||
|
@ -624,11 +660,13 @@ public class PageFactory {
|
||||||
Log.e(TAG,String.format("title is %s\n,size is %s ,position is %s" ,line,line.length(),mBookUtil.getPosition() ));
|
Log.e(TAG,String.format("title is %s\n,size is %s ,position is %s" ,line,line.length(),mBookUtil.getPosition() ));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lines.add(line);
|
lines.add(line+word);
|
||||||
|
// lines.add("\n");
|
||||||
line = "";
|
line = "";
|
||||||
width = 0;
|
width = 0;
|
||||||
// height += paragraphSpace;
|
height += paragraphSpace - lineSpace;
|
||||||
if (lines.size() == mLineCount){
|
calculateLineCount(height);
|
||||||
|
if (lines.size()>= mLineCount){
|
||||||
Log.e(TAG,String.format("lines count limit a %s,lines size %s",mLineCount,lines.size()));
|
Log.e(TAG,String.format("lines count limit a %s,lines size %s",mLineCount,lines.size()));
|
||||||
line ="";
|
line ="";
|
||||||
break;
|
break;
|
||||||
|
@ -752,6 +790,7 @@ public class PageFactory {
|
||||||
return reLines;
|
return reLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//上一章
|
//上一章
|
||||||
public void preChapter(){
|
public void preChapter(){
|
||||||
if (mBookUtil.getDirectoryList().size() > 0){
|
if (mBookUtil.getDirectoryList().size() > 0){
|
||||||
|
@ -761,10 +800,14 @@ public class PageFactory {
|
||||||
}
|
}
|
||||||
num --;
|
num --;
|
||||||
if (num >= 0){
|
if (num >= 0){
|
||||||
long begin = mBookUtil.getDirectoryList().get(num).getBookChapterStartPos();
|
|
||||||
currentPage = getPageForBegin(begin);
|
nextChaptPages =currentChaptPages;
|
||||||
currentPage(true);
|
|
||||||
currentChapter = num;
|
currentChapter = num;
|
||||||
|
mBookUtil.setChapterNo(currentChapter);
|
||||||
|
currentChaptPages = loadCurrentChapt(currentChapter ) ;
|
||||||
|
currentPage = getPageForBegin(0);
|
||||||
|
currentPage(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -777,10 +820,14 @@ public class PageFactory {
|
||||||
}
|
}
|
||||||
num ++;
|
num ++;
|
||||||
if (num < getDirectoryList().size()){
|
if (num < getDirectoryList().size()){
|
||||||
long begin = getDirectoryList().get(num).getBookChapterStartPos();
|
|
||||||
currentPage = getPageForBegin(begin);
|
preChaptPages =currentChaptPages;
|
||||||
currentPage(true);
|
|
||||||
currentChapter = num;
|
currentChapter = num;
|
||||||
|
mBookUtil.setChapterNo(currentChapter);
|
||||||
|
currentChaptPages = loadCurrentChapt(currentChapter ) ;
|
||||||
|
currentPage = getPageForBegin(0);
|
||||||
|
currentPage(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -835,17 +882,36 @@ public class PageFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
//改变进度
|
//改变进度
|
||||||
public void changeChapter(long begin){
|
public void changeChapter(int chapNum){
|
||||||
currentPage = getPageForBegin(begin);
|
|
||||||
|
preChaptPages =currentChaptPages;
|
||||||
|
currentChapter = chapNum;
|
||||||
|
mBookUtil.setChapterNo(currentChapter);
|
||||||
|
currentChaptPages = loadCurrentChapt(currentChapter ) ;
|
||||||
|
currentPage = getPageForBegin(0);
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//改变行间距
|
||||||
|
public void changeLineHight(int lineSpace) {
|
||||||
|
|
||||||
|
this.lineSpace = lineSpace;
|
||||||
|
mPaint.setTextSize(m_fontSize);
|
||||||
|
calculateLineCount();
|
||||||
|
measureMarginWidth();
|
||||||
|
currentChaptPages = loadCurrentChapt(currentChapter );
|
||||||
|
currentPage = getPageForBegin(currentPage.getBegin());
|
||||||
|
currentPage(true);
|
||||||
|
|
||||||
|
}
|
||||||
//改变字体大小
|
//改变字体大小
|
||||||
public void changeFontSize(int fontSize){
|
public void changeFontSize(int fontSize){
|
||||||
this.m_fontSize = fontSize;
|
this.m_fontSize = fontSize;
|
||||||
mPaint.setTextSize(m_fontSize);
|
mPaint.setTextSize(m_fontSize);
|
||||||
calculateLineCount();
|
calculateLineCount();
|
||||||
measureMarginWidth();
|
measureMarginWidth();
|
||||||
|
currentChaptPages = loadCurrentChapt(currentChapter );
|
||||||
currentPage = getPageForBegin(currentPage.getBegin());
|
currentPage = getPageForBegin(currentPage.getBegin());
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
}
|
}
|
||||||
|
@ -857,6 +923,7 @@ public class PageFactory {
|
||||||
mBatterryPaint.setTypeface(typeface);
|
mBatterryPaint.setTypeface(typeface);
|
||||||
calculateLineCount();
|
calculateLineCount();
|
||||||
measureMarginWidth();
|
measureMarginWidth();
|
||||||
|
|
||||||
currentPage = getPageForBegin(currentPage.getBegin());
|
currentPage = getPageForBegin(currentPage.getBegin());
|
||||||
currentPage(true);
|
currentPage(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,34 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="#000000">
|
android:background="#000000">
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<com.deiniu.zhuike.view.PageWidget
|
<com.deiniu.zhuike.view.PageWidget
|
||||||
android:id="@+id/bookpage"
|
android:id="@+id/bookpage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/llTopAd"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_gravity="top"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@mipmap/side_bg"
|
||||||
|
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
<android.support.design.widget.AppBarLayout
|
<android.support.design.widget.AppBarLayout
|
||||||
android:id="@+id/appbar"
|
android:id="@+id/appbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -95,7 +95,44 @@
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="20dp"
|
||||||
android:text="@string/setting_default" />
|
android:text="@string/setting_default" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/setting_height"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_lhreduct"
|
||||||
|
style="@style/setting_dialog_button"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:background="@null"
|
||||||
|
android:textColor="@color/read_dialog_button_select"
|
||||||
|
android:text="@string/setting_subtract_line_space" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_lhsize"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="3"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:text="30" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_lhadd"
|
||||||
|
style="@style/setting_dialog_button"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textSize="30sp"
|
||||||
|
android:background="@null"
|
||||||
|
android:textColor="@color/read_dialog_button_select"
|
||||||
|
android:text="@string/setting_add_line_space" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_lhsize_default"
|
||||||
|
style="@style/setting_dialog_button"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:text="@string/setting_default" />
|
||||||
|
</LinearLayout>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/setting_height"
|
android:layout_height="@dimen/setting_height"
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
<!-- 状态栏离底部距离 -->
|
<!-- 状态栏离底部距离 -->
|
||||||
<dimen name="reading_status_margin_bottom">3dp</dimen>
|
<dimen name="reading_status_margin_bottom">3dp</dimen>
|
||||||
<!-- 行间距 -->
|
<!-- 行间距 -->
|
||||||
<dimen name="reading_line_spacing">10dp</dimen>
|
<dimen name="reading_line_spacing">15dp</dimen>
|
||||||
<!-- 段间距 -->
|
<!-- 段间距 -->
|
||||||
<dimen name="reading_paragraph_spacing">30dp</dimen>
|
<dimen name="reading_paragraph_spacing">35dp</dimen>
|
||||||
<!-- 书本字体默认大小 -->
|
<!-- 书本字体默认大小 -->
|
||||||
<dimen name="reading_default_text_size">20sp</dimen>
|
<dimen name="reading_default_text_size">20sp</dimen>
|
||||||
<!-- 书本字体最小大小 -->
|
<!-- 书本字体最小大小 -->
|
||||||
|
|
|
@ -162,8 +162,10 @@
|
||||||
<string name="setting_system">系统</string>
|
<string name="setting_system">系统</string>
|
||||||
<string name="setting_dark">暗</string>
|
<string name="setting_dark">暗</string>
|
||||||
<string name="setting_bright">亮</string>
|
<string name="setting_bright">亮</string>
|
||||||
<string name="setting_add">A+</string>
|
<string name="setting_add">字体+</string>
|
||||||
<string name="setting_subtract">A-</string>
|
<string name="setting_subtract">字体-</string>
|
||||||
|
<string name="setting_add_line_space">行高+</string>
|
||||||
|
<string name="setting_subtract_line_space">行高-</string>
|
||||||
<string name="setting_default">默认</string>
|
<string name="setting_default">默认</string>
|
||||||
|
|
||||||
<string name="font_default">系统默认</string>
|
<string name="font_default">系统默认</string>
|
||||||
|
|
Loading…
Reference in New Issue