1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-08-24 00:00:47 +02:00

Fix issues reported by linter

This commit is contained in:
Arjan Schrijver 2023-09-01 21:04:55 +02:00
parent 831772836e
commit 2ec5129500
7 changed files with 86 additions and 103 deletions

View File

@ -478,7 +478,6 @@ public class SettingsActivity extends AbstractSettingsActivityV2 {
SharedPreferences.Editor editor = GBApplication.getPrefs().getPreferences().edit();
editor.putString("opentracks_packagename", fitnessAppEditText.getText().toString());
editor.apply();
editor.commit();
})
.setNegativeButton(R.string.Cancel, (dialog, which) -> {})
.show();

View File

@ -693,7 +693,6 @@ public class GBDeviceAdapterv2 extends ListAdapter<GBDevice, GBDeviceAdapterv2.V
SharedPreferences.Editor editor = GBApplication.getDeviceSpecificSharedPrefs(device.getAddress()).edit();
editor.putFloat((String.format("fm_preset%s", index)), frequency);
editor.apply();
editor.commit();
return true;
}
});

View File

@ -320,7 +320,7 @@ public abstract class AbstractDeviceSupport implements DeviceSupport {
protected void handleGBDeviceEvent(GBDeviceEventLEDColor colorEvent) {
Context context = getContext();
LOG.info("Got event for LED Color: #" + Integer.toHexString(colorEvent.color).toUpperCase());
LOG.info("Got event for LED Color: #" + Integer.toHexString(colorEvent.color).toUpperCase(Locale.ROOT));
if (gbDevice == null) {
return;
}

View File

@ -29,7 +29,6 @@ import org.slf4j.LoggerFactory;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.Widget;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
public class WidgetPreferenceStorage {
@ -97,7 +96,6 @@ public class WidgetPreferenceStorage {
}
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putString(PREFS_WIDGET_SETTINGS, savedWidgetsPreferencesDataArray.toString());
editor.commit();
editor.apply();
}
@ -127,7 +125,6 @@ public class WidgetPreferenceStorage {
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putString(PREFS_WIDGET_SETTINGS, savedWidgetsPreferencesDataArray.toString());
editor.commit();
editor.apply();
}
@ -139,7 +136,6 @@ public class WidgetPreferenceStorage {
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
SharedPreferences.Editor editor = sharedPrefs.edit();
editor.putString(PREFS_WIDGET_SETTINGS, "");
editor.commit();
editor.apply();
}

View File

@ -1,38 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
<LinearLayout
<TextView
android:id="@+id/text_sensor_state"
android:layout_width="250dp"
android:layout_height="250dp"
android:background="@android:color/holo_red_light"
android:text="@string/unknown"
android:textSize="50sp"
android:gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">
android:text="@string/unknown"
android:textSize="50sp"
android:id="@+id/text_sensor_count"/>
<TextView
android:id="@+id/text_sensor_state"
android:layout_width="250dp"
android:layout_height="250dp"
android:background="@android:color/holo_red_light"
android:text="@string/unknown"
android:textSize="50dp"
android:gravity="center"/>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/unknown"
android:textSize="50dp"
android:id="@+id/text_sensor_count"/>
</LinearLayout>
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>

View File

@ -1,76 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="horizontal">
<LinearLayout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:text="RPM: "
android:labelFor="@+id/vesc_control_input_rpm"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RPM: "
android:labelFor="@+id/vesc_control_input_rpm"/>
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:id="@+id/vesc_control_input_rpm"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Break current (A): " />
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:id="@+id/vesc_control_input_break_current"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="0.5"
android:text="break"
android:id="@+id/vesc_control_button_break"/>
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="0.5"
android:text="fwd"
android:id="@+id/vesc_control_button_fwd" />
</LinearLayout>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Volume keys control"
android:id="@+id/vesc_control_checkbox_volume_keys" />
android:inputType="numberDecimal"
android:id="@+id/vesc_control_input_rpm"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Break current (A): " />
<EditText
android:layout_width="100dp"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:id="@+id/vesc_control_input_break_current"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="0.5"
android:text="break"
android:id="@+id/vesc_control_button_break"/>
<Button
android:layout_width="wrap_content"
android:layout_height="100dp"
android:layout_weight="0.5"
android:text="fwd"
android:id="@+id/vesc_control_button_fwd" />
</LinearLayout>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Volume keys control"
android:id="@+id/vesc_control_checkbox_volume_keys" />
</LinearLayout>

View File

@ -8,7 +8,7 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/streaks_dashboard_inner"
@ -18,7 +18,7 @@
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_marginStart="1dp"
android:layout_marginEnd="1dp"