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

[22682] TripKitUI submodule and all modules inside refactoring #153

Merged
merged 6 commits into from
Dec 3, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public static Configs buildTripKitConfig(Context context, Key.ApiKey key) {
"TripKit", Context.MODE_PRIVATE));
boolean isDebuggable = (0 != (context.getApplicationInfo().flags
& ApplicationInfo.FLAG_DEBUGGABLE) || BuildConfig.DEBUG);
return TripKitConfigs.builder().context(context)
return TripKitConfigs.Companion.builder().context(context)

.debuggable(isDebuggable)
.baseUrlAdapterFactory(new Callable<String>() {
Expand All @@ -150,7 +150,7 @@ public static Configs buildTripKitConfig(
"TripKit", Context.MODE_PRIVATE));
boolean isDebuggable = (0 != (context.getApplicationInfo().flags
& ApplicationInfo.FLAG_DEBUGGABLE) || BuildConfig.DEBUG);
return TripKitConfigs.builder().context(context)
return TripKitConfigs.Companion.builder().context(context)
.debuggable(isDebuggable)
.baseUrlAdapterFactory(
(customUrlAdapterFactory != null) ?
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.skedgo.tripkit.ui.geocoding

import com.skedgo.geocoding.agregator.GCAppResultInterface
import com.skedgo.geocoding.agregator.GCAppResultInterface.Source
import com.skedgo.tripkit.common.model.location.Location
import com.skedgo.tripkit.ui.data.places.Place.TripGoPOI

class AppResultLocationAdapter(
private val location: Location,
private val resultInterface: GCAppResultInterface
) : ResultLocationAdapter<TripGoPOI?>, GCAppResultInterface {
override fun getPlace(): TripGoPOI {
return TripGoPOI(location)
}

override val subtitle: String
get() = resultInterface.subtitle

override val appResultSource: Source
get() = resultInterface.appResultSource

override val isFavourite: Boolean
get() = resultInterface.isFavourite

override val name: String
get() = resultInterface.name

override val lat: Double?
get() = resultInterface.lat

override val lng: Double?
get() = resultInterface.lng
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.skedgo.tripkit.ui.geocoding

import com.skedgo.geocoding.agregator.GCFoursquareResultInterface
import com.skedgo.tripkit.common.model.location.Location
import com.skedgo.tripkit.ui.data.places.Place.TripGoPOI

class FoursquareResultLocationAdapter(
private val location: Location,
private val resultInterface: GCFoursquareResultInterface
) : GCFoursquareResultInterface, ResultLocationAdapter<TripGoPOI?> {
override fun getPlace(): TripGoPOI {
return TripGoPOI(location)
}

override val isVerified: Boolean
get() = resultInterface.isVerified

override val categories: List<String>
get() = resultInterface.categories

override val name: String
get() = resultInterface.name

override val lat: Double?
get() = resultInterface.lat

override val lng: Double?
get() = resultInterface.lng
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.skedgo.tripkit.ui.geocoding

import com.skedgo.geocoding.agregator.GCGoogleResultInterface
import com.skedgo.tripkit.ui.data.places.Place.WithoutLocation

class GoogleResultLocationAdapter(
private val location: WithoutLocation,
private val resultInterface: GCGoogleResultInterface
) : GCGoogleResultInterface, ResultLocationAdapter<WithoutLocation?> {
override fun getPlace(): WithoutLocation {
return location
}

override val name: String
get() = resultInterface.name

override val lat: Double?
get() = resultInterface.lat

override val lng: Double?
get() = resultInterface.lng

override val address: String?
get() = resultInterface.address
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.skedgo.tripkit.ui.geocoding

import com.skedgo.geocoding.agregator.GCSkedGoResultInterface
import com.skedgo.tripkit.common.model.location.Location
import com.skedgo.tripkit.ui.data.places.Place.TripGoPOI

class SkedgoResultLocationAdapter(
private val location: Location,
private val resultInterface: GCSkedGoResultInterface
) : GCSkedGoResultInterface, ResultLocationAdapter<TripGoPOI?> {
override fun getPlace(): TripGoPOI {
return TripGoPOI(location)
}

override val name: String
get() = resultInterface.name

override val lat: Double?
get() = resultInterface.lat

override val lng: Double?
get() = resultInterface.lng

override val resultClass: String
get() = resultInterface.resultClass

override val popularity: Int
get() = resultInterface.popularity

override val modeIdentifiers: List<String>?
get() = resultInterface.modeIdentifiers
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ internal class GetRoutingConfigImpl @Inject constructor(
walkingSpeed = walkingSpeedRepository.getWalkingSpeed(),
unit = unitsRepository.getUnit(),
cyclingSpeed = cyclingSpeedRepository.getCyclingSpeed(),
shouldUseConcessionPricing = tripPreferences.isConcessionPricingPreferred,
isOnWheelchair = tripPreferences.isWheelchairPreferred,
shouldUseConcessionPricing = tripPreferences.isConcessionPricingPreferred(),
isOnWheelchair = tripPreferences.isWheelchairPreferred(),
weightingProfile = WeightingProfile(
budgetPriority = prioritiesRepository.getBudgetPriority(),
environmentPriority = prioritiesRepository.getEnvironmentPriority(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:scrollIndicators="none"
android:layout_marginBottom="8dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:scrollIndicators="none"
android:importantForAccessibility="no">

<LinearLayout
Expand Down Expand Up @@ -67,6 +71,7 @@
android:orientation="vertical"
android:showDividers="middle"
android:scrollbars="none"
android:scrollIndicators="none"
app:entries="@{viewModel.tripResults}"
app:layout="@{@layout/trip_result_list_item_trip}"
app:layout_constraintStart_toStartOf="parent"
Expand Down
Loading
Loading