1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-25 11:26:47 +01:00

reformat code

This commit is contained in:
Andreas Shimokawa 2015-07-25 21:52:52 +02:00
parent c4590d3989
commit dbbcf20bbc
17 changed files with 53 additions and 49 deletions

View File

@ -176,6 +176,7 @@ public class GB {
* Creates and display a Toast message using the application context.
* Additionally the toast is logged using the provided severity.
* Can be called from any thread.
*
* @param message the message to display.
* @param displayTime something like Toast.LENGTH_SHORT
* @param severity either INFO, WARNING, ERROR
@ -188,6 +189,7 @@ public class GB {
* Creates and display a Toast message using the application context.
* Additionally the toast is logged using the provided severity.
* Can be called from any thread.
*
* @param message the message to display.
* @param displayTime something like Toast.LENGTH_SHORT
* @param severity either INFO, WARNING, ERROR
@ -199,6 +201,7 @@ public class GB {
/**
* Creates and display a Toast message using the application context
* Can be called from any thread.
*
* @param context the context to use
* @param message the message to display
* @param displayTime something like Toast.LENGTH_SHORT
@ -211,6 +214,7 @@ public class GB {
/**
* Creates and display a Toast message using the application context
* Can be called from any thread.
*
* @param context the context to use
* @param message the message to display
* @param displayTime something like Toast.LENGTH_SHORT

View File

@ -24,7 +24,6 @@ import nodomain.freeyourgadget.gadgetbridge.GBActivitySample;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.charts.ActivityKind;
import nodomain.freeyourgadget.gadgetbridge.charts.SleepUtils;
public abstract class AbstractChartFragment extends Fragment {

View File

@ -1,6 +1,5 @@
package nodomain.freeyourgadget.gadgetbridge.activities;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@ -13,13 +12,10 @@ import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
import android.widget.TextView;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

View File

@ -23,7 +23,6 @@ import com.github.mikephil.charting.utils.ValueFormatter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

View File

@ -5,7 +5,6 @@ import android.bluetooth.BluetoothGattCharacteristic;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
/**
* The Bluedroid implementation only allows performing one GATT request at a time.

View File

@ -1,6 +1,5 @@
package nodomain.freeyourgadget.gadgetbridge.charts;
import java.util.ArrayList;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.GBActivitySample;

View File

@ -11,7 +11,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
import nodomain.freeyourgadget.gadgetbridge.GB;
import nodomain.freeyourgadget.gadgetbridge.GBActivitySample;
@ -132,6 +131,7 @@ public class ActivityDatabaseHandler extends SQLiteOpenHelper {
/**
* Returns all available activity samples from between the two timestamps (inclusive), of the given
* provided and type(s).
*
* @param timestamp_from
* @param timestamp_to
* @param activityTypes ORed combination of #TYPE_DEEP_SLEEP, #TYPE_LIGHT_SLEEP, #TYPE_ACTIVITY

View File

@ -6,7 +6,6 @@ import android.database.sqlite.SQLiteOpenHelper;
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

View File

@ -7,10 +7,11 @@ import android.database.sqlite.SQLiteDatabase;
* Implementors provide the update from the prior schema
* version to this version, and the downgrade from this schema
* version to the next lower version.
*
* <p/>
* Implementations must have a public, no-arg constructor.
*/
public interface DBUpdateScript {
void upgradeSchema(SQLiteDatabase database);
void downgradeSchema(SQLiteDatabase database);
}

View File

@ -3,9 +3,13 @@ package nodomain.freeyourgadget.gadgetbridge.database.schema;
import android.database.sqlite.SQLiteDatabase;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.*;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_INTENSITY;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_PROVIDER;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_STEPS;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_TIMESTAMP;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_TYPE;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.TABLE_GBACTIVITYSAMPLES;
public class ActivityDBCreationScript {
public void createSchema(SQLiteDatabase db) {

View File

@ -6,7 +6,6 @@ import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.TABLE_GBACTIVITYSAMPLES;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.TABLE_STEPS_PER_DAY;
/**
* Upgrade and downgrade with DB versions <= 5 is not supported.

View File

@ -5,7 +5,10 @@ import android.database.sqlite.SQLiteDatabase;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.database.DBUpdateScript;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.*;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_PROVIDER;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_STEPS;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.KEY_TIMESTAMP;
import static nodomain.freeyourgadget.gadgetbridge.database.DBConstants.TABLE_STEPS_PER_DAY;
/**
* Adds a table "STEPS_PER_DAY".

View File

@ -9,7 +9,6 @@ import org.slf4j.LoggerFactory;
import java.util.Calendar;
import nodomain.freeyourgadget.gadgetbridge.AppManagerActivity;
import nodomain.freeyourgadget.gadgetbridge.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;

View File

@ -74,6 +74,7 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport {
//same as above, but remains untouched for the ack message
public GregorianCalendar activityDataTimestampToAck = null;
}
private static final Logger LOG = LoggerFactory.getLogger(MiBandSupport.class);
private volatile boolean telephoneRinging;
private volatile boolean isLocatingDevice;

View File

@ -11,6 +11,7 @@ import nodomain.freeyourgadget.gadgetbridge.GBApplication;
public class FileUtils {
/**
* Copies the the given sourceFile to destFile, overwriting it, in case it exists.
*
* @param sourceFile
* @param destFile
* @throws IOException
@ -30,6 +31,7 @@ public class FileUtils {
/**
* Returns the existing external storage dir.
*
* @throws IOException when the directory is not available
*/
public static File getExternalFilesDir() throws IOException {