Commit b17c8adc authored by jyx's avatar jyx

优化样式

parent 7f90e6c6
......@@ -127,11 +127,11 @@ class BookReadActivity : BaseActivity(), View.OnClickListener, BookReadView {
label_tv.text = data.author
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.setTextColor(ContextCompat.getColor(this, R.color.color_goldenrod))
} else {
tab_iv_bookshelf.setImageResource(R.mipmap.bookshelf)
tab_iv_bookshelf.setImageResource(R.mipmap.ic_book_collect)
tab_tv_bookshelf.text = "收藏"
tab_tv_bookshelf.setTextColor(ContextCompat.getColor(this, R.color.black))
}
......@@ -140,12 +140,12 @@ class BookReadActivity : BaseActivity(), View.OnClickListener, BookReadView {
private fun setIsCollect(collect: Boolean) {
isCollect = collect
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.setTextColor(ContextCompat.getColor(this, R.color.color_goldenrod))
readPresenter.collect(bookId)
} else {
tab_iv_bookshelf.setImageResource(R.mipmap.bookshelf)
tab_iv_bookshelf.setImageResource(R.mipmap.ic_book_collect)
tab_tv_bookshelf.text = "收藏"
tab_tv_bookshelf.setTextColor(ContextCompat.getColor(this, R.color.black))
readPresenter.cancelCollect(bookId)
......
......@@ -19,7 +19,6 @@ import com.mints.enjoyboxjia.ui.adapter.SearchBookAdapter
import com.mints.enjoyboxjia.ui.adapter.SearchHistoryAdapter
import com.mints.enjoyboxjia.ui.adapter.SearchHotBookAdapter
import com.mints.enjoyboxjia.utils.AppPreferencesManager
import com.mints.enjoyboxjia.utils.LogUtil
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
......@@ -108,6 +107,9 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
R.id.iv_clear -> {
clearSearchHistory()
}
R.id.iv_change -> {
searchPresenter.getHotBook()
}
}
}
......@@ -117,6 +119,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
iv_left_icon.setOnClickListener(this)
btn_search.setOnClickListener(this)
iv_clear.setOnClickListener(this)
iv_change.setOnClickListener(this)
et_search.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
......@@ -145,7 +148,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
override fun getHotBookSuc(data: BookListBean) {
searchHotBookData.clear()
searchHotBookData.addAll(data.records)
searchHotBookAdapter?.setNewInstance(searchHotBookData)
searchHotBookAdapter?.setList(searchHotBookData)
}
override fun getHotBookFail() {
......@@ -165,7 +168,7 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
srl_show.finishRefresh(true)
searchBookData.clear()
searchBookData.addAll(data.records)
searchBookAdapter?.setNewInstance(data.records)
searchBookAdapter?.setList(data.records)
} else {
if (data.records.size < searchPageSize) {
srl_show.finishLoadMoreWithNoMoreData()
......@@ -183,7 +186,6 @@ class BookSearchActivity : BaseActivity(), View.OnClickListener, BookSearchView,
}
private fun addSearchHistory(str: String) {
LogUtil.d("XXXXXXXXXX", str)
var searchHistory = AppPreferencesManager.get().getString(BOOK_SEARCH_HISTORY, "")
searchHistory += ",$str"
AppPreferencesManager.get().put(BOOK_SEARCH_HISTORY, searchHistory)
......
......@@ -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) {
hotBookData.clear()
hotBookData.addAll(data.records)
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() {}
......@@ -174,7 +162,7 @@ class BookCityFragment : LazyLoadBaseFragment(), BookCityView, View.OnClickListe
override fun getNewBookSuc(data: BookListBean) {
newBookData.clear()
newBookData.addAll(data.records)
newBookAdapter?.setNewInstance(newBookData)
newBookAdapter?.setList(newBookData)
}
override fun getNewBookFail() {}
......
......@@ -134,7 +134,7 @@ class BookShelfFragment : LazyLoadBaseFragment(), BookShelfView, View.OnClickLis
shelfBookData.clear()
shelfBookData.addAll(data.records)
shelfBookData.add(BookBean())
bookShelfAdapter?.setNewInstance(shelfBookData)
bookShelfAdapter?.setList(shelfBookData)
bookShelfAdapter?.setEditStyle(false)
} else {
bookshelf_empty.visibility = View.VISIBLE
......@@ -148,7 +148,7 @@ class BookShelfFragment : LazyLoadBaseFragment(), BookShelfView, View.OnClickLis
override fun getArticleLikeSuc(data: BookListBean) {
likeBookData.clear()
likeBookData.addAll(data.records)
likeBookAdapter?.setNewInstance(likeBookData)
likeBookAdapter?.setList(likeBookData)
}
override fun getArticleLikeFail() {
......
......@@ -67,6 +67,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:drawableStart="@mipmap/ic_author"
android:drawablePadding="2dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/color_378eff"
......@@ -144,7 +146,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_bookshelf" />
android:paddingTop="2dp" />
<TextView
android:id="@+id/tab_tv_bookshelf"
......@@ -169,7 +171,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_bookshelf" />
android:src="@mipmap/ic_book_setting" />
<TextView
android:layout_width="wrap_content"
......@@ -193,7 +195,7 @@
android:layout_width="20dp"
android:layout_height="20dp"
android:contentDescription="@null"
android:src="@drawable/selector_tab_bookshelf" />
android:src="@mipmap/ic_book_share" />
<TextView
android:layout_width="wrap_content"
......
......@@ -84,7 +84,7 @@
android:id="@+id/iv_clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_text_clear" />
android:src="@mipmap/ic_rubbish" />
</LinearLayout>
......@@ -147,7 +147,10 @@
android:id="@+id/iv_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="换一换" />
android:drawableStart="@mipmap/ic_change"
android:drawablePadding="6dp"
android:text="换一换"
android:textColor="@color/gray" />
</LinearLayout>
......
......@@ -69,7 +69,10 @@
android:id="@+id/iv_change_hot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="换一换" />
android:drawableStart="@mipmap/ic_change"
android:drawablePadding="6dp"
android:text="换一换"
android:textColor="@color/gray" />
</LinearLayout>
......@@ -110,7 +113,10 @@
android:id="@+id/iv_change_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="换一换" />
android:drawableStart="@mipmap/ic_change"
android:drawablePadding="6dp"
android:text="换一换"
android:textColor="@color/gray" />
</LinearLayout>
......
......@@ -142,7 +142,10 @@
android:id="@+id/iv_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="换一换" />
android:drawableStart="@mipmap/ic_change"
android:drawablePadding="6dp"
android:text="换一换"
android:textColor="@color/gray" />
</LinearLayout>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment