mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2025-02-23 02:03:14 +03:00
hide update function of inline (#415)
This commit is contained in:
parent
d344cc8e77
commit
356a845b69
@ -55,8 +55,9 @@ class ProvidersDesign(
|
|||||||
fun requestUpdateAll() {
|
fun requestUpdateAll() {
|
||||||
adapter.states.filter { !it.updating }.forEachIndexed { index, state ->
|
adapter.states.filter { !it.updating }.forEachIndexed { index, state ->
|
||||||
state.updating = true
|
state.updating = true
|
||||||
|
if (state.provider.vehicleType != Provider.VehicleType.Inline) {
|
||||||
requests.trySend(Request.Update(index, state.provider))
|
requests.trySend(Request.Update(index, state.provider))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -55,10 +55,17 @@ class ProviderAdapter(
|
|||||||
|
|
||||||
holder.binding.provider = state.provider
|
holder.binding.provider = state.provider
|
||||||
holder.binding.state = state
|
holder.binding.state = state
|
||||||
holder.binding.update = View.OnClickListener {
|
if (state.provider.vehicleType == Provider.VehicleType.Inline) {
|
||||||
state.updating = true
|
holder.binding.endView.visibility = View.GONE
|
||||||
|
holder.binding.elapsedView.visibility = View.GONE
|
||||||
requestUpdate(position, state.provider)
|
holder.binding.divider.visibility = View.GONE
|
||||||
|
} else {
|
||||||
|
holder.binding.endView.visibility = View.VISIBLE
|
||||||
|
holder.binding.elapsedView.visibility = View.VISIBLE
|
||||||
|
holder.binding.update = View.OnClickListener {
|
||||||
|
state.updating = true
|
||||||
|
requestUpdate(position, state.provider)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
android:text="@{IntervalKt.elapsedIntervalString(currentTime.value - state.updatedAt, context)}" />
|
android:text="@{IntervalKt.elapsedIntervalString(currentTime.value - state.updatedAt, context)}" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
android:id="@+id/divider"
|
||||||
android:layout_width="@dimen/divider_size"
|
android:layout_width="@dimen/divider_size"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user