Skip to content

Commit 88640bf

Browse files
committed
.
1 parent e987c42 commit 88640bf

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

app/src/main/java/com/hazz/kotlinmvp/ui/activity/SearchActivity.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,13 @@ class SearchActivity : BaseActivity(), SearchContract.View {
9292
}
9393
})
9494

95-
95+
//取消
9696
tv_cancel.setOnClickListener { onBackPressed() }
97-
97+
//键盘的搜索按钮
9898
et_search_view.setOnEditorActionListener(object : TextView.OnEditorActionListener {
9999
override fun onEditorAction(v: TextView?, actionId: Int, event: KeyEvent?): Boolean {
100100
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
101+
closeSoftKeyboard()
101102
keyWords = et_search_view.text.toString().trim()
102103
if (keyWords.isNullOrEmpty()) {
103104
showToast("请输入你感兴趣的关键词")
@@ -154,6 +155,7 @@ class SearchActivity : BaseActivity(), SearchContract.View {
154155
mRecyclerView_hot.adapter = mHotKeywordsAdapter
155156
//设置 Tag 的点击事件
156157
mHotKeywordsAdapter?.setOnTagItemClickListener {
158+
closeSoftKeyboard()
157159
keyWords = it
158160
mPresenter.querySearchData(it)
159161
}
@@ -167,7 +169,6 @@ class SearchActivity : BaseActivity(), SearchContract.View {
167169

168170
hideHotWordView()
169171
tv_search_count.visibility = View.VISIBLE
170-
171172
tv_search_count.text = String.format(resources.getString(R.string.search_result_count), keyWords, issue.total)
172173

173174
itemList = issue.itemList
@@ -305,13 +306,14 @@ class SearchActivity : BaseActivity(), SearchContract.View {
305306

306307
// 默认回退
307308
private fun defaultBackPressed() {
308-
closeKeyBord(et_search_view, applicationContext)
309+
closeSoftKeyboard()
309310
super.onBackPressed()
310311
}
311312

312313
override fun onDestroy() {
313314
super.onDestroy()
314315
mPresenter.detachView()
316+
mTextTypeface = null
315317
}
316318

317319

app/src/main/java/com/hazz/kotlinmvp/ui/fragment/HomeFragment.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.content.Intent
44
import android.os.Build
55
import android.os.Bundle
66
import android.support.v4.app.ActivityOptionsCompat
7+
import android.support.v7.widget.DefaultItemAnimator
78
import android.support.v7.widget.LinearLayoutManager
89
import android.support.v7.widget.RecyclerView
910
import com.hazz.kotlinmvp.R
@@ -42,7 +43,7 @@ class HomeFragment : BaseFragment(), HomeContract.View {
4243
private var loadingMore = false
4344

4445
private var isRefresh = false
45-
private var mMaterialHeader:MaterialHeader?=null
46+
private var mMaterialHeader: MaterialHeader? = null
4647

4748
companion object {
4849
fun getInstance(title: String): HomeFragment {
@@ -183,6 +184,7 @@ class HomeFragment : BaseFragment(), HomeContract.View {
183184

184185
mRecyclerView.adapter = mHomeAdapter
185186
mRecyclerView.layoutManager = linearLayoutManager
187+
mRecyclerView.itemAnimator = DefaultItemAnimator()
186188

187189
}
188190

app/src/main/res/layout/activity_video_detail.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
android:layout_below="@id/mVideoView"
3737
android:background="@color/color_light_black" />
3838

39+
3940
<android.support.v7.widget.RecyclerView
4041
android:id="@+id/mRecyclerView"
4142
android:layout_width="match_parent"

app/src/main/res/layout/item_video_detail_info.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:expandableTextView="http://schemas.android.com/apk/res-auto"
43
xmlns:tools="http://schemas.android.com/tools"
54
android:layout_width="match_parent"
65
android:layout_height="wrap_content"

0 commit comments

Comments
 (0)