Skip to content

Satellite tracker and pass predictor for Android, inspired by Gpredict

Swapped the onboarding activity for a simple dialog

Arty Bishop38d21b98a08e
diff --git a/app/build.gradle b/app/build.gradle
index 6353ecb9..793d991e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -52,7 +52,6 @@ dependencies {
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
implementation "androidx.preference:preference-ktx:$preference_version"
- implementation "androidx.viewpager2:viewpager2:$view_pager2_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
kapt "androidx.room:room-compiler:$room_version"
@@ -65,8 +64,8 @@ dependencies {
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
- implementation "org.osmdroid:osmdroid-android:$osmdroid_version"
implementation "com.github.davidmoten:predict4java:$predict4java_version"
+ implementation "org.osmdroid:osmdroid-android:$osmdroid_version"
implementation "com.jakewharton.timber:timber:$timber_version"
testImplementation "junit:junit:$junit_version"
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c5abad64..41d76fe6 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -9,10 +9,9 @@
android:name=".Look4SatApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
- android:theme="@style/AppTheme">
+ android:label="@string/app_name">
<activity
- android:name=".ui.splashScreen.SplashActivity"
+ android:name=".ui.mainScreen.MainActivity"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.Splash">
<intent-filter>
@@ -21,9 +20,6 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <activity
- android:name=".ui.mainScreen.MainActivity"
- android:screenOrientation="portrait" />
</application>
</manifest>
\ No newline at end of file
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/MainActivity.kt b/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/MainActivity.kt
index 27e6a080..b3e6e42f 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/MainActivity.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/MainActivity.kt
@@ -25,17 +25,24 @@ import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.rtbishop.look4sat.R
import com.rtbishop.look4sat.databinding.ActivityMainBinding
+import com.rtbishop.look4sat.utility.PrefsManager
import dagger.hilt.android.AndroidEntryPoint
+import javax.inject.Inject
@AndroidEntryPoint
class MainActivity : AppCompatActivity() {
-
+
+ @Inject
+ lateinit var prefsManager: PrefsManager
+
override fun onCreate(savedInstanceState: Bundle?) {
+ setTheme(R.style.AppTheme)
super.onCreate(savedInstanceState)
ActivityMainBinding.inflate(layoutInflater).apply {
setContentView(root)
val navHost = supportFragmentManager.findFragmentById(R.id.nav_host) as NavHostFragment
navBottom.setupWithNavController(navHost.navController)
+ if (prefsManager.isFirstLaunch()) navHost.navController.navigate(R.id.nav_dialog_splash)
}
}
}
\ No newline at end of file
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/SourcesDialog.kt b/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/SourcesDialog.kt
index 51aa5862..98253a6e 100644
--- a/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/SourcesDialog.kt
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/SourcesDialog.kt
@@ -23,6 +23,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import android.view.WindowManager
import androidx.appcompat.app.AppCompatDialogFragment
import androidx.fragment.app.activityViewModels
import androidx.recyclerview.widget.LinearLayoutManager
@@ -47,6 +48,10 @@ class SourcesDialog : AppCompatDialogFragment() {
viewModel.getSources().observe(viewLifecycleOwner, { sources ->
val sourcesAdapter = SourcesAdapter(sources as MutableList<TleSource>)
DialogSourcesBinding.bind(view).apply {
+ dialog?.window?.setLayout(
+ WindowManager.LayoutParams.MATCH_PARENT,
+ WindowManager.LayoutParams.WRAP_CONTENT
+ )
tleSourcesRecycler.apply {
adapter = sourcesAdapter
layoutManager = LinearLayoutManager(requireContext())
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/SplashDialog.kt b/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/SplashDialog.kt
new file mode 100644
index 00000000..cac061be
--- /dev/null
+++ b/app/src/main/java/com/rtbishop/look4sat/ui/mainScreen/SplashDialog.kt
@@ -0,0 +1,47 @@
+/*******************************************************************************
+Look4Sat. Amateur radio satellite tracker and pass predictor.
+Copyright (C) 2019, 2020 Arty Bishop ([email protected])
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ ******************************************************************************/
+
+package com.rtbishop.look4sat.ui.mainScreen
+
+import android.os.Bundle
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import android.view.WindowManager
+import androidx.appcompat.app.AppCompatDialogFragment
+import com.rtbishop.look4sat.R
+import com.rtbishop.look4sat.databinding.DialogSplashBinding
+
+class SplashDialog : AppCompatDialogFragment() {
+
+ override fun onCreateView(inflater: LayoutInflater, group: ViewGroup?, state: Bundle?): View? {
+ return inflater.inflate(R.layout.dialog_splash, group, false)
+ }
+
+ override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
+ super.onViewCreated(view, savedInstanceState)
+ DialogSplashBinding.bind(view).apply {
+ dialog?.window?.setLayout(
+ WindowManager.LayoutParams.MATCH_PARENT,
+ WindowManager.LayoutParams.WRAP_CONTENT
+ )
+ splashButton.setOnClickListener { dismiss() }
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/PosFragment.kt b/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/PosFragment.kt
deleted file mode 100644
index c1fa6160..00000000
--- a/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/PosFragment.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- Look4Sat. Amateur radio satellite tracker and pass predictor.
- Copyright (C) 2019, 2020 Arty Bishop ([email protected])
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- ******************************************************************************/
-
-package com.rtbishop.look4sat.ui.splashScreen
-
-import androidx.fragment.app.Fragment
-import com.rtbishop.look4sat.R
-
-class PosFragment : Fragment(R.layout.fragment_splash_pos)
\ No newline at end of file
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/SplashActivity.kt b/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/SplashActivity.kt
deleted file mode 100644
index 027caeab..00000000
--- a/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/SplashActivity.kt
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- Look4Sat. Amateur radio satellite tracker and pass predictor.
- Copyright (C) 2019, 2020 Arty Bishop ([email protected])
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- ******************************************************************************/
-
-package com.rtbishop.look4sat.ui.splashScreen
-
-import android.content.Intent
-import android.os.Bundle
-import androidx.fragment.app.Fragment
-import androidx.fragment.app.FragmentActivity
-import androidx.viewpager2.adapter.FragmentStateAdapter
-import androidx.viewpager2.widget.ViewPager2
-import com.rtbishop.look4sat.R
-import com.rtbishop.look4sat.databinding.ActivitySplashBinding
-import com.rtbishop.look4sat.ui.mainScreen.MainActivity
-import com.rtbishop.look4sat.utility.PrefsManager
-import dagger.hilt.android.AndroidEntryPoint
-import javax.inject.Inject
-
-@AndroidEntryPoint
-class SplashActivity : FragmentActivity() {
-
- private val pagesCount = 2
-
- @Inject
- lateinit var prefsManager: PrefsManager
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- if (prefsManager.isFirstLaunch()) showOnboarding()
- else startMainActivity()
- }
-
- private fun showOnboarding() {
- setTheme(R.style.AppTheme)
- ActivitySplashBinding.inflate(layoutInflater).apply {
- setContentView(root)
- splashPager.apply {
- adapter = SplashPagerAdapter(this@SplashActivity)
- registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
- override fun onPageSelected(position: Int) {
- super.onPageSelected(position)
- if (position == pagesCount - 1) {
- splashNext.setImageResource(R.drawable.ic_check)
- }
- }
- })
- isUserInputEnabled = false
- }
- splashNext.setOnClickListener {
- if (splashPager.currentItem < pagesCount - 1) splashPager.currentItem++
- else if (splashPager.currentItem == pagesCount - 1) startMainActivity()
- }
- }
- }
-
- private fun startMainActivity() {
- startActivity(Intent(this, MainActivity::class.java))
- finish()
- }
-
- private inner class SplashPagerAdapter(activity: FragmentActivity) :
- FragmentStateAdapter(activity) {
-
- override fun getItemCount(): Int = pagesCount
-
- override fun createFragment(position: Int): Fragment {
- return when (position) {
- 0 -> TleFragment()
- 1 -> PosFragment()
- else -> TleFragment()
- }
- }
- }
-}
\ No newline at end of file
diff --git a/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/TleFragment.kt b/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/TleFragment.kt
deleted file mode 100644
index 8ed66588..00000000
--- a/app/src/main/java/com/rtbishop/look4sat/ui/splashScreen/TleFragment.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- Look4Sat. Amateur radio satellite tracker and pass predictor.
- Copyright (C) 2019, 2020 Arty Bishop ([email protected])
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- ******************************************************************************/
-
-package com.rtbishop.look4sat.ui.splashScreen
-
-import androidx.fragment.app.Fragment
-import com.rtbishop.look4sat.R
-
-class TleFragment: Fragment(R.layout.fragment_splash_tle)
\ No newline at end of file
diff --git a/app/src/main/res/drawable/rounded_corner.xml b/app/src/main/res/drawable/rounded_corner.xml
new file mode 100644
index 00000000..9f99d55b
--- /dev/null
+++ b/app/src/main/res/drawable/rounded_corner.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?><!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Look4Sat. Amateur radio satellite tracker and pass predictor.
+ Copyright (C) 2019, 2020 Arty Bishop ([email protected])
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+ <stroke
+ android:width="0dp"
+ android:color="@color/greySurface" />
+ <solid android:color="@color/greySurface" />
+ <corners android:radius="8dp" />
+</shape>
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml
deleted file mode 100644
index a625ce91..00000000
--- a/app/src/main/res/layout/activity_splash.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".ui.splashScreen.SplashActivity">
-
- <androidx.viewpager2.widget.ViewPager2
- android:id="@+id/splashPager"
- android:layout_width="match_parent"
- android:layout_height="0dp"
- app:layout_constraintBottom_toTopOf="@+id/splashNext"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent" />
-
- <com.google.android.material.floatingactionbutton.FloatingActionButton
- android:id="@+id/splashNext"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/fab_padding"
- android:contentDescription="@string/placeholder"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:srcCompat="@drawable/ic_next" />
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/dialog_sources.xml b/app/src/main/res/layout/dialog_sources.xml
index 5b237004..c1af22ca 100644
--- a/app/src/main/res/layout/dialog_sources.xml
+++ b/app/src/main/res/layout/dialog_sources.xml
@@ -2,7 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tleSourcesDialog"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/greyDark"
android:padding="4dp">
@@ -32,17 +32,18 @@
<ImageButton
android:id="@+id/tleSourceBtnAdd"
android:layout_width="48dp"
- android:layout_height="0dp"
+ android:layout_height="48dp"
android:backgroundTint="@color/greySurface"
android:contentDescription="@string/placeholder"
android:src="@drawable/ic_add"
app:layout_constraintBottom_toBottomOf="@+id/tleSourcesWarning"
+ app:layout_constraintDimensionRatio="h,1:1"
app:layout_constraintEnd_toEndOf="@+id/tleSourcesRecycler"
app:layout_constraintTop_toTopOf="@+id/tleSourcesTitle" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/tleSourcesRecycler"
- android:layout_width="266dp"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
diff --git a/app/src/main/res/layout/dialog_splash.xml b/app/src/main/res/layout/dialog_splash.xml
new file mode 100644
index 00000000..a99d8797
--- /dev/null
+++ b/app/src/main/res/layout/dialog_splash.xml
@@ -0,0 +1,85 @@
+<?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:id="@+id/splashRoot"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@color/greyDark">
+
+ <ImageView
+ android:id="@+id/splashPosIcon"
+ android:layout_width="0dp"
+ android:layout_height="64dp"
+ android:layout_marginStart="12dp"
+ android:layout_marginTop="12dp"
+ android:background="@drawable/rounded_corner"
+ android:contentDescription="@string/placeholder"
+ android:padding="8dp"
+ app:layout_constraintBottom_toTopOf="@+id/splashTleIcon"
+ app:layout_constraintDimensionRatio="w,1:1"
+ app:layout_constraintEnd_toStartOf="@+id/splashPosMsg"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:srcCompat="@drawable/ic_map_pos" />
+
+ <ImageView
+ android:id="@+id/splashTleIcon"
+ android:layout_width="0dp"
+ android:layout_height="64dp"
+ android:layout_marginTop="12dp"
+ android:background="@drawable/rounded_corner"
+ android:contentDescription="@string/placeholder"
+ android:padding="8dp"
+ app:layout_constraintBottom_toTopOf="@+id/splashButton"
+ app:layout_constraintDimensionRatio="w,1:1"
+ app:layout_constraintEnd_toStartOf="@+id/splashTleMsg"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toStartOf="@+id/splashPosIcon"
+ app:layout_constraintTop_toBottomOf="@+id/splashPosIcon"
+ app:srcCompat="@drawable/ic_update_web" />
+
+ <com.google.android.material.textview.MaterialTextView
+ android:id="@+id/splashPosMsg"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="8dp"
+ android:gravity="fill"
+ android:padding="8dp"
+ android:text="@string/splash_loc_msg"
+ app:layout_constraintBottom_toBottomOf="@+id/splashPosIcon"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/splashPosIcon"
+ app:layout_constraintTop_toTopOf="@+id/splashPosIcon" />
+
+ <com.google.android.material.textview.MaterialTextView
+ android:id="@+id/splashTleMsg"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:gravity="fill"
+ android:padding="8dp"
+ android:text="@string/splash_tle_msg"
+ app:layout_constraintBottom_toBottomOf="@+id/splashTleIcon"
+ app:layout_constraintEnd_toEndOf="@+id/splashPosMsg"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/splashTleIcon"
+ app:layout_constraintTop_toTopOf="@+id/splashTleIcon" />
+
+ <com.google.android.material.button.MaterialButton
+ android:id="@+id/splashButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp"
+ android:backgroundTint="@color/greySurface"
+ android:text="@android:string/ok"
+ android:textColor="@color/themeLight"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/splashTleIcon" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_splash_pos.xml b/app/src/main/res/layout/fragment_splash_pos.xml
deleted file mode 100644
index 0bd20b9d..00000000
--- a/app/src/main/res/layout/fragment_splash_pos.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".ui.splashScreen.PosFragment">
-
- <androidx.cardview.widget.CardView
- android:id="@+id/splashPosTitleCard"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="48dp"
- android:layout_marginEnd="16dp"
- android:backgroundTint="@color/greySurface"
- app:cardCornerRadius="8dp"
- app:layout_constraintBottom_toTopOf="@+id/splashPosIcon"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_chainStyle="spread_inside">
-
- <TextView
- android:id="@+id/splashPosTitle"
- style="@style/SplashText"
- android:text="@string/pref_gsp_title" />
- </androidx.cardview.widget.CardView>
-
- <ImageView
- android:id="@+id/splashPosIcon"
- style="@style/SplashText.Icon"
- android:contentDescription="@string/placeholder"
- android:src="@drawable/ic_map_pos"
- app:layout_constraintBottom_toTopOf="@+id/splashPosMsgCard"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/splashPosTitleCard" />
-
- <androidx.cardview.widget.CardView
- android:id="@+id/splashPosMsgCard"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="48dp"
- android:backgroundTint="@color/greySurface"
- app:cardCornerRadius="8dp"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/splashPosIcon">
-
- <TextView
- android:id="@+id/splashPosMsg"
- style="@style/SplashText.Msg"
- android:text="@string/splash_loc_msg" />
- </androidx.cardview.widget.CardView>
-
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_splash_tle.xml b/app/src/main/res/layout/fragment_splash_tle.xml
deleted file mode 100644
index 36996443..00000000
--- a/app/src/main/res/layout/fragment_splash_tle.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context=".ui.splashScreen.TleFragment">
-
- <androidx.cardview.widget.CardView
- android:id="@+id/splashTleTitleCard"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginTop="48dp"
- android:layout_marginEnd="16dp"
- android:backgroundTint="@color/greySurface"
- app:cardCornerRadius="8dp"
- app:layout_constraintBottom_toTopOf="@+id/splashTleIcon"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintVertical_chainStyle="spread_inside">
-
- <TextView
- android:id="@+id/splashTleTitle"
- style="@style/SplashText"
- android:text="@string/splash_tle_title" />
- </androidx.cardview.widget.CardView>
-
- <ImageView
- android:id="@+id/splashTleIcon"
- style="@style/SplashText.Icon"
- android:contentDescription="@string/placeholder"
- android:src="@drawable/ic_satellite"
- app:layout_constraintBottom_toTopOf="@+id/splashTleMsgCard"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/splashTleTitleCard" />
-
- <androidx.cardview.widget.CardView
- android:id="@+id/splashTleMsgCard"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="48dp"
- android:backgroundTint="@color/greySurface"
- app:cardCornerRadius="8dp"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintHorizontal_bias="0.5"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/splashTleIcon">
-
- <TextView
- android:id="@+id/splashTleMsg"
- style="@style/SplashText.Msg"
- android:text="@string/splash_tle_msg" />
- </androidx.cardview.widget.CardView>
-
-</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
diff --git a/app/src/main/res/navigation/nav_graph.xml b/app/src/main/res/navigation/nav_graph.xml
index 76f1dab0..5d300060 100644
--- a/app/src/main/res/navigation/nav_graph.xml
+++ b/app/src/main/res/navigation/nav_graph.xml
@@ -70,5 +70,9 @@
android:id="@+id/nav_dialog_sources"
android:name="com.rtbishop.look4sat.ui.mainScreen.SourcesDialog"
tools:layout="@layout/dialog_sources" />
+ <dialog
+ android:id="@+id/nav_dialog_splash"
+ android:name="com.rtbishop.look4sat.ui.mainScreen.SplashDialog"
+ tools:layout="@layout/dialog_splash" />
</navigation>
diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml
index e70cbe87..f35d9dee 100644
--- a/app/src/main/res/values-ru/strings.xml
+++ b/app/src/main/res/values-ru/strings.xml
@@ -56,11 +56,10 @@
<string name="pref_compass_title">Использовать компас</string>
<string name="pref_time_utc_title">Показывать время пролета по UTC</string>
- <string name="splash_tle_msg">Look4Sat использует набор элементов TLE для вычисления положения
- спутников. Со временем эти данные теряют точность, поэтому их рекомендуется обновлять
- примерно раз в неделю через меню Спутники.</string>
- <string name="splash_loc_msg">Look4Sat нужно знать Ваше местоположение, чтобы корректно рассчитывать орбиты
- и пролёты спутников. Установить позицию можно через соответствующие кнопки в меню Настройки.</string>
+ <string name="splash_tle_msg">Данные спутников теряют точность со временем, поэтому
+ их рекомендуется обновлять примерно раз в неделю</string>
+ <string name="splash_loc_msg">Чтобы корректно рассчитывать орбиты спутников,
+ установите позицию наземной станции через меню Настройки</string>
<string name="info_version">Версия: %s</string>
<string name="info_subtitle">Трекер спутников для Android</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 8e13fd95..f9bc8159 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -73,13 +73,10 @@
<string name="pref_time_utc_title">Show pass time in UTC</string>
<string name="pref_compass_title">Use sensors to rotate PolarView</string>
- <string name="splash_tle_title" translatable="false">Two-Line Element set</string>
- <string name="splash_tle_msg">Look4Sat uses a TLE set to calculate the satellite positions.
- The TLE data looses precision over time, so it is recommended to update
- it weekly using the buttons in the Satellites menu</string>
- <string name="splash_loc_msg">Look4Sat needs to know your position to deliver the accurate
- passes predictions. Please set the position using the buttons (GPS, QTH Locator)
- in the Settings menu</string>
+ <string name="splash_tle_msg">TLE satellite data looses precision over time, so it is
+ recommended to update it every week or so</string>
+ <string name="splash_loc_msg">To get the accurate predictions please set
+ the ground station position via the Settings menu</string>
<string name="info_version">Version: %s</string>
<string name="info_subtitle">Satellite tracker and pass predictor</string>
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 91157650..6cce7b76 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -14,24 +14,6 @@
<item name="snackbarTextViewStyle">@style/Snackbar.Text</item>
</style>
- <style name="SplashText">
- <item name="android:padding">8dp</item>
- <item name="android:textSize">23sp</item>
- <item name="android:gravity">center</item>
- <item name="android:layout_gravity">center</item>
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">wrap_content</item>
- </style>
-
- <style name="SplashText.Msg">
- <item name="android:textSize">17sp</item>
- </style>
-
- <style name="SplashText.Icon">
- <item name="android:layout_width">128dp</item>
- <item name="android:layout_height">128dp</item>
- </style>
-
<style name="Snackbar" parent="@style/Widget.MaterialComponents.Snackbar">
<item name="backgroundTint">@color/greySurface</item>
</style>
diff --git a/build.gradle b/build.gradle
index 034d737f..1de4fd2d 100644
--- a/build.gradle
+++ b/build.gradle
@@ -7,14 +7,13 @@ buildscript {
lifecycle_version = '2.3.0'
navigation_version = '2.3.3'
preference_version = '1.1.1'
- view_pager2_version = '1.0.0'
room_version = '2.2.6'
hilt_version = '2.33-beta'
hilt_viewmodel_version = '1.0.0-alpha03'
retrofit_version = '2.9.0'
+ predict4java_version = '1.3.1'
osmdroid_version = '6.1.10'
timber_version = '4.7.1'
- predict4java_version = '1.3.1'
junit_version = '4.13.2'
coroutines_test_version = '1.3.2'
leak_canary_version = '2.5'