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

This commit is contained in:
Arty Bishop committed 2020-01-18 18:21:11 +00:00
1 parent 96939794b5
commit eee5c725fd
16 files changed
+204 -170

No files matched your search

@@ -117,7 +117,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
apply() apply()
} }
_gsp.postValue(GroundStationPosition(lat, lon, alt)) _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 tleMainList = tleList
tleSelection = mutableListOf() tleSelection = mutableListOf()
_debugMessage.postValue(app.getString(R.string.updateTleSuccess)) _debugMessage.postValue(app.getString(R.string.update_tle_success))
} catch (exception: IOException) { } 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) { viewModelScope.launch(Dispatchers.IO) {
try { try {
repository.updateTransmittersDatabase() repository.updateTransmittersDatabase()
_debugMessage.postValue(app.getString(R.string.updateTransSuccess)) _debugMessage.postValue(app.getString(R.string.update_trans_success))
} catch (exception: IOException) { } 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 predictor = PassPredictor(tle, gsp.value)
val passes = predictor.getPasses(dateNow, hoursAhead, true) val passes = predictor.getPasses(dateNow, hoursAhead, true)
passes.forEach { passes.forEach {
passList.add( passList.add(SatPass(tle, predictor, it))
SatPass(
tle,
predictor,
it
)
)
} }
} catch (exception: IllegalArgumentException) { } catch (exception: IllegalArgumentException) {
_debugMessage.postValue(app.getString(R.string.error_sat_tle)) _debugMessage.postValue(app.getString(R.string.err_parse_tle))
} catch (exception: SatNotFoundException) { } 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) } passList.removeAll { it.pass.startTime.after(dateFuture) }
@@ -224,7 +218,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
val tleList = ObjectInputStream(tleStream).readObject() val tleList = ObjectInputStream(tleStream).readObject()
tleList as List<TLE> tleList as List<TLE>
} catch (exception: FileNotFoundException) { } catch (exception: FileNotFoundException) {
_debugMessage.postValue(app.getString(R.string.no_tle_found)) _debugMessage.postValue(app.getString(R.string.err_no_tle_file))
emptyList() emptyList()
} catch (exception: IOException) { } catch (exception: IOException) {
_debugMessage.postValue(exception.toString()) _debugMessage.postValue(exception.toString())
@@ -235,7 +229,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
val selectionList = ObjectInputStream(selectionStream).readObject() val selectionList = ObjectInputStream(selectionStream).readObject()
selectionList as MutableList<Int> selectionList as MutableList<Int>
} catch (exception: FileNotFoundException) { } catch (exception: FileNotFoundException) {
_debugMessage.postValue(app.getString(R.string.no_selection_found)) _debugMessage.postValue(app.getString(R.string.err_no_selection_file))
mutableListOf() mutableListOf()
} catch (exception: IOException) { } catch (exception: IOException) {
_debugMessage.postValue(exception.toString()) _debugMessage.postValue(exception.toString())
@@ -124,15 +124,19 @@ class MainActivity : AppCompatActivity() {
viewModel.debugMessage.observe(this, Observer { message -> viewModel.debugMessage.observe(this, Observer { message ->
Toast.makeText(this, message, Toast.LENGTH_SHORT).show() Toast.makeText(this, message, Toast.LENGTH_SHORT).show()
when (message) { when (message) {
getString(R.string.updateLocSuccess) -> drawerBtnLoc.enable() getString(R.string.update_loc_success) -> drawerBtnLoc.enable()
getString(R.string.updateTleSuccess), getString(R.string.updateTleFailure) -> drawerBtnTle.enable() getString(R.string.update_tle_success) -> drawerBtnTle.enable()
getString(R.string.updateTransSuccess), getString(R.string.updateTransFailure) -> drawerBtnTrans.enable() getString(R.string.update_trans_success) -> drawerBtnTrans.enable()
getString(R.string.update_failure) -> {
drawerBtnTle.enable()
drawerBtnTrans.enable()
}
} }
}) })
viewModel.gsp.observe(this, Observer { gsp -> viewModel.gsp.observe(this, Observer { gsp ->
drawerLat.text = String.format(getString(R.string.pattern_loc), gsp.latitude) drawerLat.text = String.format(getString(R.string.pat_location), gsp.latitude)
drawerLon.text = String.format(getString(R.string.pattern_loc), gsp.longitude) drawerLon.text = String.format(getString(R.string.pat_location), gsp.longitude)
}) })
} }
@@ -159,7 +163,8 @@ class MainActivity : AppCompatActivity() {
private fun requestLocationUpdate() { private fun requestLocationUpdate() {
if (ContextCompat.checkSelfPermission(this, permLocation) != permGranted) { if (ContextCompat.checkSelfPermission(this, permLocation) != permGranted) {
if (ActivityCompat.shouldShowRequestPermissionRationale(this, permLocation)) { 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 { } else {
ActivityCompat.requestPermissions(this, arrayOf(permLocation), permLocationCode) ActivityCompat.requestPermissions(this, arrayOf(permLocation), permLocationCode)
} }
@@ -182,14 +187,14 @@ class MainActivity : AppCompatActivity() {
val navController = findNavController(R.id.nav_host) val navController = findNavController(R.id.nav_host)
return navController.navigateUp(appBarConfig) || super.onSupportNavigateUp() return navController.navigateUp(appBarConfig) || super.onSupportNavigateUp()
} }
}
fun ImageButton.enable() { private fun ImageButton.enable() {
this.isEnabled = true this.isEnabled = true
this.alpha = 1.0f this.alpha = 1.0f
} }
fun ImageButton.disable() { private fun ImageButton.disable() {
this.isEnabled = false this.isEnabled = false
this.alpha = 0.25f this.alpha = 0.25f
}
} }
@@ -205,9 +205,9 @@ class MapViewFragment : Fragment() {
if (lon > 180f) lon -= 360f if (lon > 180f) lon -= 360f
mapLat.text = String.format(context.getString(R.string.pattern_value_lat), lat) mapLat.text = String.format(context.getString(R.string.pat_latitude), lat)
mapLon.text = String.format(context.getString(R.string.pattern_value_lon), lon) mapLon.text = String.format(context.getString(R.string.pat_longitude), lon)
mapRng.text = String.format(context.getString(R.string.pattern_value_rng), rng) mapRng.text = String.format(context.getString(R.string.pat_range), rng)
} }
private fun drawGroundTrack( private fun drawGroundTrack(
@@ -83,8 +83,8 @@ class PassListFragment : Fragment() {
} }
private fun findViews(view: View) { private fun findViews(view: View) {
aosTimerText = (mainActivity).findViewById(R.id.toolbar_timer) aosTimerText = mainActivity.findViewById(R.id.toolbar_timer)
btnPassPrefs = (mainActivity).findViewById(R.id.toolbar_filter) btnPassPrefs = mainActivity.findViewById(R.id.toolbar_filter)
swipeLayout = view.findViewById(R.id.pass_list_refresh) swipeLayout = view.findViewById(R.id.pass_list_refresh)
satPassRecycler = view.findViewById(R.id.pass_list_recycler) satPassRecycler = view.findViewById(R.id.pass_list_recycler)
passListFab = view.findViewById(R.id.pass_list_fab) passListFab = view.findViewById(R.id.pass_list_fab)
@@ -161,7 +161,7 @@ class PassListFragment : Fragment() {
} }
} else Toast.makeText( } else Toast.makeText(
mainActivity, mainActivity,
getString(R.string.error_enter_value), getString(R.string.err_enter_value),
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
).show() ).show()
@@ -176,7 +176,7 @@ class PassListFragment : Fragment() {
private fun showSelectSatDialog(tleMainList: List<TLE>, selectionList: MutableList<Int>) { private fun showSelectSatDialog(tleMainList: List<TLE>, selectionList: MutableList<Int>) {
if (tleMainList.isEmpty()) { 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() .show()
} else { } else {
val tleNameArray = arrayOfNulls<String>(tleMainList.size).apply { val tleNameArray = arrayOfNulls<String>(tleMainList.size).apply {
@@ -235,7 +235,7 @@ class PassListFragment : Fragment() {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
aosTimerText.text = String.format( 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.toHours(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60, TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60 TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60
@@ -255,7 +255,7 @@ class PassListFragment : Fragment() {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
aosTimerText.text = String.format( 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.toHours(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60, TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60,
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60 TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60
@@ -271,6 +271,6 @@ class PassListFragment : Fragment() {
isTimerSet = false isTimerSet = false
} }
if (resetToNull) aosTimerText.text = 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)
} }
} }
@@ -169,18 +169,14 @@ class PolarViewFragment : Fragment() {
private fun setPassText() { private fun setPassText() {
satPos = satPass.predictor.getSatPos(Date()) satPos = satPass.predictor.getSatPos(Date())
polarAzimuth.text = String.format( polarAzimuth.text =
context.getString(R.string.pattern_value_az), String.format(context.getString(R.string.pat_azimuth), rad2Deg(satPos.azimuth))
rad2Deg(satPos.azimuth) polarElevation.text =
) String.format(context.getString(R.string.pat_elevation), rad2Deg(satPos.elevation))
polarElevation.text = String.format(
context.getString(R.string.pattern_value_el),
rad2Deg(satPos.elevation)
)
polarRange.text = 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 = 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) { private fun drawRadarView(cvs: Canvas) {
@@ -93,26 +93,26 @@ class SatPassAdapter : RecyclerView.Adapter<SatPassAdapter.SatPassHolder>() {
fun bind(satPass: SatPass) { fun bind(satPass: SatPass) {
val aos = SimpleDateFormat( val aos = SimpleDateFormat(
context.getString(R.string.pattern_time), context.getString(R.string.pat_time),
Locale.getDefault() Locale.getDefault()
).format(satPass.pass.startTime) ).format(satPass.pass.startTime)
val los = SimpleDateFormat( val los = SimpleDateFormat(
context.getString(R.string.pattern_time), context.getString(R.string.pat_time),
Locale.getDefault() Locale.getDefault()
).format(satPass.pass.endTime) ).format(satPass.pass.endTime)
satName.text = satPass.tle.name satName.text = satPass.tle.name
satId.text = 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 = 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( azimuth.text = String.format(
context.getString(R.string.pattern_pass_azimuth), context.getString(R.string.pass_azimuth),
satPass.pass.aosAzimuth, satPass.pass.aosAzimuth,
satPass.pass.losAzimuth satPass.pass.losAzimuth
) )
aosTime.text = String.format(context.getString(R.string.pattern_pass_aos), aos) aosTime.text = String.format(context.getString(R.string.pass_aos), aos)
losTime.text = String.format(context.getString(R.string.pattern_pass_los), los) losTime.text = String.format(context.getString(R.string.pass_los), los)
progressBar.progress = satPass.progress progressBar.progress = satPass.progress
itemView.setOnClickListener { itemView.setOnClickListener {
@@ -66,12 +66,12 @@ class TransmitterAdapter : RecyclerView.Adapter<TransmitterAdapter.TransmitterHo
if (transmitter.downlinkLow != null && transmitter.downlinkHigh == null) { if (transmitter.downlinkLow != null && transmitter.downlinkHigh == null) {
downlink.text = String.format( downlink.text = String.format(
context.getString(R.string.pattern_trans_down_low), context.getString(R.string.trans_down_low),
transmitter.downlinkLow / freqDivider transmitter.downlinkLow / freqDivider
) )
} else if (transmitter.downlinkLow != null && transmitter.downlinkHigh != null) { } else if (transmitter.downlinkLow != null && transmitter.downlinkHigh != null) {
downlink.text = String.format( downlink.text = String.format(
context.getString(R.string.pattern_trans_down_lowHigh), context.getString(R.string.trans_down_lowHigh),
transmitter.downlinkLow / freqDivider, transmitter.downlinkLow / freqDivider,
transmitter.downlinkHigh / freqDivider transmitter.downlinkHigh / freqDivider
) )
@@ -81,12 +81,12 @@ class TransmitterAdapter : RecyclerView.Adapter<TransmitterAdapter.TransmitterHo
if (transmitter.uplinkLow != null && transmitter.uplinkHigh == null) { if (transmitter.uplinkLow != null && transmitter.uplinkHigh == null) {
uplink.text = String.format( uplink.text = String.format(
context.getString(R.string.pattern_trans_up_low), context.getString(R.string.trans_up_low),
transmitter.uplinkLow / freqDivider transmitter.uplinkLow / freqDivider
) )
} else if (transmitter.uplinkLow != null && transmitter.uplinkHigh != null) { } else if (transmitter.uplinkLow != null && transmitter.uplinkHigh != null) {
uplink.text = String.format( uplink.text = String.format(
context.getString(R.string.pattern_trans_up_lowHigh), context.getString(R.string.trans_up_lowHigh),
transmitter.uplinkLow / freqDivider, transmitter.uplinkLow / freqDivider,
transmitter.uplinkHigh / freqDivider transmitter.uplinkHigh / freqDivider
) )
@@ -96,18 +96,18 @@ class TransmitterAdapter : RecyclerView.Adapter<TransmitterAdapter.TransmitterHo
if (transmitter.mode != null) { if (transmitter.mode != null) {
mode.text = mode.text =
String.format(context.getString(R.string.pattern_trans_mode), transmitter.mode) String.format(context.getString(R.string.trans_mode), transmitter.mode)
} else { } else {
mode.text = context.getString(R.string.no_mode) mode.text = context.getString(R.string.no_mode)
} }
if (transmitter.isInverted) { if (transmitter.isInverted) {
inverted.text = String.format( inverted.text = String.format(
context.getString(R.string.pattern_trans_invert), context.getString(R.string.trans_inverted),
context.getString(R.string.btn_yes) context.getString(R.string.btn_yes)
) )
} else { } else {
inverted.text = String.format( inverted.text = String.format(
context.getString(R.string.pattern_trans_invert), context.getString(R.string.trans_inverted),
context.getString(R.string.btn_no) context.getString(R.string.btn_no)
) )
} }
+9
View File
@@ -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>
+12
View File
@@ -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>
+2 -2
View File
@@ -51,7 +51,7 @@
android:id="@+id/pass_aosTime" android:id="@+id/pass_aosTime"
style="@style/CardPassText" style="@style/CardPassText"
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:text="@string/pass_aosTime" android:text="@string/pass_aos"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/pass_progress" app:layout_constraintStart_toStartOf="@+id/pass_progress"
app:layout_constraintTop_toBottomOf="@+id/pass_progress" /> app:layout_constraintTop_toBottomOf="@+id/pass_progress" />
@@ -59,7 +59,7 @@
<TextView <TextView
android:id="@+id/pass_losTime" android:id="@+id/pass_losTime"
style="@style/CardPassText" style="@style/CardPassText"
android:text="@string/pass_losTime" android:text="@string/pass_los"
app:layout_constraintBaseline_toBaselineOf="@+id/pass_aosTime" app:layout_constraintBaseline_toBaselineOf="@+id/pass_aosTime"
app:layout_constraintEnd_toEndOf="@+id/pass_progress" /> app:layout_constraintEnd_toEndOf="@+id/pass_progress" />
+50 -11
View File
@@ -16,42 +16,81 @@
<TextView <TextView
android:id="@+id/trans_description" android:id="@+id/trans_description"
style="@style/CardTransText" style="@style/CardTransText"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:text="@string/trans_description" android:text="@string/trans_description"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="@+id/imageView"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintStart_toEndOf="@+id/imageView"
app:layout_constraintTop_toTopOf="@+id/imageView" />
<TextView <TextView
android:id="@+id/trans_downlink" android:id="@+id/trans_downlink"
style="@style/CardTransText" style="@style/CardTransText"
android:text="@string/trans_downlink" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="@+id/trans_description" 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" /> app:layout_constraintTop_toBottomOf="@+id/trans_description" />
<TextView <TextView
android:id="@+id/trans_uplink" android:id="@+id/trans_uplink"
style="@style/CardTransText" style="@style/CardTransText"
android:text="@string/trans_uplink" android:layout_marginStart="8dp"
app:layout_constraintStart_toStartOf="@+id/trans_description" 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" /> app:layout_constraintTop_toBottomOf="@+id/trans_downlink" />
<TextView <TextView
android:id="@+id/trans_mode" android:id="@+id/trans_mode"
style="@style/CardTransText" style="@style/CardTransText"
android:layout_marginBottom="4dp" android:layout_marginStart="6dp"
android:layout_marginBottom="2dp"
android:text="@string/trans_mode" android:text="@string/trans_mode"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/trans_description" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/trans_uplink" /> app:layout_constraintTop_toBottomOf="@+id/trans_uplink" />
<TextView <TextView
android:id="@+id/trans_inverted" android:id="@+id/trans_inverted"
style="@style/CardTransText" style="@style/CardTransText"
android:layout_marginEnd="8dp" android:layout_marginEnd="6dp"
android:text="@string/trans_inverted" android:text="@string/trans_inverted"
app:layout_constraintBaseline_toBaselineOf="@+id/trans_mode" app:layout_constraintBaseline_toBaselineOf="@+id/trans_mode"
app:layout_constraintEnd_toEndOf="parent" /> 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> </androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView> </com.google.android.material.card.MaterialCardView>
+8 -6
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" 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:layout_height="wrap_content"
android:background="@drawable/launcher_background" android:background="@drawable/launcher_background"
android:gravity="bottom" android:gravity="bottom"
@@ -11,8 +11,9 @@
android:id="@+id/drawer_sat_img" android:id="@+id/drawer_sat_img"
android:layout_width="104dp" android:layout_width="104dp"
android:layout_height="104dp" android:layout_height="104dp"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="16dp"
android:contentDescription="@string/app_name" android:contentDescription="@string/app_name"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/drawer_title" app:layout_constraintStart_toEndOf="@+id/drawer_title"
@@ -25,13 +26,14 @@
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:text="@string/drawer_title" android:text="@string/drawer_title"
app:layout_constraintBottom_toBottomOf="@+id/drawer_sat_img" app:layout_constraintBottom_toBottomOf="@+id/drawer_sat_img"
app:layout_constraintHorizontal_chainStyle="spread"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/drawer_sat_img" /> app:layout_constraintTop_toTopOf="@+id/drawer_sat_img" />
<TextView <TextView
android:id="@+id/drawer_lat" android:id="@+id/drawer_lat"
style="@style/DrawerHeader.Item" 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_constraintBaseline_toBaselineOf="@+id/drawer_lat_value"
app:layout_constraintStart_toStartOf="@+id/drawer_title" /> app:layout_constraintStart_toStartOf="@+id/drawer_title" />
@@ -40,14 +42,14 @@
style="@style/DrawerHeader.ItemValue" style="@style/DrawerHeader.ItemValue"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:text="@string/drawer_lat_value" android:text="@string/pat_location"
app:layout_constraintStart_toEndOf="@+id/drawer_lat" app:layout_constraintStart_toEndOf="@+id/drawer_lat"
app:layout_constraintTop_toBottomOf="@+id/drawer_sat_img" /> app:layout_constraintTop_toBottomOf="@+id/drawer_sat_img" />
<TextView <TextView
android:id="@+id/drawer_lon" android:id="@+id/drawer_lon"
style="@style/DrawerHeader.Item" style="@style/DrawerHeader.Item"
android:text="@string/drawer_lon" android:text="@string/drawer_lon_text"
app:layout_constraintStart_toStartOf="@+id/drawer_lat" app:layout_constraintStart_toStartOf="@+id/drawer_lat"
app:layout_constraintTop_toBottomOf="@+id/drawer_lat" /> app:layout_constraintTop_toBottomOf="@+id/drawer_lat" />
@@ -55,7 +57,7 @@
android:id="@+id/drawer_lon_value" android:id="@+id/drawer_lon_value"
style="@style/DrawerHeader.ItemValue" style="@style/DrawerHeader.ItemValue"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:text="@string/drawer_lon_value" android:text="@string/pat_location"
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lon" app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lon"
app:layout_constraintStart_toEndOf="@+id/drawer_lon" /> app:layout_constraintStart_toEndOf="@+id/drawer_lon" />
@@ -32,7 +32,7 @@
style="@style/MapText" style="@style/MapText"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:text="@string/pattern_value_lat" android:text="@string/pat_latitude"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -41,7 +41,7 @@
style="@style/MapText" style="@style/MapText"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:text="@string/pattern_value_lon" android:text="@string/pat_longitude"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@@ -50,7 +50,7 @@
style="@style/MapText" style="@style/MapText"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:layout_marginBottom="4dp" android:layout_marginBottom="4dp"
android:text="@string/pattern_value_rng" android:text="@string/pat_range"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" /> app:layout_constraintEnd_toEndOf="parent" />
@@ -19,31 +19,31 @@
android:id="@+id/polar_azimuth" android:id="@+id/polar_azimuth"
style="@style/PolarViewText" style="@style/PolarViewText"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:text="@string/polar_azimuth" android:text="@string/pat_azimuth"
app:layout_constraintBottom_toBottomOf="@+id/polar_view_frame" app:layout_constraintStart_toStartOf="@+id/polar_view_frame"
app:layout_constraintStart_toStartOf="@+id/polar_view_frame" /> app:layout_constraintTop_toTopOf="@+id/polar_view_frame" />
<TextView <TextView
android:id="@+id/polar_elevation" android:id="@+id/polar_elevation"
style="@style/PolarViewText" style="@style/PolarViewText"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:text="@string/polar_elevation" android:text="@string/pat_elevation"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="@+id/polar_view_frame"
app:layout_constraintTop_toTopOf="@+id/polar_view_frame" /> app:layout_constraintTop_toTopOf="@+id/polar_view_frame" />
<TextView <TextView
android:id="@+id/polar_altitude" android:id="@+id/polar_altitude"
style="@style/PolarViewText" style="@style/PolarViewText"
android:layout_marginStart="4dp" android:layout_marginStart="4dp"
android:text="@string/polar_altitude" android:text="@string/pat_altitude"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="@+id/polar_view_frame"
app:layout_constraintTop_toTopOf="@+id/polar_view_frame" /> app:layout_constraintStart_toStartOf="@+id/polar_view_frame" />
<TextView <TextView
android:id="@+id/polar_range" android:id="@+id/polar_range"
style="@style/PolarViewText" style="@style/PolarViewText"
android:layout_marginEnd="4dp" android:layout_marginEnd="4dp"
android:text="@string/polar_range" android:text="@string/pat_range"
app:layout_constraintBottom_toBottomOf="@+id/polar_view_frame" app:layout_constraintBottom_toBottomOf="@+id/polar_view_frame"
app:layout_constraintEnd_toEndOf="@+id/polar_view_frame" /> app:layout_constraintEnd_toEndOf="@+id/polar_view_frame" />
+52 -74
View File
@@ -3,115 +3,93 @@
<string name="app_name">Look4Sat</string> <string name="app_name">Look4Sat</string>
<string name="drawer_title">L∞king \n4Sat…</string> <string name="drawer_title">L∞king \n4Sat…</string>
<string name="drawer_lat">Latitude: </string> <string name="drawer_lat_text">Latitude: </string>
<string name="drawer_lat_value">51.5074</string> <string name="drawer_lon_text">Longitude: </string>
<string name="drawer_lon">Longitude: </string>
<string name="drawer_lon_value">0.1278</string>
<string name="update_loc">Update location</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">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">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="goto_github">GitHub</string>
<string name="exit_app">Exit</string> <string name="exit_app">Exit</string>
<string name="updateLocSuccess">Location was updated</string> <string name="menu_pass_list">List of Passes</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_polar_view">Polar View</string> <string name="menu_polar_view">Polar View</string>
<string name="menu_map_view">World Map View</string> <string name="menu_map_view">World Map View</string>
<string name="menu_settings">Settings</string> <string name="menu_settings">Settings</string>
<string name="menu_credits">Credits</string> <string name="menu_credits">Credits</string>
<string name="menu_about">About the App</string> <string name="menu_about">About the App</string>
<string name="pass_satName">Meteor M2–2</string> <string name="dialog_select_sat">Select satellites to track…</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_show_track">Show ground track for…</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_key">hoursAhead</string>
<string name="pref_hours_ahead_hint">Hours ahead</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_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_key">minEl</string>
<string name="pref_min_el_hint">Minimum elevation</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_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_key">latitude</string>
<string name="pref_lat_title">Latitude</string> <string name="pref_lat_title">Latitude, deg</string>
<string name="pref_lat_input_error">Lat should be within -90 to 90 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_key">longitude</string>
<string name="pref_lon_title">Longitude</string> <string name="pref_lon_title">Longitude, deg</string>
<string name="pref_lon_input_error">Lon should be within -180 to 180 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_key">altitude</string>
<string name="pref_alt_title">Altitude</string> <string name="pref_alt_title">Altitude, m</string>
<string name="pref_alt_input_error">Alt should be within -413 to 8850 m</string> <string name="pref_alt_input_error">Set the value between -413m and 8850m</string>
<string name="pref_other_title">Other settings</string> <string name="pref_other_title">Other</string>
<string name="pref_refresh_rate_key">rate</string> <string name="pref_refresh_rate_key">rate</string>
<string name="pref_refresh_rate_title">Refresh rate</string> <string name="pref_refresh_rate_title">View refresh rate, ms</string>
<string name="pref_refresh_rate_input_error">Value should be within 250 to 10000 ms</string> <string name="pref_refresh_rate_input_error">Set the value between 250ms and 10000ms</string>
<string name="pref_refresh_rate_summary">Views update interval, ms</string>
<string name="no_permissions">Missing permissions</string>
<string name="no_mode">Mode: Null</string> <string name="no_mode">Mode: Null</string>
<string name="no_uplink">Uplink: Null</string> <string name="no_uplink">Uplink: Null</string>
<string name="no_downlink">Downlink: 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_selected_sat">No satellites were shortlisted</string>
<string name="no_tle_found">TLE file was not found</string> <string name="no_transmitters">No transmitters found for this Satellite</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="err_no_permissions">Missing permissions</string>
<string name="error_sat_tle">There was a problem with a satellite TLE</string> <string name="err_sat_wont_pass">Certain satellites shall not pass</string>
<string name="error_update_tle">Please, update your TLE</string> <string name="err_parse_tle">Error parsing TLE entry</string>
<string name="error_enter_value">Please, enter the value</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="pattern_loc">%.4f</string> <string name="pass_satName">%s</string>
<string name="pattern_time">HH:mm:ss</string> <string name="pass_aos">AOS - %s</string>
<string name="pattern_timer_aos">AOS -%02d:%02d:%02d</string> <string name="pass_los">LOS - %s</string>
<string name="pattern_timer_los">LOS -%02d:%02d:%02d</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="pattern_pass_aos">AOS - %s</string> <string name="pat_location">%.4f</string>
<string name="pattern_pass_los">LOS - %s</string> <string name="pat_time">HH:mm:ss</string>
<string name="pattern_pass_satId">Id: %d</string> <string name="pat_azimuth">Azimuth: %.1f°</string>
<string name="pattern_pass_maxEl">MaxEl: %.1f°</string> <string name="pat_elevation">Elevation: %.1f°</string>
<string name="pattern_pass_azimuth">Az: %2d° -> %2d°</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="pattern_value_az">Az: %.1f°</string> <string name="trans_description">%s</string>
<string name="pattern_value_el">El: %.1f°</string> <string name="trans_mode">Mode: %s</string>
<string name="pattern_value_lat">Lat: %.1f°</string> <string name="trans_inverted">Inverted: %s</string>
<string name="pattern_value_lon">Lon: %.1f°</string> <string name="trans_up_low">Uplink: %.4f MHz</string>
<string name="pattern_value_rng">Rng: %.0f km</string> <string name="trans_up_lowHigh">Uplink: %.4f - %.4f MHz</string>
<string name="pattern_value_alt">Alt: %.0f km</string> <string name="trans_down_low">Downlink: %.4f MHz</string>
<string name="trans_down_lowHigh">Downlink: %.4f - %.4f MHz</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="btn_yes">Yes</string> <string name="btn_yes">Yes</string>
<string name="btn_no">No</string> <string name="btn_no">No</string>
-1
View File
@@ -26,7 +26,6 @@
android:key="@string/pref_refresh_rate_key" android:key="@string/pref_refresh_rate_key"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
android:singleLine="true" android:singleLine="true"
android:summary="@string/pref_refresh_rate_summary"
android:title="@string/pref_refresh_rate_title" /> android:title="@string/pref_refresh_rate_title" />
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>