mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Updated DrawerHeader layout. Hopefully it's a final version. Moved the timer setup to the Sky fragment.
This commit is contained in:
1 parent
1f2832d13e
commit
92767bd0a4
7 files changed
+152
-126
No files matched your search
@@ -6,7 +6,6 @@ import android.content.pm.ActivityInfo
|
|||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.CountDownTimer
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
@@ -20,14 +19,13 @@ import androidx.drawerlayout.widget.DrawerLayout
|
|||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.navigation.findNavController
|
import androidx.navigation.findNavController
|
||||||
|
import androidx.navigation.ui.AppBarConfiguration
|
||||||
import androidx.navigation.ui.navigateUp
|
import androidx.navigation.ui.navigateUp
|
||||||
import androidx.navigation.ui.setupActionBarWithNavController
|
import androidx.navigation.ui.setupActionBarWithNavController
|
||||||
import androidx.navigation.ui.setupWithNavController
|
import androidx.navigation.ui.setupWithNavController
|
||||||
import com.google.android.material.navigation.NavigationView
|
import com.google.android.material.navigation.NavigationView
|
||||||
import com.rtbishop.lookingsat.MainViewModel
|
import com.rtbishop.lookingsat.MainViewModel
|
||||||
import com.rtbishop.lookingsat.R
|
import com.rtbishop.lookingsat.R
|
||||||
import java.util.*
|
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
|
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
@@ -36,42 +34,38 @@ class MainActivity : AppCompatActivity() {
|
|||||||
private val permGranted = PackageManager.PERMISSION_GRANTED
|
private val permGranted = PackageManager.PERMISSION_GRANTED
|
||||||
private val githubUrl = "https://github.com/rt-bishop/LookingSat"
|
private val githubUrl = "https://github.com/rt-bishop/LookingSat"
|
||||||
|
|
||||||
private lateinit var drawerLayout: DrawerLayout
|
|
||||||
private lateinit var viewModel: MainViewModel
|
private lateinit var viewModel: MainViewModel
|
||||||
private lateinit var timerLayout: ConstraintLayout
|
private lateinit var timerLayout: ConstraintLayout
|
||||||
private lateinit var timeToAos: TextView
|
private lateinit var drawerLayout: DrawerLayout
|
||||||
private lateinit var drawerLat: TextView
|
private lateinit var drawerLat: TextView
|
||||||
private lateinit var drawerLon: TextView
|
private lateinit var drawerLon: TextView
|
||||||
private lateinit var drawerHeight: TextView
|
|
||||||
private lateinit var drawerBtnLoc: ImageButton
|
private lateinit var drawerBtnLoc: ImageButton
|
||||||
private lateinit var drawerBtnTle: ImageButton
|
private lateinit var drawerBtnTle: ImageButton
|
||||||
private lateinit var drawerBtnTrans: ImageButton
|
private lateinit var drawerBtnTrans: ImageButton
|
||||||
private lateinit var drawerBtnGithub: ImageButton
|
private lateinit var drawerBtnGithub: ImageButton
|
||||||
private lateinit var drawerBtnExit: ImageButton
|
private lateinit var drawerBtnExit: ImageButton
|
||||||
|
private lateinit var appBarConfig: AppBarConfiguration
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
setContentView(R.layout.activity_main)
|
setContentView(R.layout.activity_main)
|
||||||
setupComponents()
|
setupComponents()
|
||||||
setupDrawer()
|
setupDrawer()
|
||||||
setupTimer()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupComponents() {
|
private fun setupComponents() {
|
||||||
viewModel = ViewModelProvider(this).get(MainViewModel::class.java)
|
val navView: NavigationView = findViewById(R.id.nav_view)
|
||||||
timerLayout = findViewById(R.id.toolbar_layout_timer)
|
val header = navView.getHeaderView(0)
|
||||||
timeToAos = findViewById(R.id.toolbar_time_to_aos)
|
|
||||||
|
|
||||||
val toolbar: Toolbar = findViewById(R.id.toolbar)
|
val toolbar: Toolbar = findViewById(R.id.toolbar)
|
||||||
setSupportActionBar(toolbar)
|
setSupportActionBar(toolbar)
|
||||||
|
|
||||||
|
viewModel = ViewModelProvider(this).get(MainViewModel::class.java)
|
||||||
|
|
||||||
|
timerLayout = findViewById(R.id.toolbar_layout_timer)
|
||||||
drawerLayout = findViewById(R.id.drawer_layout)
|
drawerLayout = findViewById(R.id.drawer_layout)
|
||||||
val navView: NavigationView = findViewById(R.id.nav_view)
|
|
||||||
val header = navView.getHeaderView(0)
|
|
||||||
|
|
||||||
drawerLat = header.findViewById(R.id.drawer_lat_value)
|
drawerLat = header.findViewById(R.id.drawer_lat_value)
|
||||||
drawerLon = header.findViewById(R.id.drawer_lon_value)
|
drawerLon = header.findViewById(R.id.drawer_lon_value)
|
||||||
drawerHeight = header.findViewById(R.id.drawer_height_value)
|
|
||||||
|
|
||||||
drawerBtnLoc = header.findViewById(R.id.drawer_btn_loc)
|
drawerBtnLoc = header.findViewById(R.id.drawer_btn_loc)
|
||||||
drawerBtnTle = header.findViewById(R.id.drawer_btn_tle)
|
drawerBtnTle = header.findViewById(R.id.drawer_btn_tle)
|
||||||
@@ -79,8 +73,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
drawerBtnGithub = header.findViewById(R.id.drawer_btn_github)
|
drawerBtnGithub = header.findViewById(R.id.drawer_btn_github)
|
||||||
drawerBtnExit = header.findViewById(R.id.drawer_btn_exit)
|
drawerBtnExit = header.findViewById(R.id.drawer_btn_exit)
|
||||||
|
|
||||||
|
appBarConfig = AppBarConfiguration(
|
||||||
|
setOf(R.id.nav_sky, R.id.nav_map, R.id.nav_credits, R.id.nav_about),
|
||||||
|
drawerLayout
|
||||||
|
)
|
||||||
|
|
||||||
val navController = findNavController(R.id.nav_host)
|
val navController = findNavController(R.id.nav_host)
|
||||||
setupActionBarWithNavController(navController, drawerLayout)
|
setupActionBarWithNavController(navController, appBarConfig)
|
||||||
navView.setupWithNavController(navController)
|
navView.setupWithNavController(navController)
|
||||||
|
|
||||||
navController.addOnDestinationChangedListener { _, destination, _ ->
|
navController.addOnDestinationChangedListener { _, destination, _ ->
|
||||||
@@ -95,6 +94,8 @@ class MainActivity : AppCompatActivity() {
|
|||||||
toolbar.visibility = View.GONE
|
toolbar.visibility = View.GONE
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
|
this.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||||
|
toolbar.visibility = View.VISIBLE
|
||||||
timerLayout.visibility = View.GONE
|
timerLayout.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,7 +112,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
viewModel.gsp.observe(this, Observer { gsp ->
|
viewModel.gsp.observe(this, Observer { gsp ->
|
||||||
drawerLat.text = String.format("%.4f", gsp.latitude)
|
drawerLat.text = String.format("%.4f", gsp.latitude)
|
||||||
drawerLon.text = String.format("%.4f", gsp.longitude)
|
drawerLon.text = String.format("%.4f", gsp.longitude)
|
||||||
drawerHeight.text = String.format("%.1fm", gsp.heightAMSL)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
drawerBtnLoc.setOnClickListener { updateLocation() }
|
drawerBtnLoc.setOnClickListener { updateLocation() }
|
||||||
@@ -123,32 +123,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
drawerBtnExit.setOnClickListener { finish() }
|
drawerBtnExit.setOnClickListener { finish() }
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupTimer() {
|
|
||||||
val cal = Calendar.getInstance()
|
|
||||||
cal.add(Calendar.DAY_OF_MONTH, 1)
|
|
||||||
cal.set(Calendar.HOUR_OF_DAY, 0)
|
|
||||||
cal.set(Calendar.MINUTE, 0)
|
|
||||||
cal.set(Calendar.SECOND, 0)
|
|
||||||
cal.set(Calendar.MILLISECOND, 0)
|
|
||||||
val totalMillis = cal.timeInMillis - System.currentTimeMillis()
|
|
||||||
|
|
||||||
val timer = object : CountDownTimer(totalMillis, 1000) {
|
|
||||||
override fun onFinish() {
|
|
||||||
Toast.makeText(this@MainActivity, "Time is up!", Toast.LENGTH_SHORT).show()
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onTick(millisUntilFinished: Long) {
|
|
||||||
timeToAos.text = String.format(
|
|
||||||
resources.getString(R.string.toolbar_aos_in),
|
|
||||||
TimeUnit.MILLISECONDS.toHours(millisUntilFinished) % 60,
|
|
||||||
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60,
|
|
||||||
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
timer.start()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateLocation() {
|
private fun updateLocation() {
|
||||||
if (ContextCompat.checkSelfPermission(this, permLocation) != permGranted) {
|
if (ContextCompat.checkSelfPermission(this, permLocation) != permGranted) {
|
||||||
if (ActivityCompat.shouldShowRequestPermissionRationale(this, permLocation)) {
|
if (ActivityCompat.shouldShowRequestPermissionRationale(this, permLocation)) {
|
||||||
@@ -173,6 +147,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
override fun onSupportNavigateUp(): Boolean {
|
override fun onSupportNavigateUp(): Boolean {
|
||||||
val navController = findNavController(R.id.nav_host)
|
val navController = findNavController(R.id.nav_host)
|
||||||
return navController.navigateUp(drawerLayout) || super.onSupportNavigateUp()
|
return navController.navigateUp(appBarConfig) || super.onSupportNavigateUp()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,14 @@
|
|||||||
package com.rtbishop.lookingsat.ui
|
package com.rtbishop.lookingsat.ui
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.os.CountDownTimer
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.ProgressBar
|
import android.widget.ProgressBar
|
||||||
|
import android.widget.TextView
|
||||||
|
import android.widget.Toast
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
@@ -19,6 +22,8 @@ import com.rtbishop.lookingsat.R
|
|||||||
import com.rtbishop.lookingsat.repo.SatPass
|
import com.rtbishop.lookingsat.repo.SatPass
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
import java.util.*
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class SkyFragment : Fragment() {
|
class SkyFragment : Fragment() {
|
||||||
|
|
||||||
@@ -27,6 +32,7 @@ class SkyFragment : Fragment() {
|
|||||||
private lateinit var recViewFuture: RecyclerView
|
private lateinit var recViewFuture: RecyclerView
|
||||||
private lateinit var recAdapterCurrent: RecyclerView.Adapter<*>
|
private lateinit var recAdapterCurrent: RecyclerView.Adapter<*>
|
||||||
private lateinit var recAdapterFuture: RecyclerView.Adapter<*>
|
private lateinit var recAdapterFuture: RecyclerView.Adapter<*>
|
||||||
|
private lateinit var timeToAos: TextView
|
||||||
private lateinit var btnPassPrefs: ImageButton
|
private lateinit var btnPassPrefs: ImageButton
|
||||||
private lateinit var progressBar: ProgressBar
|
private lateinit var progressBar: ProgressBar
|
||||||
private lateinit var fab: FloatingActionButton
|
private lateinit var fab: FloatingActionButton
|
||||||
@@ -42,6 +48,7 @@ class SkyFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
viewModel = ViewModelProvider(activity as MainActivity).get(MainViewModel::class.java)
|
viewModel = ViewModelProvider(activity as MainActivity).get(MainViewModel::class.java)
|
||||||
|
timeToAos = (activity as MainActivity).findViewById(R.id.toolbar_time_to_aos)
|
||||||
btnPassPrefs = (activity as MainActivity).findViewById(R.id.toolbar_btn_refresh)
|
btnPassPrefs = (activity as MainActivity).findViewById(R.id.toolbar_btn_refresh)
|
||||||
progressBar = view.findViewById(R.id.sky_progressbar)
|
progressBar = view.findViewById(R.id.sky_progressbar)
|
||||||
recViewFuture = view.findViewById(R.id.sky_recycler_future)
|
recViewFuture = view.findViewById(R.id.sky_recycler_future)
|
||||||
@@ -50,6 +57,8 @@ class SkyFragment : Fragment() {
|
|||||||
recViewFuture.layoutManager = LinearLayoutManager(activity)
|
recViewFuture.layoutManager = LinearLayoutManager(activity)
|
||||||
|
|
||||||
fab.setOnClickListener { showSelectSatDialog() }
|
fab.setOnClickListener { showSelectSatDialog() }
|
||||||
|
|
||||||
|
setupTimer()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showSelectSatDialog() {
|
private fun showSelectSatDialog() {
|
||||||
@@ -107,4 +116,30 @@ class SkyFragment : Fragment() {
|
|||||||
recViewFuture.visibility = View.VISIBLE
|
recViewFuture.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupTimer() {
|
||||||
|
val cal = Calendar.getInstance()
|
||||||
|
cal.add(Calendar.DAY_OF_MONTH, 1)
|
||||||
|
cal.set(Calendar.HOUR_OF_DAY, 0)
|
||||||
|
cal.set(Calendar.MINUTE, 0)
|
||||||
|
cal.set(Calendar.SECOND, 0)
|
||||||
|
cal.set(Calendar.MILLISECOND, 0)
|
||||||
|
val totalMillis = cal.timeInMillis - System.currentTimeMillis()
|
||||||
|
|
||||||
|
val timer = object : CountDownTimer(totalMillis, 1000) {
|
||||||
|
override fun onFinish() {
|
||||||
|
Toast.makeText(activity, "Time is up!", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onTick(millisUntilFinished: Long) {
|
||||||
|
timeToAos.text = String.format(
|
||||||
|
"AOS -%02d:%02d:%02d",
|
||||||
|
TimeUnit.MILLISECONDS.toHours(millisUntilFinished) % 60,
|
||||||
|
TimeUnit.MILLISECONDS.toMinutes(millisUntilFinished) % 60,
|
||||||
|
TimeUnit.MILLISECONDS.toSeconds(millisUntilFinished) % 60
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
timer.start()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
<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="match_parent"
|
||||||
android:layout_height="@dimen/drawer_header_height"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/launcher_background"
|
android:background="@drawable/launcher_background"
|
||||||
android:gravity="bottom"
|
android:gravity="bottom"
|
||||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||||
@@ -12,129 +12,148 @@
|
|||||||
android:layout_width="108dp"
|
android:layout_width="108dp"
|
||||||
android:layout_height="108dp"
|
android:layout_height="108dp"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
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_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:srcCompat="@drawable/ic_sat_desc_left" />
|
app:srcCompat="@drawable/ic_sat_desc_left" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawer_title"
|
android:id="@+id/drawer_title"
|
||||||
style="@style/DrawerHeader.Title"
|
style="@style/DrawerHeader.Title"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
android:text="@string/title"
|
android:text="@string/title"
|
||||||
app:layout_constraintStart_toStartOf="@+id/drawer_subtitle"
|
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_subtitle"
|
android:id="@+id/drawer_subtitle"
|
||||||
style="@style/DrawerHeader.Title"
|
style="@style/DrawerHeader.Title"
|
||||||
android:text="@string/subtitle"
|
android:text="@string/subtitle"
|
||||||
app:layout_constraintStart_toStartOf="@+id/drawer_lat"
|
app:layout_constraintBottom_toBottomOf="@+id/drawer_sat_img"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/drawer_title"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/drawer_title" />
|
app:layout_constraintTop_toBottomOf="@+id/drawer_title" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawer_lat"
|
android:id="@+id/drawer_lat"
|
||||||
style="@style/DrawerHeader.Item"
|
style="@style/DrawerHeader.Item"
|
||||||
android:text="@string/drawer_latitude"
|
android:text="@string/drawer_latitude"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/drawer_lon_value"
|
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lat_value"
|
||||||
app:layout_constraintStart_toStartOf="@+id/drawer_lon" />
|
app:layout_constraintStart_toStartOf="@+id/drawer_subtitle" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawer_lat_value"
|
android:id="@+id/drawer_lat_value"
|
||||||
style="@style/DrawerHeader.Value"
|
style="@style/DrawerHeader.ItemValue"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
android:text="@string/drawer_latitude_value"
|
android:text="@string/drawer_latitude_value"
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lat"
|
app:layout_constraintStart_toEndOf="@+id/drawer_lat"
|
||||||
app:layout_constraintStart_toEndOf="@+id/drawer_lat" />
|
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_longitude"
|
android:text="@string/drawer_longitude"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/drawer_height_value"
|
app:layout_constraintStart_toStartOf="@+id/drawer_lat"
|
||||||
app:layout_constraintStart_toStartOf="@+id/drawer_height" />
|
app:layout_constraintTop_toBottomOf="@+id/drawer_lat" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/drawer_lon_value"
|
android:id="@+id/drawer_lon_value"
|
||||||
style="@style/DrawerHeader.Value"
|
style="@style/DrawerHeader.ItemValue"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:text="@string/drawer_longitude_value"
|
android:text="@string/drawer_longitude_value"
|
||||||
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" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/drawer_height"
|
|
||||||
style="@style/DrawerHeader.Item"
|
|
||||||
android:layout_marginStart="4dp"
|
|
||||||
android:layout_marginBottom="4dp"
|
|
||||||
android:text="@string/drawer_height"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/drawer_btn_loc"
|
|
||||||
app:layout_constraintStart_toStartOf="@+id/drawer_btn_loc" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/drawer_height_value"
|
|
||||||
style="@style/DrawerHeader.Value"
|
|
||||||
android:layout_marginStart="8dp"
|
|
||||||
android:text="@string/drawer_height_value"
|
|
||||||
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_height"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/drawer_height" />
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/drawer_btn_loc"
|
android:id="@+id/drawer_btn_loc"
|
||||||
style="@style/DrawerHeader.Button"
|
style="@style/DrawerHeader.Button"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:contentDescription="@string/placeholder"
|
android:contentDescription="@string/placeholder"
|
||||||
android:src="@drawable/ic_location"
|
android:src="@drawable/ic_location"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toTopOf="@+id/drawer_btn_tle"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_tle"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintTop_toBottomOf="@+id/drawer_lon_value" />
|
||||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
<TextView
|
||||||
|
android:id="@+id/drawer_tv_loc"
|
||||||
|
style="@style/DrawerHeader.ButtonText"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/update_location"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_loc"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/drawer_btn_loc"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/drawer_btn_loc" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/drawer_btn_tle"
|
android:id="@+id/drawer_btn_tle"
|
||||||
style="@style/DrawerHeader.Button"
|
style="@style/DrawerHeader.Button"
|
||||||
android:contentDescription="@string/placeholder"
|
android:contentDescription="@string/placeholder"
|
||||||
android:src="@drawable/ic_tle"
|
android:src="@drawable/ic_tle"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_trans"
|
app:layout_constraintBottom_toTopOf="@+id/drawer_btn_trans"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_trans"
|
app:layout_constraintStart_toStartOf="@+id/drawer_btn_loc"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_loc" />
|
||||||
app:layout_constraintStart_toEndOf="@+id/drawer_btn_loc"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/drawer_btn_trans" />
|
<TextView
|
||||||
|
android:id="@+id/drawer_tv_tle"
|
||||||
|
style="@style/DrawerHeader.ButtonText"
|
||||||
|
android:text="@string/update_tle"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_tle"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/drawer_tv_loc"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_loc" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/drawer_btn_trans"
|
android:id="@+id/drawer_btn_trans"
|
||||||
style="@style/DrawerHeader.Button"
|
style="@style/DrawerHeader.Button"
|
||||||
android:contentDescription="@string/placeholder"
|
android:contentDescription="@string/placeholder"
|
||||||
android:src="@drawable/ic_trans"
|
android:src="@drawable/ic_trans"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_exit"
|
app:layout_constraintBottom_toTopOf="@+id/drawer_btn_github"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_github"
|
app:layout_constraintStart_toStartOf="@+id/drawer_btn_tle"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_tle" />
|
||||||
app:layout_constraintStart_toEndOf="@+id/drawer_btn_tle"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/drawer_btn_exit" />
|
<TextView
|
||||||
|
android:id="@+id/drawer_tv_trans"
|
||||||
|
style="@style/DrawerHeader.ButtonText"
|
||||||
|
android:text="@string/update_transmitters"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_trans"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/drawer_tv_tle"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_tle" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/drawer_btn_github"
|
android:id="@+id/drawer_btn_github"
|
||||||
style="@style/DrawerHeader.Button"
|
style="@style/DrawerHeader.Button"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
android:contentDescription="@string/placeholder"
|
android:contentDescription="@string/placeholder"
|
||||||
android:src="@drawable/ic_github"
|
android:src="@drawable/ic_github"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_loc"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_exit"
|
app:layout_constraintStart_toStartOf="@+id/drawer_btn_trans"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_trans" />
|
||||||
app:layout_constraintStart_toEndOf="@+id/drawer_btn_trans"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/drawer_btn_loc" />
|
<TextView
|
||||||
|
android:id="@+id/drawer_tv_github"
|
||||||
|
style="@style/DrawerHeader.ButtonText"
|
||||||
|
android:text="@string/github"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_github"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/drawer_tv_trans"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_trans" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/drawer_btn_exit"
|
android:id="@+id/drawer_btn_exit"
|
||||||
style="@style/DrawerHeader.Button"
|
style="@style/DrawerHeader.Button"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginStart="8dp"
|
||||||
android:contentDescription="@string/placeholder"
|
android:contentDescription="@string/placeholder"
|
||||||
android:src="@drawable/ic_exit"
|
android:src="@drawable/ic_exit"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_github"
|
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_github"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintStart_toEndOf="@+id/drawer_tv_github"
|
||||||
app:layout_constraintHorizontal_bias="0.5"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/drawer_btn_github"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/drawer_btn_github" />
|
app:layout_constraintTop_toTopOf="@+id/drawer_btn_github" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/drawer_tv_exit"
|
||||||
|
style="@style/DrawerHeader.ButtonText"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:text="@string/exit"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_exit"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/drawer_btn_exit"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/drawer_btn_exit" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -12,18 +12,13 @@
|
|||||||
android:id="@+id/nav_map"
|
android:id="@+id/nav_map"
|
||||||
android:icon="@drawable/ic_map"
|
android:icon="@drawable/ic_map"
|
||||||
android:title="@string/menu_map" />
|
android:title="@string/menu_map" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_credits"
|
||||||
|
android:icon="@drawable/ic_credits"
|
||||||
|
android:title="@string/menu_credits" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/nav_about"
|
||||||
|
android:icon="@drawable/ic_about"
|
||||||
|
android:title="@string/menu_about" />
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
<item android:title="@string/about">
|
|
||||||
<menu>
|
|
||||||
<item
|
|
||||||
android:id="@+id/nav_credits"
|
|
||||||
android:icon="@drawable/ic_credits"
|
|
||||||
android:title="@string/menu_credits" />
|
|
||||||
<item
|
|
||||||
android:id="@+id/nav_about"
|
|
||||||
android:icon="@drawable/ic_about"
|
|
||||||
android:title="@string/menu_about" />
|
|
||||||
</menu>
|
|
||||||
</item>
|
|
||||||
</menu>
|
</menu>
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<dimen name="drawer_header_height">292dp</dimen>
|
|
||||||
<dimen name="fab_margin">16dp</dimen>
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -8,8 +8,12 @@
|
|||||||
<string name="drawer_latitude_value">51.5074</string>
|
<string name="drawer_latitude_value">51.5074</string>
|
||||||
<string name="drawer_longitude">Longitude: </string>
|
<string name="drawer_longitude">Longitude: </string>
|
||||||
<string name="drawer_longitude_value">0.1278</string>
|
<string name="drawer_longitude_value">0.1278</string>
|
||||||
<string name="drawer_height">Height AMSL: </string>
|
|
||||||
<string name="drawer_height_value">48.0m</string>
|
<string name="update_location">Update location</string>
|
||||||
|
<string name="update_tle">Update TLE file</string>
|
||||||
|
<string name="update_transmitters">Update transmitters DB</string>
|
||||||
|
<string name="github">GitHub</string>
|
||||||
|
<string name="exit">Exit</string>
|
||||||
|
|
||||||
<string name="menu_sky">Sky at a Glance</string>
|
<string name="menu_sky">Sky at a Glance</string>
|
||||||
<string name="menu_radar">Radar View</string>
|
<string name="menu_radar">Radar View</string>
|
||||||
@@ -17,9 +21,6 @@
|
|||||||
<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="toolbar_aos_in">AOS in %02d:%02d:%02d</string>
|
|
||||||
<string name="toolbar_refresh">Refresh</string>
|
|
||||||
|
|
||||||
<string name="card_sat_name">Meteor M2–2</string>
|
<string name="card_sat_name">Meteor M2–2</string>
|
||||||
<string name="card_pass_vector">V: 180° -> 360°</string>
|
<string name="card_pass_vector">V: 180° -> 360°</string>
|
||||||
<string name="card_max_el">75.5°</string>
|
<string name="card_max_el">75.5°</string>
|
||||||
@@ -30,5 +31,4 @@
|
|||||||
|
|
||||||
<string name="map_content">Nasa Map</string>
|
<string name="map_content">Nasa Map</string>
|
||||||
<string name="placeholder">Placeholder</string>
|
<string name="placeholder">Placeholder</string>
|
||||||
<string name="about">About</string>
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -29,14 +29,14 @@
|
|||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DrawerHeader.Value">
|
<style name="DrawerHeader.Item">
|
||||||
<item name="android:textSize">26sp</item>
|
<item name="android:textSize">24sp</item>
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:fontFamily">serif</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DrawerHeader.Item">
|
<style name="DrawerHeader.ItemValue">
|
||||||
<item name="android:textSize">21sp</item>
|
<item name="android:textSize">28sp</item>
|
||||||
<item name="android:fontFamily">serif</item>
|
<item name="android:textStyle">bold</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DrawerHeader.Button">
|
<style name="DrawerHeader.Button">
|
||||||
@@ -45,12 +45,16 @@
|
|||||||
<item name="android:backgroundTint">@color/themeAccent</item>
|
<item name="android:backgroundTint">@color/themeAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="DrawerHeader.ButtonText">
|
||||||
|
<item name="android:textSize">18sp</item>
|
||||||
|
<item name="android:fontFamily">serif</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="ToolbarText">
|
<style name="ToolbarText">
|
||||||
<item name="android:layout_width">wrap_content</item>
|
<item name="android:layout_width">wrap_content</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:gravity">center</item>
|
<item name="android:gravity">center</item>
|
||||||
<item name="android:text">@string/toolbar_aos_in</item>
|
<item name="android:textSize">32sp</item>
|
||||||
<item name="android:textSize">30sp</item>
|
|
||||||
<item name="android:textStyle">bold</item>
|
<item name="android:textStyle">bold</item>
|
||||||
<item name="android:textColor">@color/themeAccent</item>
|
<item name="android:textColor">@color/themeAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in new issue
Block a user