mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2025-01-24 16:47:32 +01:00
Added calendar blacklist setting to banglejs
This commit is contained in:
parent
85758d8369
commit
d9daa16bf8
@ -185,6 +185,7 @@ public class BangleJSCoordinator extends AbstractBLEDeviceCoordinator {
|
||||
if (BuildConfig.INTERNET_ACCESS)
|
||||
settings.add(R.xml.devicesettings_device_internet_access);
|
||||
settings.add(R.xml.devicesettings_device_intents);
|
||||
settings.add(R.xml.devicesettings_sync_calendar);
|
||||
// must be a better way of doing this?
|
||||
int[] settingsInt = new int[settings.size()];
|
||||
for (int i=0; i<settings.size(); i++) settingsInt[i] = settings.get(i);
|
||||
|
@ -96,7 +96,8 @@ import nodomain.freeyourgadget.gadgetbridge.model.ActivityKind;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEvents;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.calendar.CalendarEvent;
|
||||
import nodomain.freeyourgadget.gadgetbridge.util.calendar.CalendarManager;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
|
||||
@ -608,7 +609,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
||||
}
|
||||
} break;
|
||||
case "force_calendar_sync": {
|
||||
if(!GBApplication.getPrefs().getBoolean("enable_calendar_sync", false)) return;
|
||||
//if(!GBApplication.getPrefs().getBoolean("enable_calendar_sync", false)) return;
|
||||
//pretty much like the updateEvents in CalendarReceiver, but would need a lot of libraries here
|
||||
JSONArray ids = json.getJSONArray("ids");
|
||||
ArrayList<Long> idsList = new ArrayList(ids.length());
|
||||
@ -1290,14 +1291,14 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
|
||||
int availableSlots = 6;
|
||||
|
||||
try {
|
||||
CalendarEvents upcomingEvents = new CalendarEvents();
|
||||
List<CalendarEvents.CalendarEvent> mEvents = upcomingEvents.getCalendarEventList(getContext());
|
||||
CalendarManager upcomingEvents = new CalendarManager(getContext(), getDevice().getAddress());
|
||||
List<CalendarEvent> mEvents = upcomingEvents.getCalendarEventList();
|
||||
JSONObject cal = new JSONObject();
|
||||
JSONArray events = new JSONArray();
|
||||
|
||||
cal.put("t", "calendarevents");
|
||||
|
||||
for (CalendarEvents.CalendarEvent mEvt : mEvents) {
|
||||
for (CalendarEvent mEvt : mEvents) {
|
||||
if(availableSlots<1) break;
|
||||
JSONObject o = new JSONObject();
|
||||
o.put("timestamp", mEvt.getBeginSeconds());
|
||||
|
@ -145,8 +145,6 @@
|
||||
<string name="connecting">In collegamento</string>
|
||||
<string name="connected">Connesso</string>
|
||||
<string name="_unknown_">(sconosciuto)</string>
|
||||
<string name="pref_title_banglejs_settings">Impostazioni Bangle.js</string>
|
||||
<string name="pref_header_banglejs_timeline">Timeline Bangle.js</string>
|
||||
<string name="test">Test</string>
|
||||
<string name="test_notification">Notifica di prova</string>
|
||||
<string name="this_is_a_test_notification_from_gadgetbridge">Notifica di prova creata da Gadgetbridge</string>
|
||||
|
@ -289,8 +289,6 @@
|
||||
<string name="pref_summary_device_internet_access">Allow apps on this device to access the internet</string>
|
||||
<string name="pref_title_device_intents">Allow Intents</string>
|
||||
<string name="pref_summary_device_intents">Allow Bangle.js watch apps to send Android Intents, and allow other apps on Android (like Tasker) to send data to Bangle.js with the com.banglejs.uart.tx Intent.</string>
|
||||
<string name="pref_title_banglejs_settings">Bangle.js settings</string>
|
||||
<string name="pref_header_banglejs_timeline">Bangle.js timeline</string>
|
||||
<string name="pref_summary_sync_calendar">Enables calendar alerts, even when disconnected</string>
|
||||
<string name="pref_title_sync_caldendar">Sync calendar events</string>
|
||||
<string name="pref_summary_relax_firmware_checks">Relax firmware checks</string>
|
||||
|
@ -294,27 +294,6 @@
|
||||
android:title="Emulator Port" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen
|
||||
android:icon="@drawable/ic_device_banglejs"
|
||||
android:key="pref_key_banglejs"
|
||||
android:title="@string/pref_title_banglejs_settings">
|
||||
<PreferenceCategory android:title="@string/pref_header_banglejs_timeline">
|
||||
<CheckBoxPreference
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:defaultValue="true"
|
||||
android:key="enable_calendar_sync"
|
||||
android:summary="@string/pref_summary_enable_calendar_sync"
|
||||
android:title="@string/pref_title_enable_calendar_sync" />
|
||||
<Preference
|
||||
android:key="pref_key_blacklist_calendars_bangle"
|
||||
android:title="@string/pref_blacklist_calendars" />
|
||||
<CheckBoxPreference
|
||||
android:layout="@layout/preference_checkbox"
|
||||
android:key="send_sunrise_sunset"
|
||||
android:summary="@string/pref_summary_sunrise_sunset"
|
||||
android:title="@string/pref_title_sunrise_sunset" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
<PreferenceScreen
|
||||
android:icon="@drawable/ic_device_hplus"
|
||||
android:key="pref_key_hplus"
|
||||
|
Loading…
x
Reference in New Issue
Block a user