Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material Design 3 migration (V2) #927

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
dc38bfe
Migrate all dialogs to Material Design 3
Bnyro Jun 12, 2023
ca55a4e
Migrate colors and list items to Material design 3
Bnyro Jun 12, 2023
fbb1752
Fix minor issues and migrate search suggestions style to md3
Bnyro Jun 12, 2023
ff56aff
Migrate preference dialogs to MD3
Bnyro Jun 12, 2023
2dcb6ba
Improve appearance of transport networks
Bnyro Jun 12, 2023
03f51cc
Rewrite navigation drawer for Material Design 3
Bnyro Jul 24, 2023
30091fb
remove unneeded tests due to md3 migration
Bnyro Jul 31, 2023
cd2ae56
make material 3 more colorful
newhinton Jan 12, 2024
1c670ef
use better splashscreen
newhinton Jan 17, 2024
d6369c5
add material you colors
newhinton Jan 17, 2024
ebb7758
fix star color
newhinton Jan 17, 2024
fc4bdb3
add dark material you colors
newhinton Jan 17, 2024
4bcd65c
use back arrow instead of toolbar
newhinton Jan 17, 2024
ac763ad
make trip view semi-fullscreen
newhinton Jan 17, 2024
a057e5b
use colors in textviews
newhinton Jan 18, 2024
d8bac80
mute colors a bit
newhinton Jan 18, 2024
296ea97
fix primary card style
newhinton Jan 22, 2024
71fd70c
update startup icon color
newhinton Jan 22, 2024
1196dc0
add startup icon
newhinton Jan 22, 2024
d38dfb1
add missing colors
newhinton Jan 22, 2024
c091cb7
push map route below statusbar
newhinton Jan 23, 2024
2649704
improve splash screen colors
newhinton Jan 23, 2024
56f8e9b
update divider between map and content
newhinton Jan 23, 2024
1685862
draw map below statusbar in map activity
newhinton Jan 23, 2024
3dae404
partially fix shadow on special location fragment
newhinton Jan 23, 2024
28fa82b
use transparent navigation bar
newhinton Jan 23, 2024
6f6ed83
fix minor color choices
newhinton Jan 23, 2024
8eeb109
make walk icon more legible
newhinton Jan 23, 2024
b6677e0
use light navbar
newhinton Jan 26, 2024
6946aa4
add main view rounded corners
newhinton Jan 31, 2024
204c59b
add rounded corners
newhinton Feb 4, 2024
6ebc0d5
add better dropdown background
newhinton Feb 4, 2024
8472ced
add myself to cla
newhinton Feb 4, 2024
4cabad3
fix typo
newhinton Feb 4, 2024
56cc7e2
remove divider from detailview
newhinton Feb 4, 2024
d411da1
remove divider comments
newhinton Feb 4, 2024
08d41fb
remove border from map
newhinton Feb 4, 2024
ed81b76
Animate details screen
newhinton Feb 4, 2024
aa04e25
use proper namespace
newhinton Feb 4, 2024
d59a8d4
Merge remote-tracking branch 'upstream/master' into md3
newhinton Feb 4, 2024
c07cb18
fix merge errors
newhinton Feb 4, 2024
bd45519
make message for trip section more prominent
newhinton Feb 5, 2024
ce1f44e
use smaller, filled circles for intermediary stops
newhinton Feb 5, 2024
3d9934f
fix scroll issue on map-selected-target-location
newhinton Feb 5, 2024
155632b
Merge branch 'master' into md3
Altonss Feb 7, 2024
2e8c3f5
fix toolbar menus not showing
newhinton Feb 7, 2024
1ac9369
reintroduce yellow walk color
newhinton Feb 18, 2024
64ee501
fix typo in comment
newhinton Feb 18, 2024
d160830
Fix PopupMenu icon colors
newhinton Feb 18, 2024
0100569
fix coloring on network selection
newhinton Feb 19, 2024
001cb61
refactor attribute naming
newhinton Feb 19, 2024
c534558
use less prominent color for back button
newhinton Feb 19, 2024
d1f2b45
use proper color for toolbar close
newhinton Feb 19, 2024
5b1dbad
improve map attribution
newhinton Mar 13, 2024
64f4b49
use material dialog for transport mode selector
newhinton Mar 13, 2024
4bb7cfb
use less obtrusive color on favorite card
newhinton Mar 13, 2024
e7a18ec
undo intellij-configchange
newhinton Mar 13, 2024
d393f5d
update first network selection
newhinton Mar 14, 2024
200ad84
improve list styles
newhinton Mar 14, 2024
7fa31ca
Switch navheader to constraintlayout
newhinton Mar 14, 2024
62f3fac
fix map attribution on trip details
newhinton Mar 14, 2024
ca358fe
increase back button contrast
newhinton Mar 14, 2024
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
3 changes: 2 additions & 1 deletion .clabot
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"thgoebel",
"pt2121",
"Jean-BaptisteC",
"Bnyro"
"Bnyro",
"newinton"
newhinton marked this conversation as resolved.
Show resolved Hide resolved
],
"label": "cla-signed ✔️",
"message": "Thank you for your pull request and welcome to our community! We require contributors to sign our [Contributor License Agreement](https://github.com/grote/Transportr/blob/master/CLA.md), and we don't seem to have the user {{usersWithoutCLA}} on file. In order for your code to get reviewed and merged, please explicitly state that you accept the agreement. Alternatively, you can add a commit that adds yourself to https://github.com/grote/Transportr/blob/master/.clabot"
Expand Down
3 changes: 0 additions & 3 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ dependencies {
implementation 'com.github.omadahealth:swipy:1.2.3'
implementation 'de.cketti.library.changelog:ckchangelog:1.2.2'
implementation 'com.google.android:flexbox:0.3.2'
implementation 'com.mikepenz:materialdrawer:6.1.1'
implementation 'com.mikepenz:aboutlibraries:6.2.0'
implementation "com.mikepenz:fastadapter:$fastadapterVersion"
implementation "com.mikepenz:fastadapter-commons:$fastadapterVersion"
Expand Down Expand Up @@ -163,4 +162,6 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
androidTestImplementation('tools.fastlane:screengrab:2.1.1')
kaptAndroidTestDebug "com.google.dagger:dagger-compiler:$daggerVersion"

implementation 'androidx.core:core-splashscreen:1.0.1'
}
10 changes: 5 additions & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
<activity
android:name="de.grobox.transportr.map.MapActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="stateHidden|adjustPan">
android:windowSoftInputMode="stateHidden|adjustPan"
android:theme="@style/Theme.App.Starting">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand All @@ -68,18 +68,18 @@
<activity
android:name="de.grobox.transportr.trips.search.DirectionsActivity"
android:exported="true"
android:theme="@style/AppTheme.MapFullscreen"
android:windowSoftInputMode="stateHidden"/>

<activity
android:name="de.grobox.transportr.departures.DeparturesActivity"
android:label="@string/drawer_departures"
android:parentActivityName="de.grobox.transportr.map.MapActivity"
tools:targetApi="jelly_bean"/>
android:parentActivityName="de.grobox.transportr.map.MapActivity" />

<activity
android:name="de.grobox.transportr.trips.detail.TripDetailActivity"
android:parentActivityName="de.grobox.transportr.trips.search.DirectionsActivity"
tools:targetApi="jelly_bean"/>
android:theme="@style/AppTheme.MapFullscreen" />

<activity
android:name="de.grobox.transportr.networks.PickTransportNetworkActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package de.grobox.transportr

import android.app.Application
import com.google.android.material.color.DynamicColors
import com.mapbox.mapboxsdk.Mapbox
import com.mapbox.services.android.telemetry.MapboxTelemetry

Expand All @@ -27,6 +28,8 @@ open class TransportrApplication : Application() {
private set

override fun onCreate() {
DynamicColors.applyToActivitiesIfAvailable(this)

super.onCreate()

Mapbox.getInstance(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,27 @@ import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.widget.TextView
import androidx.cardview.widget.CardView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import de.grobox.transportr.R
import com.google.android.material.card.MaterialCardView
import de.grobox.transportr.ui.LineView
import de.grobox.transportr.utils.DateUtils.formatDelay
import de.grobox.transportr.utils.DateUtils.formatTime
import de.grobox.transportr.utils.DateUtils.formatRelativeTime
import de.grobox.transportr.utils.DateUtils.formatTime
import de.grobox.transportr.utils.TransportrUtils.getLocationName
import de.schildbach.pte.dto.Departure
import kotlinx.android.synthetic.main.list_item_departure.view.*
import java.util.*
import kotlinx.android.synthetic.main.list_item_departure.view.delay
import kotlinx.android.synthetic.main.list_item_departure.view.departureTimeAbs
import kotlinx.android.synthetic.main.list_item_departure.view.departureTimeRel
import kotlinx.android.synthetic.main.list_item_departure.view.destinationView
import kotlinx.android.synthetic.main.list_item_departure.view.line
import kotlinx.android.synthetic.main.list_item_departure.view.lineNameView
import kotlinx.android.synthetic.main.list_item_departure.view.messageView
import kotlinx.android.synthetic.main.list_item_departure.view.positionView
import java.util.Date

internal class DepartureViewHolder(v: View) : RecyclerView.ViewHolder(v) {

private val card: CardView = v as CardView
private val card: MaterialCardView = v as MaterialCardView
private val line: LineView = v.line
private val lineName: TextView = v.lineNameView
private val timeRel: TextView = v.departureTimeRel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package de.grobox.transportr.departures;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import androidx.annotation.NonNull;
Expand All @@ -40,6 +41,7 @@
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.material.color.MaterialColors;
import com.omadahealth.github.swipyrefreshlayout.library.SwipyRefreshLayout;
import com.omadahealth.github.swipyrefreshlayout.library.SwipyRefreshLayoutDirection;

Expand Down Expand Up @@ -121,7 +123,7 @@ public void onCreate(@Nullable Bundle savedInstanceState) {

// Swipe to Refresh
swipe = findViewById(R.id.swipe);
swipe.setColorSchemeResources(R.color.accent);
swipe.setColorSchemeColors(MaterialColors.getColor(this, R.attr.colorPrimary, Color.TRANSPARENT));
swipe.setDirection(SwipyRefreshLayoutDirection.BOTH);
swipe.setDistanceToTriggerSync(getDragDistance(this));
swipe.setOnRefreshListener(direction -> loadMoreDepartures(direction != TOP));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@

package de.grobox.transportr.favorites.locations

import android.app.Activity
import android.content.DialogInterface
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager.LayoutParams
import android.view.inputmethod.InputMethodManager
import androidx.annotation.StringRes
import androidx.fragment.app.DialogFragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import com.mikepenz.materialize.util.KeyboardUtil
import de.grobox.transportr.AppComponent
import de.grobox.transportr.R
import de.grobox.transportr.TransportrApplication
Expand All @@ -43,6 +46,7 @@ import de.grobox.transportr.settings.SettingsManager
import javax.annotation.ParametersAreNonnullByDefault
import javax.inject.Inject


@ParametersAreNonnullByDefault
abstract class SpecialLocationFragment : DialogFragment(), LocationView.LocationViewListener {

Expand All @@ -62,10 +66,6 @@ abstract class SpecialLocationFragment : DialogFragment(), LocationView.Location
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
inject((activity!!.application as TransportrApplication).component)
setStyle(
STYLE_NO_TITLE,
R.style.SetHomeDialogTheme
)
}

protected abstract fun inject(component: AppComponent)
Expand All @@ -74,6 +74,8 @@ abstract class SpecialLocationFragment : DialogFragment(), LocationView.Location
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val v = inflater.inflate(R.layout.fragment_special_location, container)

dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))

// Initialize LocationView
loc = v.findViewById(R.id.location_input)
loc.setHint(hint)
Expand Down Expand Up @@ -109,7 +111,8 @@ abstract class SpecialLocationFragment : DialogFragment(), LocationView.Location
}

override fun onCancel(dialog: DialogInterface) {
KeyboardUtil.hideKeyboard(activity)
val imm = activity?.getSystemService(Activity.INPUT_METHOD_SERVICE) as InputMethodManager?
imm?.hideSoftInputFromWindow(requireActivity().currentFocus?.windowToken, 0)
Comment on lines -112 to +115
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would vote for having our own KeyboardUtil.kt that encapsulates this rather ugly piece of code.

}

override fun onLocationItemClick(loc: WrapLocation, type: FavLocationType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import android.view.View
import android.view.View.OnFocusChangeListener
import android.view.inputmethod.InputMethodManager
import android.widget.*
import androidx.core.content.res.ResourcesCompat
import com.google.common.base.Strings.isNullOrEmpty
import de.grobox.transportr.R
import de.grobox.transportr.data.locations.FavoriteLocation
Expand Down Expand Up @@ -142,6 +143,11 @@ open class LocationView @JvmOverloads constructor(context: Context, attrs: Attri
val location: AutoCompleteTextView = view.findViewById(R.id.location)
internal val progress: ProgressBar = view.findViewById(R.id.progress)
val clear: ImageButton = view.findViewById(R.id.clearButton)

init {
val drawable = ResourcesCompat.getDrawable(view.context.resources, R.drawable.shape_location_dropdown, null)
location.setDropDownBackgroundDrawable(drawable)
}
}

/* State Saving and Restoring */
Expand Down
167 changes: 0 additions & 167 deletions app/src/main/java/de/grobox/transportr/map/DrawerActivity.kt

This file was deleted.

Loading