Skip to content

Satellite tracker and pass predictor for Android, inspired by Gpredict

Further refactoring and strings cleanup. Changed the look of a transmission recycler item.

Arty Bishopeee5c725fdb9
diff --git a/app/src/main/java/com/rtbishop/look4sat/MainViewModel.kt b/app/src/main/java/com/rtbishop/look4sat/MainViewModel.kt
index 869da1ab..cd5c0711 100644
--- a/app/src/main/java/com/rtbishop/look4sat/MainViewModel.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/MainViewModel.kt
@@ -117,7 +117,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
apply()
}
_gsp.postValue(GroundStationPosition(lat, lon, alt))
- _debugMessage.postValue(app.getString(R.string.updateLocSuccess))
+ _debugMessage.postValue(app.getString(R.string.update_loc_success))
}
}
@@ -142,9 +142,9 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
}
tleMainList = tleList
tleSelection = mutableListOf()
- _debugMessage.postValue(app.getString(R.string.updateTleSuccess))
+ _debugMessage.postValue(app.getString(R.string.update_tle_success))
} catch (exception: IOException) {
- _debugMessage.postValue(app.getString(R.string.updateTleFailure))
+ _debugMessage.postValue(app.getString(R.string.update_failure))
}
}
}
@@ -153,9 +153,9 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
viewModelScope.launch(Dispatchers.IO) {
try {
repository.updateTransmittersDatabase()
- _debugMessage.postValue(app.getString(R.string.updateTransSuccess))
+ _debugMessage.postValue(app.getString(R.string.update_trans_success))
} catch (exception: IOException) {
- _debugMessage.postValue(app.getString(R.string.updateTransFailure))
+ _debugMessage.postValue(app.getString(R.string.update_failure))
}
}
}
@@ -190,18 +190,12 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
val predictor = PassPredictor(tle, gsp.value)
val passes = predictor.getPasses(dateNow, hoursAhead, true)
passes.forEach {
- passList.add(
- SatPass(
- tle,
- predictor,
- it
- )
- )
+ passList.add(SatPass(tle, predictor, it))
}
} catch (exception: IllegalArgumentException) {
- _debugMessage.postValue(app.getString(R.string.error_sat_tle))
+ _debugMessage.postValue(app.getString(R.string.err_parse_tle))
} catch (exception: SatNotFoundException) {
- _debugMessage.postValue(app.getString(R.string.error_sat_wont_pass))
+ _debugMessage.postValue(app.getString(R.string.err_sat_wont_pass))
}
}
passList.removeAll { it.pass.startTime.after(dateFuture) }
@@ -224,7 +218,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
val tleList = ObjectInputStream(tleStream).readObject()
tleList as List<TLE>
} catch (exception: FileNotFoundException) {
- _debugMessage.postValue(app.getString(R.string.no_tle_found))
+ _debugMessage.postValue(app.getString(R.string.err_no_tle_file))
emptyList()
} catch (exception: IOException) {
_debugMessage.postValue(exception.toString())
@@ -235,7 +229,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
val selectionList = ObjectInputStream(selectionStream).readObject()
selectionList as MutableList<Int>
} catch (exception: FileNotFoundException) {
- _debugMessage.postValue(app.getString(R.string.no_selection_found))
+ _debugMessage.postValue(app.getString(R.string.err_no_selection_file))
mutableListOf()
} catch (exception: IOException) {
_debugMessage.postValue(exception.toString())
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/MainActivity.kt b/app/src/main/java/com/rtbishop/look4sat/ui/MainActivity.kt
index 14a5c2e6..ddd44668 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/MainActivity.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/MainActivity.kt
@@ -124,15 +124,19 @@ class MainActivity : AppCompatActivity() {
viewModel.debugMessage.observe(this, Observer { message ->
Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
when (message) {
- getString(R.string.updateLocSuccess) -> drawerBtnLoc.enable()
- getString(R.string.updateTleSuccess), getString(R.string.updateTleFailure) -> drawerBtnTle.enable()
- getString(R.string.updateTransSuccess), getString(R.string.updateTransFailure) -> drawerBtnTrans.enable()
+ getString(R.string.update_loc_success) -> drawerBtnLoc.enable()
+ getString(R.string.update_tle_success) -> drawerBtnTle.enable()
+ getString(R.string.update_trans_success) -> drawerBtnTrans.enable()
+ getString(R.string.update_failure) -> {
+ drawerBtnTle.enable()
+ drawerBtnTrans.enable()
+ }
}
})
viewModel.gsp.observe(this, Observer { gsp ->
- drawerLat.text = String.format(getString(R.string.pattern_loc), gsp.latitude)
- drawerLon.text = String.format(getString(R.string.pattern_loc), gsp.longitude)
+ drawerLat.text = String.format(getString(R.string.pat_location), gsp.latitude)
+ drawerLon.text = String.format(getString(R.string.pat_location), gsp.longitude)
})
}
@@ -159,7 +163,8 @@ class MainActivity : AppCompatActivity() {
private fun requestLocationUpdate() {
if (ContextCompat.checkSelfPermission(this, permLocation) != permGranted) {
if (ActivityCompat.shouldShowRequestPermissionRationale(this, permLocation)) {
- Toast.makeText(this, getString(R.string.no_permissions), Toast.LENGTH_LONG).show()
+ Toast.makeText(this, getString(R.string.err_no_permissions), Toast.LENGTH_LONG)
+ .show()
} else {
ActivityCompat.requestPermissions(this, arrayOf(permLocation), permLocationCode)
}
@@ -182,14 +187,14 @@ class MainActivity : AppCompatActivity() {
val navController = findNavController(R.id.nav_host)
return navController.navigateUp(appBarConfig) || super.onSupportNavigateUp()
}
-}
-fun ImageButton.enable() {
- this.isEnabled = true
- this.alpha = 1.0f
-}
+ private fun ImageButton.enable() {
+ this.isEnabled = true
+ this.alpha = 1.0f
+ }
-fun ImageButton.disable() {
- this.isEnabled = false
- this.alpha = 0.25f
+ private fun ImageButton.disable() {
+ this.isEnabled = false
+ this.alpha = 0.25f
+ }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/MapViewFragment.kt b/app/src/main/java/com/rtbishop/look4sat/ui/MapViewFragment.kt
index 927a4209..f66d4ab4 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/MapViewFragment.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/MapViewFragment.kt
@@ -205,9 +205,9 @@ class MapViewFragment : Fragment() {
if (lon > 180f) lon -= 360f
- mapLat.text = String.format(context.getString(R.string.pattern_value_lat), lat)
- mapLon.text = String.format(context.getString(R.string.pattern_value_lon), lon)
- mapRng.text = String.format(context.getString(R.string.pattern_value_rng), rng)
+ mapLat.text = String.format(context.getString(R.string.pat_latitude), lat)
+ mapLon.text = String.format(context.getString(R.string.pat_longitude), lon)
+ mapRng.text = String.format(context.getString(R.string.pat_range), rng)
}
private fun drawGroundTrack(
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/PassListFragment.kt b/app/src/main/java/com/rtbishop/look4sat/ui/PassListFragment.kt
index 9da72bbb..79bcd7ec 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/PassListFragment.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/PassListFragment.kt
@@ -83,8 +83,8 @@ class PassListFragment : Fragment() {
}
private fun findViews(view: View) {
- aosTimerText = (mainActivity).findViewById(R.id.toolbar_timer)
- btnPassPrefs = (mainActivity).findViewById(R.id.toolbar_filter)
+ aosTimerText = mainActivity.findViewById(R.id.toolbar_timer)
+ btnPassPrefs = mainActivity.findViewById(R.id.toolbar_filter)
swipeLayout = view.findViewById(R.id.pass_list_refresh)
satPassRecycler = view.findViewById(R.id.pass_list_recycler)
passListFab = view.findViewById(R.id.pass_list_fab)
@@ -161,7 +161,7 @@ class PassListFragment : Fragment() {
}
} else Toast.makeText(
mainActivity,
- getString(R.string.error_enter_value),
+ getString(R.string.err_enter_value),
Toast.LENGTH_SHORT
).show()
@@ -176,7 +176,7 @@ class PassListFragment : Fragment() {
private fun showSelectSatDialog(tleMainList: List<TLE>, selectionList: MutableList<Int>) {
if (tleMainList.isEmpty()) {
- Toast.makeText(mainActivity, getString(R.string.error_update_tle), Toast.LENGTH_SHORT)
+ Toast.makeText(mainActivity, getString(R.string.err_update_tle), Toast.LENGTH_SHORT)
.show()
} else {
val tleNameArray = arrayOfNulls<String>(tleMainList.size).apply {
@@ -235,7 +235,7 @@ class PassListFragment : Fragment() {
override fun onTick(millisUntilFinished: Long) {
aosTimerText.text = String.format(
- mainActivity.getString(R.string.pattern_timer_aos),
+ mainActivity.getString(R.string.pat_timer_aos),
TimeUnit.MILLISECONDS.toHours(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60
@@ -255,7 +255,7 @@ class PassListFragment : Fragment() {
override fun onTick(millisUntilFinished: Long) {
aosTimerText.text = String.format(
- mainActivity.getString(R.string.pattern_timer_los),
+ mainActivity.getString(R.string.pat_timer_los),
TimeUnit.MILLISECONDS.toHours(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60
@@ -271,6 +271,6 @@ class PassListFragment : Fragment() {
isTimerSet = false
}
if (resetToNull) aosTimerText.text =
- String.format(getString(R.string.pattern_timer_aos), 0, 0, 0)
+ String.format(getString(R.string.pat_timer_aos), 0, 0, 0)
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/PolarViewFragment.kt b/app/src/main/java/com/rtbishop/look4sat/ui/PolarViewFragment.kt
index ddc88ed8..da49c807 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/PolarViewFragment.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/PolarViewFragment.kt
@@ -169,18 +169,14 @@ class PolarViewFragment : Fragment() {
private fun setPassText() {
satPos = satPass.predictor.getSatPos(Date())
- polarAzimuth.text = String.format(
- context.getString(R.string.pattern_value_az),
- rad2Deg(satPos.azimuth)
- )
- polarElevation.text = String.format(
- context.getString(R.string.pattern_value_el),
- rad2Deg(satPos.elevation)
- )
+ polarAzimuth.text =
+ String.format(context.getString(R.string.pat_azimuth), rad2Deg(satPos.azimuth))
+ polarElevation.text =
+ String.format(context.getString(R.string.pat_elevation), rad2Deg(satPos.elevation))
polarRange.text =
- String.format(context.getString(R.string.pattern_value_rng), satPos.range)
+ String.format(context.getString(R.string.pat_range), satPos.range)
polarAltitude.text =
- String.format(context.getString(R.string.pattern_value_alt), satPos.altitude)
+ String.format(context.getString(R.string.pat_altitude), satPos.altitude)
}
private fun drawRadarView(cvs: Canvas) {
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/adapters/SatPassAdapter.kt b/app/src/main/java/com/rtbishop/look4sat/ui/adapters/SatPassAdapter.kt
index 2ca825bf..1eb7b4ca 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/adapters/SatPassAdapter.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/adapters/SatPassAdapter.kt
@@ -93,26 +93,26 @@ class SatPassAdapter : RecyclerView.Adapter<SatPassAdapter.SatPassHolder>() {
fun bind(satPass: SatPass) {
val aos = SimpleDateFormat(
- context.getString(R.string.pattern_time),
+ context.getString(R.string.pat_time),
Locale.getDefault()
).format(satPass.pass.startTime)
val los = SimpleDateFormat(
- context.getString(R.string.pattern_time),
+ context.getString(R.string.pat_time),
Locale.getDefault()
).format(satPass.pass.endTime)
satName.text = satPass.tle.name
satId.text =
- String.format(context.getString(R.string.pattern_pass_satId), satPass.tle.catnum)
+ String.format(context.getString(R.string.pass_satId), satPass.tle.catnum)
maxEl.text =
- String.format(context.getString(R.string.pattern_pass_maxEl), satPass.pass.maxEl)
+ String.format(context.getString(R.string.pass_maxEl), satPass.pass.maxEl)
azimuth.text = String.format(
- context.getString(R.string.pattern_pass_azimuth),
+ context.getString(R.string.pass_azimuth),
satPass.pass.aosAzimuth,
satPass.pass.losAzimuth
)
- aosTime.text = String.format(context.getString(R.string.pattern_pass_aos), aos)
- losTime.text = String.format(context.getString(R.string.pattern_pass_los), los)
+ aosTime.text = String.format(context.getString(R.string.pass_aos), aos)
+ losTime.text = String.format(context.getString(R.string.pass_los), los)
progressBar.progress = satPass.progress
itemView.setOnClickListener {
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/adapters/TransmitterAdapter.kt b/app/src/main/java/com/rtbishop/look4sat/ui/adapters/TransmitterAdapter.kt
index 5307155f..5b343faf 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/adapters/TransmitterAdapter.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/adapters/TransmitterAdapter.kt
@@ -66,12 +66,12 @@ class TransmitterAdapter : RecyclerView.Adapter<TransmitterAdapter.TransmitterHo
if (transmitter.downlinkLow != null && transmitter.downlinkHigh == null) {
downlink.text = String.format(
- context.getString(R.string.pattern_trans_down_low),
+ context.getString(R.string.trans_down_low),
transmitter.downlinkLow / freqDivider
)
} else if (transmitter.downlinkLow != null && transmitter.downlinkHigh != null) {
downlink.text = String.format(
- context.getString(R.string.pattern_trans_down_lowHigh),
+ context.getString(R.string.trans_down_lowHigh),
transmitter.downlinkLow / freqDivider,
transmitter.downlinkHigh / freqDivider
)
@@ -81,12 +81,12 @@ class TransmitterAdapter : RecyclerView.Adapter<TransmitterAdapter.TransmitterHo
if (transmitter.uplinkLow != null && transmitter.uplinkHigh == null) {
uplink.text = String.format(
- context.getString(R.string.pattern_trans_up_low),
+ context.getString(R.string.trans_up_low),
transmitter.uplinkLow / freqDivider
)
} else if (transmitter.uplinkLow != null && transmitter.uplinkHigh != null) {
uplink.text = String.format(
- context.getString(R.string.pattern_trans_up_lowHigh),
+ context.getString(R.string.trans_up_lowHigh),
transmitter.uplinkLow / freqDivider,
transmitter.uplinkHigh / freqDivider
)
@@ -96,18 +96,18 @@ class TransmitterAdapter : RecyclerView.Adapter<TransmitterAdapter.TransmitterHo
if (transmitter.mode != null) {
mode.text =
- String.format(context.getString(R.string.pattern_trans_mode), transmitter.mode)
+ String.format(context.getString(R.string.trans_mode), transmitter.mode)
} else {
mode.text = context.getString(R.string.no_mode)
}
if (transmitter.isInverted) {
inverted.text = String.format(
- context.getString(R.string.pattern_trans_invert),
+ context.getString(R.string.trans_inverted),
context.getString(R.string.btn_yes)
)
} else {
inverted.text = String.format(
- context.getString(R.string.pattern_trans_invert),
+ context.getString(R.string.trans_inverted),
context.getString(R.string.btn_no)
)
}
diff --git a/app/src/main/res/drawable/ic_arrow.xml b/app/src/main/res/drawable/ic_arrow.xml
new file mode 100644
index 00000000..0f6e4b82
--- /dev/null
+++ b/app/src/main/res/drawable/ic_arrow.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFE082"
+ android:pathData="M7.41,15.41L12,10.83l4.59,4.58L18,14l-6,-6 -6,6z" />
+</vector>
diff --git a/app/src/main/res/drawable/ic_trans.xml b/app/src/main/res/drawable/ic_trans.xml
new file mode 100644
index 00000000..551cf66d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_trans.xml
@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FFE082"
+ android:pathData="M6.18,17.82m-2.18,0a2.18,2.18 0,1 1,4.36 0a2.18,2.18 0,1 1,-4.36 0" />
+ <path
+ android:fillColor="#FFE082"
+ android:pathData="M4,4.44v2.83c7.03,0 12.73,5.7 12.73,12.73h2.83c0,-8.59 -6.97,-15.56 -15.56,-15.56zM4,10.1v2.83c3.9,0 7.07,3.17 7.07,7.07h2.83c0,-5.47 -4.43,-9.9 -9.9,-9.9z" />
+</vector>
diff --git a/app/src/main/res/layout/card_pass.xml b/app/src/main/res/layout/card_pass.xml
index 7e20288f..e981db52 100644
--- a/app/src/main/res/layout/card_pass.xml
+++ b/app/src/main/res/layout/card_pass.xml
@@ -51,7 +51,7 @@
android:id="@+id/pass_aosTime"
style="@style/CardPassText"
android:layout_marginBottom="4dp"
- android:text="@string/pass_aosTime"
+ android:text="@string/pass_aos"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/pass_progress"
app:layout_constraintTop_toBottomOf="@+id/pass_progress" />
@@ -59,7 +59,7 @@
<TextView
android:id="@+id/pass_losTime"
style="@style/CardPassText"
- android:text="@string/pass_losTime"
+ android:text="@string/pass_los"
app:layout_constraintBaseline_toBaselineOf="@+id/pass_aosTime"
app:layout_constraintEnd_toEndOf="@+id/pass_progress" />
diff --git a/app/src/main/res/layout/card_trans.xml b/app/src/main/res/layout/card_trans.xml
index c999ed49..ead3f749 100644
--- a/app/src/main/res/layout/card_trans.xml
+++ b/app/src/main/res/layout/card_trans.xml
@@ -16,42 +16,81 @@
<TextView
android:id="@+id/trans_description"
style="@style/CardTransText"
- android:layout_marginStart="8dp"
- android:layout_marginTop="4dp"
android:text="@string/trans_description"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
+ app:layout_constraintBottom_toBottomOf="@+id/imageView"
+ app:layout_constraintStart_toEndOf="@+id/imageView"
+ app:layout_constraintTop_toTopOf="@+id/imageView" />
<TextView
android:id="@+id/trans_downlink"
style="@style/CardTransText"
- android:text="@string/trans_downlink"
- app:layout_constraintStart_toStartOf="@+id/trans_description"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
+ android:text="@string/trans_down_lowHigh"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/trans_description" />
<TextView
android:id="@+id/trans_uplink"
style="@style/CardTransText"
- android:text="@string/trans_uplink"
- app:layout_constraintStart_toStartOf="@+id/trans_description"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
+ android:text="@string/trans_up_lowHigh"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/trans_downlink" />
<TextView
android:id="@+id/trans_mode"
style="@style/CardTransText"
- android:layout_marginBottom="4dp"
+ android:layout_marginStart="6dp"
+ android:layout_marginBottom="2dp"
android:text="@string/trans_mode"
app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="@+id/trans_description"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/trans_uplink" />
<TextView
android:id="@+id/trans_inverted"
style="@style/CardTransText"
- android:layout_marginEnd="8dp"
+ android:layout_marginEnd="6dp"
android:text="@string/trans_inverted"
app:layout_constraintBaseline_toBaselineOf="@+id/trans_mode"
app:layout_constraintEnd_toEndOf="parent" />
+ <ImageView
+ android:id="@+id/imageView"
+ android:layout_width="20dp"
+ android:layout_height="20dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginTop="4dp"
+ android:contentDescription="@string/placeholder"
+ android:rotation="90"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:srcCompat="@drawable/ic_trans" />
+
+ <ImageView
+ android:id="@+id/imageView2"
+ android:layout_width="20dp"
+ android:layout_height="20dp"
+ android:contentDescription="@string/placeholder"
+ android:rotation="180"
+ app:layout_constraintBottom_toBottomOf="@+id/trans_downlink"
+ app:layout_constraintEnd_toStartOf="@+id/trans_downlink"
+ app:layout_constraintTop_toTopOf="@+id/trans_downlink"
+ app:srcCompat="@drawable/ic_arrow" />
+
+ <ImageView
+ android:id="@+id/imageView3"
+ android:layout_width="20dp"
+ android:layout_height="20dp"
+ android:contentDescription="@string/placeholder"
+ app:layout_constraintBottom_toBottomOf="@+id/trans_uplink"
+ app:layout_constraintEnd_toStartOf="@+id/trans_uplink"
+ app:layout_constraintTop_toBottomOf="@+id/trans_downlink"
+ app:srcCompat="@drawable/ic_arrow" />
+
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
\ No newline at end of file
diff --git a/app/src/main/res/layout/drawer_header.xml b/app/src/main/res/layout/drawer_header.xml
index aaff6959..9e167acd 100644
--- a/app/src/main/res/layout/drawer_header.xml
+++ b/app/src/main/res/layout/drawer_header.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
+ android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/launcher_background"
android:gravity="bottom"
@@ -11,8 +11,9 @@
android:id="@+id/drawer_sat_img"
android:layout_width="104dp"
android:layout_height="104dp"
+ android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
- android:layout_marginEnd="8dp"
+ android:layout_marginEnd="16dp"
android:contentDescription="@string/app_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/drawer_title"
@@ -25,13 +26,14 @@
android:layout_marginStart="8dp"
android:text="@string/drawer_title"
app:layout_constraintBottom_toBottomOf="@+id/drawer_sat_img"
+ app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/drawer_sat_img" />
<TextView
android:id="@+id/drawer_lat"
style="@style/DrawerHeader.Item"
- android:text="@string/drawer_lat"
+ android:text="@string/drawer_lat_text"
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lat_value"
app:layout_constraintStart_toStartOf="@+id/drawer_title" />
@@ -40,14 +42,14 @@
style="@style/DrawerHeader.ItemValue"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
- android:text="@string/drawer_lat_value"
+ android:text="@string/pat_location"
app:layout_constraintStart_toEndOf="@+id/drawer_lat"
app:layout_constraintTop_toBottomOf="@+id/drawer_sat_img" />
<TextView
android:id="@+id/drawer_lon"
style="@style/DrawerHeader.Item"
- android:text="@string/drawer_lon"
+ android:text="@string/drawer_lon_text"
app:layout_constraintStart_toStartOf="@+id/drawer_lat"
app:layout_constraintTop_toBottomOf="@+id/drawer_lat" />
@@ -55,7 +57,7 @@
android:id="@+id/drawer_lon_value"
style="@style/DrawerHeader.ItemValue"
android:layout_marginStart="8dp"
- android:text="@string/drawer_lon_value"
+ android:text="@string/pat_location"
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lon"
app:layout_constraintStart_toEndOf="@+id/drawer_lon" />
diff --git a/app/src/main/res/layout/fragment_map_view.xml b/app/src/main/res/layout/fragment_map_view.xml
index 54c72c25..798efcd5 100644
--- a/app/src/main/res/layout/fragment_map_view.xml
+++ b/app/src/main/res/layout/fragment_map_view.xml
@@ -32,7 +32,7 @@
style="@style/MapText"
android:layout_marginStart="4dp"
android:layout_marginTop="4dp"
- android:text="@string/pattern_value_lat"
+ android:text="@string/pat_latitude"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -41,7 +41,7 @@
style="@style/MapText"
android:layout_marginTop="4dp"
android:layout_marginEnd="4dp"
- android:text="@string/pattern_value_lon"
+ android:text="@string/pat_longitude"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
@@ -50,7 +50,7 @@
style="@style/MapText"
android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp"
- android:text="@string/pattern_value_rng"
+ android:text="@string/pat_range"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
diff --git a/app/src/main/res/layout/fragment_polar_view.xml b/app/src/main/res/layout/fragment_polar_view.xml
index 76e72a14..95d09a3d 100644
--- a/app/src/main/res/layout/fragment_polar_view.xml
+++ b/app/src/main/res/layout/fragment_polar_view.xml
@@ -19,31 +19,31 @@
android:id="@+id/polar_azimuth"
style="@style/PolarViewText"
android:layout_marginStart="4dp"
- android:text="@string/polar_azimuth"
- app:layout_constraintBottom_toBottomOf="@+id/polar_view_frame"
- app:layout_constraintStart_toStartOf="@+id/polar_view_frame" />
+ android:text="@string/pat_azimuth"
+ app:layout_constraintStart_toStartOf="@+id/polar_view_frame"
+ app:layout_constraintTop_toTopOf="@+id/polar_view_frame" />
<TextView
android:id="@+id/polar_elevation"
style="@style/PolarViewText"
android:layout_marginEnd="4dp"
- android:text="@string/polar_elevation"
- app:layout_constraintEnd_toEndOf="parent"
+ android:text="@string/pat_elevation"
+ app:layout_constraintEnd_toEndOf="@+id/polar_view_frame"
app:layout_constraintTop_toTopOf="@+id/polar_view_frame" />
<TextView
android:id="@+id/polar_altitude"
style="@style/PolarViewText"
android:layout_marginStart="4dp"
- android:text="@string/polar_altitude"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="@+id/polar_view_frame" />
+ android:text="@string/pat_altitude"
+ app:layout_constraintBottom_toBottomOf="@+id/polar_view_frame"
+ app:layout_constraintStart_toStartOf="@+id/polar_view_frame" />
<TextView
android:id="@+id/polar_range"
style="@style/PolarViewText"
android:layout_marginEnd="4dp"
- android:text="@string/polar_range"
+ android:text="@string/pat_range"
app:layout_constraintBottom_toBottomOf="@+id/polar_view_frame"
app:layout_constraintEnd_toEndOf="@+id/polar_view_frame" />
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index bf5cd6dd..f8e26168 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -3,115 +3,93 @@
<string name="app_name">Look4Sat</string>
<string name="drawer_title">L∞king \n4Sat…</string>
- <string name="drawer_lat">Latitude: </string>
- <string name="drawer_lat_value">51.5074</string>
- <string name="drawer_lon">Longitude: </string>
- <string name="drawer_lon_value">0.1278</string>
+ <string name="drawer_lat_text">Latitude: </string>
+ <string name="drawer_lon_text">Longitude: </string>
<string name="update_loc">Update location</string>
+ <string name="update_loc_success">Location was updated</string>
<string name="update_tle">Update TLE file</string>
+ <string name="update_tle_success">TLE file was updated</string>
<string name="update_trans">Update transmitters DB</string>
+ <string name="update_trans_success">Transmitters database was updated</string>
+ <string name="update_failure">Check your internet connection</string>
<string name="goto_github">GitHub</string>
<string name="exit_app">Exit</string>
- <string name="updateLocSuccess">Location was updated</string>
- <string name="updateTleSuccess">TLE file was updated</string>
- <string name="updateTleFailure">Could not update TLE file</string>
- <string name="updateTransSuccess">Transmitters database was updated</string>
- <string name="updateTransFailure">Could not update transmitters</string>
-
- <string name="menu_pass_list">List of passes</string>
+ <string name="menu_pass_list">List of Passes</string>
<string name="menu_polar_view">Polar View</string>
<string name="menu_map_view">World Map View</string>
<string name="menu_settings">Settings</string>
<string name="menu_credits">Credits</string>
<string name="menu_about">About the App</string>
- <string name="pass_satName">Meteor M2–2</string>
- <string name="pass_satId">ID: 48680</string>
- <string name="pass_azimuth">Az: 180° -> 360°</string>
- <string name="pass_maxEl">MaxEl: 75.5°</string>
- <string name="pass_aosTime">AOS - 13:14:15</string>
- <string name="pass_losTime">LOS - 16:17:18</string>
-
- <string name="polar_azimuth">Azimuth: 180.00°</string>
- <string name="polar_elevation">Elevation: 75.50°</string>
- <string name="polar_altitude">Altitude: 850 km</string>
- <string name="polar_range">Range: 12000 km</string>
-
- <string name="trans_description">ARGOS-3 A-DCS 465.9875MHz</string>
- <string name="trans_downlink">Downlink: 465.9875 MHz</string>
- <string name="trans_uplink">Uplink: 465.9875 MHz</string>
- <string name="trans_mode">Mode: BPSK400</string>
- <string name="trans_inverted">Inverted: Yes</string>
-
- <string name="dialog_select_sat">Select satellites to track</string>
+ <string name="dialog_select_sat">Select satellites to track…</string>
<string name="dialog_show_track">Show ground track for…</string>
- <string name="dialog_filter_passes">Filter passes</string>
+ <string name="dialog_filter_passes">Filter passes…</string>
<string name="pref_hours_ahead_key">hoursAhead</string>
<string name="pref_hours_ahead_hint">Hours ahead</string>
<string name="pref_hours_ahead_summary">Show passes that occur within X hours</string>
- <string name="pref_hours_ahead_input_error">Value should be within 1–168 hours</string>
+ <string name="pref_hours_ahead_input_error">Set the value between 1h and 168h</string>
<string name="pref_min_el_key">minEl</string>
<string name="pref_min_el_hint">Minimum elevation</string>
<string name="pref_min_el_summary">Show passes with max elevation above</string>
- <string name="pref_min_el_input_error">Value should be within 0–90 deg</string>
+ <string name="pref_min_el_input_error">Set the value between 0° and 90°</string>
- <string name="pref_gsp_title">Ground station position settings</string>
+ <string name="pref_gsp_title">Ground station position</string>
<string name="pref_lat_key">latitude</string>
- <string name="pref_lat_title">Latitude</string>
- <string name="pref_lat_input_error">Lat should be within -90 to 90 deg</string>
+ <string name="pref_lat_title">Latitude, deg</string>
+ <string name="pref_lat_input_error">Set the value between -90° and 90°</string>
<string name="pref_lon_key">longitude</string>
- <string name="pref_lon_title">Longitude</string>
- <string name="pref_lon_input_error">Lon should be within -180 to 180 deg</string>
+ <string name="pref_lon_title">Longitude, deg</string>
+ <string name="pref_lon_input_error">Set the value between -180° and 180°</string>
<string name="pref_alt_key">altitude</string>
- <string name="pref_alt_title">Altitude</string>
- <string name="pref_alt_input_error">Alt should be within -413 to 8850 m</string>
- <string name="pref_other_title">Other settings</string>
+ <string name="pref_alt_title">Altitude, m</string>
+ <string name="pref_alt_input_error">Set the value between -413m and 8850m</string>
+ <string name="pref_other_title">Other</string>
<string name="pref_refresh_rate_key">rate</string>
- <string name="pref_refresh_rate_title">Refresh rate</string>
- <string name="pref_refresh_rate_input_error">Value should be within 250 to 10000 ms</string>
- <string name="pref_refresh_rate_summary">Views update interval, ms</string>
+ <string name="pref_refresh_rate_title">View refresh rate, ms</string>
+ <string name="pref_refresh_rate_input_error">Set the value between 250ms and 10000ms</string>
- <string name="no_permissions">Missing permissions</string>
<string name="no_mode">Mode: Null</string>
<string name="no_uplink">Uplink: Null</string>
<string name="no_downlink">Downlink: Null</string>
- <string name="no_transmitters">No transmitters found for this Satellite</string>
<string name="no_selected_sat">No satellites were shortlisted</string>
- <string name="no_tle_found">TLE file was not found</string>
- <string name="no_selection_found">Selection file was not found</string>
-
- <string name="error_sat_wont_pass">Certain satellites will never pass</string>
- <string name="error_sat_tle">There was a problem with a satellite TLE</string>
- <string name="error_update_tle">Please, update your TLE</string>
- <string name="error_enter_value">Please, enter the value</string>
-
- <string name="pattern_loc">%.4f</string>
- <string name="pattern_time">HH:mm:ss</string>
- <string name="pattern_timer_aos">AOS -%02d:%02d:%02d</string>
- <string name="pattern_timer_los">LOS -%02d:%02d:%02d</string>
-
- <string name="pattern_pass_aos">AOS - %s</string>
- <string name="pattern_pass_los">LOS - %s</string>
- <string name="pattern_pass_satId">Id: %d</string>
- <string name="pattern_pass_maxEl">MaxEl: %.1f°</string>
- <string name="pattern_pass_azimuth">Az: %2d° -> %2d°</string>
-
- <string name="pattern_value_az">Az: %.1f°</string>
- <string name="pattern_value_el">El: %.1f°</string>
- <string name="pattern_value_lat">Lat: %.1f°</string>
- <string name="pattern_value_lon">Lon: %.1f°</string>
- <string name="pattern_value_rng">Rng: %.0f km</string>
- <string name="pattern_value_alt">Alt: %.0f km</string>
+ <string name="no_transmitters">No transmitters found for this Satellite</string>
- <string name="pattern_trans_mode">Mode: %s</string>
- <string name="pattern_trans_invert">Inverted: %s</string>
- <string name="pattern_trans_up_low">Uplink: %.4f MHz</string>
- <string name="pattern_trans_up_lowHigh">Uplink: %.4f - %.4f MHz</string>
- <string name="pattern_trans_down_low">Downlink: %.4f MHz</string>
- <string name="pattern_trans_down_lowHigh">Downlink: %.4f - %.4f MHz</string>
+ <string name="err_no_permissions">Missing permissions</string>
+ <string name="err_sat_wont_pass">Certain satellites shall not pass</string>
+ <string name="err_parse_tle">Error parsing TLE entry</string>
+ <string name="err_update_tle">Please, update your TLE file</string>
+ <string name="err_enter_value">Please, enter the value</string>
+ <string name="err_no_tle_file">TLE file was not found</string>
+ <string name="err_no_selection_file">Selection file was not found</string>
+
+ <string name="pass_satName">%s</string>
+ <string name="pass_aos">AOS - %s</string>
+ <string name="pass_los">LOS - %s</string>
+ <string name="pass_satId">Id: %d</string>
+ <string name="pass_maxEl">MaxEl: %.1f°</string>
+ <string name="pass_azimuth">Az: %2d° -> %2d°</string>
+
+ <string name="pat_location">%.4f</string>
+ <string name="pat_time">HH:mm:ss</string>
+ <string name="pat_azimuth">Azimuth: %.1f°</string>
+ <string name="pat_elevation">Elevation: %.1f°</string>
+ <string name="pat_latitude">Latitude: %.1f°</string>
+ <string name="pat_longitude">Longitude: %.1f°</string>
+ <string name="pat_range">Range: %.0f km</string>
+ <string name="pat_altitude">Altitude: %.0f km</string>
+ <string name="pat_timer_aos">AOS -%02d:%02d:%02d</string>
+ <string name="pat_timer_los">LOS -%02d:%02d:%02d</string>
+
+ <string name="trans_description">%s</string>
+ <string name="trans_mode">Mode: %s</string>
+ <string name="trans_inverted">Inverted: %s</string>
+ <string name="trans_up_low">Uplink: %.4f MHz</string>
+ <string name="trans_up_lowHigh">Uplink: %.4f - %.4f MHz</string>
+ <string name="trans_down_low">Downlink: %.4f MHz</string>
+ <string name="trans_down_lowHigh">Downlink: %.4f - %.4f MHz</string>
<string name="btn_yes">Yes</string>
<string name="btn_no">No</string>
diff --git a/app/src/main/res/xml/preference.xml b/app/src/main/res/xml/preference.xml
index bd2219d4..6577fb1d 100644
--- a/app/src/main/res/xml/preference.xml
+++ b/app/src/main/res/xml/preference.xml
@@ -26,7 +26,6 @@
android:key="@string/pref_refresh_rate_key"
android:selectAllOnFocus="true"
android:singleLine="true"
- android:summary="@string/pref_refresh_rate_summary"
android:title="@string/pref_refresh_rate_title" />
</PreferenceCategory>
</PreferenceScreen>
\ No newline at end of file