mirror of
https://github.com/MetaCubeX/ClashMetaForAndroid.git
synced 2025-02-21 09:13:16 +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() {
|
||||
adapter.states.filter { !it.updating }.forEachIndexed { index, state ->
|
||||
state.updating = true
|
||||
|
||||
requests.trySend(Request.Update(index, state.provider))
|
||||
if (state.provider.vehicleType != Provider.VehicleType.Inline) {
|
||||
requests.trySend(Request.Update(index, state.provider))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -55,10 +55,17 @@ class ProviderAdapter(
|
||||
|
||||
holder.binding.provider = state.provider
|
||||
holder.binding.state = state
|
||||
holder.binding.update = View.OnClickListener {
|
||||
state.updating = true
|
||||
|
||||
requestUpdate(position, state.provider)
|
||||
if (state.provider.vehicleType == Provider.VehicleType.Inline) {
|
||||
holder.binding.endView.visibility = View.GONE
|
||||
holder.binding.elapsedView.visibility = View.GONE
|
||||
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)}" />
|
||||
|
||||
<View
|
||||
android:id="@+id/divider"
|
||||
android:layout_width="@dimen/divider_size"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
Loading…
x
Reference in New Issue
Block a user