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

Update libraries and translations, fix some lint errors #708

Merged
merged 3 commits into from
Sep 14, 2020
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
47 changes: 19 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,28 +98,30 @@ android {
'TrustAllX509TrustManager', // accept certificates as implemented in PTE
'GradleDependency', // don't complain about old library versions
'IconDensities', //todo: migrate all (network) icons to vectors
'PrivateResource', //todo: investigate about private Material design resources (e.g. CarcView style)
'Typos', //todo: remove after next translation fetch
'TypographyEllipsis' //todo: remove after next translation fetch
'PrivateResource' //todo: investigate about private Material design resources (e.g. CardView style)
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"

implementation('androidx.appcompat:appcompat:1.2.0-alpha03') {
because 'fixes bug where stopped activities would not resume'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.activity:activity:1.1.0'
implementation('androidx.fragment:fragment:1.1.0!!') {
because 'issues with MapBox SDK onDestroy after upgrading to 1.2.0-alpha02 or newer versions'
Copy link
Owner

Choose a reason for hiding this comment

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

Hopefully, this won't cause issues with other AndroidX libraries depending on this one.

}
implementation('androidx.preference:preference:1.1.0') {
because 'newer version requires fragment v1.2.4'
}
implementation 'androidx.preference:preference:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
implementation 'androidx.lifecycle:lifecycle-common-java8:2.2.0'
implementation 'androidx.room:room-runtime:2.2.3'
kapt 'androidx.room:room-compiler:2.2.3'
implementation 'androidx.room:room-runtime:2.2.5'
kapt 'androidx.room:room-compiler:2.2.5'

implementation 'com.github.omadahealth:swipy:1.2.3'
implementation 'de.cketti.library.changelog:ckchangelog:1.2.2'
Expand Down Expand Up @@ -156,25 +158,14 @@ dependencies {
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation 'androidx.arch.core:core-testing:2.1.0'

androidTestImplementation "androidx.test:core:1.2.0"
androidTestImplementation "androidx.arch.core:core-testing:2.1.0"
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation "androidx.test.ext:junit:1.1.1"
androidTestImplementation('androidx.test.espresso:espresso-core:3.2.0') {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.google.code.findbugs'
}
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.2.0') {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support', module: 'support-v4'
exclude group: 'com.android.support', module: 'design'
exclude group: 'com.android.support', module: 'recyclerview-v7'
exclude group: 'com.google.code.findbugs'
}
androidTestImplementation 'androidx.test:core:1.3.0'
androidTestImplementation 'androidx.arch.core:core-testing:2.1.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
androidTestImplementation('tools.fastlane:screengrab:1.1.0') {
exclude group: 'com.android.support', module: 'support-annotations'
exclude group: 'com.android.support.test.uiautomator'
exclude group: 'com.google.code.findbugs'
exclude group: 'androidx.test.uiautomator' //requires minSDK >= 18
Copy link
Owner

Choose a reason for hiding this comment

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

If needed, one could take a use minSDK for instrumentation tests only.

}
kaptAndroidTestDebug "com.google.dagger:dagger-compiler:$daggerVersion"
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import de.schildbach.pte.NetworkProvider
import de.schildbach.pte.dto.QueryTripsResult
import de.schildbach.pte.dto.QueryTripsResult.Status.OK
import de.schildbach.pte.dto.Trip
import de.schildbach.pte.dto.TripOptions
import java.util.*

internal class TripReloader(
Expand All @@ -46,8 +47,9 @@ internal class TripReloader(
Thread {
try {
val queryTripsResult = networkProvider.queryTrips(
query.from.location, query.via?.location, query.to.location, newDate, true, query.products,
settingsManager.optimize, settingsManager.walkSpeed, null, null)
query.from.location, query.via?.location, query.to.location, newDate, true,
TripOptions(query.products, settingsManager.optimize, settingsManager.walkSpeed, null, null)
)
if (queryTripsResult.status == OK && queryTripsResult.trips.size > 0) {
onTripReloaded(queryTripsResult)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import de.schildbach.pte.dto.QueryTripsContext
import de.schildbach.pte.dto.QueryTripsResult
import de.schildbach.pte.dto.QueryTripsResult.Status.*
import de.schildbach.pte.dto.Trip
import de.schildbach.pte.dto.TripOptions
import java.io.InterruptedIOException
import java.net.SocketTimeoutException
import kotlin.concurrent.thread
Expand Down Expand Up @@ -107,9 +108,10 @@ internal class TripsRepository(
private fun queryTrips(query: TripQuery) {
try {
val queryTripsResult = networkProvider.queryTrips(
query.from.location, if (query.via == null) null else query.via.location, query.to.location,
query.date, query.departure, query.products, settingsManager.optimize, settingsManager.walkSpeed,
null, null)
query.from.location, if (query.via == null) null else query.via.location, query.to.location,
query.date, query.departure,
TripOptions(query.products, settingsManager.optimize, settingsManager.walkSpeed, null, null)
)
if (queryTripsResult.status == OK && queryTripsResult.trips.size > 0) {
// deliver result first, so UI can get updated
onQueryTripsResultReceived(queryTripsResult)
Expand Down Expand Up @@ -207,24 +209,24 @@ internal class TripsRepository(
.append(": ")
.append(errorShort)
val body = StringBuilder()
.appendln("### Query")
.appendln("- NetworkId: `${networkProvider.id().name}`")
.appendln("- From: `${query.from.location}`")
.appendln("- Via: `${if (query.via == null) "null" else query.via.location}`")
.appendln("- To: `${query.to.location}`")
.appendln("- Date: `${query.date}`")
.appendln("- Departure: `${query.departure}`")
.appendln("- Products: `${query.products}`")
.appendln("- Optimize for: `${settingsManager.optimize}`")
.appendln("- Walk Speed: `${settingsManager.walkSpeed}`")
.appendln()
.appendln("### Error")
.appendln("```")
.appendln(error)
.appendln("```")
.appendln()
.appendln("### Additional information")
.appendln("[Please modify this part]")
.appendLine("### Query")
.appendLine("- NetworkId: `${networkProvider.id().name}`")
.appendLine("- From: `${query.from.location}`")
.appendLine("- Via: `${if (query.via == null) "null" else query.via.location}`")
.appendLine("- To: `${query.to.location}`")
.appendLine("- Date: `${query.date}`")
.appendLine("- Departure: `${query.departure}`")
.appendLine("- Products: `${query.products}`")
.appendLine("- Optimize for: `${settingsManager.optimize}`")
.appendLine("- Walk Speed: `${settingsManager.walkSpeed}`")
.appendLine()
.appendLine("### Error")
.appendLine("```")
.appendLine(error)
.appendLine("```")
.appendLine()
.appendLine("### Additional information")
.appendLine("[Please modify this part]")

val uri = Uri.Builder()
.scheme("https")
Expand Down
Loading