mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-11 21:43:05 +02:00
Cleanup.
This commit is contained in:
@@ -48,10 +48,8 @@ public class CustomSQLiteOpenHelperTest {
|
|||||||
public static Map<String, String> getSQL(SQLiteDatabase db, String type) {
|
public static Map<String, String> getSQL(SQLiteDatabase db, String type) {
|
||||||
HashMap<String, String> sqlMap = new HashMap<>();
|
HashMap<String, String> sqlMap = new HashMap<>();
|
||||||
try (Cursor cursor = db.query("sqlite_master", new String[]{"name", "SQL"}, "type=?", new String[]{type}, null, null, "name")) {
|
try (Cursor cursor = db.query("sqlite_master", new String[]{"name", "SQL"}, "type=?", new String[]{type}, null, null, "name")) {
|
||||||
if (cursor != null) {
|
while (cursor.moveToNext()) {
|
||||||
while (cursor.moveToNext()) {
|
sqlMap.put(cursor.getString(0), cursor.getString(1));
|
||||||
sqlMap.put(cursor.getString(0), cursor.getString(1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sqlMap;
|
return sqlMap;
|
||||||
@@ -64,12 +62,10 @@ public class CustomSQLiteOpenHelperTest {
|
|||||||
*/
|
*/
|
||||||
private static boolean hasSqlCreate(SQLiteDatabase db, String sqlCreate) {
|
private static boolean hasSqlCreate(SQLiteDatabase db, String sqlCreate) {
|
||||||
try (Cursor cursor = db.rawQuery("SELECT SQL FROM sqlite_master", null)) {
|
try (Cursor cursor = db.rawQuery("SELECT SQL FROM sqlite_master", null)) {
|
||||||
if (cursor != null) {
|
while (cursor.moveToNext()) {
|
||||||
while (cursor.moveToNext()) {
|
String sql = cursor.getString(0);
|
||||||
String sql = cursor.getString(0);
|
if (sqlCreate.equals(sql)) {
|
||||||
if (sqlCreate.equals(sql)) {
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package de.dennisguse.opentracks.chart;
|
package de.dennisguse.opentracks.chart;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
import android.graphics.DashPathEffect;
|
import android.graphics.DashPathEffect;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
@@ -49,10 +48,8 @@ import de.dennisguse.opentracks.R;
|
|||||||
import de.dennisguse.opentracks.data.models.Marker;
|
import de.dennisguse.opentracks.data.models.Marker;
|
||||||
import de.dennisguse.opentracks.settings.UnitSystem;
|
import de.dennisguse.opentracks.settings.UnitSystem;
|
||||||
import de.dennisguse.opentracks.stats.ExtremityMonitor;
|
import de.dennisguse.opentracks.stats.ExtremityMonitor;
|
||||||
import de.dennisguse.opentracks.ui.markers.MarkerDetailActivity;
|
|
||||||
import de.dennisguse.opentracks.ui.markers.MarkerUtils;
|
import de.dennisguse.opentracks.ui.markers.MarkerUtils;
|
||||||
import de.dennisguse.opentracks.ui.util.ThemeUtils;
|
import de.dennisguse.opentracks.ui.util.ThemeUtils;
|
||||||
import de.dennisguse.opentracks.util.IntentUtils;
|
|
||||||
import de.dennisguse.opentracks.util.StringUtils;
|
import de.dennisguse.opentracks.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -857,7 +854,7 @@ public class ChartView extends View {
|
|||||||
* @param chartValueSeries the chart value series
|
* @param chartValueSeries the chart value series
|
||||||
* @param canvas the canvas
|
* @param canvas the canvas
|
||||||
* @param xPosition the right most x position
|
* @param xPosition the right most x position
|
||||||
* @parm yOffset offset to apply to y position
|
* @param yOffset offset to apply to y position
|
||||||
* @param yValue the y value
|
* @param yValue the y value
|
||||||
* @return the marker width.
|
* @return the marker width.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ public class ChooseActivityTypeDialogFragment extends DialogFragment implements
|
|||||||
|
|
||||||
private static final String CHOOSE_ACTIVITY_TYPE_DIALOG_TAG = "chooseActivityType";
|
private static final String CHOOSE_ACTIVITY_TYPE_DIALOG_TAG = "chooseActivityType";
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static void showDialog(FragmentManager fragmentManager, Context context, String activityTypeLocalized) {
|
public static void showDialog(FragmentManager fragmentManager, Context context, String activityTypeLocalized) {
|
||||||
ActivityType activityType = ActivityType.findByLocalizedString(context, activityTypeLocalized);
|
ActivityType activityType = ActivityType.findByLocalizedString(context, activityTypeLocalized);
|
||||||
showDialog(fragmentManager, activityType);
|
showDialog(fragmentManager, activityType);
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class ImportActivity extends AbstractActivity {
|
|||||||
|
|
||||||
importer = new Importer(this, documentFiles);
|
importer = new Importer(this, documentFiles);
|
||||||
importer.getLiveData()
|
importer.getLiveData()
|
||||||
.observe(this, summary -> setProgress(summary));
|
.observe(this, this::setProgress);
|
||||||
importer.startImport();
|
importer.startImport();
|
||||||
|
|
||||||
//Works for a directory, but we might have received multiple files via SEND_MULTIPLE.
|
//Works for a directory, but we might have received multiple files via SEND_MULTIPLE.
|
||||||
|
|||||||
+1
-2
@@ -105,8 +105,7 @@ class TrackRecordingServiceNotificationManager implements SharedPreferences.OnSh
|
|||||||
Notification setGPSonlyStarted(Context context) {
|
Notification setGPSonlyStarted(Context context) {
|
||||||
Intent intent = IntentUtils.newIntent(context, TrackListActivity.class);
|
Intent intent = IntentUtils.newIntent(context, TrackListActivity.class);
|
||||||
|
|
||||||
int pendingIntentFlags = 0;
|
int pendingIntentFlags = PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT;
|
||||||
pendingIntentFlags = PendingIntent.FLAG_IMMUTABLE | PendingIntent.FLAG_UPDATE_CURRENT;
|
|
||||||
PendingIntent pendingIntent = TaskStackBuilder.create(context)
|
PendingIntent pendingIntent = TaskStackBuilder.create(context)
|
||||||
.addParentStack(TrackListActivity.class)
|
.addParentStack(TrackListActivity.class)
|
||||||
.addNextIntent(intent)
|
.addNextIntent(intent)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class IntervalStatisticsAdapter extends RecyclerView.Adapter<RecyclerView
|
|||||||
private List<IntervalStatistics.Interval> intervalList;
|
private List<IntervalStatistics.Interval> intervalList;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final StackMode stackMode;
|
private final StackMode stackMode;
|
||||||
private UnitSystem unitSystem = UnitSystem.defaultUnitSystem();
|
private UnitSystem unitSystem;
|
||||||
private boolean isReportSpeed;
|
private boolean isReportSpeed;
|
||||||
|
|
||||||
public IntervalStatisticsAdapter(Context context, StackMode stackMode, UnitSystem unitSystem, boolean isReportSpeed) {
|
public IntervalStatisticsAdapter(Context context, StackMode stackMode, UnitSystem unitSystem, boolean isReportSpeed) {
|
||||||
|
|||||||
@@ -10,6 +10,6 @@
|
|||||||
android:translateY="24">
|
android:translateY="24">
|
||||||
<path
|
<path
|
||||||
android:pathData="M85.133,20.59C85.731,18.546 84.756,17.817 82.965,18.968L23.874,56.967c-1.791,1.152 -1.519,2.224 0.604,2.382L49.019,61.18c2.124,0.159 4.477,1.918 5.229,3.91l8.7,23.021c0.753,1.992 1.857,1.949 2.455,-0.094z"
|
android:pathData="M85.133,20.59C85.731,18.546 84.756,17.817 82.965,18.968L23.874,56.967c-1.791,1.152 -1.519,2.224 0.604,2.382L49.019,61.18c2.124,0.159 4.477,1.918 5.229,3.91l8.7,23.021c0.753,1.992 1.857,1.949 2.455,-0.094z"
|
||||||
android:fillColor="#FFFFFF"></path>
|
android:fillColor="#FFFFFF" />
|
||||||
</group>
|
</group>
|
||||||
</vector>
|
</vector>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ limitations under the License.
|
|||||||
<string name="sensor_unit_power" translatable="false">w</string>
|
<string name="sensor_unit_power" translatable="false">w</string>
|
||||||
|
|
||||||
<string name="value_unknown" translatable="false">-</string>
|
<string name="value_unknown" translatable="false">-</string>
|
||||||
<string name="empty" translatable="false"></string>
|
<string name="empty" translatable="false" />
|
||||||
<string name="report_issue_link" translatable="false">https://codeberg.org/OpenTracksApp/OpenTracks/issues/new?labels=bug&template=bug_report.md&body=%1$s</string>
|
<string name="report_issue_link" translatable="false">https://codeberg.org/OpenTracksApp/OpenTracks/issues/new?labels=bug&template=bug_report.md&body=%1$s</string>
|
||||||
|
|
||||||
<string-array name="marker_types">
|
<string-array name="marker_types">
|
||||||
|
|||||||
Reference in New Issue
Block a user