Updated DrawerHeader layout. Hopefully it's a final version. Moved the timer setup to the Sky fragment.

This commit is contained in:
Arty Bishop committed 2019-11-23 16:04:25 +00:00
1 parent 1f2832d13e
commit 92767bd0a4
7 files changed
+152 -126

No files matched your search

+74 -55
View File
@@ -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:layout_width="match_parent"
android:layout_height="@dimen/drawer_header_height"
android:layout_height="wrap_content"
android:background="@drawable/launcher_background"
android:gravity="bottom"
android:theme="@style/ThemeOverlay.AppCompat.Dark">
@@ -12,129 +12,148 @@
android:layout_width="108dp"
android:layout_height="108dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:contentDescription="@string/app_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/drawer_title"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_sat_desc_left" />
<TextView
android:id="@+id/drawer_title"
style="@style/DrawerHeader.Title"
android:layout_marginStart="8dp"
android:text="@string/title"
app:layout_constraintStart_toStartOf="@+id/drawer_subtitle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/drawer_sat_img" />
<TextView
android:id="@+id/drawer_subtitle"
style="@style/DrawerHeader.Title"
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" />
<TextView
android:id="@+id/drawer_lat"
style="@style/DrawerHeader.Item"
android:text="@string/drawer_latitude"
app:layout_constraintBottom_toTopOf="@+id/drawer_lon_value"
app:layout_constraintStart_toStartOf="@+id/drawer_lon" />
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lat_value"
app:layout_constraintStart_toStartOf="@+id/drawer_subtitle" />
<TextView
android:id="@+id/drawer_lat_value"
style="@style/DrawerHeader.Value"
style="@style/DrawerHeader.ItemValue"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
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
android:id="@+id/drawer_lon"
style="@style/DrawerHeader.Item"
android:text="@string/drawer_longitude"
app:layout_constraintBottom_toTopOf="@+id/drawer_height_value"
app:layout_constraintStart_toStartOf="@+id/drawer_height" />
app:layout_constraintStart_toStartOf="@+id/drawer_lat"
app:layout_constraintTop_toBottomOf="@+id/drawer_lat" />
<TextView
android:id="@+id/drawer_lon_value"
style="@style/DrawerHeader.Value"
style="@style/DrawerHeader.ItemValue"
android:layout_marginStart="8dp"
android:text="@string/drawer_longitude_value"
app:layout_constraintBaseline_toBaselineOf="@+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
android:id="@+id/drawer_btn_loc"
style="@style/DrawerHeader.Button"
android:layout_marginStart="4dp"
android:layout_marginBottom="4dp"
android:layout_marginStart="8dp"
android:layout_marginTop="4dp"
android:contentDescription="@string/placeholder"
android:src="@drawable/ic_location"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_tle"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintBottom_toTopOf="@+id/drawer_btn_tle"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/drawer_lon_value" />
<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
android:id="@+id/drawer_btn_tle"
style="@style/DrawerHeader.Button"
android:contentDescription="@string/placeholder"
android:src="@drawable/ic_tle"
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_trans"
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_trans"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/drawer_btn_loc"
app:layout_constraintTop_toTopOf="@+id/drawer_btn_trans" />
app:layout_constraintBottom_toTopOf="@+id/drawer_btn_trans"
app:layout_constraintStart_toStartOf="@+id/drawer_btn_loc"
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_loc" />
<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
android:id="@+id/drawer_btn_trans"
style="@style/DrawerHeader.Button"
android:contentDescription="@string/placeholder"
android:src="@drawable/ic_trans"
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_exit"
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_github"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/drawer_btn_tle"
app:layout_constraintTop_toTopOf="@+id/drawer_btn_exit" />
app:layout_constraintBottom_toTopOf="@+id/drawer_btn_github"
app:layout_constraintStart_toStartOf="@+id/drawer_btn_tle"
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_tle" />
<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
android:id="@+id/drawer_btn_github"
style="@style/DrawerHeader.Button"
android:layout_marginBottom="8dp"
android:contentDescription="@string/placeholder"
android:src="@drawable/ic_github"
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_loc"
app:layout_constraintEnd_toStartOf="@+id/drawer_btn_exit"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/drawer_btn_trans"
app:layout_constraintTop_toTopOf="@+id/drawer_btn_loc" />
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="@+id/drawer_btn_trans"
app:layout_constraintTop_toBottomOf="@+id/drawer_btn_trans" />
<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
android:id="@+id/drawer_btn_exit"
style="@style/DrawerHeader.Button"
android:layout_marginEnd="4dp"
android:layout_marginStart="8dp"
android:contentDescription="@string/placeholder"
android:src="@drawable/ic_exit"
app:layout_constraintBottom_toBottomOf="@+id/drawer_btn_github"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/drawer_btn_github"
app:layout_constraintStart_toEndOf="@+id/drawer_tv_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>
+8 -13
View File
@@ -12,18 +12,13 @@
android:id="@+id/nav_map"
android:icon="@drawable/ic_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>
<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>
-1
View File
@@ -1,4 +1,3 @@
<resources>
<dimen name="drawer_header_height">292dp</dimen>
<dimen name="fab_margin">16dp</dimen>
</resources>
+6 -6
View File
@@ -8,8 +8,12 @@
<string name="drawer_latitude_value">51.5074</string>
<string name="drawer_longitude">Longitude: </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_radar">Radar View</string>
@@ -17,9 +21,6 @@
<string name="menu_credits">Credits</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_pass_vector">V: 180° -> 360°</string>
<string name="card_max_el">75.5°</string>
@@ -30,5 +31,4 @@
<string name="map_content">Nasa Map</string>
<string name="placeholder">Placeholder</string>
<string name="about">About</string>
</resources>
+12 -8
View File
@@ -29,14 +29,14 @@
<item name="android:textStyle">bold</item>
</style>
<style name="DrawerHeader.Value">
<item name="android:textSize">26sp</item>
<item name="android:textStyle">bold</item>
<style name="DrawerHeader.Item">
<item name="android:textSize">24sp</item>
<item name="android:fontFamily">serif</item>
</style>
<style name="DrawerHeader.Item">
<item name="android:textSize">21sp</item>
<item name="android:fontFamily">serif</item>
<style name="DrawerHeader.ItemValue">
<item name="android:textSize">28sp</item>
<item name="android:textStyle">bold</item>
</style>
<style name="DrawerHeader.Button">
@@ -45,12 +45,16 @@
<item name="android:backgroundTint">@color/themeAccent</item>
</style>
<style name="DrawerHeader.ButtonText">
<item name="android:textSize">18sp</item>
<item name="android:fontFamily">serif</item>
</style>
<style name="ToolbarText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:gravity">center</item>
<item name="android:text">@string/toolbar_aos_in</item>
<item name="android:textSize">30sp</item>
<item name="android:textSize">32sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@color/themeAccent</item>
</style>