Added NavActivity as a future replacement for the MainActivity

This commit is contained in:
Arty Bishop committed 2020-10-06 23:24:16 +01:00
1 parent 9e557ebcf5
commit d4ac615a8d
16 files changed
+188 -26

No files matched your search

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/themeAccent" android:state_selected="true" />
<item android:color="@color/themeLight" />
</selector>
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z" />
</vector>
+10
View File
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M4,10.5c-0.83,0 -1.5,0.67 -1.5,1.5s0.67,1.5 1.5,1.5 1.5,-0.67 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM4,4.5c-0.83,0 -1.5,0.67 -1.5,1.5S3.17,7.5 4,7.5 5.5,6.83 5.5,6 4.83,4.5 4,4.5zM4,16.5c-0.83,0 -1.5,0.68 -1.5,1.5s0.68,1.5 1.5,1.5 1.5,-0.68 1.5,-1.5 -0.67,-1.5 -1.5,-1.5zM7,19h14v-2L7,17v2zM7,13h14v-2L7,11v2zM7,5v2h14L21,5L7,5z" />
</vector>
+38
View File
@@ -0,0 +1,38 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@+id/nav_bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/nav_frag"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:defaultNavHost="true"
app:navGraph="@navigation/temp_graph" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/nav_bottom"
android:layout_width="match_parent"
android:layout_height="48dp"
app:itemIconSize="24dp"
app:itemIconTint="@color/nav_item_selector"
app:itemTextColor="@color/nav_item_selector"
app:labelVisibilityMode="selected"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:menu="@menu/nav_menu" />
</androidx.constraintlayout.widget.ConstraintLayout>
+40
View File
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Look4Sat. Amateur radio and weather satellite tracker and passes predictor for Android.
~ 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.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/nav_satellites"
android:icon="@drawable/ic_sat_desc_left"
android:title="@string/menu_bottom_entries" />
<item
android:id="@+id/nav_passes"
android:icon="@drawable/ic_list"
android:title="@string/menu_bottom_passes" />
<item
android:id="@+id/nav_world_map"
android:icon="@drawable/ic_update_tle"
android:title="@string/menu_bottom_osm" />
<item
android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings"
android:title="@string/menu_settings" />
<item
android:id="@+id/nav_about"
android:icon="@drawable/ic_help_outline"
android:title="@string/menu_bottom_about" />
</menu>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<navigation 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:id="@+id/temp_graph"
app:startDestination="@id/nav_about">
<fragment
android:id="@+id/nav_satellites"
android:name="com.rtbishop.look4sat.ui.fragments.AboutFragment" />
<fragment
android:id="@+id/nav_passes"
android:name="com.rtbishop.look4sat.ui.fragments.AboutFragment" />
<fragment
android:id="@+id/nav_world_map"
android:name="com.rtbishop.look4sat.ui.fragments.AboutFragment" />
<fragment
android:id="@+id/nav_settings"
android:name="com.rtbishop.look4sat.ui.fragments.AboutFragment" />
<fragment
android:id="@+id/nav_about"
android:name="com.rtbishop.look4sat.ui.fragments.AboutFragment"
android:label="fragment_about"
tools:layout="@layout/fragment_about" />
</navigation>
+5
View File
@@ -37,6 +37,11 @@
<string name="menu_map_osm">Карта мира (Демо)</string>
<string name="menu_settings">Настройки</string>
<string name="menu_about">О приложении</string>
<string name="menu_bottom_entries">Спутники</string>
<string name="menu_bottom_passes">Пролеты</string>
<string name="menu_bottom_osm">Карта Мира</string>
<string name="menu_bottom_settings">Настройки</string>
<string name="menu_bottom_about">О приложении</string>
<string name="dialog_select_sat">Выберите спутники для слежения</string>
<string name="dialog_show_track">Показать трассу орбиты для</string>
+5
View File
@@ -40,6 +40,11 @@
<string name="menu_map_osm">World Map Demo</string>
<string name="menu_settings">Settings</string>
<string name="menu_about">About the App</string>
<string name="menu_bottom_entries">Satellites</string>
<string name="menu_bottom_passes">Passes</string>
<string name="menu_bottom_osm">World Map</string>
<string name="menu_bottom_settings">Settings</string>
<string name="menu_bottom_about">About</string>
<string name="dialog_select_sat">Select satellites to track</string>
<string name="dialog_show_track">Show ground track for</string>