Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_book
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_book
Commits
b17c8adc
Commit
b17c8adc
authored
Sep 25, 2024
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化样式
parent
7f90e6c6
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
40 additions
and
36 deletions
+40
-36
BookReadActivity.kt
...va/com/mints/enjoyboxjia/ui/activitys/BookReadActivity.kt
+4
-4
BookSearchActivity.kt
.../com/mints/enjoyboxjia/ui/activitys/BookSearchActivity.kt
+6
-4
BookCityFragment.kt
...ava/com/mints/enjoyboxjia/ui/fragment/BookCityFragment.kt
+6
-18
BookShelfFragment.kt
...va/com/mints/enjoyboxjia/ui/fragment/BookShelfFragment.kt
+2
-2
activity_book_read.xml
book/app/src/main/res/layout/activity_book_read.xml
+5
-3
activity_book_search.xml
book/app/src/main/res/layout/activity_book_search.xml
+5
-2
fragment_main_bookcity.xml
book/app/src/main/res/layout/fragment_main_bookcity.xml
+8
-2
fragment_main_bookshelf.xml
book/app/src/main/res/layout/fragment_main_bookshelf.xml
+4
-1
ic_author.png
book/app/src/main/res/mipmap-xhdpi/ic_author.png
+0
-0
ic_book_collect.png
book/app/src/main/res/mipmap-xhdpi/ic_book_collect.png
+0
-0
ic_book_collect_s.png
book/app/src/main/res/mipmap-xhdpi/ic_book_collect_s.png
+0
-0
ic_book_setting.png
book/app/src/main/res/mipmap-xhdpi/ic_book_setting.png
+0
-0
ic_book_share.png
book/app/src/main/res/mipmap-xhdpi/ic_book_share.png
+0
-0
ic_change.png
book/app/src/main/res/mipmap-xhdpi/ic_change.png
+0
-0
ic_rubbish.png
book/app/src/main/res/mipmap-xhdpi/ic_rubbish.png
+0
-0
No files found.
book/app/src/main/java/com/mints/enjoyboxjia/ui/activitys/BookReadActivity.kt
View file @
b17c8adc
...
@@ -127,11 +127,11 @@ class BookReadActivity : BaseActivity(), View.OnClickListener, BookReadView {
...
@@ -127,11 +127,11 @@ class BookReadActivity : BaseActivity(), View.OnClickListener, BookReadView {
label_tv
.
text
=
data
.
author
label_tv
.
text
=
data
.
author
if
(
data
.
isCollect
==
1
)
{
if
(
data
.
isCollect
==
1
)
{
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
bookshelf
)
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
ic_book_collect_s
)
tab_tv_bookshelf
.
text
=
"已收藏"
tab_tv_bookshelf
.
text
=
"已收藏"
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_goldenrod
))
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_goldenrod
))
}
else
{
}
else
{
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
bookshelf
)
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
ic_book_collect
)
tab_tv_bookshelf
.
text
=
"收藏"
tab_tv_bookshelf
.
text
=
"收藏"
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
black
))
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
black
))
}
}
...
@@ -140,12 +140,12 @@ class BookReadActivity : BaseActivity(), View.OnClickListener, BookReadView {
...
@@ -140,12 +140,12 @@ class BookReadActivity : BaseActivity(), View.OnClickListener, BookReadView {
private
fun
setIsCollect
(
collect
:
Boolean
)
{
private
fun
setIsCollect
(
collect
:
Boolean
)
{
isCollect
=
collect
isCollect
=
collect
if
(
isCollect
)
{
if
(
isCollect
)
{
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
bookshelf
)
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
ic_book_collect_s
)
tab_tv_bookshelf
.
text
=
"已收藏"
tab_tv_bookshelf
.
text
=
"已收藏"
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_goldenrod
))
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_goldenrod
))
readPresenter
.
collect
(
bookId
)
readPresenter
.
collect
(
bookId
)
}
else
{
}
else
{
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
bookshelf
)
tab_iv_bookshelf
.
setImageResource
(
R
.
mipmap
.
ic_book_collect
)
tab_tv_bookshelf
.
text
=
"收藏"
tab_tv_bookshelf
.
text
=
"收藏"
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
black
))
tab_tv_bookshelf
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
black
))
readPresenter
.
cancelCollect
(
bookId
)
readPresenter
.
cancelCollect
(
bookId
)
...
...
book/app/src/main/java/com/mints/enjoyboxjia/ui/activitys/BookSearchActivity.kt
View file @
b17c8adc
...
@@ -19,7 +19,6 @@ import com.mints.enjoyboxjia.ui.adapter.SearchBookAdapter
...
@@ -19,7 +19,6 @@ import com.mints.enjoyboxjia.ui.adapter.SearchBookAdapter
import
com.mints.enjoyboxjia.ui.adapter.SearchHistoryAdapter
import
com.mints.enjoyboxjia.ui.adapter.SearchHistoryAdapter
import
com.mints.enjoyboxjia.ui.adapter.SearchHotBookAdapter
import
com.mints.enjoyboxjia.ui.adapter.SearchHotBookAdapter
import
com.mints.enjoyboxjia.utils.AppPreferencesManager
import
com.mints.enjoyboxjia.utils.AppPreferencesManager
import
com.mints.enjoyboxjia.utils.LogUtil
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
...
@@ -108,6 +107,9 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
...
@@ -108,6 +107,9 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
R
.
id
.
iv_clear
->
{
R
.
id
.
iv_clear
->
{
clearSearchHistory
()
clearSearchHistory
()
}
}
R
.
id
.
iv_change
->
{
searchPresenter
.
getHotBook
()
}
}
}
}
}
...
@@ -117,6 +119,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
...
@@ -117,6 +119,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
iv_left_icon
.
setOnClickListener
(
this
)
iv_left_icon
.
setOnClickListener
(
this
)
btn_search
.
setOnClickListener
(
this
)
btn_search
.
setOnClickListener
(
this
)
iv_clear
.
setOnClickListener
(
this
)
iv_clear
.
setOnClickListener
(
this
)
iv_change
.
setOnClickListener
(
this
)
et_search
.
addTextChangedListener
(
object
:
TextWatcher
{
et_search
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
...
@@ -145,7 +148,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
...
@@ -145,7 +148,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
override
fun
getHotBookSuc
(
data
:
BookListBean
)
{
override
fun
getHotBookSuc
(
data
:
BookListBean
)
{
searchHotBookData
.
clear
()
searchHotBookData
.
clear
()
searchHotBookData
.
addAll
(
data
.
records
)
searchHotBookData
.
addAll
(
data
.
records
)
searchHotBookAdapter
?.
set
NewInstance
(
searchHotBookData
)
searchHotBookAdapter
?.
set
List
(
searchHotBookData
)
}
}
override
fun
getHotBookFail
()
{
override
fun
getHotBookFail
()
{
...
@@ -165,7 +168,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
...
@@ -165,7 +168,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
srl_show
.
finishRefresh
(
true
)
srl_show
.
finishRefresh
(
true
)
searchBookData
.
clear
()
searchBookData
.
clear
()
searchBookData
.
addAll
(
data
.
records
)
searchBookData
.
addAll
(
data
.
records
)
searchBookAdapter
?.
set
NewInstance
(
data
.
records
)
searchBookAdapter
?.
set
List
(
data
.
records
)
}
else
{
}
else
{
if
(
data
.
records
.
size
<
searchPageSize
)
{
if
(
data
.
records
.
size
<
searchPageSize
)
{
srl_show
.
finishLoadMoreWithNoMoreData
()
srl_show
.
finishLoadMoreWithNoMoreData
()
...
@@ -183,7 +186,6 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
...
@@ -183,7 +186,6 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
}
}
private
fun
addSearchHistory
(
str
:
String
)
{
private
fun
addSearchHistory
(
str
:
String
)
{
LogUtil
.
d
(
"XXXXXXXXXX"
,
str
)
var
searchHistory
=
AppPreferencesManager
.
get
().
getString
(
BOOK_SEARCH_HISTORY
,
""
)
var
searchHistory
=
AppPreferencesManager
.
get
().
getString
(
BOOK_SEARCH_HISTORY
,
""
)
searchHistory
+=
",$str"
searchHistory
+=
",$str"
AppPreferencesManager
.
get
().
put
(
BOOK_SEARCH_HISTORY
,
searchHistory
)
AppPreferencesManager
.
get
().
put
(
BOOK_SEARCH_HISTORY
,
searchHistory
)
...
...
book/app/src/main/java/com/mints/enjoyboxjia/ui/fragment/BookCityFragment.kt
View file @
b17c8adc
...
@@ -146,27 +146,15 @@ class BookCityFragment : LazyLoadBaseFragment(), BookCityView, View.OnClickListe
...
@@ -146,27 +146,15 @@ class BookCityFragment : LazyLoadBaseFragment(), BookCityView, View.OnClickListe
}
}
}
}
override
fun
onFragmentResume
()
{
// if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_TWO) {
// if (AntiShake.check(banner?.id)) return
// banner?.start()
// if (TextUtils.isEmpty(userManager?.userID)) {
// //获取游客登录数据
// bookCityPresenter.userLogin()
// } else {
// bookCityPresenter.getBannerBook()
// bookCityPresenter.getHotBook()
// bookCityPresenter.getNewBook()
// }
// }
}
override
fun
getHotBookSuc
(
data
:
BookListBean
)
{
override
fun
getHotBookSuc
(
data
:
BookListBean
)
{
hotBookData
.
clear
()
hotBookData
.
clear
()
hotBookData
.
addAll
(
data
.
records
)
hotBookData
.
addAll
(
data
.
records
)
hotBookData
.
removeAt
(
0
)
hotBookData
.
removeAt
(
0
)
hotBookAdapter
?.
addHeaderView
(
getHotHeader
(
data
.
records
[
0
]))
hotBookAdapter
?.
setNewInstance
(
hotBookData
)
hotBookAdapter
?.
let
{
it
.
setHeaderView
(
getHotHeader
(
data
.
records
[
0
]))
it
.
setList
(
hotBookData
)
}
}
}
override
fun
getHotBookFail
()
{}
override
fun
getHotBookFail
()
{}
...
@@ -174,7 +162,7 @@ class BookCityFragment : LazyLoadBaseFragment(), BookCityView, View.OnClickListe
...
@@ -174,7 +162,7 @@ class BookCityFragment : LazyLoadBaseFragment(), BookCityView, View.OnClickListe
override
fun
getNewBookSuc
(
data
:
BookListBean
)
{
override
fun
getNewBookSuc
(
data
:
BookListBean
)
{
newBookData
.
clear
()
newBookData
.
clear
()
newBookData
.
addAll
(
data
.
records
)
newBookData
.
addAll
(
data
.
records
)
newBookAdapter
?.
set
NewInstance
(
newBookData
)
newBookAdapter
?.
set
List
(
newBookData
)
}
}
override
fun
getNewBookFail
()
{}
override
fun
getNewBookFail
()
{}
...
...
book/app/src/main/java/com/mints/enjoyboxjia/ui/fragment/BookShelfFragment.kt
View file @
b17c8adc
...
@@ -134,7 +134,7 @@ class BookShelfFragment : LazyLoadBaseFragment(), BookShelfView, View.OnClickLis
...
@@ -134,7 +134,7 @@ class BookShelfFragment : LazyLoadBaseFragment(), BookShelfView, View.OnClickLis
shelfBookData
.
clear
()
shelfBookData
.
clear
()
shelfBookData
.
addAll
(
data
.
records
)
shelfBookData
.
addAll
(
data
.
records
)
shelfBookData
.
add
(
BookBean
())
shelfBookData
.
add
(
BookBean
())
bookShelfAdapter
?.
set
NewInstance
(
shelfBookData
)
bookShelfAdapter
?.
set
List
(
shelfBookData
)
bookShelfAdapter
?.
setEditStyle
(
false
)
bookShelfAdapter
?.
setEditStyle
(
false
)
}
else
{
}
else
{
bookshelf_empty
.
visibility
=
View
.
VISIBLE
bookshelf_empty
.
visibility
=
View
.
VISIBLE
...
@@ -148,7 +148,7 @@ class BookShelfFragment : LazyLoadBaseFragment(), BookShelfView, View.OnClickLis
...
@@ -148,7 +148,7 @@ class BookShelfFragment : LazyLoadBaseFragment(), BookShelfView, View.OnClickLis
override
fun
getArticleLikeSuc
(
data
:
BookListBean
)
{
override
fun
getArticleLikeSuc
(
data
:
BookListBean
)
{
likeBookData
.
clear
()
likeBookData
.
clear
()
likeBookData
.
addAll
(
data
.
records
)
likeBookData
.
addAll
(
data
.
records
)
likeBookAdapter
?.
set
NewInstance
(
likeBookData
)
likeBookAdapter
?.
set
List
(
likeBookData
)
}
}
override
fun
getArticleLikeFail
()
{
override
fun
getArticleLikeFail
()
{
...
...
book/app/src/main/res/layout/activity_book_read.xml
View file @
b17c8adc
...
@@ -67,6 +67,8 @@
...
@@ -67,6 +67,8 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:layout_marginTop=
"4dp"
android:drawableStart=
"@mipmap/ic_author"
android:drawablePadding=
"2dp"
android:ellipsize=
"end"
android:ellipsize=
"end"
android:maxLines=
"1"
android:maxLines=
"1"
android:textColor=
"@color/color_378eff"
android:textColor=
"@color/color_378eff"
...
@@ -144,7 +146,7 @@
...
@@ -144,7 +146,7 @@
android:layout_width=
"20dp"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_height=
"20dp"
android:contentDescription=
"@null"
android:contentDescription=
"@null"
android:
src=
"@drawable/selector_tab_bookshelf
"
/>
android:
paddingTop=
"2dp
"
/>
<TextView
<TextView
android:id=
"@+id/tab_tv_bookshelf"
android:id=
"@+id/tab_tv_bookshelf"
...
@@ -169,7 +171,7 @@
...
@@ -169,7 +171,7 @@
android:layout_width=
"20dp"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_height=
"20dp"
android:contentDescription=
"@null"
android:contentDescription=
"@null"
android:src=
"@
drawable/selector_tab_bookshelf
"
/>
android:src=
"@
mipmap/ic_book_setting
"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -193,7 +195,7 @@
...
@@ -193,7 +195,7 @@
android:layout_width=
"20dp"
android:layout_width=
"20dp"
android:layout_height=
"20dp"
android:layout_height=
"20dp"
android:contentDescription=
"@null"
android:contentDescription=
"@null"
android:src=
"@
drawable/selector_tab_bookshelf
"
/>
android:src=
"@
mipmap/ic_book_share
"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
...
book/app/src/main/res/layout/activity_book_search.xml
View file @
b17c8adc
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
android:id=
"@+id/iv_clear"
android:id=
"@+id/iv_clear"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@mipmap/ic_
text_clear
"
/>
android:src=
"@mipmap/ic_
rubbish
"
/>
</LinearLayout>
</LinearLayout>
...
@@ -147,7 +147,10 @@
...
@@ -147,7 +147,10 @@
android:id=
"@+id/iv_change"
android:id=
"@+id/iv_change"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"换一换"
/>
android:drawableStart=
"@mipmap/ic_change"
android:drawablePadding=
"6dp"
android:text=
"换一换"
android:textColor=
"@color/gray"
/>
</LinearLayout>
</LinearLayout>
...
...
book/app/src/main/res/layout/fragment_main_bookcity.xml
View file @
b17c8adc
...
@@ -69,7 +69,10 @@
...
@@ -69,7 +69,10 @@
android:id=
"@+id/iv_change_hot"
android:id=
"@+id/iv_change_hot"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"换一换"
/>
android:drawableStart=
"@mipmap/ic_change"
android:drawablePadding=
"6dp"
android:text=
"换一换"
android:textColor=
"@color/gray"
/>
</LinearLayout>
</LinearLayout>
...
@@ -110,7 +113,10 @@
...
@@ -110,7 +113,10 @@
android:id=
"@+id/iv_change_new"
android:id=
"@+id/iv_change_new"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"换一换"
/>
android:drawableStart=
"@mipmap/ic_change"
android:drawablePadding=
"6dp"
android:text=
"换一换"
android:textColor=
"@color/gray"
/>
</LinearLayout>
</LinearLayout>
...
...
book/app/src/main/res/layout/fragment_main_bookshelf.xml
View file @
b17c8adc
...
@@ -142,7 +142,10 @@
...
@@ -142,7 +142,10 @@
android:id=
"@+id/iv_change"
android:id=
"@+id/iv_change"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"换一换"
/>
android:drawableStart=
"@mipmap/ic_change"
android:drawablePadding=
"6dp"
android:text=
"换一换"
android:textColor=
"@color/gray"
/>
</LinearLayout>
</LinearLayout>
...
...
book/app/src/main/res/mipmap-xhdpi/ic_author.png
0 → 100644
View file @
b17c8adc
620 Bytes
book/app/src/main/res/mipmap-xhdpi/ic_book_collect.png
0 → 100644
View file @
b17c8adc
449 Bytes
book/app/src/main/res/mipmap-xhdpi/ic_book_collect_s.png
0 → 100644
View file @
b17c8adc
617 Bytes
book/app/src/main/res/mipmap-xhdpi/ic_book_setting.png
0 → 100644
View file @
b17c8adc
1019 Bytes
book/app/src/main/res/mipmap-xhdpi/ic_book_share.png
0 → 100644
View file @
b17c8adc
658 Bytes
book/app/src/main/res/mipmap-xhdpi/ic_change.png
0 → 100644
View file @
b17c8adc
972 Bytes
book/app/src/main/res/mipmap-xhdpi/ic_rubbish.png
0 → 100644
View file @
b17c8adc
1.71 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment