1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-26 10:35:50 +01:00

Make widgets configuration activities adhere to configured style

This commit is contained in:
Arjan Schrijver 2023-08-04 23:16:43 +02:00 committed by Arjan Schrijver
parent 3e1b6b2f4d
commit 225d466a7b
2 changed files with 20 additions and 2 deletions

View File

@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
@ -29,10 +30,11 @@ import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.util.WidgetPreferenceStorage;
public class SleepAlarmWidgetConfigurationActivity extends Activity {
public class SleepAlarmWidgetConfigurationActivity extends Activity implements GBActivity {
// modified copy of WidgetConfigurationActivity
// if we knew which widget is calling this config activity, we could only use a single configuration
@ -45,6 +47,8 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
AbstractGBActivity.init(this, AbstractGBActivity.NO_ACTIONBAR);
super.onCreate(savedInstanceState);
setResult(RESULT_CANCELED);
@ -139,4 +143,9 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity {
}
return newMap;
}
@Override
public void setLanguage(Locale language, boolean invalidateLanguage) {
AndroidUtils.setLanguage(this, language);
}
}

View File

@ -19,6 +19,7 @@ import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
@ -29,10 +30,11 @@ import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.util.AndroidUtils;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.util.WidgetPreferenceStorage;
public class WidgetConfigurationActivity extends Activity {
public class WidgetConfigurationActivity extends Activity implements GBActivity {
private static final Logger LOG = LoggerFactory.getLogger(WidgetConfigurationActivity.class);
int mAppWidgetId;
@ -40,6 +42,8 @@ public class WidgetConfigurationActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
AbstractGBActivity.init(this, AbstractGBActivity.NO_ACTIONBAR);
super.onCreate(savedInstanceState);
setResult(RESULT_CANCELED);
@ -132,4 +136,9 @@ public class WidgetConfigurationActivity extends Activity {
}
return newMap;
}
@Override
public void setLanguage(Locale language, boolean invalidateLanguage) {
AndroidUtils.setLanguage(this, language);
}
}