Skip to content

Commit 2593895

Browse files
committed
update
1 parent 9a458fa commit 2593895

File tree

7 files changed

+25
-11
lines changed

7 files changed

+25
-11
lines changed

assets/images/home_bg2.jpeg

67.5 KB
Loading

lib/common/config/config.dart

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ class Config {
1515
static String spCacheVertical = "spCacheVertical_key"; //是否横屏换页
1616
static String bookPath = "";
1717

18+
static String readerCackeKey = "spCacheReaderBg_key";
19+
static String readerBgImg = 'assets/images/read_bg.png'; //默认阅读背景图片
20+
1821
static int isLodingDown = 0;
1922

2023
/// 当前数据库版本 */

lib/views/book/book_detail_screen.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class BookDetailScreenWidget extends State<BookDetailScreen> {
7373
}
7474
print("+=============================${book.toJson()}");
7575
Directory existsBook =
76-
new Directory(path + "/" + this.widget.book.id.toString());
76+
new Directory(path + "/" + book.id.toString());
7777
if (existsBook.existsSync()) {
7878
setState(() {});
7979
return;

lib/views/home/welcome_page.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ class SplashScreenState extends State<SplashScreen> {
5252

5353
@override
5454
void initState() {
55-
TestFunction.test();
55+
// TestFunction.test();
5656
// SpUtils.clearAll();
5757
DownApi.requestPermission();
5858
DbUtils.initDbTabel();
5959
startTime();
6060
super.initState();
6161
slides.add(
6262
new Slide(
63-
title: "C.TEAM 出品",
63+
title: "Joucks 出品",
6464
description:
65-
"官网:https://c.team\n\nC.TEAM是创新团队\n\nC.TEAM旗下有很多爆款产品 \n并且C.TEAM产品是完全免费、开源",
65+
"该产品是完全免费、开源",
6666
styleDescription: TextStyle(
6767
color: Colors.white, fontSize: 20.0, fontFamily: 'Raleway'),
6868
marginDescription:

lib/views/reader/reader_catalog.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class _ReaderCatalogState extends State<ReaderCatalog> {
8888
bottom: Screen.bottomSafeHeight,
8989
left: 30,
9090
right: 30),
91-
color: Colors.grey,
91+
color: Colors.white,
9292
height: Screen.height - 350,
9393
padding: EdgeInsets.all(3.0),
9494
child: new Column(children: <Widget>[

lib/views/reader/reader_menu.dart

+15-4
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,16 @@ class _ReaderMenuState extends State<ReaderMenu>
376376
crossAxisAlignment: CrossAxisAlignment.center,
377377
children: <Widget>[
378378
SizedBox(height: 8),
379-
buildTitleWdget("行间距"),
379+
buildTitleWdget("背景"),
380380
SizedBox(height: 5),
381381
Row(
382382
children: <Widget>[
383-
buidIconBtnWdget(Icon(Icons.format_align_left), () {}),
384-
buidIconBtnWdget(Icon(Icons.format_align_justify), () {}),
383+
buidIconBtnWdget(Icon(Icons.format_align_left), () {
384+
switchReaderBgFunc('assets/images/home_bg2.jpeg');
385+
}),
386+
buidIconBtnWdget(Icon(Icons.format_align_justify), () {
387+
switchReaderBgFunc('assets/images/read_bg.jpeg');
388+
}),
385389
buidIconBtnWdget(Icon(Icons.format_align_right), () {}),
386390
],
387391
),
@@ -413,6 +417,13 @@ class _ReaderMenuState extends State<ReaderMenu>
413417
);
414418
}
415419

420+
//切换背景
421+
switchReaderBgFunc(String bgPath) {
422+
print("切换背景为:$bgPath");
423+
Config.readerBgImg = bgPath;
424+
SpUtils.setValue(Config.readerCackeKey, bgPath);
425+
}
426+
416427
//二级菜单横竖平设置
417428
buildAnimatedIcon(IconData icon1, IconData icon2, bool left) {
418429
var widthNum = (Screen.width - 11) / 3;
@@ -523,7 +534,7 @@ class _ReaderMenuState extends State<ReaderMenu>
523534
//底部按钮单个
524535
buildBottomItem(String title, String iconImg, Widget icon) {
525536
return Container(
526-
padding: EdgeInsets.symmetric(vertical:4),
537+
padding: EdgeInsets.symmetric(vertical: 4),
527538
child: GestureDetector(
528539
onTap: () {
529540
Toast.show("功能暂未开放");

lib/views/reader/reader_screen.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ class ReaderSceneState extends State<ReaderScene> with RouteAware {
543543
top: 0,
544544
right: 0,
545545
bottom: 0,
546-
child: Image.asset('assets/images/read_bg.png',
546+
child: Image.asset(Config.readerBgImg,
547547
fit: BoxFit.cover)),
548548
Center(
549549
child: Text("加载中..."),
@@ -563,7 +563,7 @@ class ReaderSceneState extends State<ReaderScene> with RouteAware {
563563
top: 0,
564564
right: 0,
565565
bottom: 0,
566-
child: Image.asset('assets/images/read_bg.png',
566+
child: Image.asset(Config.readerBgImg,
567567
fit: BoxFit.cover)),
568568
buildPageView(),
569569
buildMenu(),

0 commit comments

Comments
 (0)