Skip to content

Commit

Permalink
True north functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Kr0oked committed Mar 24, 2023
1 parent 64d3b34 commit de5d675
Show file tree
Hide file tree
Showing 34 changed files with 898 additions and 327 deletions.
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
}

android {
Expand Down Expand Up @@ -64,6 +65,9 @@ android {
buildFeatures {
dataBinding true
}
lintOptions {
warning 'MissingTranslation'
}
}

dependencies {
Expand Down
20 changes: 15 additions & 5 deletions app/src/androidTest/java/com/bobek/compass/InstrumentedTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,29 @@ class InstrumentedTest {
.perform(click())

setAccuracy(SensorAccuracy.NO_CONTACT)
onView(withId(R.id.sensor_accuracy_text)).check(matches(withText(R.string.sensor_accuracy_no_contact)))
onView(withId(R.id.sensor_accuracy_text))
.check(matches(isDisplayed()))
.check(matches(withText(R.string.sensor_accuracy_no_contact)))

setAccuracy(SensorAccuracy.UNRELIABLE)
onView(withId(R.id.sensor_accuracy_text)).check(matches(withText(R.string.sensor_accuracy_unreliable)))
onView(withId(R.id.sensor_accuracy_text))
.check(matches(isDisplayed()))
.check(matches(withText(R.string.sensor_accuracy_unreliable)))

setAccuracy(SensorAccuracy.LOW)
onView(withId(R.id.sensor_accuracy_text)).check(matches(withText(R.string.sensor_accuracy_low)))
onView(withId(R.id.sensor_accuracy_text))
.check(matches(isDisplayed()))
.check(matches(withText(R.string.sensor_accuracy_low)))

setAccuracy(SensorAccuracy.MEDIUM)
onView(withId(R.id.sensor_accuracy_text)).check(matches(withText(R.string.sensor_accuracy_medium)))
onView(withId(R.id.sensor_accuracy_text))
.check(matches(isDisplayed()))
.check(matches(withText(R.string.sensor_accuracy_medium)))

setAccuracy(SensorAccuracy.HIGH)
onView(withId(R.id.sensor_accuracy_text)).check(matches(withText(R.string.sensor_accuracy_high)))
onView(withId(R.id.sensor_accuracy_text))
.check(matches(isDisplayed()))
.check(matches(withText(R.string.sensor_accuracy_high)))

onView(withText(R.string.ok)).perform(click())
}
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
android:name="android.hardware.sensor.gyroscope"
android:required="true" />

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:name=".CompassApplication"
android:allowBackup="true"
Expand Down
Loading

0 comments on commit de5d675

Please sign in to comment.