mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-04 11:57:21 +00:00
Major updates to drawer header layout. Added extension methods for doubles in shared preferences. Code cleanup.
This commit is contained in:
1 parent
f24edc62a0
commit
2b41402e5c
15 files changed
+155
-162
No files matched your search
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#C0C0C0"
|
||||
android:pathData="M12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM20.94,11c-0.46,-4.17 -3.77,-7.48 -7.94,-7.94L13,1h-2v2.06C6.83,3.52 3.52,6.83 3.06,11L1,11v2h2.06c0.46,4.17 3.77,7.48 7.94,7.94L11,23h2v-2.06c4.17,-0.46 7.48,-3.77 7.94,-7.94L23,13v-2h-2.06zM12,19c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z" />
|
||||
</vector>
|
||||
@@ -8,15 +8,13 @@
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||
android:background="?attr/colorPrimary">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/timer_layout"
|
||||
|
||||
@@ -8,92 +8,95 @@
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/drawer_img"
|
||||
android:layout_width="108dp"
|
||||
android:layout_height="108dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:id="@+id/drawer_sat_img"
|
||||
android:layout_width="116dp"
|
||||
android:layout_height="116dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:contentDescription="@string/app_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_sat_desc_right" />
|
||||
app:srcCompat="@drawable/ic_sat_desc_left" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/drawer_header_title"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@color/colorDrawerText"
|
||||
android:textSize="24sp"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_subtitle"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drawer_img" />
|
||||
style="@style/DrawerHeader.Title"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/title"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/drawer_sat_img" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/drawer_header_subtitle"
|
||||
android:textColor="@color/colorDrawerText"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
style="@style/DrawerHeader.Title"
|
||||
android:text="@string/subtitle"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drawer_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_lat"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/DrawerHeader.Item"
|
||||
android:text="@string/latitude"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:textColor="@color/colorDrawerText"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/drawer_lat_value"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_lat_value"
|
||||
app:layout_constraintTop_toTopOf="@+id/drawer_img" />
|
||||
app:layout_constraintBottom_toTopOf="@+id/drawer_lon_value"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_lon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_lat_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/DrawerHeader.Value"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/latitude_def"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@color/colorDrawerText"
|
||||
android:textSize="26sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/drawer_lon"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_lon"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drawer_lat" />
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_lat"
|
||||
app:layout_constraintStart_toEndOf="@+id/drawer_lat" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_lon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/DrawerHeader.Item"
|
||||
android:text="@string/longitude"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:textColor="@color/colorDrawerText"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/drawer_lon_value"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_lon_value"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drawer_lat_value" />
|
||||
app:layout_constraintBottom_toTopOf="@+id/drawer_height_value"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_height" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_lon_value"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/DrawerHeader.Value"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="@string/longitude_def"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Title"
|
||||
android:textColor="@color/colorDrawerText"
|
||||
android:textSize="26sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/drawer_img"
|
||||
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_marginBottom="8dp"
|
||||
android:text="@string/height"
|
||||
app:layout_constraintBottom_toTopOf="@+id/drawer_link"
|
||||
app:layout_constraintStart_toStartOf="@+id/drawer_link" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_height_value"
|
||||
style="@style/DrawerHeader.Value"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text="@string/height_def"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/drawer_height"
|
||||
app:layout_constraintStart_toEndOf="@+id/drawer_height" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/drawer_get_location"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginEnd="32dp"
|
||||
android:contentDescription="@string/placeholder"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/drawer_height_value"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/drawer_img"
|
||||
app:layout_constraintTop_toBottomOf="@+id/drawer_lon" />
|
||||
app:layout_constraintTop_toTopOf="@+id/drawer_lat_value"
|
||||
app:srcCompat="@drawable/ic_location" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawer_link"
|
||||
style="@style/DrawerHeader"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/drawer_header_link"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -12,10 +12,6 @@
|
||||
android:title="@string/menu_map" />
|
||||
</group>
|
||||
|
||||
<item
|
||||
android:id="@+id/nav_settings"
|
||||
android:title="@string/menu_settings" />
|
||||
|
||||
<item android:title="@string/menu_about">
|
||||
<menu>
|
||||
<item
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/update_location"
|
||||
android:title="@string/menu_update_location" />
|
||||
<item
|
||||
android:id="@+id/fetch_trans"
|
||||
android:title="@string/menu_fetch_transmitters" />
|
||||
|
||||
@@ -23,11 +23,6 @@
|
||||
android:label="@string/menu_map"
|
||||
tools:layout="@layout/fragment_worldmap" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_settings"
|
||||
android:name="com.rtbishop.lookingsat.ui.SettingsFragment"
|
||||
android:label="@string/menu_settings" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/nav_credits"
|
||||
android:name="com.rtbishop.lookingsat.ui.CreditsFragment"
|
||||
|
||||
@@ -5,5 +5,5 @@
|
||||
<color name="colorAccent">#C0C0C0</color>
|
||||
|
||||
<color name="colorDrawerText">#C0C0C0</color>
|
||||
<color name="colorBackground">#181818</color>
|
||||
<color name="colorBackground">#212121</color>
|
||||
</resources>
|
||||
@@ -1,4 +1,4 @@
|
||||
<resources>
|
||||
<dimen name="drawer_header_height">232dp</dimen>
|
||||
<dimen name="drawer_header_height">280dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
</resources>
|
||||
@@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="app_name">LookingSat</string>
|
||||
<string name="drawer_header_title">L∞kingSat</string>
|
||||
<string name="drawer_header_subtitle">https://github.com/rt-bishop/LookingSat</string>
|
||||
<string name="title">L∞king</string>
|
||||
<string name="subtitle">S@t</string>
|
||||
<string name="drawer_header_link">https://github.com/rt-bishop/LookingSat</string>
|
||||
|
||||
<string name="menu_sky">Sky at a Glance</string>
|
||||
<string name="menu_radar">Radar View</string>
|
||||
@@ -12,14 +14,14 @@
|
||||
<string name="menu_credits">Credits</string>
|
||||
|
||||
<string name="device_location_summary">Allow the app to get your location</string>
|
||||
<string name="latitude">Latitude:</string>
|
||||
<string name="latitude_def">-30.0000</string>
|
||||
<string name="latitude">Latitude: </string>
|
||||
<string name="latitude_def">-90.0000</string>
|
||||
<string name="latitude_summary">Ground station latitude from -90 to 90</string>
|
||||
<string name="longitude">Longitude:</string>
|
||||
<string name="longitude_def">-60.0000</string>
|
||||
<string name="longitude">Longitude: </string>
|
||||
<string name="longitude_def">-180.0000</string>
|
||||
<string name="longitude_summary">Ground station longitude from -180 to 180</string>
|
||||
<string name="height">Height:</string>
|
||||
<string name="height_def">64</string>
|
||||
<string name="height">Height AMSL: </string>
|
||||
<string name="height_def">51.0m</string>
|
||||
<string name="height_summary">Ground station height in meters AMSL</string>
|
||||
|
||||
<string name="menu_update_location">Update location</string>
|
||||
|
||||
@@ -13,8 +13,25 @@
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
|
||||
<style name="DrawerHeader">
|
||||
<item name="android:layout_width">wrap_content</item>
|
||||
<item name="android:layout_height">wrap_content</item>
|
||||
<item name="android:textColor">@color/colorDrawerText</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat" />
|
||||
<style name="DrawerHeader.Title">
|
||||
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Title</item>
|
||||
<item name="android:textSize">32sp</item>
|
||||
</style>
|
||||
|
||||
<style name="DrawerHeader.Item">
|
||||
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Medium</item>
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
|
||||
<style name="DrawerHeader.Value">
|
||||
<item name="android:textAppearance">@style/TextAppearance.AppCompat.Large</item>
|
||||
<item name="android:textSize">24sp</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<PreferenceCategory android:title="Ground station location">
|
||||
<SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:disableDependentsState="true"
|
||||
android:key="DEVICE_LOCATION"
|
||||
android:summary="@string/device_location_summary"
|
||||
android:title="Use device location" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="@string/latitude_def"
|
||||
android:dependency="DEVICE_LOCATION"
|
||||
android:key="LATITUDE"
|
||||
android:summary="@string/latitude_summary"
|
||||
android:title="@string/latitude" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="@string/longitude_def"
|
||||
android:dependency="DEVICE_LOCATION"
|
||||
android:key="LONGITUDE"
|
||||
android:summary="@string/longitude_summary"
|
||||
android:title="@string/longitude" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="@string/height_def"
|
||||
android:dependency="DEVICE_LOCATION"
|
||||
android:key="HEIGHT"
|
||||
android:summary="@string/height_summary"
|
||||
android:title="@string/height" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
Reference in new issue
Block a user