1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-21 07:51:46 +02:00

Minor cleanup

This commit is contained in:
Erik Johansson
2018-04-14 22:53:21 +02:00
parent e269ede462
commit 8969166150
5 changed files with 8 additions and 8 deletions

View File

@@ -17,8 +17,6 @@ package com.health.openscale.gui;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.support.test.InstrumentationRegistry; import android.support.test.InstrumentationRegistry;
@@ -99,7 +97,7 @@ public class ScreenshotRecorder {
}); });
} catch (Throwable throwable) { } catch (Throwable throwable) {
throwable.printStackTrace(); throwable.printStackTrace();
}; }
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

View File

@@ -69,6 +69,8 @@ import java.util.TreeMap;
public class OpenScale { public class OpenScale {
public static final String DATABASE_NAME = "openScale.db";
private static OpenScale instance; private static OpenScale instance;
private AppDatabase appDB; private AppDatabase appDB;
@@ -110,7 +112,7 @@ public class OpenScale {
appDB.close(); appDB.close();
} }
appDB = Room.databaseBuilder(context, AppDatabase.class, "openScale.db") appDB = Room.databaseBuilder(context, AppDatabase.class, DATABASE_NAME)
.allowMainThreadQueries() .allowMainThreadQueries()
.addCallback(new RoomDatabase.Callback() { .addCallback(new RoomDatabase.Callback() {
@Override @Override

View File

@@ -42,7 +42,7 @@ import java.util.UUID;
public class BluetoothBeurerSanitas extends BluetoothCommunication { public class BluetoothBeurerSanitas extends BluetoothCommunication {
public final static String TAG = "BeurerSanitas"; public final static String TAG = "BeurerSanitas";
enum DeviceType { BEURER_BF700_800_RT_LIBRA, BEURER_BF710, SANITAS_SBF70_70 }; enum DeviceType { BEURER_BF700_800_RT_LIBRA, BEURER_BF710, SANITAS_SBF70_70 }
private static final int PRIMARY_SERVICE = 0x180A; private static final int PRIMARY_SERVICE = 0x180A;
private static final UUID SYSTEM_ID = UUID.fromString("00002A23-0000-1000-8000-00805F9B34FB"); private static final UUID SYSTEM_ID = UUID.fromString("00002A23-0000-1000-8000-00805F9B34FB");

View File

@@ -221,14 +221,14 @@ public class BackupPreferences extends PreferenceFragment {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
importBackup(); importBackup();
} else { } else {
Toast.makeText(getActivity().getApplicationContext(), getResources().getString(R.string.permission_not_granted), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), R.string.permission_not_granted, Toast.LENGTH_SHORT).show();
} }
break; break;
case PermissionHelper.PERMISSIONS_REQUEST_ACCESS_WRITE_STORAGE: case PermissionHelper.PERMISSIONS_REQUEST_ACCESS_WRITE_STORAGE:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
exportBackup(); exportBackup();
} else { } else {
Toast.makeText(getActivity().getApplicationContext(), getResources().getString(R.string.permission_not_granted), Toast.LENGTH_SHORT).show(); Toast.makeText(getActivity(), R.string.permission_not_granted, Toast.LENGTH_SHORT).show();
} }
break; break;
} }

View File

@@ -386,7 +386,7 @@ public abstract class MeasurementView extends TableLayout {
public String getPreferenceSummary() { return ""; } public String getPreferenceSummary() { return ""; }
public boolean hasExtraPreferences() { return false; } public boolean hasExtraPreferences() { return false; }
public void prepareExtraPreferencesScreen(PreferenceScreen screen) { }; public void prepareExtraPreferencesScreen(PreferenceScreen screen) { }
protected abstract View getInputView(); protected abstract View getInputView();
protected abstract boolean validateAndSetInput(View view); protected abstract boolean validateAndSetInput(View view);