kopia lustrzana https://github.com/rt-bishop/Look4Sat
Updated dependencies, code cleanup
rodzic
dd6151a6cf
commit
d8d6a3263e
|
|
@ -92,10 +92,10 @@ class PolarViewFragment : Fragment(R.layout.fragment_polar_view), SensorEventLis
|
|||
override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int) {}
|
||||
|
||||
override fun onSensorChanged(event: SensorEvent?) {
|
||||
event?.let { useSoftwareSensor(it) }
|
||||
event?.let { calculateAzimuth(it) }
|
||||
}
|
||||
|
||||
private fun useSoftwareSensor(event: SensorEvent) {
|
||||
private fun calculateAzimuth(event: SensorEvent) {
|
||||
val rotationValues = FloatArray(9)
|
||||
SensorManager.getRotationMatrixFromVector(rotationValues, event.values)
|
||||
val orientationValues = FloatArray(3)
|
||||
|
|
@ -105,11 +105,6 @@ class PolarViewFragment : Fragment(R.layout.fragment_polar_view), SensorEventLis
|
|||
polarView?.rotation = -(roundedAzimuth + magneticDeclination)
|
||||
}
|
||||
|
||||
private fun filterSensorData(input: FloatArray, output: FloatArray) {
|
||||
val filterStep = 1f
|
||||
input.indices.forEach { output[it] = output[it] + filterStep * (input[it] - output[it]) }
|
||||
}
|
||||
|
||||
private fun observePasses() {
|
||||
viewModel.getPassList().observe(viewLifecycleOwner, { result ->
|
||||
if (result is Result.Success) {
|
||||
|
|
|
|||
35
build.gradle
35
build.gradle
|
|
@ -18,26 +18,27 @@
|
|||
*/
|
||||
|
||||
buildscript {
|
||||
ext.gradle_version = '4.0.1'
|
||||
ext.gradle_plugin_version = '1.4.0'
|
||||
ext.material_version = '1.2.1'
|
||||
ext.app_compat_version = '1.2.0'
|
||||
ext.support_lib_version = '1.0.0'
|
||||
ext.constraint_layout_version = '2.0.1'
|
||||
ext.ktx_version = '1.3.1'
|
||||
ext.preference_version = '1.1.1'
|
||||
ext.navigation_version = '2.3.0'
|
||||
ext.lifecycle_version = '2.2.0'
|
||||
ext.room_version = '2.2.5'
|
||||
ext.dagger_version = '2.28.3'
|
||||
ext.retrofit_version = '2.9.0'
|
||||
ext.okhttp_version = '4.8.1'
|
||||
ext.openStreetMap_version = '6.1.8'
|
||||
ext.predict4java_version = '1.3.1'
|
||||
ext {
|
||||
gradle_version = '4.0.1'
|
||||
gradle_plugin_version = '1.4.10'
|
||||
material_version = '1.2.1'
|
||||
app_compat_version = '1.2.0'
|
||||
support_lib_version = '1.0.0'
|
||||
constraint_layout_version = '2.0.1'
|
||||
ktx_version = '1.3.1'
|
||||
preference_version = '1.1.1'
|
||||
navigation_version = '2.3.0'
|
||||
lifecycle_version = '2.2.0'
|
||||
room_version = '2.2.5'
|
||||
dagger_version = '2.29.1'
|
||||
retrofit_version = '2.9.0'
|
||||
okhttp_version = '4.9.0'
|
||||
openStreetMap_version = '6.1.8'
|
||||
predict4java_version = '1.3.1'
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:$gradle_version"
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue