mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Improve animations
This commit is contained in:
parent
6818be21a1
commit
621c74c1d6
@ -5,14 +5,13 @@ import android.os.Parcelable
|
||||
import android.util.SparseArray
|
||||
import android.widget.Toast
|
||||
import androidx.activity.viewModels
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.text.HtmlCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.recyclerview.widget.DividerItemDecoration
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator
|
||||
import com.google.android.material.divider.MaterialDividerItemDecoration
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import kotlinx.coroutines.launch
|
||||
@ -92,6 +91,7 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() {
|
||||
viewModel.onExpirationTypeSelected(it)
|
||||
}
|
||||
binding.recyclerViewDeleteTypes.apply {
|
||||
(itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
adapter = deleteTypeOptionAdapter
|
||||
addDividers()
|
||||
setHasFixedSize(true)
|
||||
@ -102,6 +102,7 @@ class ExpirationSettingsActivity: PassphraseRequiredActionBarActivity() {
|
||||
viewModel.onExpirationTimerSelected(it)
|
||||
}
|
||||
binding.recyclerViewTimerOptions.apply {
|
||||
(itemAnimator as SimpleItemAnimator).supportsChangeAnimations = false
|
||||
adapter = timerOptionAdapter
|
||||
addDividers()
|
||||
}
|
||||
|
@ -35,14 +35,14 @@ class RadioOptionAdapter<T>(
|
||||
isSelected = position == selectedOptionPosition
|
||||
) {
|
||||
onClickListener(it)
|
||||
selectedOptionPosition = position
|
||||
notifyItemRangeChanged(0, itemCount)
|
||||
setSelectedPosition(position)
|
||||
}
|
||||
}
|
||||
|
||||
fun setSelectedPosition(selectedPosition: Int) {
|
||||
notifyItemChanged(selectedOptionPosition)
|
||||
selectedOptionPosition = selectedPosition
|
||||
notifyDataSetChanged()
|
||||
notifyItemChanged(selectedOptionPosition)
|
||||
}
|
||||
|
||||
class ViewHolder<T>(itemView: View): RecyclerView.ViewHolder(itemView) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user