Skip to content

Commit

Permalink
Codacy warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
emartynov committed Sep 12, 2016
1 parent 8b51d72 commit b5eb81d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/org/glucosio/android/db/Migration.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import io.realm.RealmObjectSchema;
import io.realm.RealmSchema;

public class Migration implements RealmMigration {
class Migration implements RealmMigration {

@Override
public void migrate(final DynamicRealm realm, long oldVersion, long newVersion) {
Expand Down Expand Up @@ -97,28 +97,28 @@ class HB1ACReading
************************************************/

if (oldVersion == 0) {
RealmObjectSchema weightSchema = schema.create("WeightReading")
schema.create("WeightReading")
.addField("id", Long.class, FieldAttribute.PRIMARY_KEY, FieldAttribute.REQUIRED)
.addField("created", Date.class)
.addField("reading", Integer.class, FieldAttribute.REQUIRED);

RealmObjectSchema pressureSchema = schema.create("PressureReading")
schema.create("PressureReading")
.addField("id", Long.class, FieldAttribute.PRIMARY_KEY, FieldAttribute.REQUIRED)
.addField("created", Date.class)
.addField("minReading", Integer.class, FieldAttribute.REQUIRED)
.addField("maxReading", Integer.class, FieldAttribute.REQUIRED);

RealmObjectSchema ketoneSchema = schema.create("KetoneReading")
schema.create("KetoneReading")
.addField("id", Long.class, FieldAttribute.PRIMARY_KEY, FieldAttribute.REQUIRED)
.addField("created", Date.class)
.addField("reading", Double.class, FieldAttribute.REQUIRED);

RealmObjectSchema HB1ACSchema = schema.create("HB1ACReading")
schema.create("HB1ACReading")
.addField("id", Long.class, FieldAttribute.PRIMARY_KEY, FieldAttribute.REQUIRED)
.addField("created", Date.class)
.addField("reading", Integer.class, FieldAttribute.REQUIRED);

RealmObjectSchema cholesterolSchema = schema.create("CholesterolReading")
schema.create("CholesterolReading")
.addField("id", Long.class, FieldAttribute.PRIMARY_KEY, FieldAttribute.REQUIRED)
.addField("created", Date.class)
.addField("totalReading", Integer.class, FieldAttribute.REQUIRED)
Expand Down Expand Up @@ -164,7 +164,7 @@ public void apply(DynamicRealmObject obj) {

if (oldVersion == 3) {
// Add Reminders
RealmObjectSchema remindersSchema = schema.create("Reminder")
schema.create("Reminder")
.addField("id", Long.class, FieldAttribute.PRIMARY_KEY, FieldAttribute.REQUIRED)
.addField("metric", String.class)
.addField("alarmTime", Date.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import org.glucosio.android.tools.GlucosioAlarmManager;
import org.glucosio.android.tools.GlucosioNotificationManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
import java.util.List;

public class GlucosioAlarmManager {
List<Reminder> reminders;
Context context;
AlarmManager alarmMgr;
DatabaseHandler db;
private Context context;
private AlarmManager alarmMgr;
private DatabaseHandler db;

public GlucosioAlarmManager(Context context) {
this.context = context;
Expand All @@ -27,7 +26,7 @@ public GlucosioAlarmManager(Context context) {
}

public void setAlarms() {
reminders = db.getReminders();
List<Reminder> reminders = db.getReminders();
int activeRemindersCount = 0;

// Set an alarm for each date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.glucosio.android.activity.AddGlucoseActivity;

public class GlucosioNotificationManager {
private static final String REMOTE_INPUT_KEY = "glucosio_remote_key";
private static final int NOTIFICATION_ID = 011;
//private static final String REMOTE_INPUT_KEY = "glucosio_remote_key";
private static final int NOTIFICATION_ID = 11;
private Context context;

public GlucosioNotificationManager(Context context) {
Expand All @@ -23,7 +23,7 @@ public GlucosioNotificationManager(Context context) {
public void sendReminderNotification() {
String NOTIFICATION_TITLE = "\u23f0";
String NOTIFICATION_TEXT = context.getString(R.string.reminders_notification_text);
String NOTIFICATION_ACTION = context.getString(R.string.reminders_notification_action);
//String NOTIFICATION_ACTION = context.getString(R.string.reminders_notification_action);

Intent intent = new Intent(context, AddGlucoseActivity.class);
intent.putExtra("glucose_reminder_notification", true);
Expand Down

0 comments on commit b5eb81d

Please sign in to comment.