UI commit
This commit is contained in:
parent
98f79a30bd
commit
6435dceb4a
@ -40,7 +40,7 @@ android {
|
|||||||
jniDebuggable true
|
jniDebuggable true
|
||||||
zipAlignEnabled false
|
zipAlignEnabled false
|
||||||
shrinkResources false
|
shrinkResources false
|
||||||
minifyEnabled true
|
minifyEnabled false
|
||||||
signingConfig signingConfigs.config
|
signingConfig signingConfigs.config
|
||||||
addManifestPlaceholders([
|
addManifestPlaceholders([
|
||||||
'app_name': 'Mireo Debug'
|
'app_name': 'Mireo Debug'
|
||||||
|
@ -4,10 +4,15 @@ import android.content.Intent
|
|||||||
import android.text.Editable
|
import android.text.Editable
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import android.text.TextWatcher
|
import android.text.TextWatcher
|
||||||
|
import android.view.KeyEvent
|
||||||
|
import android.view.inputmethod.EditorInfo
|
||||||
import android.widget.EditText
|
import android.widget.EditText
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.hjq.http.EasyHttp
|
||||||
|
import com.hjq.http.config.IRequestApi
|
||||||
|
import com.hjq.http.listener.HttpCallbackProxy
|
||||||
import com.localee.mireo.app.R
|
import com.localee.mireo.app.R
|
||||||
import com.localee.mireo.app.action.StatusAction
|
import com.localee.mireo.app.action.StatusAction
|
||||||
import com.localee.mireo.app.app.AppActivity
|
import com.localee.mireo.app.app.AppActivity
|
||||||
@ -18,9 +23,6 @@ import com.localee.mireo.app.other.MsConstants.CONSTANTS_short_play_id
|
|||||||
import com.localee.mireo.app.ui.adapter.SearchHotAdapter
|
import com.localee.mireo.app.ui.adapter.SearchHotAdapter
|
||||||
import com.localee.mireo.app.ui.adapter.SearchSearchAdapter
|
import com.localee.mireo.app.ui.adapter.SearchSearchAdapter
|
||||||
import com.localee.mireo.app.widget.StatusLayout
|
import com.localee.mireo.app.widget.StatusLayout
|
||||||
import com.hjq.http.EasyHttp
|
|
||||||
import com.hjq.http.config.IRequestApi
|
|
||||||
import com.hjq.http.listener.HttpCallbackProxy
|
|
||||||
|
|
||||||
|
|
||||||
class SearchActivity : AppActivity(), StatusAction {
|
class SearchActivity : AppActivity(), StatusAction {
|
||||||
@ -72,9 +74,24 @@ class SearchActivity : AppActivity(), StatusAction {
|
|||||||
override fun afterTextChanged(editable: Editable) {
|
override fun afterTextChanged(editable: Editable) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
etSearch?.setOnEditorActionListener { _, actionId, _ ->
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
etSearch?.setOnKeyListener { _, keyCode, event ->
|
||||||
|
if (event.action == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_ENTER) {
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
}
|
||||||
mAdapter?.setOnItemClickListener { adapter, view, position ->
|
mAdapter?.setOnItemClickListener { adapter, view, position ->
|
||||||
val searchHot: com.localee.mireo.app.http.api.SearchHotApi.Bean.Data = adapter.items.get(position)
|
val searchHot: com.localee.mireo.app.http.api.SearchHotApi.Bean.Data =
|
||||||
|
adapter.items.get(position)
|
||||||
startActivity(
|
startActivity(
|
||||||
Intent(
|
Intent(
|
||||||
this,
|
this,
|
||||||
@ -86,7 +103,8 @@ class SearchActivity : AppActivity(), StatusAction {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
mKeyAdapter?.setOnItemClickListener { adapter, view, position ->
|
mKeyAdapter?.setOnItemClickListener { adapter, view, position ->
|
||||||
val search: com.localee.mireo.app.http.api.SearchSearchApi.Bean.Data = adapter.items.get(position)
|
val search: com.localee.mireo.app.http.api.SearchSearchApi.Bean.Data =
|
||||||
|
adapter.items.get(position)
|
||||||
startActivity(
|
startActivity(
|
||||||
Intent(
|
Intent(
|
||||||
this,
|
this,
|
||||||
|
@ -110,6 +110,8 @@ class ListTabFragment : TitleBarFragment<HomeActivity>(), OnRefreshLoadMoreListe
|
|||||||
for (i in detailList.indices) {
|
for (i in detailList.indices) {
|
||||||
if (detailList[i].short_play_id == historyBean.short_play_id) {
|
if (detailList[i].short_play_id == historyBean.short_play_id) {
|
||||||
detailList.removeAt(i)
|
detailList.removeAt(i)
|
||||||
|
viewModel.meToHistoryCheckAction(0)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -189,9 +191,25 @@ class ListTabFragment : TitleBarFragment<HomeActivity>(), OnRefreshLoadMoreListe
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun setCancel() {
|
||||||
|
val allData: List<HistoryBean.Data>? = mAdapter?.items
|
||||||
|
for (i in allData?.indices!!) {
|
||||||
|
allData[i].is_check = false
|
||||||
|
}
|
||||||
|
detailList.clear()
|
||||||
|
mAdapter?.selectEdit = !mAdapter?.selectEdit!!
|
||||||
|
mAdapter?.notifyDataSetChanged()
|
||||||
|
if (llDelete?.visibility == View.VISIBLE)
|
||||||
|
llDelete?.visibility = View.GONE
|
||||||
|
else
|
||||||
|
llDelete?.visibility = View.VISIBLE
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
fun setAllSelect(isSelect: Boolean) {
|
fun setAllSelect(isSelect: Boolean) {
|
||||||
val allData: List<HistoryBean.Data>? = mAdapter?.items
|
val allData: List<HistoryBean.Data>? = mAdapter?.items
|
||||||
if (isSelect) {
|
if (isSelect) {
|
||||||
|
detailList.clear()
|
||||||
for (i in allData?.indices!!) {
|
for (i in allData?.indices!!) {
|
||||||
allData[i].is_check = true
|
allData[i].is_check = true
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.localee.mireo.app.ui.fragment
|
package com.localee.mireo.app.ui.fragment
|
||||||
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import android.widget.FrameLayout
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.appcompat.widget.AppCompatCheckBox
|
import androidx.appcompat.widget.AppCompatCheckBox
|
||||||
@ -32,6 +33,7 @@ class MessageFragment : TitleBarFragment<HomeActivity>(), TabAdapter.OnTabListen
|
|||||||
private val tabView: RecyclerView? by lazy { findViewById(R.id.rv_list_tab) }
|
private val tabView: RecyclerView? by lazy { findViewById(R.id.rv_list_tab) }
|
||||||
private val viewPager: ViewPager? by lazy { findViewById(R.id.viewPager) }
|
private val viewPager: ViewPager? by lazy { findViewById(R.id.viewPager) }
|
||||||
private val tvCancel: TextView? by lazy { findViewById(R.id.tv_cancel) }
|
private val tvCancel: TextView? by lazy { findViewById(R.id.tv_cancel) }
|
||||||
|
private val flSelectCheck: FrameLayout? by lazy { findViewById(R.id.fl_select_check) }
|
||||||
private val cbSelectCheck: AppCompatCheckBox? by lazy { findViewById(R.id.cb_select_check) }
|
private val cbSelectCheck: AppCompatCheckBox? by lazy { findViewById(R.id.cb_select_check) }
|
||||||
|
|
||||||
private var tabAdapter: TabAdapter? = null
|
private var tabAdapter: TabAdapter? = null
|
||||||
@ -92,7 +94,7 @@ class MessageFragment : TitleBarFragment<HomeActivity>(), TabAdapter.OnTabListen
|
|||||||
tvCancel?.visibility = View.VISIBLE
|
tvCancel?.visibility = View.VISIBLE
|
||||||
ivMore?.visibility = View.GONE
|
ivMore?.visibility = View.GONE
|
||||||
tabView?.visibility = View.INVISIBLE
|
tabView?.visibility = View.INVISIBLE
|
||||||
cbSelectCheck?.visibility = View.VISIBLE
|
flSelectCheck?.visibility = View.VISIBLE
|
||||||
listTabOneFragment.setEdit()
|
listTabOneFragment.setEdit()
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -106,25 +108,37 @@ class MessageFragment : TitleBarFragment<HomeActivity>(), TabAdapter.OnTabListen
|
|||||||
tvCancel?.visibility = View.GONE
|
tvCancel?.visibility = View.GONE
|
||||||
ivMore?.visibility = View.VISIBLE
|
ivMore?.visibility = View.VISIBLE
|
||||||
tabView?.visibility = View.VISIBLE
|
tabView?.visibility = View.VISIBLE
|
||||||
cbSelectCheck?.visibility = View.GONE
|
cbSelectCheck?.isChecked = false
|
||||||
listTabOneFragment.setEdit()
|
flSelectCheck?.visibility = View.GONE
|
||||||
|
listTabOneFragment.setCancel()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cbSelectCheck?.setOnCheckedChangeListener { buttonView, isChecked ->
|
flSelectCheck?.setOnClickListener {
|
||||||
if (isChecked) {
|
if (cbSelectCheck?.isChecked == true){
|
||||||
listTabOneFragment.setAllSelect(true)
|
cbSelectCheck?.isChecked = false
|
||||||
} else {
|
|
||||||
listTabOneFragment.setAllSelect(false)
|
listTabOneFragment.setAllSelect(false)
|
||||||
|
}else{
|
||||||
|
cbSelectCheck?.isChecked = true
|
||||||
|
listTabOneFragment.setAllSelect(true)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// cbSelectCheck?.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||||
|
// if (isChecked) {
|
||||||
|
// listTabOneFragment.setAllSelect(true)
|
||||||
|
// } else {
|
||||||
|
// listTabOneFragment.setAllSelect(false)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.listTabAction.observe(this) { data ->
|
viewModel.listTabAction.observe(this) { data ->
|
||||||
tvCancel?.visibility = View.GONE
|
tvCancel?.visibility = View.GONE
|
||||||
ivMore?.visibility = View.VISIBLE
|
ivMore?.visibility = View.VISIBLE
|
||||||
tabView?.visibility = View.VISIBLE
|
tabView?.visibility = View.VISIBLE
|
||||||
cbSelectCheck?.isChecked = false
|
cbSelectCheck?.isChecked = false
|
||||||
cbSelectCheck?.visibility = View.GONE
|
flSelectCheck?.visibility = View.GONE
|
||||||
listTabOneFragment.setEdit()
|
listTabOneFragment.setEdit()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,6 +153,10 @@ class MessageFragment : TitleBarFragment<HomeActivity>(), TabAdapter.OnTabListen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
viewModel.meToHistoryCheckAction.observe(this) { data ->
|
||||||
|
cbSelectCheck?.isChecked = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,4 +25,11 @@ class SharedViewModel : ViewModel() {
|
|||||||
fun meToHistoryAction(data: Int) {
|
fun meToHistoryAction(data: Int) {
|
||||||
_meToHistoryAction.value = data
|
_meToHistoryAction.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private val _meToHistoryCheckAction = MutableLiveData<Int>()
|
||||||
|
val meToHistoryCheckAction: LiveData<Int> get() = _meToHistoryCheckAction
|
||||||
|
|
||||||
|
fun meToHistoryCheckAction(data: Int) {
|
||||||
|
_meToHistoryCheckAction.value = data
|
||||||
|
}
|
||||||
}
|
}
|
@ -10,13 +10,14 @@
|
|||||||
android:id="@+id/rl_status_refresh"
|
android:id="@+id/rl_status_refresh"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@+id/ll_delete"
|
||||||
app:srlEnablePreviewInEditMode="false">
|
app:srlEnablePreviewInEditMode="false">
|
||||||
|
|
||||||
<com.localee.mireo.app.widget.StatusLayout
|
<com.localee.mireo.app.widget.StatusLayout
|
||||||
android:id="@+id/hl_status_hint"
|
android:id="@+id/hl_status_hint"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_above="@+id/ll_delete">
|
>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recyclerView"
|
android:id="@+id/recyclerView"
|
||||||
|
@ -123,6 +123,7 @@
|
|||||||
android:drawablePadding="@dimen/dp_3"
|
android:drawablePadding="@dimen/dp_3"
|
||||||
android:paddingHorizontal="@dimen/dp_5"
|
android:paddingHorizontal="@dimen/dp_5"
|
||||||
android:text="2%"
|
android:text="2%"
|
||||||
|
android:visibility="gone"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/sp_9"
|
android:textSize="@dimen/sp_9"
|
||||||
app:shape_radiusInBottomRight="@dimen/dp_8"
|
app:shape_radiusInBottomRight="@dimen/dp_8"
|
||||||
|
@ -20,19 +20,31 @@
|
|||||||
tools:listitem="@layout/tab_item_design"
|
tools:listitem="@layout/tab_item_design"
|
||||||
tools:spanCount="2" />
|
tools:spanCount="2" />
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatCheckBox
|
<FrameLayout
|
||||||
android:id="@+id/cb_select_check"
|
android:id="@+id/fl_select_check"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignTop="@+id/rv_list_tab"
|
android:layout_alignTop="@+id/rv_list_tab"
|
||||||
android:layout_alignBottom="@+id/rv_list_tab"
|
android:layout_alignBottom="@+id/rv_list_tab"
|
||||||
android:layout_marginLeft="@dimen/sp_15"
|
android:layout_marginLeft="@dimen/sp_15"
|
||||||
|
android:visibility="gone"
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatCheckBox
|
||||||
|
android:id="@+id/cb_select_check"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:text=" Select All"
|
android:text=" Select All"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
|
android:layout_gravity="center"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="gone"
|
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
|
android:clickable="false"
|
||||||
|
android:focusable="false"
|
||||||
|
android:focusableInTouchMode="false"
|
||||||
app:buttonCompat="@drawable/checkbox_selector" />
|
app:buttonCompat="@drawable/checkbox_selector" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_more"
|
android:id="@+id/iv_more"
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
android:drawablePadding="@dimen/dp_5"
|
android:drawablePadding="@dimen/dp_5"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:hint="Search"
|
android:hint="Search"
|
||||||
|
android:inputType="text"
|
||||||
android:paddingHorizontal="@dimen/dp_14"
|
android:paddingHorizontal="@dimen/dp_14"
|
||||||
android:textColor="@color/example_color_d9d9d9"
|
android:textColor="@color/example_color_d9d9d9"
|
||||||
android:textSize="@dimen/sp_12"
|
android:textSize="@dimen/sp_12"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user