Finished splash activity and UI

This commit is contained in:
Arty Bishop committed 2020-11-24 14:39:33 +00:00
1 parent e524a62b77
commit b91a7c1ff8
15 files changed
+196 -83

No files matched your search

@@ -16,7 +16,7 @@ import javax.inject.Inject
@AndroidEntryPoint
class SplashActivity : FragmentActivity() {
private val pagesCount = 3
private val pagesCount = 2
@Inject
lateinit var prefsManager: PrefsManager
@@ -41,7 +41,7 @@ class SplashActivity : FragmentActivity() {
}
}
})
// isUserInputEnabled = false
isUserInputEnabled = false
}
splashNext.setOnClickListener {
if (splashPager.currentItem < pagesCount - 1) splashPager.currentItem++
@@ -62,10 +62,9 @@ class SplashActivity : FragmentActivity() {
override fun createFragment(position: Int): Fragment {
return when (position) {
0 -> FirstFragment()
1 -> SecondFragment()
2 -> ThirdFragment()
else -> FirstFragment()
0 -> SplashTleFragment()
1 -> SplashPosFragment()
else -> SplashTleFragment()
}
}
}
@@ -3,4 +3,4 @@ package com.rtbishop.look4sat.ui.splash
import androidx.fragment.app.Fragment
import com.rtbishop.look4sat.R
class SecondFragment: Fragment(R.layout.fragment_second)
class SplashPosFragment : Fragment(R.layout.fragment_splash_pos)
@@ -3,4 +3,4 @@ package com.rtbishop.look4sat.ui.splash
import androidx.fragment.app.Fragment
import com.rtbishop.look4sat.R
class FirstFragment : Fragment(R.layout.fragment_first)
class SplashTleFragment: Fragment(R.layout.fragment_splash_tle)
@@ -1,6 +0,0 @@
package com.rtbishop.look4sat.ui.splash
import androidx.fragment.app.Fragment
import com.rtbishop.look4sat.R
class ThirdFragment : Fragment(R.layout.fragment_third)
+4 -5
View File
@@ -2,9 +2,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
android:viewportHeight="24">
<path
android:fillColor="@color/themeLight"
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z" />
</vector>
@@ -0,0 +1,23 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="24dp"
android:height="24dp"
android:viewportWidth="128"
android:viewportHeight="128">
<path
android:fillColor="@color/themeLight"
android:pathData="m105.138,114.121a2.864,2.864 90,0 0,1.701 -0.85l19.334,-19.331a2.864,2.864 90,0 0,-0 -4.027l-26.584,-26.625a2.864,2.864 90,0 0,-1.835 -0.805l-7.922,-0.626 5.773,-5.772a2.864,2.864 90,0 0,-0 -4.027l-19.602,-19.644a2.864,2.864 90,0 0,-4.073 -0l-5.773,5.772 -0.627,-7.92a2.864,2.864 90,0 0,-0.805 -1.835l-26.629,-26.58a2.864,2.864 90,0 0,-4.073 -0l-19.289,19.286a2.864,2.864 90,0 0,-0 4.072l26.584,26.625a2.864,2.864 90,0 0,1.835 0.805l7.922,0.626 -5.773,5.772a2.864,2.864 90,0 0,-0 4.072l19.603,19.599a2.864,2.864 90,0 0,4.073 -0l5.773,-5.772 0.626,7.92a2.864,2.864 90,0 0,0.806 1.835l26.629,26.58a2.864,2.864 90,0 0,2.059 0.85,2.864 2.864,90 0,0 0.269,-0zM104.825,107.23 L80.97,83.38 80.165,72.685 85.58,67.271 96.276,68.121 120.13,91.926zM55.326,47.85 L44.629,47 20.775,23.194 36.081,7.891 59.891,31.741 60.741,42.436z"
tools:ignore="VectorPath" />
<path
android:fillColor="@color/themeLight"
android:pathData="m62.653,115.806a2.864,2.864 90,1 0,-0 -5.727c-11.457,-0 -22.876,-4.351 -31.634,-13.107 -8.741,-8.74 -13.095,-20.174 -13.095,-31.614a2.864,2.864 90,1 0,-5.728 -0c-0,12.897 4.935,25.829 14.773,35.664 9.85,9.848 22.772,14.785 35.684,14.785z" />
<path
android:fillColor="@color/themeLight"
android:pathData="m62.653,127a2.864,2.864 90,1 0,-0 -5.727c-14.325,-0 -28.612,-5.441 -39.547,-16.375 -10.935,-10.933 -16.378,-25.233 -16.378,-39.541a2.864,2.864 90,1 0,-5.728 -0c-0,15.763 6.025,31.562 18.055,43.59 12.029,12.028 27.818,18.052 43.597,18.052z" />
<path
android:fillColor="@color/themeLight"
android:pathData="m62.653,104.698a2.864,2.864 90,1 0,-0 -5.727c-8.62,-0 -17.201,-3.263 -23.778,-9.839 -6.577,-6.576 -9.855,-15.174 -9.855,-23.774a2.864,2.864 90,1 0,-5.728 -0c-0,10.061 3.861,20.153 11.533,27.824 7.672,7.671 17.756,11.517 27.829,11.517z" />
<path
android:fillColor="@color/themeLight"
android:pathData="m62.653,93.475a2.864,2.864 90,1 0,-0 -5.727c-5.737,-0 -11.453,-2.174 -15.836,-6.557 -4.384,-4.383 -6.558,-10.098 -6.558,-15.834a2.864,2.864 90,1 0,-5.728 -0c-0,7.192 2.757,14.406 8.236,19.883 5.479,5.478 12.693,8.234 19.887,8.234z" />
</vector>
+3 -4
View File
@@ -9,8 +9,8 @@
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/splashPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="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" />
@@ -19,9 +19,8 @@
android:id="@+id/splashNext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="76dp"
android:layout_marginBottom="48dp"
android:contentDescription="@string/placeholder"
app:fabSize="mini"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@@ -1,20 +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.splash.FirstFragment" >
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="First Fragment"
android:textSize="36sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -1,20 +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.splash.FirstFragment" >
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Second Fragment"
android:textSize="36sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@@ -0,0 +1,63 @@
<?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.splash.SplashPosFragment">
<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>
@@ -0,0 +1,63 @@
<?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.splash.SplashTleFragment">
<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>
@@ -1,20 +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.splash.FirstFragment" >
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Third Fragment"
android:textSize="36sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
+7
View File
@@ -66,6 +66,13 @@
<string name="pref_compass_title">Использовать компас</string>
<string name="pref_time_utc_title">Показывать время пролета по UTC</string>
<string name="splash_tle_msg">Look4Sat использует двухстрочный набор элементов TLE
для вычисления положения спутников. Со временем TLE теряют точность, рекомендуется
их обновлять примерно раз в неделю. Это можно сделать через меню "Спутники"</string>
<string name="splash_loc_msg">Look4Sat нужно знать местоположение, чтобы корректно рассчитывать
орбиты и пролёты спутников относительно него. Пожалуйста, установите позицию
(GPS, Локатор QTH) через меню "Настройки"</string>
<string name="info_version">Версия: %s</string>
<string name="info_subtitle">Трекер спутников для Android</string>
<string name="info_bmc">Угостить кофе</string>
+8
View File
@@ -85,6 +85,14 @@
<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 compute the position of
the satellites. The TLE data looses precision over time, so it is recommended to update
it weekly via the buttons in the Satellites tab</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 tab</string>
<string name="info_version">Version: %s</string>
<string name="info_subtitle">Satellite tracker for Android</string>
<string name="info_github" translatable="false">GitHub</string>
+18
View File
@@ -33,6 +33,24 @@
<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>