diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt index 2b7dd7b40b..6d4061fb4d 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/LiveNowTabFragment.kt @@ -10,8 +10,8 @@ import android.view.Gravity import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.view.animation.LinearInterpolator import android.widget.ArrayAdapter -import android.widget.Button import android.widget.ImageView import android.widget.TextView import net.osmand.Location @@ -47,6 +47,8 @@ class LiveNowTabFragment : Fragment(), TelegramListener, TelegramIncomingMessage private lateinit var adapter: LiveNowListAdapter private lateinit var locationViewCache: UpdateLocationViewCache + private lateinit var openOsmAndBtn: View + private var location: Location? = null private var heading: Float? = null private var locationUiUpdateAllowed: Boolean = true @@ -66,13 +68,19 @@ class LiveNowTabFragment : Fragment(), TelegramListener, TelegramIncomingMessage override fun onScrollStateChanged(recyclerView: RecyclerView?, newState: Int) { super.onScrollStateChanged(recyclerView, newState) locationUiUpdateAllowed = newState == RecyclerView.SCROLL_STATE_IDLE + when (newState) { + RecyclerView.SCROLL_STATE_DRAGGING -> animateOpenOsmAndBtn(false) + RecyclerView.SCROLL_STATE_IDLE -> animateOpenOsmAndBtn(true) + } } }) } - mainView.findViewById