From 47194484d7c2ca6ce8103312b9dbfb1244e8c4e6 Mon Sep 17 00:00:00 2001 From: Amit Kumar Date: Sat, 15 May 2021 01:18:21 +0530 Subject: Use MaterialToolbar from MDC instead of android Toolbar --- .../java/foundation/e/privacycentralapp/common/NavToolbarFragment.kt | 4 ++-- .../java/foundation/e/privacycentralapp/common/ToolbarFragment.kt | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'app/src/main/java/foundation/e/privacycentralapp') diff --git a/app/src/main/java/foundation/e/privacycentralapp/common/NavToolbarFragment.kt b/app/src/main/java/foundation/e/privacycentralapp/common/NavToolbarFragment.kt index 0a9d102..52197cd 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/common/NavToolbarFragment.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/common/NavToolbarFragment.kt @@ -17,12 +17,12 @@ package foundation.e.privacycentralapp.common -import android.widget.Toolbar import androidx.annotation.LayoutRes +import com.google.android.material.appbar.MaterialToolbar abstract class NavToolbarFragment(@LayoutRes contentLayoutId: Int) : ToolbarFragment(contentLayoutId) { - override fun setupToolbar(toolbar: Toolbar) { + override fun setupToolbar(toolbar: MaterialToolbar) { super.setupToolbar(toolbar) toolbar.apply { setNavigationIcon(lineageos.platform.R.drawable.ic_back) diff --git a/app/src/main/java/foundation/e/privacycentralapp/common/ToolbarFragment.kt b/app/src/main/java/foundation/e/privacycentralapp/common/ToolbarFragment.kt index c316340..f156e09 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/common/ToolbarFragment.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/common/ToolbarFragment.kt @@ -19,9 +19,9 @@ package foundation.e.privacycentralapp.common import android.os.Bundle import android.view.View -import android.widget.Toolbar import androidx.annotation.LayoutRes import androidx.fragment.app.Fragment +import com.google.android.material.appbar.MaterialToolbar import foundation.e.privacycentralapp.R abstract class ToolbarFragment(@LayoutRes contentLayoutId: Int) : Fragment(contentLayoutId) { @@ -33,10 +33,11 @@ abstract class ToolbarFragment(@LayoutRes contentLayoutId: Int) : Fragment(conte override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + setupToolbar(view.findViewById(R.id.toolbar)) } - open fun setupToolbar(toolbar: Toolbar) { + open fun setupToolbar(toolbar: MaterialToolbar) { toolbar.title = getTitle() } } -- cgit v1.2.1