diff options
author | Amit Kumar <amitkma@e.email> | 2021-05-15 01:18:21 +0530 |
---|---|---|
committer | Amit Kumar <amitkma@e.email> | 2021-05-15 01:18:21 +0530 |
commit | 47194484d7c2ca6ce8103312b9dbfb1244e8c4e6 (patch) | |
tree | 643171c9af65cd56ffe1fe854ae52f535f5c077a /app/src/main/java/foundation | |
parent | da842396556248654acacfdebbc01f5e20132eb6 (diff) |
Use MaterialToolbar from MDC instead of android Toolbar
Diffstat (limited to 'app/src/main/java/foundation')
-rw-r--r-- | app/src/main/java/foundation/e/privacycentralapp/common/NavToolbarFragment.kt | 4 | ||||
-rw-r--r-- | app/src/main/java/foundation/e/privacycentralapp/common/ToolbarFragment.kt | 5 |
2 files changed, 5 insertions, 4 deletions
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() } } |