1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-20 07:21:40 +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.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.preference.PreferenceManager;
import android.support.test.InstrumentationRegistry;
@@ -99,7 +97,7 @@ public class ScreenshotRecorder {
});
} catch (Throwable throwable) {
throwable.printStackTrace();
};
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

View File

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

View File

@@ -42,7 +42,7 @@ import java.util.UUID;
public class BluetoothBeurerSanitas extends BluetoothCommunication {
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 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) {
importBackup();
} 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;
case PermissionHelper.PERMISSIONS_REQUEST_ACCESS_WRITE_STORAGE:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
exportBackup();
} 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;
}

View File

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