Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "fnsb.macstransit"
minSdk 27
targetSdk 36
versionCode 34
versionName 'Release 1.5'
versionCode 35
versionName 'Release 1.5.1'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
android:label="@string/settings"
android:launchMode="standard"
android:screenOrientation="portrait"
android:theme="@style/AppThemeNoActionBar"
android:theme="@style/AppTheme"
tools:ignore="LockedOrientationActivity" />

<activity
android:name=".activities.loadingactivity.LoadingActivity"
android:launchMode="standard"
android:screenOrientation="portrait"
android:theme="@style/AppThemeNoActionBar"
android:theme="@style/AppTheme"
android:exported="true"
tools:ignore="LockedOrientationActivity">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package fnsb.macstransit.activities.mapsactivity

import android.graphics.Color
import androidx.core.graphics.Insets
import android.os.Bundle
import fnsb.macstransit.routematch.Route
import fnsb.macstransit.settings.V2
import fnsb.macstransit.R
import android.util.Log
import android.view.Gravity
import android.view.Menu
import android.view.ViewGroup
import androidx.activity.SystemBarStyle
import androidx.activity.enableEdgeToEdge
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.updatePadding
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.ViewModelProvider
Expand Down Expand Up @@ -47,15 +48,25 @@ class MapsActivity: FragmentActivity() {

lateinit var routeMenu: DialogPlus

lateinit var binding: ActivityMapsBinding

var bars: Insets? = null

override fun onCreate(savedInstanceState: Bundle?) {
Log.v("onCreate", "onCreate has been called!")

// https://stackoverflow.com/questions/76960994/enableedgetoedge-navigation-system-bar-is-not-fully-transparent
enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT),
navigationBarStyle = SystemBarStyle.light(Color.TRANSPARENT, Color.TRANSPARENT) // light causes internally enforce the navigation bar to be fully transparent
)
super.onCreate(savedInstanceState)

// Setup view model.
viewModel = ViewModelProvider(this)[MapsViewModel::class.java]

// Setup binding.
val binding: ActivityMapsBinding = ActivityMapsBinding.inflate(layoutInflater)
binding = ActivityMapsBinding.inflate(layoutInflater)
binding.viewmodel = viewModel
binding.lifecycleOwner = this
binding.activity = this
Expand Down Expand Up @@ -90,18 +101,14 @@ class MapsActivity: FragmentActivity() {
Log.v("onCreate", "Setting up fare window")
farePopupWindow = FarePopupWindow(this)

ViewCompat.setOnApplyWindowInsetsListener(binding.root) { view, insets ->
ViewCompat.setOnApplyWindowInsetsListener(binding.root) { _, insets ->
val bars = insets.getInsets(
WindowInsetsCompat.Type.systemBars()
or WindowInsetsCompat.Type.displayCutout()
)

view.updatePadding(
left = bars.left,
top = bars.top,
right = bars.right,
bottom = bars.bottom
)
binding.buttons.setPadding(bars.left,bars.top, bars.right, bars.bottom)
this.bars = bars

WindowInsetsCompat.CONSUMED
}
Expand Down Expand Up @@ -212,6 +219,5 @@ class MapsActivity: FragmentActivity() {
* This will be set to true coming out of SplashActivity
*/
var firstRun: Boolean = true

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ class MapsViewModel(application: Application): androidx.lifecycle.AndroidViewMod
Log.v("MapCoroutine", "Awaiting map...")
val map = supportFragment.awaitMap()

val insets = activity.bars
if (insets != null) {
map.setPadding(insets.left,insets.top, insets.right, insets.bottom)
}

// Move the camera to the 'home' position.
Log.v("MapCoroutine", "Moving camera to home position")
map.moveCamera(com.google.android.gms.maps.CameraUpdateFactory.newLatLngZoom(
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/routes_icon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
android:fillColor="#FF0000"/>
<path
android:pathData="M8,21.298C8,20.856 8.358,20.498 8.8,20.498H25.2C25.642,20.498 26,20.856 26,21.298V21.698C26,22.14 25.642,22.498 25.2,22.498H8.8C8.358,22.498 8,22.14 8,21.698V21.298Z"
android:fillColor="#0000FF"/>
android:fillColor="#FFFF00"/>
<path
android:pathData="M8,14.298C8,13.856 8.358,13.498 8.8,13.498H25.2C25.642,13.498 26,13.856 26,14.298V14.698C26,15.14 25.642,15.498 25.2,15.498H8.8C8.358,15.498 8,15.14 8,14.698V14.298Z"
android:fillColor="#00FF00"/>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/layout/activity_maps.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
tools:context=".activities.mapsactivity.MapsActivity" />

<LinearLayout
android:id="@+id/buttons"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="end"
Expand All @@ -50,6 +51,7 @@
android:contentDescription="@string/select_to_view_fares"
app:fabSize="mini"
android:layout_marginTop="10dp"
android:layout_marginBottom="5dp"
android:backgroundTint="@color/colorPrimary"
android:src="@drawable/fares"
android:onClick="@{() -> activity.farePopupWindow.showFarePopupWindow()}"/>
Expand Down
9 changes: 1 addition & 8 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:windowBackground">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppThemeNoActionBar" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:background">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

</resources>
3 changes: 2 additions & 1 deletion whatsnew/whatsnew-en-US
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
+ Created a completely new menu for selecting routes
+ Created a completely new menu for selecting routes
* Adjusted app styling