mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Swapped the onboarding activity for a simple dialog
This commit is contained in:
1 parent
7d970b9287
commit
38d21b98a0
19 files changed
+191
-338
No files matched your search
+1
-2
@@ -52,7 +52,6 @@ dependencies {
|
|||||||
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
|
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
|
||||||
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
|
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
|
||||||
implementation "androidx.preference:preference-ktx:$preference_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-runtime:$room_version"
|
||||||
implementation "androidx.room:room-ktx:$room_version"
|
implementation "androidx.room:room-ktx:$room_version"
|
||||||
kapt "androidx.room:room-compiler:$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:retrofit:$retrofit_version"
|
||||||
implementation "com.squareup.retrofit2:converter-moshi:$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 "com.github.davidmoten:predict4java:$predict4java_version"
|
||||||
|
implementation "org.osmdroid:osmdroid-android:$osmdroid_version"
|
||||||
implementation "com.jakewharton.timber:timber:$timber_version"
|
implementation "com.jakewharton.timber:timber:$timber_version"
|
||||||
|
|
||||||
testImplementation "junit:junit:$junit_version"
|
testImplementation "junit:junit:$junit_version"
|
||||||
|
|||||||
@@ -9,10 +9,9 @@
|
|||||||
android:name=".Look4SatApp"
|
android:name=".Look4SatApp"
|
||||||
android:allowBackup="false"
|
android:allowBackup="false"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name">
|
||||||
android:theme="@style/AppTheme">
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.splashScreen.SplashActivity"
|
android:name=".ui.mainScreen.MainActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/AppTheme.Splash">
|
android:theme="@style/AppTheme.Splash">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@@ -21,9 +20,6 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
|
||||||
android:name=".ui.mainScreen.MainActivity"
|
|
||||||
android:screenOrientation="portrait" />
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -25,17 +25,24 @@ import androidx.navigation.fragment.NavHostFragment
|
|||||||
import androidx.navigation.ui.setupWithNavController
|
import androidx.navigation.ui.setupWithNavController
|
||||||
import com.rtbishop.look4sat.R
|
import com.rtbishop.look4sat.R
|
||||||
import com.rtbishop.look4sat.databinding.ActivityMainBinding
|
import com.rtbishop.look4sat.databinding.ActivityMainBinding
|
||||||
|
import com.rtbishop.look4sat.utility.PrefsManager
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
@AndroidEntryPoint
|
@AndroidEntryPoint
|
||||||
class MainActivity : AppCompatActivity() {
|
class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
lateinit var prefsManager: PrefsManager
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
setTheme(R.style.AppTheme)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
ActivityMainBinding.inflate(layoutInflater).apply {
|
ActivityMainBinding.inflate(layoutInflater).apply {
|
||||||
setContentView(root)
|
setContentView(root)
|
||||||
val navHost = supportFragmentManager.findFragmentById(R.id.nav_host) as NavHostFragment
|
val navHost = supportFragmentManager.findFragmentById(R.id.nav_host) as NavHostFragment
|
||||||
navBottom.setupWithNavController(navHost.navController)
|
navBottom.setupWithNavController(navHost.navController)
|
||||||
|
if (prefsManager.isFirstLaunch()) navHost.navController.navigate(R.id.nav_dialog_splash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,6 +23,7 @@ import android.os.Bundle
|
|||||||
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.view.WindowManager
|
||||||
import androidx.appcompat.app.AppCompatDialogFragment
|
import androidx.appcompat.app.AppCompatDialogFragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
@@ -47,6 +48,10 @@ class SourcesDialog : AppCompatDialogFragment() {
|
|||||||
viewModel.getSources().observe(viewLifecycleOwner, { sources ->
|
viewModel.getSources().observe(viewLifecycleOwner, { sources ->
|
||||||
val sourcesAdapter = SourcesAdapter(sources as MutableList<TleSource>)
|
val sourcesAdapter = SourcesAdapter(sources as MutableList<TleSource>)
|
||||||
DialogSourcesBinding.bind(view).apply {
|
DialogSourcesBinding.bind(view).apply {
|
||||||
|
dialog?.window?.setLayout(
|
||||||
|
WindowManager.LayoutParams.MATCH_PARENT,
|
||||||
|
WindowManager.LayoutParams.WRAP_CONTENT
|
||||||
|
)
|
||||||
tleSourcesRecycler.apply {
|
tleSourcesRecycler.apply {
|
||||||
adapter = sourcesAdapter
|
adapter = sourcesAdapter
|
||||||
layoutManager = LinearLayoutManager(requireContext())
|
layoutManager = LinearLayoutManager(requireContext())
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
Look4Sat. Amateur radio satellite tracker and pass predictor.
|
||||||
|
Copyright (C) 2019, 2020 Arty Bishop (bishop.arty@gmail.com)
|
||||||
|
|
||||||
|
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() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
Look4Sat. Amateur radio satellite tracker and pass predictor.
|
|
||||||
Copyright (C) 2019, 2020 Arty Bishop (bishop.arty@gmail.com)
|
|
||||||
|
|
||||||
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)
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
Look4Sat. Amateur radio satellite tracker and pass predictor.
|
|
||||||
Copyright (C) 2019, 2020 Arty Bishop (bishop.arty@gmail.com)
|
|
||||||
|
|
||||||
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()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/*******************************************************************************
|
|
||||||
Look4Sat. Amateur radio satellite tracker and pass predictor.
|
|
||||||
Copyright (C) 2019, 2020 Arty Bishop (bishop.arty@gmail.com)
|
|
||||||
|
|
||||||
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)
|
|
||||||
@@ -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 (bishop.arty@gmail.com)
|
||||||
|
|
||||||
|
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>
|
||||||
@@ -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>
|
|
||||||
@@ -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:id="@+id/tleSourcesDialog"
|
android:id="@+id/tleSourcesDialog"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/greyDark"
|
android:background="@color/greyDark"
|
||||||
android:padding="4dp">
|
android:padding="4dp">
|
||||||
@@ -32,17 +32,18 @@
|
|||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/tleSourceBtnAdd"
|
android:id="@+id/tleSourceBtnAdd"
|
||||||
android:layout_width="48dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="48dp"
|
||||||
android:backgroundTint="@color/greySurface"
|
android:backgroundTint="@color/greySurface"
|
||||||
android:contentDescription="@string/placeholder"
|
android:contentDescription="@string/placeholder"
|
||||||
android:src="@drawable/ic_add"
|
android:src="@drawable/ic_add"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/tleSourcesWarning"
|
app:layout_constraintBottom_toBottomOf="@+id/tleSourcesWarning"
|
||||||
|
app:layout_constraintDimensionRatio="h,1:1"
|
||||||
app:layout_constraintEnd_toEndOf="@+id/tleSourcesRecycler"
|
app:layout_constraintEnd_toEndOf="@+id/tleSourcesRecycler"
|
||||||
app:layout_constraintTop_toTopOf="@+id/tleSourcesTitle" />
|
app:layout_constraintTop_toTopOf="@+id/tleSourcesTitle" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/tleSourcesRecycler"
|
android:id="@+id/tleSourcesRecycler"
|
||||||
android:layout_width="266dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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>
|
|
||||||
@@ -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>
|
|
||||||
@@ -70,5 +70,9 @@
|
|||||||
android:id="@+id/nav_dialog_sources"
|
android:id="@+id/nav_dialog_sources"
|
||||||
android:name="com.rtbishop.look4sat.ui.mainScreen.SourcesDialog"
|
android:name="com.rtbishop.look4sat.ui.mainScreen.SourcesDialog"
|
||||||
tools:layout="@layout/dialog_sources" />
|
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>
|
</navigation>
|
||||||
@@ -56,11 +56,10 @@
|
|||||||
<string name="pref_compass_title">Использовать компас</string>
|
<string name="pref_compass_title">Использовать компас</string>
|
||||||
<string name="pref_time_utc_title">Показывать время пролета по UTC</string>
|
<string name="pref_time_utc_title">Показывать время пролета по UTC</string>
|
||||||
|
|
||||||
<string name="splash_tle_msg">Look4Sat использует набор элементов TLE для вычисления положения
|
<string name="splash_tle_msg">Данные спутников теряют точность со временем, поэтому
|
||||||
спутников. Со временем эти данные теряют точность, поэтому их рекомендуется обновлять
|
их рекомендуется обновлять примерно раз в неделю</string>
|
||||||
примерно раз в неделю через меню Спутники.</string>
|
<string name="splash_loc_msg">Чтобы корректно рассчитывать орбиты спутников,
|
||||||
<string name="splash_loc_msg">Look4Sat нужно знать Ваше местоположение, чтобы корректно рассчитывать орбиты
|
установите позицию наземной станции через меню Настройки</string>
|
||||||
и пролёты спутников. Установить позицию можно через соответствующие кнопки в меню Настройки.</string>
|
|
||||||
|
|
||||||
<string name="info_version">Версия: %s</string>
|
<string name="info_version">Версия: %s</string>
|
||||||
<string name="info_subtitle">Трекер спутников для Android</string>
|
<string name="info_subtitle">Трекер спутников для Android</string>
|
||||||
|
|||||||
@@ -73,13 +73,10 @@
|
|||||||
<string name="pref_time_utc_title">Show pass time in UTC</string>
|
<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="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">TLE satellite data looses precision over time, so it is
|
||||||
<string name="splash_tle_msg">Look4Sat uses a TLE set to calculate the satellite positions.
|
recommended to update it every week or so</string>
|
||||||
The TLE data looses precision over time, so it is recommended to update
|
<string name="splash_loc_msg">To get the accurate predictions please set
|
||||||
it weekly using the buttons in the Satellites menu</string>
|
the ground station position via the Settings 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="info_version">Version: %s</string>
|
<string name="info_version">Version: %s</string>
|
||||||
<string name="info_subtitle">Satellite tracker and pass predictor</string>
|
<string name="info_subtitle">Satellite tracker and pass predictor</string>
|
||||||
|
|||||||
@@ -14,24 +14,6 @@
|
|||||||
<item name="snackbarTextViewStyle">@style/Snackbar.Text</item>
|
<item name="snackbarTextViewStyle">@style/Snackbar.Text</item>
|
||||||
</style>
|
</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">
|
<style name="Snackbar" parent="@style/Widget.MaterialComponents.Snackbar">
|
||||||
<item name="backgroundTint">@color/greySurface</item>
|
<item name="backgroundTint">@color/greySurface</item>
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+1
-2
@@ -7,14 +7,13 @@ buildscript {
|
|||||||
lifecycle_version = '2.3.0'
|
lifecycle_version = '2.3.0'
|
||||||
navigation_version = '2.3.3'
|
navigation_version = '2.3.3'
|
||||||
preference_version = '1.1.1'
|
preference_version = '1.1.1'
|
||||||
view_pager2_version = '1.0.0'
|
|
||||||
room_version = '2.2.6'
|
room_version = '2.2.6'
|
||||||
hilt_version = '2.33-beta'
|
hilt_version = '2.33-beta'
|
||||||
hilt_viewmodel_version = '1.0.0-alpha03'
|
hilt_viewmodel_version = '1.0.0-alpha03'
|
||||||
retrofit_version = '2.9.0'
|
retrofit_version = '2.9.0'
|
||||||
|
predict4java_version = '1.3.1'
|
||||||
osmdroid_version = '6.1.10'
|
osmdroid_version = '6.1.10'
|
||||||
timber_version = '4.7.1'
|
timber_version = '4.7.1'
|
||||||
predict4java_version = '1.3.1'
|
|
||||||
junit_version = '4.13.2'
|
junit_version = '4.13.2'
|
||||||
coroutines_test_version = '1.3.2'
|
coroutines_test_version = '1.3.2'
|
||||||
leak_canary_version = '2.5'
|
leak_canary_version = '2.5'
|
||||||
|
|||||||
Reference in new issue
Block a user