checkpoint

This commit is contained in:
voussoir 2023-03-22 17:23:20 -07:00
parent 06ca0fd2b3
commit e96bfac4a9
4 changed files with 92 additions and 78 deletions

View file

@ -39,6 +39,8 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
debug { debug {
applicationIdSuffix '.debug'
// Comment out the below lines if you do not need to test resource shrinking // Comment out the below lines if you do not need to test resource shrinking
// minifyEnabled true // minifyEnabled true
// shrinkResources true // shrinkResources true

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- App Name -->
<string name="app_name">trkpt.debug</string>
</resources>

View file

@ -30,7 +30,6 @@ import android.provider.DocumentsContract
import android.provider.Settings import android.provider.Settings
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import android.widget.Button
import android.widget.Toast import android.widget.Toast
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.preference.EditTextPreference import androidx.preference.EditTextPreference
@ -190,7 +189,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
{ {
val battery_optimization_button = Preference(context) val battery_optimization_button = Preference(context)
battery_optimization_button.title = "Disable battery optimization" battery_optimization_button.title = "Disable battery optimization"
battery_optimization_button.summary = "If your device kills the app, you can give this a try" battery_optimization_button.summary = "If your device kills the app, you can give this a try."
battery_optimization_button.setOnPreferenceClickListener { battery_optimization_button.setOnPreferenceClickListener {
val i: Intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).setData(Uri.parse("package:${context.packageName}")) val i: Intent = Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS).setData(Uri.parse("package:${context.packageName}"))
context.startActivity(i) context.startActivity(i)

View file

@ -8,97 +8,105 @@
tools:context=".MainActivity"> tools:context=".MainActivity">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/trackfragment_constraint_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
> >
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/selected_trkpt_info" android:id="@+id/trackfragment_tools_constraint_layout"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="128dp"
android:layout_marginEnd="8dp"
android:gravity="right"
android:text="time\nlat\nlong"
app:fontFamily="monospace"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageButton
android:id="@+id/delete_selected_trkpt_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="Delete selected trackpoint"
android:src="@drawable/ic_delete_24dp"
android:visibility="gone"
app:backgroundTint="@color/default_transparent"
app:layout_constraintBottom_toTopOf="@+id/map"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_delete_24dp" />
<DatePicker
android:id="@+id/track_query_start_date"
android:layout_width="wrap_content"
android:layout_height="130dp"
android:calendarViewShown="false"
android:datePickerMode="spinner"
android:scaleX="0.6"
android:scaleY="0.6"
android:translationX="-45dp"
android:translationY="-30dp"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent">
<TimePicker <TextView
android:id="@+id/track_query_start_time" android:id="@+id/selected_trkpt_info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="130dp" android:layout_height="wrap_content"
android:translationX="-150dp" android:layout_marginEnd="8dp"
android:translationY="-30dp" android:gravity="right"
android:timePickerMode="spinner" android:text="time\nlat\nlong"
app:layout_constraintTop_toTopOf="parent" app:fontFamily="monospace"
app:layout_constraintStart_toEndOf="@+id/track_query_start_date" app:layout_constraintEnd_toEndOf="parent"
android:scaleX="0.6" app:layout_constraintTop_toTopOf="parent" />
android:scaleY="0.6"
/>
<DatePicker <ImageButton
android:id="@+id/track_query_end_date" android:id="@+id/delete_selected_trkpt_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="130dp" android:layout_height="wrap_content"
android:translationX="-45dp" android:contentDescription="Delete selected trackpoint"
android:translationY="-100dp" android:src="@drawable/ic_delete_24dp"
android:datePickerMode="spinner" android:visibility="gone"
android:calendarViewShown="false" app:backgroundTint="@color/default_transparent"
app:layout_constraintTop_toBottomOf="@+id/track_query_start_date" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:scaleX="0.6" app:srcCompat="@drawable/ic_delete_24dp" />
android:scaleY="0.6"
/>
<TimePicker
android:id="@+id/track_query_end_time" <DatePicker
android:layout_width="wrap_content" android:id="@+id/track_query_start_date"
android:layout_height="130dp" android:layout_width="wrap_content"
android:translationX="-150dp" android:layout_height="130dp"
android:translationY="-100dp" android:calendarViewShown="false"
android:timePickerMode="spinner" android:datePickerMode="spinner"
app:layout_constraintTop_toBottomOf="@+id/track_query_start_time" android:scaleX="0.6"
app:layout_constraintStart_toEndOf="@+id/track_query_start_date" android:scaleY="0.6"
android:scaleX="0.6" android:translationX="-45dp"
android:scaleY="0.6" android:translationY="-30dp"
/> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TimePicker
android:id="@+id/track_query_start_time"
android:layout_width="wrap_content"
android:layout_height="130dp"
android:scaleX="0.6"
android:scaleY="0.6"
android:timePickerMode="spinner"
android:translationX="-150dp"
android:translationY="-30dp"
app:layout_constraintStart_toEndOf="@+id/track_query_start_date"
app:layout_constraintTop_toTopOf="parent" />
<DatePicker
android:id="@+id/track_query_end_date"
android:layout_width="wrap_content"
android:layout_height="130dp"
android:calendarViewShown="false"
android:datePickerMode="spinner"
android:scaleX="0.6"
android:scaleY="0.6"
android:translationX="-45dp"
android:translationY="-100dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/track_query_start_date" />
<TimePicker
android:id="@+id/track_query_end_time"
android:layout_width="wrap_content"
android:layout_height="130dp"
android:scaleX="0.6"
android:scaleY="0.6"
android:timePickerMode="spinner"
android:translationX="-150dp"
android:translationY="-100dp"
app:layout_constraintStart_toEndOf="@+id/track_query_start_date"
app:layout_constraintTop_toBottomOf="@+id/track_query_start_time" />
</androidx.constraintlayout.widget.ConstraintLayout>
<org.osmdroid.views.MapView <org.osmdroid.views.MapView
android:id="@+id/map" android:id="@+id/map"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@+id/track_query_end_time" android:layout_marginBottom="54dp"
android:contentDescription="@string/descr_map_last_track"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toBottomOf="@+id/trackfragment_tools_constraint_layout">
android:contentDescription="@string/descr_map_last_track"
>
</org.osmdroid.views.MapView> </org.osmdroid.views.MapView>