Commit 690f6fa4 authored by Sylvain Berfini's avatar Sylvain Berfini :cow:
Browse files

Fixed rounded corners of main lists not properly applied on old Android versions

1 merge request!1530Fixed rounded corners of main lists not properly applied on old Android versions
Pipeline #83297 passed with stage
in 5 minutes and 11 seconds
Showing 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 -->
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment