mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Fixed rounded corners of main lists not properly applied on old Android versions
This commit is contained in:
parent
45cfac3ac6
commit
690f6fa4c2
5 changed files with 14 additions and 0 deletions
|
|
@ -119,6 +119,7 @@ class ConversationsListFragment : AbstractMainFragment() {
|
|||
|
||||
binding.conversationsList.setHasFixedSize(true)
|
||||
binding.conversationsList.layoutManager = LinearLayoutManager(requireContext())
|
||||
binding.conversationsList.outlineProvider = outlineProvider
|
||||
binding.conversationsList.clipToOutline = true
|
||||
|
||||
adapter.conversationLongClickedEvent.observe(viewLifecycleOwner) {
|
||||
|
|
|
|||
|
|
@ -20,9 +20,11 @@
|
|||
package org.linphone.ui.main.fragment
|
||||
|
||||
import android.content.res.Configuration
|
||||
import android.graphics.Outline
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewOutlineProvider
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.annotation.IdRes
|
||||
|
|
@ -54,6 +56,14 @@ abstract class AbstractMainFragment : GenericMainFragment() {
|
|||
private const val TAG = "[Abstract Main Fragment]"
|
||||
}
|
||||
|
||||
protected val outlineProvider = object : ViewOutlineProvider() {
|
||||
override fun getOutline(view: View?, outline: Outline?) {
|
||||
val radius = resources.getDimension(R.dimen.top_bar_rounded_corner_radius)
|
||||
view ?: return
|
||||
outline?.setRoundRect(0, 0, view.width, (view.height + radius).toInt(), radius)
|
||||
}
|
||||
}
|
||||
|
||||
private var currentFragmentId: Int = 0
|
||||
|
||||
private lateinit var viewModel: AbstractMainViewModel
|
||||
|
|
|
|||
|
|
@ -106,6 +106,7 @@ class HistoryListFragment : AbstractMainFragment() {
|
|||
|
||||
binding.historyList.setHasFixedSize(true)
|
||||
binding.historyList.layoutManager = LinearLayoutManager(requireContext())
|
||||
binding.historyList.outlineProvider = outlineProvider
|
||||
binding.historyList.clipToOutline = true
|
||||
|
||||
adapter.callLogLongClickedEvent.observe(viewLifecycleOwner) {
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ class MeetingsListFragment : AbstractMainFragment() {
|
|||
|
||||
val headerItemDecoration = RecyclerViewHeaderDecoration(requireContext(), adapter)
|
||||
binding.meetingsList.addItemDecoration(headerItemDecoration)
|
||||
binding.meetingsList.outlineProvider = outlineProvider
|
||||
binding.meetingsList.clipToOutline = true
|
||||
|
||||
binding.setNewMeetingClicked {
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<dimen name="primary_secondary_buttons_label_padding">11dp</dimen>
|
||||
<dimen name="dialog_top_bottom_margin">20dp</dimen>
|
||||
|
||||
<dimen name="top_bar_rounded_corner_radius">20dp</dimen>
|
||||
<dimen name="top_bar_shadow_height">54dp</dimen>
|
||||
<dimen name="top_bar_height">55dp</dimen>
|
||||
<dimen name="toast_top_margin">70dp</dimen> <!-- 15dp + top_bar_height -->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue