Bimba.git

commit c09a1e8af7e316a3911f5fb9e0d604be6e13d6fe

Author: Adam <git@apiote.xyz>

fix toolbar font

%!v(PANIC=String method: strings: negative Repeat count)


diff --git a/app/src/main/java/ml/adamsprogs/bimba/departures/DeparturesActivity.kt b/app/src/main/java/ml/adamsprogs/bimba/departures/DeparturesActivity.kt
index 5896a7bc1f2a91b21377e2cd31053206292ef947..54dc07e30d23a1cb9bcf32ce8fd19ddb029082d4 100644
--- a/app/src/main/java/ml/adamsprogs/bimba/departures/DeparturesActivity.kt
+++ b/app/src/main/java/ml/adamsprogs/bimba/departures/DeparturesActivity.kt
@@ -7,12 +7,14 @@ import android.os.Bundle
 import android.util.Log
 import android.view.View
 import android.widget.Toast
+import androidx.core.content.res.ResourcesCompat
 import androidx.core.view.WindowCompat
 import androidx.recyclerview.widget.LinearLayoutManager
 import kotlinx.coroutines.Dispatchers
 import kotlinx.coroutines.MainScope
 import kotlinx.coroutines.launch
 import kotlinx.coroutines.withContext
+import ml.adamsprogs.bimba.R
 import ml.adamsprogs.bimba.api.*
 import ml.adamsprogs.bimba.databinding.ActivityDeparturesBinding
 import java.io.InputStream
@@ -30,9 +32,13 @@ 		super.onCreate(savedInstanceState)
 		_binding = ActivityDeparturesBinding.inflate(layoutInflater)
 		setContentView(binding.root)
 
-//		setSupportActionBar(binding.departuresAppBar)
-//		supportActionBar?.title = "Półwiejska"
-		binding.collapsingLayout.title = intent?.extras?.getString("name")
+		binding.collapsingLayout.apply {
+			title = intent?.extras?.getString("name")
+			val tf = ResourcesCompat.getFont(this@DeparturesActivity, R.font.railway)
+			setCollapsedTitleTypeface(tf)
+			setExpandedTitleTypeface(tf)
+		}
+
 		binding.departuresRecycler.layoutManager = LinearLayoutManager(this)
 		adapter = BimbaDeparturesAdapter(layoutInflater, this, listOf()) {
 			Log.v("Departure", "clicked: $it")




diff --git a/app/src/main/res/layout/activity_departures.xml b/app/src/main/res/layout/activity_departures.xml
index 783da782471292a2ce18f33c274c2ed6dbb6c215..9b89f4d145aa3499bdf4b03faeb760b2466cb710 100644
--- a/app/src/main/res/layout/activity_departures.xml
+++ b/app/src/main/res/layout/activity_departures.xml
@@ -24,7 +24,6 @@ 		android:layout_width="match_parent"
 		android:layout_height="wrap_content"
 		android:fitsSystemWindows="true">
 
-		<!-- todo toolbar font family -->
 		<com.google.android.material.appbar.CollapsingToolbarLayout
 			android:id="@+id/collapsing_layout"
 			style="?attr/collapsingToolbarLayoutMediumStyle"




diff --git a/app/src/main/res/layout/activity_results.xml b/app/src/main/res/layout/activity_results.xml
index 33184f38545b8294990827b54cb99eb79f2a7bf1..c8d8940f8aabd45cc4040bc46253c3fded640832 100644
--- a/app/src/main/res/layout/activity_results.xml
+++ b/app/src/main/res/layout/activity_results.xml
@@ -19,7 +19,6 @@ 			app:layout_constraintStart_toStartOf="parent"
 			app:layout_constraintTop_toTopOf="parent" />
 	</androidx.constraintlayout.widget.ConstraintLayout>
 
-	<!-- todo toolbar font family -->
 	<com.google.android.material.appbar.AppBarLayout
 		android:layout_width="match_parent"
 		android:layout_height="wrap_content"