1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-16 05:37:51 +01:00

Merge branch 'master' of codeberg.org:Freeyourgadget/Gadgetbridge

This commit is contained in:
Gordon Williams 2022-05-18 16:18:01 +01:00
commit 96654a01fb
181 changed files with 7862 additions and 849 deletions

View File

@ -1,5 +1,29 @@
### Changelog ### Changelog
### 0.67.0
* Initial Support for Sony WF-1000XM3
* Initial Support for Galaxy Buds Pro
* Huami: Add Toggle function for Open Tracks tracking to button actions
* Huami: Move inactivity warnings, goal notification and HR monitoring to device-specific settings
* Mi Band 6: set time on connect
* Mi Band 5/6, Amazfit Bip S/U/Pro: Add world clock configuration
* Mi Band 5/6: support sensitivity setting for lift wrist configuration
* Mi Band 5: Add support for configuring workout menu on device
* Mi Band 4/5/6, Amazfit Bip U/Pro: Add support for vibration patterns
* Mi Band 5: Increase number of reminder slots to 50
* Mi Band 5/6: Add setting for HR activity monitoring, HR alerts, stress monitoring
* Amazfit Neo: Allow to disable beeps for email notifications
* Bangle.js: Fix incoming calls in release builds
* Fossil Hybrid HR: Support flexible custom menu on watch
* Fossil Hybrid HR: Add support for native DND Call/SMS functionality
* VESC: added battery indicator
* UM25: Add reset option to current accumulation
* UM25: Add notification on below current threshold
* Fix crash when calendar is accessed but permission is denied
* Add com.asus.asusincallui and com.samsung.android.incallui to blacklist
* New icons for Sony overhead headphones, Sony WF 800n and Mi Band 6
### 0.66.0 ### 0.66.0
* Add basic support for Casio GBD-H1000 * Add basic support for Casio GBD-H1000
* Add support for Hama Fit Track 1900 - via FitPro device support * Add support for Hama Fit Track 1900 - via FitPro device support

View File

@ -43,7 +43,7 @@ public class GBDaoGenerator {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
final Schema schema = new Schema(37, MAIN_PACKAGE + ".entities"); final Schema schema = new Schema(38, MAIN_PACKAGE + ".entities");
Entity userAttributes = addUserAttributes(schema); Entity userAttributes = addUserAttributes(schema);
Entity user = addUserInfo(schema, userAttributes); Entity user = addUserInfo(schema, userAttributes);
@ -87,6 +87,7 @@ public class GBDaoGenerator {
addCalendarSyncState(schema, device); addCalendarSyncState(schema, device);
addAlarms(schema, user, device); addAlarms(schema, user, device);
addReminders(schema, user, device); addReminders(schema, user, device);
addWorldClocks(schema, user, device);
Entity notificationFilter = addNotificationFilters(schema); Entity notificationFilter = addNotificationFilters(schema);
@ -561,6 +562,24 @@ public class GBDaoGenerator {
reminder.addToOne(device, deviceId); reminder.addToOne(device, deviceId);
} }
private static void addWorldClocks(Schema schema, Entity user, Entity device) {
Entity worldClock = addEntity(schema, "WorldClock");
worldClock.implementsInterface("nodomain.freeyourgadget.gadgetbridge.model.WorldClock");
Property deviceId = worldClock.addLongProperty("deviceId").notNull().getProperty();
Property userId = worldClock.addLongProperty("userId").notNull().getProperty();
Property worldClockId = worldClock.addStringProperty("worldClockId").notNull().primaryKey().getProperty();
Index indexUnique = new Index();
indexUnique.addProperty(deviceId);
indexUnique.addProperty(userId);
indexUnique.addProperty(worldClockId);
indexUnique.makeUnique();
worldClock.addIndex(indexUnique);
worldClock.addStringProperty("label").notNull();
worldClock.addStringProperty("timeZoneId").notNull();
worldClock.addToOne(user, userId);
worldClock.addToOne(device, deviceId);
}
private static void addNotificationFilterEntry(Schema schema, Entity notificationFilterEntity) { private static void addNotificationFilterEntry(Schema schema, Entity notificationFilterEntity) {
Entity notificatonFilterEntry = addEntity(schema, "NotificationFilterEntry"); Entity notificatonFilterEntry = addEntity(schema, "NotificationFilterEntry");
notificatonFilterEntry.addIdProperty().autoincrement(); notificatonFilterEntry.addIdProperty().autoincrement();

View File

@ -83,7 +83,7 @@ vendor's servers.
- PineTime (InfiniTime Firmware) - PineTime (InfiniTime Firmware)
- Roidmi, Roidmi 3, Mojietu 3 (Bluetooth FM Transmitters) - Roidmi, Roidmi 3, Mojietu 3 (Bluetooth FM Transmitters)
- [SMA](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/SMA) Q2 (SMA-Q2-OSS Firmware) - [SMA](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/SMA) Q2 (SMA-Q2-OSS Firmware)
- [Sony WH-1000XM3, WH-1000XM4, WF-SP800N](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Sony-Headphones) - [Sony WH-1000XM3, WH-1000XM4, WF-SP800N, WF-1000XM3](https://codeberg.org/Freeyourgadget/Gadgetbridge/wiki/Sony-Headphones)
- Teclast H10, H30 - Teclast H10, H30
- TLW64 - TLW64
- Vibratissimo (Experimental) - Vibratissimo (Experimental)

View File

@ -55,8 +55,8 @@ android {
multiDexEnabled true multiDexEnabled true
// Note: always bump BOTH versionCode and versionName! // Note: always bump BOTH versionCode and versionName!
versionName "0.66.0" versionName "0.67.0"
versionCode 210 versionCode 211
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
multiDexEnabled true multiDexEnabled true
buildConfigField "String", "GIT_HASH_SHORT", "\"${getGitHashShort()}\"" buildConfigField "String", "GIT_HASH_SHORT", "\"${getGitHashShort()}\""
@ -154,7 +154,7 @@ android {
versionNameSuffix "-banglejs" versionNameSuffix "-banglejs"
buildConfigField "boolean", "INTERNET_ACCESS", "true" buildConfigField "boolean", "INTERNET_ACCESS", "true"
// Disable pebble provider to allow Bangle.js Gadgetbridge to coexist with Gadgetbridge // Disable pebble provider to allow Bangle.js Gadgetbridge to coexist with Gadgetbridge
resValue "string", "pebble_content_provider", "com.getpebble.android.nopebble.provider" resValue "string", "pebble_content_provider", "com.getpebble.android.nopebble.bangle.provider"
resValue "string", "app_name", "@string/application_name_banglejs_main" resValue "string", "app_name", "@string/application_name_banglejs_main"
resValue "string", "title_activity_controlcenter", "@string/title_activity_controlcenter_banglejs_main" resValue "string", "title_activity_controlcenter", "@string/title_activity_controlcenter_banglejs_main"
resValue "string", "about_activity_title", "@string/about_activity_title_banglejs_main" resValue "string", "about_activity_title", "@string/about_activity_title_banglejs_main"
@ -238,6 +238,10 @@ dependencies {
implementation 'com.google.protobuf:protobuf-lite:3.0.1' implementation 'com.google.protobuf:protobuf-lite:3.0.1'
implementation "androidx.multidex:multidex:2.0.1" implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.android.volley:volley:1.2.1' implementation 'com.android.volley:volley:1.2.1'
// JSR-310 timezones backport for Android, since we're still on java 7
implementation 'com.jakewharton.threetenabp:threetenabp:1.4.0'
testImplementation 'org.threeten:threetenbp:1.6.0'
} }
preBuild.dependsOn(":GBDaoGenerator:genSources") preBuild.dependsOn(":GBDaoGenerator:genSources")

View File

@ -18,10 +18,14 @@
-keepclassmembers class nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.webview.JSInterface { -keepclassmembers class nodomain.freeyourgadget.gadgetbridge.service.devices.pebble.webview.JSInterface {
public *; public *;
} }
# Required for refection in BangleJSDeviceSupport # Required for reflection in BangleJSDeviceSupport
-keepclassmembers class nodomain.freeyourgadget.gadgetbridge.model.CallSpec { -keepclassmembers class nodomain.freeyourgadget.gadgetbridge.model.CallSpec {
public static *; public static *;
} }
# Required for reflection in method GattCharacteristic.initDebugMap()
-keepclassmembers class nodomain.freeyourgadget.gadgetbridge.service.btle.GattCharacteristic {
public static *;
}
-keepattributes JavascriptInterface -keepattributes JavascriptInterface
# https://github.com/tony19/logback-android/issues/29 # https://github.com/tony19/logback-android/issues/29

View File

@ -503,6 +503,10 @@
android:name=".activities.ConfigureReminders" android:name=".activities.ConfigureReminders"
android:label="@string/title_activity_set_reminders" android:label="@string/title_activity_set_reminders"
android:parentActivityName=".activities.ControlCenterv2" /> android:parentActivityName=".activities.ControlCenterv2" />
<activity
android:name=".activities.ConfigureWorldClocks"
android:label="@string/pref_world_clocks_title"
android:parentActivityName=".activities.ControlCenterv2" />
<activity <activity
android:name=".activities.devicesettings.DeviceSettingsActivity" android:name=".activities.devicesettings.DeviceSettingsActivity"
android:label="@string/title_activity_device_specific_settings" android:label="@string/title_activity_device_specific_settings"
@ -518,6 +522,12 @@
android:parentActivityName=".activities.ConfigureReminders" android:parentActivityName=".activities.ConfigureReminders"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" /> android:windowSoftInputMode="adjustResize" />
<activity
android:name=".activities.WorldClockDetails"
android:label="@string/title_activity_world_clock_details"
android:parentActivityName=".activities.ConfigureWorldClocks"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />
<activity <activity
android:name=".activities.VibrationActivity" android:name=".activities.VibrationActivity"
android:label="@string/title_activity_vibration" android:label="@string/title_activity_vibration"

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="10.399478mm"
height="10.338884mm"
viewBox="0 0 10.399477 10.338885"
version="1.1"
id="svg5"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="buds_pro_case.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="1"
fit-margin-top="1"
inkscape:zoom="8"
inkscape:cx="39.6875"
inkscape:cy="37.9375"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-95.852619,-146.01635)">
<path
style="fill:#000000;stroke:#000000;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 98.725767,155.07946 c -2.011931,-0.33512 -3.224531,-2.80083 -2.421739,-4.92438 0.698696,-1.8482 1.220768,-2.38464 2.716612,-2.79141 0.622809,-0.16937 3.23294,-0.2015 3.88217,-0.0478 1.27757,0.30245 1.88675,0.72802 2.36901,1.65499 0.70733,1.35957 0.89693,2.22299 0.71935,3.27582 -0.25793,1.52921 -1.29315,2.61077 -2.72307,2.84497 -0.55609,0.0911 -3.977465,0.0819 -4.542333,-0.0122 z m 4.644383,-0.15465 c 0.60321,-0.1105 1.30489,-0.48711 1.65427,-0.88788 0.30716,-0.35233 0.68597,-1.10792 0.76801,-1.53187 l 0.053,-0.27397 -0.22851,0.24421 c -0.33209,0.35491 -0.77469,0.62265 -1.34022,0.81074 -1.13605,0.37784 -5.214307,0.38683 -6.410497,0.0141 -0.55739,-0.17367 -1.193139,-0.55571 -1.433201,-0.86126 l -0.163268,-0.2078 0.04663,0.27396 c 0.07099,0.4171 0.462077,1.19611 0.773559,1.54089 0.330733,0.36608 0.957492,0.72348 1.500185,0.85545 0.505093,0.12283 4.140102,0.14063 4.780022,0.0234 z m 0.5638,-1.66846 c 0.91653,-0.23153 1.68237,-0.77465 1.90019,-1.34755 0.20798,-0.54704 -0.0205,-1.55801 -0.623,-2.75628 -0.4674,-0.9296 -1.05748,-1.37665 -2.19843,-1.66553 -0.67764,-0.17157 -3.410689,-0.14747 -4.065651,0.0359 -1.070946,0.29976 -1.649067,0.76556 -2.081871,1.67737 -0.99471,2.09563 -0.884667,3.03994 0.434692,3.73021 0.829113,0.43377 1.468822,0.5086 4.06904,0.47594 1.56307,-0.0196 2.19526,-0.0566 2.56503,-0.15002 z"
id="path1716" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="10.999999mm"
height="10.999998mm"
viewBox="0 0 11 10.999998"
version="1.1"
id="svg4576"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="buds_pro_left.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview4578"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
fit-margin-top="0"
fit-margin-bottom="0"
fit-margin-left="0"
fit-margin-right="0"
inkscape:zoom="16"
inkscape:cx="32.09375"
inkscape:cy="39.15625"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
showguides="true"
inkscape:guide-bbox="true">
<sodipodi:guide
position="-47.790315,6.0004159"
orientation="0,-1"
id="guide34420" />
</sodipodi:namedview>
<defs
id="defs4573" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-93.982649,-153.80574)">
<path
id="path61748"
style="font-size:4.23333px;line-height:124%;font-family:Sans;-inkscape-font-specification:Sans;letter-spacing:0px;word-spacing:0px;stroke:#000000;stroke-width:0.265"
d="m 98.636978,156.07032 h 0.367759 v 2.42358 h 1.323583 v 0.31142 h -1.691342 z m 0.315833,7.6524 c 0.356876,-0.14916 0.822437,-0.53623 0.968511,-0.80526 0.07231,-0.13321 0.02551,-0.13439 -0.475169,-0.012 -0.984441,0.24062 -1.681127,0.009 -2.306585,-0.76927 -0.26071,-0.32411 -0.295617,-0.44513 -0.339874,-1.17836 l -0.04933,-0.81715 -0.256509,0.30582 c -0.822265,0.98037 -0.459417,2.6469 0.70147,3.22181 0.48908,0.24221 1.251667,0.26583 1.757481,0.0544 z m -1.330485,0.32864 c -0.541904,-0.12922 -0.867149,-0.32727 -1.225662,-0.74633 -0.606112,-0.70845 -0.727348,-1.77669 -0.299201,-2.6363 0.135175,-0.2714 0.322096,-0.53432 0.415381,-0.58427 0.157826,-0.0845 0.159638,-0.11891 0.0261,-0.49524 -0.352113,-0.99233 -0.20943,-2.51608 0.328134,-3.50425 0.328783,-0.60438 1.0431,-1.2434 1.603455,-1.43443 1.115376,-0.38024 2.679607,0.0425 3.461337,0.93534 1.21161,1.38389 1.52834,3.21746 0.81726,4.73098 -0.23868,0.50801 -1.21551,1.49715 -1.92601,1.95027 -0.34353,0.21907 -0.56429,0.44351 -0.67787,0.68916 -0.371437,0.80334 -1.568126,1.32275 -2.522924,1.09507 z m 2.19911,-1.4967 c 0.978664,-0.37204 2.470754,-1.6715 2.795454,-2.43453 0.78312,-1.84035 -0.11926,-4.30442 -1.87124,-5.10964 -0.806242,-0.37056 -1.788981,-0.3857 -2.470056,-0.038 -1.451067,0.74068 -2.106198,2.85414 -1.464365,4.72405 0.0966,0.28145 0.176572,0.77122 0.177715,1.08843 0.0044,1.23212 0.671638,1.94724 1.817915,1.94848 0.305191,3.3e-4 0.749449,-0.0779 1.014577,-0.17873 z" />
<g
id="g1961"
transform="translate(5.7478236e-5,3.0300929e-4)">
<path
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 99.687906,159.96304 c 0.03116,-0.0812 0.399384,-0.2858 0.818354,-0.45477 0.84931,-0.34253 1.0686,-0.3103 1.0686,0.15703 0,0.24663 -0.0628,0.29752 -0.70948,0.57453 -0.86444,0.37031 -0.952978,0.55914 -1.060626,0.26518 -0.107648,-0.29395 -0.14798,-0.46082 -0.116848,-0.54197 z"
id="path1775"
sodipodi:nodetypes="ccsccc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="10.999999mm"
height="10.999999mm"
viewBox="0 0 11 10.999999"
version="1.1"
id="svg4576"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="buds_pro_right.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview4578"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
fit-margin-top="0"
fit-margin-bottom="0"
fit-margin-left="0"
fit-margin-right="0"
inkscape:zoom="11.313709"
inkscape:cx="36.63697"
inkscape:cy="29.831067"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
showguides="true"
inkscape:guide-bbox="true">
<sodipodi:guide
position="1.2413708,6.0162603"
orientation="0,-1"
id="guide34430" />
</sodipodi:namedview>
<defs
id="defs4573" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-85.996183,-154.42373)">
<g
aria-label="R"
id="text28286"
style="font-style:italic;font-size:4.23333px;line-height:124%;font-family:Sans;-inkscape-font-specification:'Sans Italic';letter-spacing:0px;word-spacing:0px;stroke-width:0.299542px"
transform="matrix(0.88023484,0,0,0.88636119,10.922244,18.114874)">
<path
id="path61769"
style="font-size:4.23333px;line-height:124%;font-family:Sans;-inkscape-font-specification:Sans;letter-spacing:0px;word-spacing:0px;stroke:#000000;stroke-width:0.299542px"
d="m 91.7518,157.96053 q 0.134359,0.0455 0.260449,0.1943 0.128158,0.14883 0.256315,0.40928 l 0.423747,0.84336 h -0.448552 l -0.394807,-0.79169 q -0.152962,-0.31005 -0.297656,-0.41134 -0.142627,-0.10128 -0.390674,-0.10128 H 90.70587 v 1.30431 h -0.417545 v -3.08612 h 0.942577 q 0.529166,0 0.789615,0.22118 0.260449,0.22117 0.260449,0.66766 0,0.29145 -0.136425,0.48369 -0.134359,0.19223 -0.392741,0.26665 z m -1.04593,-1.29605 v 1.09554 h 0.525032 q 0.30179,0 0.454752,-0.13849 0.15503,-0.14056 0.15503,-0.41134 0,-0.27079 -0.15503,-0.40721 -0.152962,-0.1385 -0.454752,-0.1385 z m 1.432917,8.30872 c -0.405432,-0.16828 -0.934338,-0.60499 -1.100286,-0.9085 -0.08215,-0.15028 -0.02898,-0.15162 0.53982,-0.0135 1.118385,0.27146 1.909867,0.0101 2.620416,-0.8679 0.296193,-0.36567 0.335853,-0.50221 0.386124,-1.32944 l 0.05601,-0.92191 0.291411,0.34503 c 0.934148,1.10606 0.521917,2.98625 -0.796913,3.63487 -0.555624,0.27326 -1.421972,0.29991 -1.996603,0.0614 z m -0.98681,-1.31781 c -1.111824,-0.41974 -2.806926,-1.8858 -3.175801,-2.74666 -0.889675,-2.0763 0.135483,-4.85628 2.125836,-5.76475 0.915942,-0.41805 2.032389,-0.43513 2.806137,-0.0429 1.648492,0.83564 2.39276,3.22007 1.663613,5.32971 -0.109743,0.31753 -0.200605,0.8701 -0.2019,1.22797 -0.0057,1.3901 -0.763024,2.1969 -2.065267,2.19829 -0.346714,3.8e-4 -0.851416,-0.0879 -1.152618,-0.20163 z m 2.498327,1.68859 c 0.615631,-0.14579 0.985134,-0.36923 1.392423,-0.84202 0.688578,-0.79928 0.826314,-2.00447 0.33991,-2.97429 -0.153562,-0.3062 -0.365914,-0.60283 -0.471897,-0.65918 -0.179304,-0.0953 -0.181361,-0.13416 -0.02965,-0.55873 0.400029,-1.11956 0.237925,-2.83867 -0.372776,-3.95353 -0.373514,-0.68188 -1.185013,-1.40282 -1.821627,-1.61833 -1.267129,-0.42899 -3.044181,0.048 -3.932276,1.05525 -1.376461,1.56132 -1.736294,3.62997 -0.928459,5.33754 0.271153,0.57314 1.380895,1.68909 2.188066,2.20031 0.390272,0.24715 0.641063,0.50037 0.770097,0.77751 0.421974,0.90634 1.781479,1.49234 2.86619,1.23547 z" />
</g>
<g
id="g3227"
transform="translate(2.1600298e-4,2.9611944e-4)">
<path
style="fill:#000000;stroke:#000000;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 91.29092,160.58104 c -0.03116,-0.0812 -0.399381,-0.2858 -0.818345,-0.45477 -0.849311,-0.34253 -1.068608,-0.31031 -1.068608,0.15703 0,0.24663 0.06281,0.29752 0.709484,0.57453 0.864443,0.37031 0.947778,0.40745 1.058024,0.18934 0.110245,-0.21811 0.150577,-0.38498 0.119445,-0.46613 z"
id="path3121"
sodipodi:nodetypes="cssccc" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg2"
width="28.740126"
height="28.740126"
viewBox="0 0 28.740126 28.740126"
sodipodi:docname="ic_device_galaxy_buds_pro.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 14.370063 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="28.740126 : 14.370063 : 1"
inkscape:persp3d-origin="14.370063 : 9.580042 : 1"
id="perspective903" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1035"
id="namedview4"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="16"
inkscape:cx="9.59375"
inkscape:cy="19.78125"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
inkscape:pagecheckerboard="0">
<inkscape:grid
type="xygrid"
id="grid972" />
</sodipodi:namedview>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Background"
style="display:inline">
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Bottom"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#1f7fdb;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-5"
width="22.819572"
height="21.904638"
x="2.9239759"
y="3.8768768"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Middle"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#4dabf5;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-7"
width="22.819572"
height="21.904638"
x="2.9317887"
y="3.0349438"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Top"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="fill:#2196f3;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817"
width="22.819572"
height="21.904638"
x="2.9238882"
y="3.4130721"
ry="0.9472276" />
</g>
<g
id="g63739"
transform="translate(0.05413571,0.02254964)">
<path
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 21.237726,23.178927 c 0.634206,-0.154792 1.014861,-0.392033 1.434432,-0.894023 0.709355,-0.848648 0.851246,-2.128284 0.35017,-3.158004 -0.158194,-0.325102 -0.376956,-0.640059 -0.486135,-0.699886 -0.184713,-0.101225 -0.186831,-0.142449 -0.0305,-0.593252 0.4121,-1.188704 0.245104,-3.013982 -0.384023,-4.197709 -0.384785,-0.723994 -1.220769,-1.489466 -1.876589,-1.718287 -1.305362,-0.455487 -3.136032,0.05098 -4.050919,1.120434 -1.417995,1.657746 -1.788681,3.854161 -0.956476,5.667197 0.279331,0.608544 1.422559,1.793423 2.254089,2.336206 0.402046,0.262429 0.660398,0.531288 0.79333,0.825545 0.434706,0.962313 1.83523,1.584515 2.952669,1.311779 z m -1.557124,-0.393681 c -0.417663,-0.178671 -0.962525,-0.642359 -1.13348,-0.964615 -0.08464,-0.159567 -0.02985,-0.160978 0.556108,-0.01438 1.152123,0.288237 1.967488,0.0109 2.699481,-0.921499 0.305122,-0.388252 0.34598,-0.533223 0.397766,-1.411541 l 0.05768,-0.978857 0.300204,0.366331 c 0.962332,1.174379 0.537663,3.170699 -0.820959,3.859379 -0.572392,0.290149 -1.464875,0.318438 -2.056846,0.0651 z M 18.664017,21.38604 c -1.145368,-0.445668 -2.891616,-2.002277 -3.271619,-2.916302 -0.916517,-2.204544 0.139572,-5.156228 2.189977,-6.12081 0.943576,-0.443884 2.09371,-0.462014 2.890806,-0.04544 1.698228,0.887254 2.464953,3.418948 1.713805,5.658899 -0.113052,0.337133 -0.206657,0.923837 -0.207992,1.30381 -0.0056,1.475953 -0.786045,2.332595 -2.127581,2.334067 -0.357171,4.12e-4 -0.877106,-0.09332 -1.187396,-0.214086 z m 0.05143,-2.660283 c 0.09413,-0.1471 0.141331,-0.346993 0.104904,-0.444199 -0.03648,-0.09727 -0.46741,-0.342356 -0.95774,-0.544765 -0.99398,-0.410316 -1.250633,-0.37172 -1.250633,0.188105 0,0.29544 0.0735,0.356398 0.830335,0.688221 1.011691,0.443601 1.058716,0.44776 1.273129,0.112618 z"
id="path4913" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:#fffffd;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 7.8095555,17.66233 c -0.643309,-0.154792 -1.029417,-0.392034 -1.455018,-0.894023 -0.719533,-0.848647 -0.863456,-2.128283 -0.35519,-3.158003 0.16047,-0.325108 0.382369,-0.640058 0.493111,-0.699893 0.187359,-0.101222 0.189511,-0.142441 0.03099,-0.593244 -0.418003,-1.188704 -0.24862,-3.0139926 0.389538,-4.1977137 0.390307,-0.7239821 1.238294,-1.4894593 1.903507,-1.7182926 1.3240955,-0.4554866 3.1810385,0.05091 4.1090525,1.1204365 1.438337,1.6577511 1.814337,3.8541708 0.970193,5.6672038 -0.283344,0.608542 -1.442967,1.793425 -2.286421,2.336214 -0.407815,0.262422 -0.669885,0.531277 -0.804719,0.825539 -0.440944,0.962315 -1.8615685,1.584512 -2.9950365,1.311776 z m 1.579457,-0.393675 c 0.423658,-0.178678 0.9763395,-0.642346 1.1497485,-0.964615 0.08584,-0.159571 0.03028,-0.160985 -0.5640875,-0.01437 -1.168658,0.288237 -1.995714,0.01078 -2.738213,-0.921502 -0.309496,-0.388249 -0.350936,-0.533218 -0.403474,-1.411549 l -0.05856,-0.978857 -0.30451,0.366339 c -0.976134,1.174378 -0.545387,3.170701 0.832735,3.859381 0.580601,0.290142 1.48589,0.318436 2.086356,0.06516 z m 1.0311705,-1.39921 c 1.1618,-0.445664 2.933103,-2.002277 3.318564,-2.916305 C 14.668411,10.748599 13.59717,7.7969088 11.517344,6.832342 10.560231,6.3884511 9.3935935,6.370315 8.5850695,6.786822 c -1.722603,0.8872548 -2.500328,3.418952 -1.73839,5.658903 0.114677,0.337147 0.209614,0.923838 0.210971,1.303822 0.0052,1.475947 0.79732,2.332583 2.158099,2.334069 0.362301,3.8e-4 0.8896925,-0.09332 1.2044335,-0.214099 z m -0.05212,-2.660279 c -0.09548,-0.147102 -0.14336,-0.346994 -0.106402,-0.444203 0.03699,-0.09727 0.47412,-0.342357 0.971491,-0.544765 1.008241,-0.410314 1.268566,-0.371706 1.268566,0.188105 0,0.295436 -0.07455,0.356397 -0.842244,0.688225 -1.026201,0.443591 -1.073911,0.44776 -1.291402,0.112602 z"
id="path4913-6" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Original"
style="display:none"
sodipodi:insensitive="true">
<image
y="0.0079936879"
x="0.010951031"
id="image4124"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAA3NCSVQICAjb4U/gAAAACXBIWXMA ADFOAAAxTgGacD5yAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAABF0RVh0 VGl0bGUAUGViYmxlIEljb26KvwD9AAAADHRFWHRBdXRob3IAeHBobnh/4OzMAAAAY3RFWHRDb3B5 cmlnaHQAQ0MgQXR0cmlidXRpb24tTm9uQ29tbWVyY2lhbC1TaGFyZUFsaWtlIGh0dHA6Ly9jcmVh dGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC/eBBrlAAABy1BMVEUAAAAAAAAA AP8AAIAAAFUAAKoAVaoAAIAAQIAAM2YAM5kzM2YzM5krK4AkJG0kJJIgIIAcHHEcHI4aGoAXF3QX F4sXLnQXLosVK4AUJ3YUJ4kSJIAkJIARInciInciIogQIIAgIIAeHngeHoccHIAcK4AbKHkbKIYa GoAaJoAYJHkXI4AXI4sWIXoWIYUVIIAfH3ofH4UdJ4ATHIQcJnsbJIAaI4QaIoAZIXsZIYQYIHgY IIAXH4MXJ3wXHoAXJoBLpfAWJHwdJHwdJIMcI4Acas0VIoMbIoAaIXwaIIAZH3wZH4MZJXwYHoAY HoYYJIAehtsYHoIefdtHoO0jetZGovNEn+4gg+EfgN5Ep/VKqfREpvQgfdkgfttKqvQggd4hjesw nPMwnPRJqfUhgd4hjutJqfUgfttNq/VNq/QhlPEhlPIhlvMkmPMglvIff9sgjeoglPAhk/AhlPEh lPIhlvMkl/MkmPMlmPMmmPMnmfMpmvMzn/Q0n/Q1n/Q2oPRIqfVNq/VasfZbsvZhtPZitfdtuveQ yvmXzvmj0/qk1Pqu2fu83/vR6f3T6v3Z7f3i8f3j8v3l8/7m8/7p9f7q9f7x+P7y+f7////ougeB AAAAb3RSTlMAAQECAwMDBAQFBQUFBgcHCAkJCgsLCwsMDQ0ODg8PDxAQERESEhMTFBQVFhYXFxgZ GRobGxwdHh8fICAhISIiIiMjIyQkJSYnKCkpKSoqKiorKyssLC2xs7O0tba2tu7u7u7u7+/w8fHy +/v7+/ywJhX9AAAC0klEQVRo3u2a+VfTQBCAm00iW0nSTVNKbKQYbIMUC6jU4q2IB2rF+74vPEAR LSjIIXgAAiqef65py6MNJe17y1RF8/26L/N1N9O8ZGZcLof/DiYFoiV1cZHwiGVZjh7zalRAYYbn sFsQ6RFwGccyBeJjwSMrPn8lHX6fQqRy3tbAsFiU1So9FA4bNIRD63XNTwTO5pSYc9fuvwbgwaW9 SxqYs/eGBgcAGBy+fRrlpRPDsJdfJoEYuMgvzibz/vK3kmDcFMuxNZvM/BG74QTdFV6PJZsYlhe9 XXCCrlCVStwcyhG45QCkoCmiV0o4uwXEib4aQMHjbc0RTXYvCMx/mGdNHaSgraWxRhEXzsgUEC0C KWjfszlUYRWsrYcUHGttNlSRzxUEo5CCjrZYrSqVVlD3Nwj6vqcZsovzKrPeTy3o/5lmxE4wnFl/ 4QhKLvjy2YY5IEExHMH0B1umQQSj9o+EUUewIBh/m8c4qOBbfu58dQRLCmYnJmZLKphKJicdwR8X vJsymSmhIM37FSv4OJlhxnlUOAJHAC8Ye5PHmPNe9PsEJX/5dT5AigvmPtkw53wnr3xB34809uWc zDp9OWflV7xgBaBlzY79MWORALhuui+vbhoArfwe3rUp5MtWfl2Il1QDUtAaj+rKakv1XdEhBfGm Wo1kq+/pM1Ih+wdRI6iIq3IFvEAewgke6QHFg1mU26PjhbtwghsKEbG1X8ew3PmnUPGfXRAwv7hr yqAD13t6nwPQ23PnBMeivG4gg85c7XwCQOeVU+avZ5bslcrrNm7dfehIInGSguOJo+0Hd27ZoOam j3ULvOjTI02x+PYddLTEY42GJpfnpo/L0g50k8pqI1IfbWikoSFaXxfSFKnMrqFsZpKbKKoWDFbT EdQCqlfCdhtIG7AoESLTQogk4EJd/VRTn8fLgecKTg3MjyUsA4SKDD7MT1bQ8++NmvwCRmydh2Fg UvEAAAAASUVORK5CYII= "
style="opacity:0.49074079;image-rendering:optimizeQuality"
preserveAspectRatio="none"
height="28.710279"
width="28.710279" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg2"
width="28.740126"
height="28.740126"
viewBox="0 0 28.740126 28.740126"
sodipodi:docname="ic_device_miband6.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 14.370063 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="28.740126 : 14.370063 : 1"
inkscape:persp3d-origin="14.370063 : 9.580042 : 1"
id="perspective903" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1035"
id="namedview4"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="16.000001"
inkscape:cx="7.5312495"
inkscape:cy="18.906249"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
inkscape:pagecheckerboard="0">
<inkscape:grid
type="xygrid"
id="grid972" />
</sodipodi:namedview>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Background"
style="display:inline">
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Bottom"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#1f7fdb;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-5"
width="22.819572"
height="21.904638"
x="2.9239759"
y="3.8768768"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Middle"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#4dabf5;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-7"
width="22.819572"
height="21.904638"
x="2.9317887"
y="3.0349438"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Top"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="fill:#2196f3;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817"
width="22.819572"
height="21.904638"
x="2.9238882"
y="3.4130721"
ry="0.9472276" />
</g>
<g
id="g3290"
transform="translate(0.06106299,-0.04193669)">
<path
style="fill:#ffffff;fill-opacity:1;stroke-width:3.77953"
d="m 5.7005371,14.062732 c 0.00345,-0.03232 0.013618,-0.134324 0.023098,-0.226674 0.052057,-0.502923 0.2664409,-1.351244 0.3915769,-1.549467 0.024477,-0.03878 0.076621,-0.09101 0.1157675,-0.116009 0.1381934,-0.0882 0.4683357,-0.160533 1.0160246,-0.222623 0.1544916,-0.0175 0.3033982,-0.04042 0.3308835,-0.05094 0.069898,-0.02672 0.2694919,-0.0674 0.330556,-0.0674 0.029045,0 0.1528109,-0.05016 0.2885308,-0.116957 0.4663707,-0.229536 0.9722843,-0.357145 1.597637,-0.40298 0.3197226,-0.02344 8.7265726,-0.02361 9.0500356,-1.89e-4 0.652071,0.04723 1.177696,0.187449 1.687436,0.450227 l 0.243463,0.125507 0.310621,0.0306 c 0.596954,0.05887 1.04326,0.137305 1.216256,0.213823 0.0981,0.04344 0.189561,0.12854 0.235198,0.21896 0.08601,0.170462 0.226243,0.687839 0.303984,1.121803 0.153044,0.854198 0.104262,1.629242 -0.16305,2.590391 -0.08412,0.302605 -0.139822,0.434653 -0.218589,0.518609 -0.138246,0.147338 -0.522565,0.238473 -1.348615,0.319808 l -0.335805,0.0331 -0.277042,0.14009 c -0.496631,0.251134 -0.965794,0.377985 -1.611884,0.435808 -0.35012,0.03129 -8.733467,0.03189 -9.1175547,5.69e-4 -0.6601552,-0.05378 -1.2013714,-0.200007 -1.6801359,-0.453951 -0.098125,-0.05206 -0.1498116,-0.06826 -0.2442131,-0.07662 -0.065847,-0.006 -0.1678593,-0.02499 -0.2266738,-0.04275 -0.05878,-0.01767 -0.2655963,-0.0518 -0.4595188,-0.07585 C 6.3912287,16.764537 6.1913765,16.692028 6.0776776,16.4675 6.0255336,16.364497 5.8912448,15.904677 5.8314304,15.624247 5.8166924,15.554947 5.7978174,15.468092 5.7896294,15.431152 5.7145594,15.094537 5.6685873,14.38872 5.7005374,14.06274 Z"
id="path1062" />
<path
id="path_3"
d="m 9.388,13.204 h 9.841 c 0.29,0 0.568,0.115 0.774,0.32 0.205,0.206 0.32,0.484 0.32,0.774 v 0.228 c 0,0.29 -0.115,0.568 -0.32,0.774 -0.206,0.205 -0.484,0.32 -0.774,0.32 H 9.39 C 9.198,15.62 9.009,15.57 8.843,15.474 8.676,15.378 8.538,15.24 8.442,15.073 8.346,14.907 8.295,14.718 8.295,14.526 v -0.228 c 0,-0.29 0.115,-0.568 0.32,-0.774 0.206,-0.205 0.484,-0.32 0.774,-0.32 z"
fill="#ffffff"
stroke="#ffffff"
stroke-width="2.22514"
style="fill:#4dabf5;fill-opacity:1;stroke:#4dabf5;stroke-opacity:1" />
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Original"
style="display:none"
sodipodi:insensitive="true">
<image
y="0.0079936879"
x="0.010951031"
id="image4124"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAA3NCSVQICAjb4U/gAAAACXBIWXMA ADFOAAAxTgGacD5yAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAABF0RVh0 VGl0bGUAUGViYmxlIEljb26KvwD9AAAADHRFWHRBdXRob3IAeHBobnh/4OzMAAAAY3RFWHRDb3B5 cmlnaHQAQ0MgQXR0cmlidXRpb24tTm9uQ29tbWVyY2lhbC1TaGFyZUFsaWtlIGh0dHA6Ly9jcmVh dGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC/eBBrlAAABy1BMVEUAAAAAAAAA AP8AAIAAAFUAAKoAVaoAAIAAQIAAM2YAM5kzM2YzM5krK4AkJG0kJJIgIIAcHHEcHI4aGoAXF3QX F4sXLnQXLosVK4AUJ3YUJ4kSJIAkJIARInciInciIogQIIAgIIAeHngeHoccHIAcK4AbKHkbKIYa GoAaJoAYJHkXI4AXI4sWIXoWIYUVIIAfH3ofH4UdJ4ATHIQcJnsbJIAaI4QaIoAZIXsZIYQYIHgY IIAXH4MXJ3wXHoAXJoBLpfAWJHwdJHwdJIMcI4Acas0VIoMbIoAaIXwaIIAZH3wZH4MZJXwYHoAY HoYYJIAehtsYHoIefdtHoO0jetZGovNEn+4gg+EfgN5Ep/VKqfREpvQgfdkgfttKqvQggd4hjesw nPMwnPRJqfUhgd4hjutJqfUgfttNq/VNq/QhlPEhlPIhlvMkmPMglvIff9sgjeoglPAhk/AhlPEh lPIhlvMkl/MkmPMlmPMmmPMnmfMpmvMzn/Q0n/Q1n/Q2oPRIqfVNq/VasfZbsvZhtPZitfdtuveQ yvmXzvmj0/qk1Pqu2fu83/vR6f3T6v3Z7f3i8f3j8v3l8/7m8/7p9f7q9f7x+P7y+f7////ougeB AAAAb3RSTlMAAQECAwMDBAQFBQUFBgcHCAkJCgsLCwsMDQ0ODg8PDxAQERESEhMTFBQVFhYXFxgZ GRobGxwdHh8fICAhISIiIiMjIyQkJSYnKCkpKSoqKiorKyssLC2xs7O0tba2tu7u7u7u7+/w8fHy +/v7+/ywJhX9AAAC0klEQVRo3u2a+VfTQBCAm00iW0nSTVNKbKQYbIMUC6jU4q2IB2rF+74vPEAR LSjIIXgAAiqef65py6MNJe17y1RF8/26L/N1N9O8ZGZcLof/DiYFoiV1cZHwiGVZjh7zalRAYYbn sFsQ6RFwGccyBeJjwSMrPn8lHX6fQqRy3tbAsFiU1So9FA4bNIRD63XNTwTO5pSYc9fuvwbgwaW9 SxqYs/eGBgcAGBy+fRrlpRPDsJdfJoEYuMgvzibz/vK3kmDcFMuxNZvM/BG74QTdFV6PJZsYlhe9 XXCCrlCVStwcyhG45QCkoCmiV0o4uwXEib4aQMHjbc0RTXYvCMx/mGdNHaSgraWxRhEXzsgUEC0C KWjfszlUYRWsrYcUHGttNlSRzxUEo5CCjrZYrSqVVlD3Nwj6vqcZsovzKrPeTy3o/5lmxE4wnFl/ 4QhKLvjy2YY5IEExHMH0B1umQQSj9o+EUUewIBh/m8c4qOBbfu58dQRLCmYnJmZLKphKJicdwR8X vJsymSmhIM37FSv4OJlhxnlUOAJHAC8Ye5PHmPNe9PsEJX/5dT5AigvmPtkw53wnr3xB34809uWc zDp9OWflV7xgBaBlzY79MWORALhuui+vbhoArfwe3rUp5MtWfl2Il1QDUtAaj+rKakv1XdEhBfGm Wo1kq+/pM1Ih+wdRI6iIq3IFvEAewgke6QHFg1mU26PjhbtwghsKEbG1X8ew3PmnUPGfXRAwv7hr yqAD13t6nwPQ23PnBMeivG4gg85c7XwCQOeVU+avZ5bslcrrNm7dfehIInGSguOJo+0Hd27ZoOam j3ULvOjTI02x+PYddLTEY42GJpfnpo/L0g50k8pqI1IfbWikoSFaXxfSFKnMrqFsZpKbKKoWDFbT EdQCqlfCdhtIG7AoESLTQogk4EJd/VRTn8fLgecKTg3MjyUsA4SKDD7MT1bQ8++NmvwCRmydh2Fg UvEAAAAASUVORK5CYII= "
style="opacity:0.49074079;image-rendering:optimizeQuality"
preserveAspectRatio="none"
height="28.710279"
width="28.710279" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -0,0 +1,215 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg2"
width="28.740126"
height="28.740126"
viewBox="0 0 28.740126 28.740126"
sodipodi:docname="ic_device_sony_800n.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 14.370063 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="28.740126 : 14.370063 : 1"
inkscape:persp3d-origin="14.370063 : 9.580042 : 1"
id="perspective903" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1035"
id="namedview4"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="22.627418"
inkscape:cx="8.8167373"
inkscape:cy="16.373941"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
inkscape:pagecheckerboard="0">
<inkscape:grid
type="xygrid"
id="grid972" />
</sodipodi:namedview>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Background"
style="display:inline">
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Bottom"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#1f7fdb;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-5"
width="22.819572"
height="21.904638"
x="2.9239759"
y="3.8768768"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Middle"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#4dabf5;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-7"
width="22.819572"
height="21.904638"
x="2.9317887"
y="3.0349438"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Top"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="fill:#2196f3;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817"
width="22.819572"
height="21.904638"
x="2.9238882"
y="3.4130721"
ry="0.9472276" />
</g>
<g
id="g2458"
transform="translate(0.01135305,-0.15009041)">
<g
id="g2347">
<path
id="path13615-2"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 7.279849,6.2422412 c -0.03346,0.01692 -0.06557,0.03428 -0.09731,0.05262 -0.03173,0.01835 -0.06309,0.03768 -0.09514,0.05843 -0.03205,0.02076 -0.06477,0.04295 -0.09916,0.0671 -0.03438,0.02415 -0.07046,0.05023 -0.109229,0.07876 -0.02534,0.01848 -0.05048,0.03753 -0.07551,0.05707 -0.02503,0.01954 -0.0499,0.0396 -0.07456,0.06013 -0.04934,0.04106 -0.09793,0.084 -0.145486,0.128648 -0.04756,0.04465 -0.09414,0.091 -0.139497,0.138751 -0.04536,0.04774 -0.08948,0.09688 -0.132231,0.147218 -0.04275,0.05034 -0.08411,0.101873 -0.123825,0.15432 -0.0397,0.05244 -0.07777,0.105815 -0.114003,0.159856 -0.03625,0.05404 -0.07062,0.108751 -0.102975,0.163896 -0.01618,0.02756 -0.0319,0.05524 -0.04703,0.08299 -0.01513,0.02775 -0.02969,0.05557 -0.04371,0.08346 -0.03618,0.07192 -0.06927,0.14029 -0.09954,0.205974 -0.03028,0.0657 -0.05776,0.1287 -0.08266,0.190082 -0.02488,0.06138 -0.04721,0.121101 -0.06723,0.180116 -0.01,0.02952 -0.01941,0.05886 -0.0283,0.08813 -0.009,0.02927 -0.01728,0.05852 -0.0251,0.08781 -0.0078,0.02929 -0.01514,0.05865 -0.02198,0.0882 -0.0069,0.02954 -0.01321,0.05927 -0.01911,0.0893 -0.01181,0.06007 -0.02184,0.12132 -0.03033,0.184805 -0.0086,0.06349 -0.01548,0.129192 -0.02116,0.198028 -0.0057,0.06884 -0.01012,0.140872 -0.01351,0.216987 -0.0025,0.05629 -0.0043,0.110992 -0.0052,0.16448 -8.64e-4,0.05349 -9.69e-4,0.105698 -6.4e-5,0.156926 8.64e-4,0.05122 0.0027,0.101473 0.0056,0.150996 0.0029,0.04952 0.0067,0.09832 0.01168,0.146697 0.0049,0.04837 0.01103,0.09631 0.01829,0.144095 0.0073,0.04777 0.01565,0.09538 0.02537,0.1431138 0.0097,0.04773 0.02073,0.09559 0.03307,0.143831 0.01233,0.04823 0.02603,0.09688 0.04117,0.146177 0.01514,0.04931 0.03172,0.0993 0.04983,0.150215 0.01811,0.05092 0.03775,0.102736 0.05902,0.155817 0.02125,0.05309 0.04414,0.107386 0.0687,0.163179 0.02456,0.0558 0.05079,0.113155 0.07883,0.172233 0.02805,0.05908 0.0579,0.119891 0.0896,0.182787 0.03169,0.0629 0.06523,0.127824 0.100756,0.195098 0.03552,0.06727 0.07298,0.136893 0.112485,0.209101 0.03951,0.07221 0.08105,0.147045 0.124707,0.224738 0.06395,0.110373 0.12747,0.218614 0.190476,0.324728 0.063,0.10611 0.12555,0.210119 0.187612,0.312027 0.06207,0.101911 0.123617,0.201698 0.184741,0.299454 0.06112,0.09775 0.121762,0.19342 0.181938,0.287076 0.06017,0.09366 0.119894,0.185283 0.179133,0.274895 0.05924,0.08961 0.118038,0.177222 0.176331,0.262845 0.05829,0.08562 0.116105,0.1693 0.173462,0.250989 0.05736,0.08169 0.114249,0.161388 0.170659,0.239198 0.05641,0.0778 0.112317,0.153684 0.167791,0.227668 0.05546,0.07399 0.110513,0.14612 0.165051,0.216333 0.05453,0.07022 0.108593,0.138504 0.162182,0.204999 0.0027,0.0033 0.0053,0.0064 0.008,0.0098 C 8.00872,14.732698 7.120877,13.942779 6.658257,13.361473 5.598455,12.029821 5.055189,10.452858 5.217346,9.1790022 5.365603,8.0143522 5.882,7.0633652 6.841532,6.1881132 7.079748,5.9708212 7.106058,5.9999142 7.175394,6.0213522 7.413036,6.1657852 7.440231,6.1534602 7.2799,6.2422692 Z"
sodipodi:nodetypes="cssscssssssssssssssssssssssssssssssssssscsssssssssssccsscc" />
<path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 11.577603,11.492866 c 0.322335,-0.01399 0.357232,0.03938 0.593611,-0.181212 0.221983,-0.240393 0.274315,-0.351823 0.276651,-0.568905 0.0025,-0.225226 -0.0071,-0.251559 -0.197844,-0.709979 C 11.842608,9.0532972 11.354715,8.0707792 11.126601,7.7704282 10.78476,7.3203352 10.29549,6.9914762 9.74677,6.8222662 9.333842,6.6949312 8.625467,6.7136062 8.182495,6.8635162 6.779112,7.3384312 6.027958,8.8521302 6.491449,10.27125 c 0.271605,0.831606 0.705445,1.281983 1.214295,1.281983 z"
id="path3272-6"
sodipodi:nodetypes="ccsssssscc" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
id="path16756-1"
sodipodi:type="arc"
sodipodi:cx="-12.009243"
sodipodi:cy="12.377947"
sodipodi:rx="0.19409445"
sodipodi:ry="0.19840427"
sodipodi:start="0.57990659"
sodipodi:end="0.54828965"
sodipodi:arc-type="arc"
sodipodi:open="true"
d="m -11.84688,12.486662 a 0.19409445,0.19840427 0 0 1 -0.26743,0.05811 0.19409445,0.19840427 0 0 1 -0.05896,-0.2729 0.19409445,0.19840427 0 0 1 0.266498,-0.06242 0.19409445,0.19840427 0 0 1 0.06317,0.271913"
transform="scale(-1,1)" />
<path
id="rect20090-0"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
d="m 11.857757,10.952689 -3.825845,0.06844 c -0.144962,0.0026 -0.261704,0.119311 -0.261704,0.267512 0,0.148204 0.11674,0.270106 0.261704,0.267514 l 3.825845,-0.06844 c 0.144962,-0.0026 0.261704,-0.119312 0.261704,-0.267515 0,-0.148201 -0.116741,-0.270105 -0.261704,-0.267511 z"
sodipodi:nodetypes="sssssss" />
<path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 12.18194,17.216199 c 0.624312,-0.131607 1.333297,-0.60414 1.680554,-1.120063 0.529917,-0.787312 0.660533,-1.614976 0.412007,-2.610703 -0.445153,-1.783509 -1.737094,-5.0026358 -2.421826,-6.0344618 -0.48947,-0.737586 -1.146722,-1.225567 -1.985164,-1.473899 -0.284388,-0.08423 -0.549789,-0.118307 -0.970098,-0.126588 -0.24378,-0.0048 -0.652706,0.03674 -1.040841,0.17381 -0.485591,0.168758 -0.640212,0.230083 -0.950323,0.458278 -0.405441,0.295742 -0.788291,0.729017 -1.012688,1.175025 -0.289449,0.575304 -0.391516,0.937594 -0.418687,1.546511 -0.04019,0.9006898 0.117467,1.4116638 0.816102,2.6547258 1.00275,1.681382 1.225081,2.020621 2.371836,3.434141 0.232245,0.299614 0.629643,0.75695 0.883104,1.016312 0.372595,0.381249 0.523321,0.502467 0.787118,0.633023 0.598301,0.296089 1.270931,0.395727 1.848906,0.273889 z"
id="path5762-6"
sodipodi:nodetypes="ssssssccssccsss" />
</g>
<g
id="g2347-1"
style="display:inline"
transform="matrix(-1,0,0,1,28.780726,6.499701)">
<path
id="path13615-2-5"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 7.279849,6.2422412 c -0.03346,0.01692 -0.06557,0.03428 -0.09731,0.05262 -0.03173,0.01835 -0.06309,0.03768 -0.09514,0.05843 -0.03205,0.02076 -0.06477,0.04295 -0.09916,0.0671 -0.03438,0.02415 -0.07046,0.05023 -0.109229,0.07876 -0.02534,0.01848 -0.05048,0.03753 -0.07551,0.05707 -0.02503,0.01954 -0.0499,0.0396 -0.07456,0.06013 -0.04934,0.04106 -0.09793,0.084 -0.145486,0.128648 -0.04756,0.04465 -0.09414,0.091 -0.139497,0.138751 -0.04536,0.04774 -0.08948,0.09688 -0.132231,0.147218 -0.04275,0.05034 -0.08411,0.101873 -0.123825,0.15432 -0.0397,0.05244 -0.07777,0.105815 -0.114003,0.159856 -0.03625,0.05404 -0.07062,0.108751 -0.102975,0.163896 -0.01618,0.02756 -0.0319,0.05524 -0.04703,0.08299 -0.01513,0.02775 -0.02969,0.05557 -0.04371,0.08346 -0.03618,0.07192 -0.06927,0.14029 -0.09954,0.205974 -0.03028,0.0657 -0.05776,0.1287 -0.08266,0.190082 -0.02488,0.06138 -0.04721,0.121101 -0.06723,0.180116 -0.01,0.02952 -0.01941,0.05886 -0.0283,0.08813 -0.009,0.02927 -0.01728,0.05852 -0.0251,0.08781 -0.0078,0.02929 -0.01514,0.05865 -0.02198,0.0882 -0.0069,0.02954 -0.01321,0.05927 -0.01911,0.0893 -0.01181,0.06007 -0.02184,0.12132 -0.03033,0.184805 -0.0086,0.06349 -0.01548,0.129192 -0.02116,0.198028 -0.0057,0.06884 -0.01012,0.140872 -0.01351,0.216987 -0.0025,0.05629 -0.0043,0.110992 -0.0052,0.16448 -8.64e-4,0.05349 -9.69e-4,0.105698 -6.4e-5,0.156926 8.64e-4,0.05122 0.0027,0.101473 0.0056,0.150996 0.0029,0.04952 0.0067,0.09832 0.01168,0.146697 0.0049,0.04837 0.01103,0.09631 0.01829,0.144095 0.0073,0.04777 0.01565,0.09538 0.02537,0.1431138 0.0097,0.04773 0.02073,0.09559 0.03307,0.143831 0.01233,0.04823 0.02603,0.09688 0.04117,0.146177 0.01514,0.04931 0.03172,0.0993 0.04983,0.150215 0.01811,0.05092 0.03775,0.102736 0.05902,0.155817 0.02125,0.05309 0.04414,0.107386 0.0687,0.163179 0.02456,0.0558 0.05079,0.113155 0.07883,0.172233 0.02805,0.05908 0.0579,0.119891 0.0896,0.182787 0.03169,0.0629 0.06523,0.127824 0.100756,0.195098 0.03552,0.06727 0.07298,0.136893 0.112485,0.209101 0.03951,0.07221 0.08105,0.147045 0.124707,0.224738 0.06395,0.110373 0.12747,0.218614 0.190476,0.324728 0.063,0.10611 0.12555,0.210119 0.187612,0.312027 0.06207,0.101911 0.123617,0.201698 0.184741,0.299454 0.06112,0.09775 0.121762,0.19342 0.181938,0.287076 0.06017,0.09366 0.119894,0.185283 0.179133,0.274895 0.05924,0.08961 0.118038,0.177222 0.176331,0.262845 0.05829,0.08562 0.116105,0.1693 0.173462,0.250989 0.05736,0.08169 0.114249,0.161388 0.170659,0.239198 0.05641,0.0778 0.112317,0.153684 0.167791,0.227668 0.05546,0.07399 0.110513,0.14612 0.165051,0.216333 0.05453,0.07022 0.108593,0.138504 0.162182,0.204999 0.0027,0.0033 0.0053,0.0064 0.008,0.0098 C 8.00872,14.732698 7.120877,13.942779 6.658257,13.361473 5.598455,12.029821 5.055189,10.452858 5.217346,9.1790022 5.365603,8.0143522 5.882,7.0633652 6.841532,6.1881132 7.079748,5.9708212 7.106058,5.9999142 7.175394,6.0213522 7.413036,6.1657852 7.440231,6.1534602 7.2799,6.2422692 Z"
sodipodi:nodetypes="cssscssssssssssssssssssssssssssssssssssscsssssssssssccsscc" />
<path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.3;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 11.577603,11.492866 c 0.322335,-0.01399 0.357232,0.03938 0.593611,-0.181212 0.221983,-0.240393 0.274315,-0.351823 0.276651,-0.568905 0.0025,-0.225226 -0.0071,-0.251559 -0.197844,-0.709979 C 11.842608,9.0532972 11.354715,8.0707792 11.126601,7.7704282 10.78476,7.3203352 10.29549,6.9914762 9.74677,6.8222662 9.333842,6.6949312 8.625467,6.7136062 8.182495,6.8635162 6.779112,7.3384312 6.027958,8.8521302 6.491449,10.27125 c 0.271605,0.831606 0.705445,1.281983 1.214295,1.281983 z"
id="path3272-6-9"
sodipodi:nodetypes="ccsssssscc" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
id="path16756-1-4"
sodipodi:type="arc"
sodipodi:cx="-12.009243"
sodipodi:cy="12.377947"
sodipodi:rx="0.19409445"
sodipodi:ry="0.19840427"
sodipodi:start="0.57990659"
sodipodi:end="0.54828965"
sodipodi:arc-type="arc"
sodipodi:open="true"
transform="scale(-1,1)"
d="m -11.84688,12.486662 a 0.19409445,0.19840427 0 0 1 -0.26743,0.05811 0.19409445,0.19840427 0 0 1 -0.05896,-0.2729 0.19409445,0.19840427 0 0 1 0.266498,-0.06242 0.19409445,0.19840427 0 0 1 0.06317,0.271913" />
<path
id="rect20090-0-9"
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
d="m 11.857757,10.952689 -3.825845,0.06844 c -0.144962,0.0026 -0.261704,0.119311 -0.261704,0.267512 0,0.148204 0.11674,0.270106 0.261704,0.267514 l 3.825845,-0.06844 c 0.144962,-0.0026 0.261704,-0.119312 0.261704,-0.267515 0,-0.148201 -0.116741,-0.270105 -0.261704,-0.267511 z"
sodipodi:nodetypes="sssssss" />
<path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0.4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 12.18194,17.216199 c 0.624312,-0.131607 1.333297,-0.60414 1.680554,-1.120063 0.529917,-0.787312 0.660533,-1.614976 0.412007,-2.610703 -0.445153,-1.783509 -1.737094,-5.0026358 -2.421826,-6.0344618 -0.48947,-0.737586 -1.146722,-1.225567 -1.985164,-1.473899 -0.284388,-0.08423 -0.549789,-0.118307 -0.970098,-0.126588 -0.24378,-0.0048 -0.652706,0.03674 -1.040841,0.17381 -0.485591,0.168758 -0.640212,0.230083 -0.950323,0.458278 -0.405441,0.295742 -0.788291,0.729017 -1.012688,1.175025 -0.289449,0.575304 -0.391516,0.937594 -0.418687,1.546511 -0.04019,0.9006898 0.117467,1.4116638 0.816102,2.6547258 1.00275,1.681382 1.225081,2.020621 2.371836,3.434141 0.232245,0.299614 0.629643,0.75695 0.883104,1.016312 0.372595,0.381249 0.523321,0.502467 0.787118,0.633023 0.598301,0.296089 1.270931,0.395727 1.848906,0.273889 z"
id="path5762-6-0"
sodipodi:nodetypes="ssssssccssccsss" />
</g>
</g>
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Original"
style="display:none"
sodipodi:insensitive="true">
<image
y="0.0079936879"
x="0.010951031"
id="image4124"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAA3NCSVQICAjb4U/gAAAACXBIWXMA ADFOAAAxTgGacD5yAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAABF0RVh0 VGl0bGUAUGViYmxlIEljb26KvwD9AAAADHRFWHRBdXRob3IAeHBobnh/4OzMAAAAY3RFWHRDb3B5 cmlnaHQAQ0MgQXR0cmlidXRpb24tTm9uQ29tbWVyY2lhbC1TaGFyZUFsaWtlIGh0dHA6Ly9jcmVh dGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC/eBBrlAAABy1BMVEUAAAAAAAAA AP8AAIAAAFUAAKoAVaoAAIAAQIAAM2YAM5kzM2YzM5krK4AkJG0kJJIgIIAcHHEcHI4aGoAXF3QX F4sXLnQXLosVK4AUJ3YUJ4kSJIAkJIARInciInciIogQIIAgIIAeHngeHoccHIAcK4AbKHkbKIYa GoAaJoAYJHkXI4AXI4sWIXoWIYUVIIAfH3ofH4UdJ4ATHIQcJnsbJIAaI4QaIoAZIXsZIYQYIHgY IIAXH4MXJ3wXHoAXJoBLpfAWJHwdJHwdJIMcI4Acas0VIoMbIoAaIXwaIIAZH3wZH4MZJXwYHoAY HoYYJIAehtsYHoIefdtHoO0jetZGovNEn+4gg+EfgN5Ep/VKqfREpvQgfdkgfttKqvQggd4hjesw nPMwnPRJqfUhgd4hjutJqfUgfttNq/VNq/QhlPEhlPIhlvMkmPMglvIff9sgjeoglPAhk/AhlPEh lPIhlvMkl/MkmPMlmPMmmPMnmfMpmvMzn/Q0n/Q1n/Q2oPRIqfVNq/VasfZbsvZhtPZitfdtuveQ yvmXzvmj0/qk1Pqu2fu83/vR6f3T6v3Z7f3i8f3j8v3l8/7m8/7p9f7q9f7x+P7y+f7////ougeB AAAAb3RSTlMAAQECAwMDBAQFBQUFBgcHCAkJCgsLCwsMDQ0ODg8PDxAQERESEhMTFBQVFhYXFxgZ GRobGxwdHh8fICAhISIiIiMjIyQkJSYnKCkpKSoqKiorKyssLC2xs7O0tba2tu7u7u7u7+/w8fHy +/v7+/ywJhX9AAAC0klEQVRo3u2a+VfTQBCAm00iW0nSTVNKbKQYbIMUC6jU4q2IB2rF+74vPEAR LSjIIXgAAiqef65py6MNJe17y1RF8/26L/N1N9O8ZGZcLof/DiYFoiV1cZHwiGVZjh7zalRAYYbn sFsQ6RFwGccyBeJjwSMrPn8lHX6fQqRy3tbAsFiU1So9FA4bNIRD63XNTwTO5pSYc9fuvwbgwaW9 SxqYs/eGBgcAGBy+fRrlpRPDsJdfJoEYuMgvzibz/vK3kmDcFMuxNZvM/BG74QTdFV6PJZsYlhe9 XXCCrlCVStwcyhG45QCkoCmiV0o4uwXEib4aQMHjbc0RTXYvCMx/mGdNHaSgraWxRhEXzsgUEC0C KWjfszlUYRWsrYcUHGttNlSRzxUEo5CCjrZYrSqVVlD3Nwj6vqcZsovzKrPeTy3o/5lmxE4wnFl/ 4QhKLvjy2YY5IEExHMH0B1umQQSj9o+EUUewIBh/m8c4qOBbfu58dQRLCmYnJmZLKphKJicdwR8X vJsymSmhIM37FSv4OJlhxnlUOAJHAC8Ye5PHmPNe9PsEJX/5dT5AigvmPtkw53wnr3xB34809uWc zDp9OWflV7xgBaBlzY79MWORALhuui+vbhoArfwe3rUp5MtWfl2Il1QDUtAaj+rKakv1XdEhBfGm Wo1kq+/pM1Ih+wdRI6iIq3IFvEAewgke6QHFg1mU26PjhbtwghsKEbG1X8ew3PmnUPGfXRAwv7hr yqAD13t6nwPQ23PnBMeivG4gg85c7XwCQOeVU+avZ5bslcrrNm7dfehIInGSguOJo+0Hd27ZoOam j3ULvOjTI02x+PYddLTEY42GJpfnpo/L0g50k8pqI1IfbWikoSFaXxfSFKnMrqFsZpKbKKoWDFbT EdQCqlfCdhtIG7AoESLTQogk4EJd/VRTn8fLgecKTg3MjyUsA4SKDD7MT1bQ8++NmvwCRmydh2Fg UvEAAAAASUVORK5CYII= "
style="opacity:0.49074079;image-rendering:optimizeQuality"
preserveAspectRatio="none"
height="28.710279"
width="28.710279" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 19 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
version="1.1"
id="svg2"
width="28.740126"
height="28.740126"
viewBox="0 0 28.740126 28.740126"
sodipodi:docname="ic_device_sony_overhead.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata8">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs6">
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 14.370063 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="28.740126 : 14.370063 : 1"
inkscape:persp3d-origin="14.370063 : 9.580042 : 1"
id="perspective903" />
</defs>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1035"
id="namedview4"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="14.060255"
inkscape:cx="16.038116"
inkscape:cy="16.820463"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
inkscape:pagecheckerboard="0">
<inkscape:grid
type="xygrid"
id="grid972" />
</sodipodi:namedview>
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="Background"
style="display:inline">
<g
inkscape:groupmode="layer"
id="layer4"
inkscape:label="Bottom"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#1f7fdb;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-5"
width="22.819572"
height="21.904638"
x="2.9239759"
y="3.8768768"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer3"
inkscape:label="Middle"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="display:inline;fill:#4dabf5;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817-7"
width="22.819572"
height="21.904638"
x="2.9317887"
y="3.0349438"
ry="0.9472276" />
</g>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Top"
style="display:inline"
sodipodi:insensitive="true">
<rect
style="fill:#2196f3;fill-opacity:1;stroke:none;stroke-width:3.57115;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect817"
width="22.819572"
height="21.904638"
x="2.9238882"
y="3.4130721"
ry="0.9472276" />
</g>
<path
style="fill:#fffffe;fill-opacity:1;stroke:#ffffff;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 11.787869,22.120059 c 0,0 -2.0910928,-0.292225 -2.6575991,-1.224839 C 8.591619,20.070641 8.1561259,19.180865 7.631892,18.347822 7.1090996,17.567626 7.597652,16.75833 7.689044,15.972138 7.681324,14.958429 7.4045423,13.938261 7.660211,12.932578 8.0157417,10.868804 9.1613178,8.9354471 10.817587,7.6863456 c 2.688723,-1.872765 6.803457,-1.2142137 8.663673,1.5537297 1.346536,1.7828427 2.026474,4.1325137 1.553678,6.3603877 -0.08676,0.923119 0.697056,1.927541 0.06127,2.790481 -0.596062,0.923479 -1.055471,1.947842 -1.712391,2.823233 -0.755807,0.595235 -2.691274,0.772608 -2.691274,0.772608 0,0 -1.514132,-0.618389 -1.649831,-1.431339 0.04222,-0.63115 0.500806,-1.13731 0.745842,-1.700974 0.841894,-1.549407 1.744777,-3.066705 2.737174,-4.521276 0.490354,-0.443872 1.602437,0.740266 1.564181,-0.407131 0.0762,-1.293714 -0.5099,-2.515494 -1.130701,-3.606183 C 18.440464,9.4639663 17.592752,8.8615802 16.642705,8.6047311 14.609615,7.9145591 12.211932,8.1319408 10.47655,9.4725077 9.3167635,10.728865 8.5844629,12.446821 8.637239,14.181989 c 0.3008752,0.859132 1.1571611,-0.488382 1.685694,0.352971 0.605742,0.619625 0.904223,1.470703 1.405699,2.171243 0.728953,1.200475 1.437492,2.419372 1.999338,3.711723 -0.01029,0.972211 -1.940049,1.702133 -1.940049,1.702133 z"
id="path4466"
sodipodi:nodetypes="cccccccccccccccccccccccc" />
</g>
<g
inkscape:groupmode="layer"
id="layer5"
inkscape:label="Original"
style="display:none"
sodipodi:insensitive="true">
<image
y="0.0079936879"
x="0.010951031"
id="image4124"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAMAAADVRocKAAAAA3NCSVQICAjb4U/gAAAACXBIWXMA ADFOAAAxTgGacD5yAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAABF0RVh0 VGl0bGUAUGViYmxlIEljb26KvwD9AAAADHRFWHRBdXRob3IAeHBobnh/4OzMAAAAY3RFWHRDb3B5 cmlnaHQAQ0MgQXR0cmlidXRpb24tTm9uQ29tbWVyY2lhbC1TaGFyZUFsaWtlIGh0dHA6Ly9jcmVh dGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzMuMC/eBBrlAAABy1BMVEUAAAAAAAAA AP8AAIAAAFUAAKoAVaoAAIAAQIAAM2YAM5kzM2YzM5krK4AkJG0kJJIgIIAcHHEcHI4aGoAXF3QX F4sXLnQXLosVK4AUJ3YUJ4kSJIAkJIARInciInciIogQIIAgIIAeHngeHoccHIAcK4AbKHkbKIYa GoAaJoAYJHkXI4AXI4sWIXoWIYUVIIAfH3ofH4UdJ4ATHIQcJnsbJIAaI4QaIoAZIXsZIYQYIHgY IIAXH4MXJ3wXHoAXJoBLpfAWJHwdJHwdJIMcI4Acas0VIoMbIoAaIXwaIIAZH3wZH4MZJXwYHoAY HoYYJIAehtsYHoIefdtHoO0jetZGovNEn+4gg+EfgN5Ep/VKqfREpvQgfdkgfttKqvQggd4hjesw nPMwnPRJqfUhgd4hjutJqfUgfttNq/VNq/QhlPEhlPIhlvMkmPMglvIff9sgjeoglPAhk/AhlPEh lPIhlvMkl/MkmPMlmPMmmPMnmfMpmvMzn/Q0n/Q1n/Q2oPRIqfVNq/VasfZbsvZhtPZitfdtuveQ yvmXzvmj0/qk1Pqu2fu83/vR6f3T6v3Z7f3i8f3j8v3l8/7m8/7p9f7q9f7x+P7y+f7////ougeB AAAAb3RSTlMAAQECAwMDBAQFBQUFBgcHCAkJCgsLCwsMDQ0ODg8PDxAQERESEhMTFBQVFhYXFxgZ GRobGxwdHh8fICAhISIiIiMjIyQkJSYnKCkpKSoqKiorKyssLC2xs7O0tba2tu7u7u7u7+/w8fHy +/v7+/ywJhX9AAAC0klEQVRo3u2a+VfTQBCAm00iW0nSTVNKbKQYbIMUC6jU4q2IB2rF+74vPEAR LSjIIXgAAiqef65py6MNJe17y1RF8/26L/N1N9O8ZGZcLof/DiYFoiV1cZHwiGVZjh7zalRAYYbn sFsQ6RFwGccyBeJjwSMrPn8lHX6fQqRy3tbAsFiU1So9FA4bNIRD63XNTwTO5pSYc9fuvwbgwaW9 SxqYs/eGBgcAGBy+fRrlpRPDsJdfJoEYuMgvzibz/vK3kmDcFMuxNZvM/BG74QTdFV6PJZsYlhe9 XXCCrlCVStwcyhG45QCkoCmiV0o4uwXEib4aQMHjbc0RTXYvCMx/mGdNHaSgraWxRhEXzsgUEC0C KWjfszlUYRWsrYcUHGttNlSRzxUEo5CCjrZYrSqVVlD3Nwj6vqcZsovzKrPeTy3o/5lmxE4wnFl/ 4QhKLvjy2YY5IEExHMH0B1umQQSj9o+EUUewIBh/m8c4qOBbfu58dQRLCmYnJmZLKphKJicdwR8X vJsymSmhIM37FSv4OJlhxnlUOAJHAC8Ye5PHmPNe9PsEJX/5dT5AigvmPtkw53wnr3xB34809uWc zDp9OWflV7xgBaBlzY79MWORALhuui+vbhoArfwe3rUp5MtWfl2Il1QDUtAaj+rKakv1XdEhBfGm Wo1kq+/pM1Ih+wdRI6iIq3IFvEAewgke6QHFg1mU26PjhbtwghsKEbG1X8ew3PmnUPGfXRAwv7hr yqAD13t6nwPQ23PnBMeivG4gg85c7XwCQOeVU+avZ5bslcrrNm7dfehIInGSguOJo+0Hd27ZoOam j3ULvOjTI02x+PYddLTEY42GJpfnpo/L0g50k8pqI1IfbWikoSFaXxfSFKnMrqFsZpKbKKoWDFbT EdQCqlfCdhtIG7AoESLTQogk4EJd/VRTn8fLgecKTg3MjyUsA4SKDD7MT1bQ8++NmvwCRmydh2Fg UvEAAAAASUVORK5CYII= "
style="opacity:0.49074079;image-rendering:optimizeQuality"
preserveAspectRatio="none"
height="28.710279"
width="28.710279" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="12.321217mm"
height="12.3mm"
viewBox="0 0 12.321217 12.3"
version="1.1"
id="svg3988"
sodipodi:docname="ic_sony_wf_800n_right.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview3990"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
fit-margin-left="2"
fit-margin-right="2"
fit-margin-bottom="1"
fit-margin-top="1"
inkscape:zoom="10.248373"
inkscape:cx="5.7082231"
inkscape:cy="32.639327"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<sodipodi:guide
position="7.864604,2.6305704"
orientation="0,-1"
id="guide4472" />
<sodipodi:guide
position="3.8004999,2.3743318"
orientation="1,0"
id="guide14199" />
</sodipodi:namedview>
<defs
id="defs3985" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-81.704318,-153.92826)">
<path
id="path13615-2-5"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 90.053204,155.41797 c 0.02931,0.0131 0.05714,0.0295 0.0848,0.0455 0.02766,0.0164 0.05496,0.0328 0.08289,0.0508 0.02799,0.0164 0.05645,0.0373 0.08642,0.0583 0.02997,0.0196 0.06139,0.0436 0.09518,0.0681 0.02207,0.0164 0.044,0.0328 0.0658,0.0495 0.02174,0.0164 0.04347,0.0344 0.06498,0.0521 0.04298,0.0357 0.08533,0.0727 0.12676,0.11136 0.04143,0.0386 0.08204,0.0789 0.121557,0.12021 0.03952,0.0413 0.07795,0.0839 0.115234,0.12741 0.03725,0.0436 0.07328,0.0881 0.10789,0.13364 0.03458,0.0455 0.06778,0.0917 0.09933,0.13855 0.03162,0.0468 0.06155,0.0943 0.08974,0.14215 0.01416,0.0229 0.02766,0.0478 0.04097,0.0721 0.01317,0.0229 0.02602,0.0482 0.0381,0.0724 0.03162,0.0622 0.06037,0.12152 0.08675,0.17851 0.02635,0.057 0.05032,0.11169 0.07203,0.16475 0.02174,0.0531 0.04113,0.10482 0.05859,0.15624 0.0086,0.0262 0.0168,0.0511 0.0247,0.0763 0.0079,0.0262 0.01515,0.0508 0.02174,0.076 0.0069,0.0262 0.01317,0.0508 0.0191,0.0763 0.0059,0.0262 0.01153,0.0514 0.0168,0.0773 0.01021,0.0521 0.0191,0.10514 0.02635,0.16017 0.0076,0.055 0.0135,0.11202 0.01844,0.17163 0.0049,0.0596 0.0089,0.12218 0.01186,0.18801 0.0022,0.0488 0.0036,0.0963 0.0046,0.14248 7.51e-4,0.0465 8.43e-4,0.0917 5.6e-5,0.13593 -7.54e-4,0.0442 -0.0024,0.0878 -0.0049,0.13069 -0.0025,0.0429 -0.0059,0.0852 -0.01021,0.12709 -0.0043,0.0419 -0.0096,0.0835 -0.01581,0.12479 -0.0063,0.0413 -0.0135,0.0825 -0.02206,0.12414 -0.0086,0.0413 -0.01811,0.0829 -0.02898,0.12479 -0.01087,0.0419 -0.02272,0.0839 -0.03586,0.12676 -0.01317,0.0429 -0.02766,0.0861 -0.04341,0.13036 -0.01581,0.0442 -0.03293,0.0891 -0.05141,0.13495 -0.01844,0.0459 -0.03847,0.093 -0.05987,0.1415 -0.02141,0.0485 -0.04426,0.0979 -0.0687,0.14936 -0.02437,0.0511 -0.05045,0.10383 -0.07809,0.15853 -0.02766,0.0544 -0.05684,0.1107 -0.0878,0.16901 -0.03096,0.0583 -0.06359,0.11857 -0.09801,0.18113 -0.03441,0.0626 -0.07061,0.12741 -0.10868,0.19488 -0.05572,0.0957 -0.111084,0.18932 -0.165984,0.28136 -0.0549,0.092 -0.109405,0.18211 -0.163481,0.27022 -0.05408,0.0884 -0.107725,0.17491 -0.160978,0.25942 -0.05325,0.0848 -0.106112,0.1677 -0.158542,0.24893 -0.05243,0.0812 -0.104464,0.16049 -0.156104,0.23812 -0.05161,0.0776 -0.10285,0.15362 -0.153634,0.22764 -0.05078,0.074 -0.101171,0.14674 -0.151131,0.21749 -0.04999,0.0708 -0.09956,0.13986 -0.148694,0.20733 -0.04914,0.0675 -0.09788,0.13331 -0.146191,0.19718 -0.04831,0.0642 -0.0963,0.12676 -0.14382,0.18736 -0.04752,0.0609 -0.09462,0.11988 -0.141317,0.17752 -0.0024,0.003 -0.0046,0.007 -0.0069,0.01 0.194966,-0.0262 0.968613,-0.71204 1.37172,-1.21583 0.923471,-1.15403 1.396852,-2.52066 1.255554,-3.62461 -0.129197,-1.00932 -0.579152,-1.83344 -1.415251,-2.59196 -0.207579,-0.18834 -0.2305,-0.16312 -0.290933,-0.14445 -0.207085,0.12512 -0.230764,0.11464 -0.09106,0.19161 z"
sodipodi:nodetypes="cssscssssssssssssssssssssssssssssssssssscsssssssssssccsscc" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 86.308307,159.96828 c -0.280855,-0.0131 -0.311286,0.0341 -0.517248,-0.1569 -0.193417,-0.20831 -0.23903,-0.30494 -0.241072,-0.49305 -0.0022,-0.19521 0.0063,-0.21814 0.172406,-0.61528 0.355002,-0.84882 0.780135,-1.7003 0.978905,-1.96057 0.297882,-0.39006 0.724197,-0.67506 1.20233,-0.8217 0.35981,-0.11038 0.97706,-0.0943 1.363049,0.0357 1.222855,0.41159 1.877382,1.7234 1.473514,2.95321 -0.236659,0.72069 -0.614698,1.11099 -1.05809,1.11099 z"
id="path3272-6-9"
sodipodi:nodetypes="ccsssssscc" />
<path
id="rect20090-0-9"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
d="m 86.064192,159.50015 3.333695,0.0593 c 0.126299,0.002 0.22803,0.1035 0.22803,0.2319 0,0.12839 -0.101731,0.23419 -0.22803,0.2319 l -3.333695,-0.0593 c -0.126299,-0.002 -0.22803,-0.1035 -0.22803,-0.2319 0,-0.12839 0.101731,-0.23419 0.22803,-0.2319 z"
sodipodi:nodetypes="sssssss" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 85.781713,164.92823 c -0.544003,-0.11398 -1.161783,-0.52357 -1.464372,-0.97067 -0.461748,-0.6823 -0.575563,-1.39958 -0.359006,-2.26249 0.387889,-1.54563 1.513636,-4.33537 2.110287,-5.22959 0.426503,-0.63919 0.999207,-1.06208 1.729794,-1.27731 0.247791,-0.073 0.479065,-0.10252 0.845307,-0.10973 0.21242,-0.003 0.568742,0.0328 0.906948,0.15067 0.423124,0.14609 0.557855,0.19948 0.828076,0.39715 0.353286,0.25613 0.686884,0.63179 0.882416,1.01829 0.252204,0.49858 0.341154,0.81253 0.364829,1.34023 0.03501,0.78057 -0.102357,1.2234 -0.71112,2.30065 -0.873758,1.45714 -1.067488,1.7511 -2.066729,2.97611 -0.202375,0.25974 -0.548646,0.65597 -0.7695,0.88076 -0.324657,0.33039 -0.456002,0.43543 -0.685867,0.54856 -0.521335,0.25647 -1.10744,0.34297 -1.611063,0.23747 z"
id="path5762-6-0"
sodipodi:nodetypes="ssssssccssccsss" />
<g
aria-label="L"
id="text6720"
style="font-size:3.175px;font-family:Sans;-inkscape-font-specification:Sans;letter-spacing:0px;word-spacing:0px;stroke:#000000;stroke-width:0.264583px"
transform="translate(-1.0010411,0.02155759)">
<g
id="path14201">
<path
style="color:#000000;-inkscape-font-specification:Sans;fill:#000000;stroke:none;-inkscape-stroke:none"
d="m 86.637918,161.02382 h 0.313159 v 2.05104 h 1.127063 v 0.26355 h -1.440222 z"
id="path14206" />
<path
style="color:#000000;-inkscape-font-specification:Sans;fill:#000000;stroke:none;-inkscape-stroke:none"
d="m 86.505859,160.89062 v 0.13282 2.44726 h 1.705078 v -0.52734 h -1.126953 v -2.05274 z m 0.263672,0.26563 h 0.04883 v 2.05078 h -0.04883 z"
id="path14208" />
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="12.321217mm"
height="12.3mm"
viewBox="0 0 12.321217 12.3"
version="1.1"
id="svg3988"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="ic_sony_wf_800n_left.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview3990"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
fit-margin-left="2"
fit-margin-right="2"
fit-margin-bottom="1"
fit-margin-top="1"
inkscape:zoom="28.986776"
inkscape:cx="25.201147"
inkscape:cy="32.44583"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<sodipodi:guide
position="8.0623995,2.7429643"
orientation="0,-1"
id="guide4472" />
<sodipodi:guide
position="4.9027758,5.5559637"
orientation="1,0"
id="guide14199" />
</sodipodi:namedview>
<defs
id="defs3985" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-81.704318,-153.92826)">
<g
aria-label="R"
id="text19879"
style="font-size:3.175px;font-family:Sans;-inkscape-font-specification:Sans;letter-spacing:0px;word-spacing:0px;stroke:#000000;stroke-width:0.264583px"
transform="translate(0.9003844,-0.00688411)">
<g
id="path20419">
<path
style="color:#000000;-inkscape-font-specification:Sans;fill:#000000;stroke:none;-inkscape-stroke:none"
d="m 88.752478,162.27504 q 0.100769,0.0341 0.195337,0.14573 0.09612,0.11162 0.192236,0.30696 l 0.31781,0.63251 h -0.336413 l -0.296106,-0.59376 q -0.114722,-0.23254 -0.223242,-0.30851 -0.106971,-0.076 -0.293006,-0.076 H 87.96803 v 0.97823 h -0.313159 v -2.31458 h 0.706933 q 0.396875,0 0.592212,0.16588 0.195337,0.16588 0.195337,0.50074 0,0.21859 -0.102319,0.36277 -0.100769,0.14418 -0.294556,0.19999 z m -0.784448,-0.97203 v 0.82165 h 0.393774 q 0.226343,0 0.341065,-0.10387 0.116272,-0.10542 0.116272,-0.30851 0,-0.20309 -0.116272,-0.3054 -0.114722,-0.10387 -0.341065,-0.10387 z"
id="path20424" />
<path
style="color:#000000;-inkscape-font-specification:Sans;fill:#000000;stroke:none;-inkscape-stroke:none"
d="m 87.523437,160.91406 v 2.57813 h 0.576172 v -0.97852 h 0.208985 c 0.106008,0 0.175,0.023 0.216797,0.0527 0.03834,0.0268 0.109953,0.1125 0.18164,0.25781 v 0.002 l 0.332031,0.66602 h 0.632813 l -0.414063,-0.82227 v -0.002 c -0.06683,-0.13558 -0.13491,-0.24575 -0.208984,-0.33203 -0.02289,-0.027 -0.05326,-0.036 -0.07813,-0.0586 0.06187,-0.0418 0.140739,-0.0643 0.183594,-0.125 0.08647,-0.12185 0.126953,-0.27308 0.126953,-0.43945 0,-0.24896 -0.07849,-0.46255 -0.242188,-0.60156 -0.163919,-0.1392 -0.39472,-0.19727 -0.677734,-0.19727 z m 0.263672,0.26367 h 0.04883 v 0.125 0.94727 0.008 0.97071 h -0.04883 z m 0.710938,0.0371 c 0.148175,0.0194 0.300592,0.0378 0.371094,0.0977 0.09675,0.0822 0.148437,0.20287 0.148437,0.40039 0,0.12509 -0.02817,0.21477 -0.07813,0.28516 V 162 c -0.03013,0.0431 -0.08781,0.0643 -0.136719,0.0918 0.0941,-0.098 0.148438,-0.22921 0.148438,-0.37891 0,-0.15997 -0.051,-0.3074 -0.160156,-0.4043 -0.07397,-0.067 -0.186918,-0.0752 -0.292969,-0.0937 z m -0.398438,0.22071 h 0.261719 c 0.130659,0 0.207561,0.0301 0.251953,0.0703 h 0.002 c 0.04492,0.0395 0.07227,0.0969 0.07227,0.20703 0,0.11015 -0.02802,0.1671 -0.07422,0.20898 -0.04439,0.0402 -0.121294,0.0703 -0.251953,0.0703 h -0.261719 z m 0.632813,0.70312 c -0.0069,0.002 -0.0083,0.008 -0.01563,0.01 l -0.0957,0.0273 v 0.1582 c -0.08301,-0.0446 -0.176683,-0.0726 -0.283203,-0.0762 h 0.02344 c 0.147723,0 0.267887,-0.0478 0.371094,-0.11914 z m -0.01172,0.26953 c 0.03608,0.0144 0.07838,0.0403 0.126953,0.0977 v 0.002 c 0.05341,0.062 0.113057,0.15579 0.173828,0.2793 l 0.222657,0.44141 h -0.04102 l -0.259766,-0.52149 c -0.06801,-0.13786 -0.140605,-0.22429 -0.222656,-0.29883 z"
id="path20426" />
</g>
</g>
<path
id="path13615-2-5"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 85.676646,155.41797 c -0.02931,0.0131 -0.05714,0.0295 -0.0848,0.0455 -0.02766,0.0164 -0.05496,0.0328 -0.08289,0.0508 -0.02799,0.0164 -0.05645,0.0373 -0.08642,0.0583 -0.02997,0.0196 -0.06139,0.0436 -0.09518,0.0681 -0.02207,0.0164 -0.044,0.0328 -0.0658,0.0495 -0.02174,0.0164 -0.04347,0.0344 -0.06498,0.0521 -0.04298,0.0357 -0.08533,0.0727 -0.12676,0.11136 -0.04143,0.0386 -0.08204,0.0789 -0.121557,0.12021 -0.03952,0.0413 -0.07795,0.0839 -0.115234,0.12741 -0.03725,0.0436 -0.07328,0.0881 -0.10789,0.13364 -0.03458,0.0455 -0.06778,0.0917 -0.09933,0.13855 -0.03162,0.0468 -0.06155,0.0943 -0.08974,0.14215 -0.01416,0.0229 -0.02766,0.0478 -0.04097,0.0721 -0.01317,0.0229 -0.02602,0.0482 -0.0381,0.0724 -0.03162,0.0622 -0.06037,0.12152 -0.08675,0.17851 -0.02635,0.057 -0.05032,0.11169 -0.07203,0.16475 -0.02174,0.0531 -0.04113,0.10482 -0.05859,0.15624 -0.0086,0.0262 -0.0168,0.0511 -0.0247,0.0763 -0.0079,0.0262 -0.01515,0.0508 -0.02174,0.076 -0.0069,0.0262 -0.01317,0.0508 -0.0191,0.0763 -0.0059,0.0262 -0.01153,0.0514 -0.0168,0.0773 -0.01021,0.0521 -0.0191,0.10514 -0.02635,0.16017 -0.0076,0.055 -0.0135,0.11202 -0.01844,0.17163 -0.0049,0.0596 -0.0089,0.12218 -0.01186,0.18801 -0.0022,0.0488 -0.0036,0.0963 -0.0046,0.14248 -7.51e-4,0.0465 -8.43e-4,0.0917 -5.6e-5,0.13593 7.54e-4,0.0442 0.0024,0.0878 0.0049,0.13069 0.0025,0.0429 0.0059,0.0852 0.01021,0.12709 0.0043,0.0419 0.0096,0.0835 0.01581,0.12479 0.0063,0.0413 0.0135,0.0825 0.02206,0.12414 0.0086,0.0413 0.01811,0.0829 0.02898,0.12479 0.01087,0.0419 0.02272,0.0839 0.03586,0.12676 0.01317,0.0429 0.02766,0.0861 0.04341,0.13036 0.01581,0.0442 0.03293,0.0891 0.05141,0.13495 0.01844,0.0459 0.03847,0.093 0.05987,0.1415 0.02141,0.0485 0.04426,0.0979 0.0687,0.14936 0.02437,0.0511 0.05045,0.10383 0.07809,0.15853 0.02766,0.0544 0.05684,0.1107 0.0878,0.16901 0.03096,0.0583 0.06359,0.11857 0.09801,0.18113 0.03441,0.0626 0.07061,0.12741 0.10868,0.19488 0.05572,0.0957 0.111084,0.18932 0.165984,0.28136 0.0549,0.092 0.109405,0.18211 0.163481,0.27022 0.05408,0.0884 0.107725,0.17491 0.160978,0.25942 0.05325,0.0848 0.106112,0.1677 0.158542,0.24893 0.05243,0.0812 0.104464,0.16049 0.156104,0.23812 0.05161,0.0776 0.10285,0.15362 0.153634,0.22764 0.05078,0.074 0.101171,0.14674 0.151131,0.21749 0.04999,0.0708 0.09956,0.13986 0.148694,0.20733 0.04914,0.0675 0.09788,0.13331 0.146191,0.19718 0.04831,0.0642 0.0963,0.12676 0.14382,0.18736 0.04752,0.0609 0.09462,0.11988 0.141317,0.17752 0.0024,0.003 0.0046,0.007 0.0069,0.01 -0.194966,-0.0262 -0.968613,-0.71204 -1.37172,-1.21583 -0.923471,-1.15403 -1.396852,-2.52066 -1.255554,-3.62461 0.129197,-1.00932 0.579152,-1.83344 1.415251,-2.59196 0.207579,-0.18834 0.2305,-0.16312 0.290933,-0.14445 0.207085,0.12512 0.230764,0.11464 0.09106,0.19161 z"
sodipodi:nodetypes="cssscssssssssssssssssssssssssssssssssssscsssssssssssccsscc" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.2;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 89.421543,159.96828 c 0.280855,-0.0131 0.311286,0.0341 0.517248,-0.1569 0.193417,-0.20831 0.23903,-0.30494 0.241072,-0.49305 0.0022,-0.19521 -0.0063,-0.21814 -0.172406,-0.61528 -0.355002,-0.84882 -0.780135,-1.7003 -0.978905,-1.96057 -0.297882,-0.39006 -0.724197,-0.67506 -1.20233,-0.8217 -0.35981,-0.11038 -0.97706,-0.0943 -1.363049,0.0357 -1.222855,0.41159 -1.877382,1.7234 -1.473514,2.95321 0.236659,0.72069 0.614698,1.11099 1.05809,1.11099 z"
id="path3272-6-9"
sodipodi:nodetypes="ccsssssscc" />
<path
id="rect20090-0-9"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
d="m 89.665658,159.50015 -3.333695,0.0593 c -0.126299,0.002 -0.22803,0.1035 -0.22803,0.2319 0,0.12839 0.101731,0.23419 0.22803,0.2319 l 3.333695,-0.0593 c 0.126299,-0.002 0.22803,-0.1035 0.22803,-0.2319 0,-0.12839 -0.101731,-0.23419 -0.22803,-0.2319 z"
sodipodi:nodetypes="sssssss" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 89.948137,164.92823 c 0.544003,-0.11398 1.161783,-0.52357 1.464372,-0.97067 0.461748,-0.6823 0.575563,-1.39958 0.359006,-2.26249 -0.387889,-1.54563 -1.513636,-4.33537 -2.110287,-5.22959 -0.426503,-0.63919 -0.999207,-1.06208 -1.729794,-1.27731 -0.247791,-0.073 -0.479065,-0.10252 -0.845307,-0.10973 -0.21242,-0.003 -0.568742,0.0328 -0.906948,0.15067 -0.423124,0.14609 -0.557855,0.19948 -0.828076,0.39715 -0.353286,0.25613 -0.686884,0.63179 -0.882416,1.01829 -0.252204,0.49858 -0.341154,0.81253 -0.364829,1.34023 -0.03501,0.78057 0.102357,1.2234 0.71112,2.30065 0.873758,1.45714 1.067488,1.7511 2.066729,2.97611 0.202375,0.25974 0.548646,0.65597 0.7695,0.88076 0.324657,0.33039 0.456002,0.43543 0.685867,0.54856 0.521335,0.25647 1.10744,0.34297 1.611063,0.23747 z"
id="path5762-6-0"
sodipodi:nodetypes="ssssssccssccsss" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.6 KiB

View File

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="75.157791mm"
height="91.070755mm"
viewBox="0 0 75.157791 91.070755"
version="1.1"
id="svg5"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="sony_800n.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.90583672"
inkscape:cx="7.1756861"
inkscape:cy="221.34232"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-77.71272,-89.542777)">
<path
id="path13615"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 135.66527,92.903517 c 0.27135,0.13426 0.53173,0.27201 0.7891,0.41755 0.25737,0.14554 0.51166,0.2989 0.77153,0.46353 0.25987,0.16464 0.52522,0.34072 0.80408,0.53227 0.27886,0.19155 0.57139,0.39849 0.88574,0.62477 0.20548,0.14663 0.4094,0.29769 0.61236,0.45268 0.20297,0.155 0.4046,0.31412 0.60462,0.47698 0.40003,0.32571 0.79411,0.6664 1.17977,1.02061 0.38566,0.35421 0.76333,0.72195 1.1312,1.10071 0.36786,0.37876 0.72564,0.76852 1.07228,1.16788 0.34664,0.399359 0.68209,0.808199 1.00408,1.224223 0.32198,0.41601 0.63058,0.83942 0.92449,1.26814 0.2939,0.42871 0.57269,0.86271 0.83509,1.30018 0.13119,0.21873 0.25869,0.43817 0.38137,0.65835 0.12268,0.22019 0.24077,0.44084 0.3545,0.66198 0.2934,0.57048 0.56166,1.11292 0.80719,1.634 0.24552,0.52109 0.4684,1.02093 0.67024,1.50792 0.20184,0.48699 0.38286,0.96066 0.54519,1.42886 0.0812,0.23409 0.15736,0.46691 0.22944,0.69918 0.0721,0.23227 0.1401,0.46424 0.2036,0.6966 0.0635,0.23235 0.12283,0.46534 0.17829,0.6997 0.0555,0.23435 0.10709,0.47021 0.15503,0.70848 0.0959,0.47653 0.17707,0.9624 0.24598,1.46606 0.0689,0.50366 0.12543,1.02488 0.17156,1.57096 0.0461,0.54609 0.082,1.11753 0.10956,1.72135 0.0204,0.44657 0.0346,0.88054 0.0419,1.30482 0.007,0.42429 0.008,0.8385 5.1e-4,1.24489 -0.007,0.40639 -0.022,0.80498 -0.045,1.19786 -0.023,0.39288 -0.0544,0.78 -0.0946,1.16375 -0.0402,0.38375 -0.0895,0.76407 -0.14831,1.14309 -0.0588,0.37901 -0.12693,0.75667 -0.20567,1.13533 -0.0787,0.37865 -0.16812,0.75833 -0.2682,1.14101 -0.10008,0.38269 -0.21104,0.76852 -0.33383,1.15962 -0.12279,0.39111 -0.25722,0.78775 -0.40411,1.19166 -0.14688,0.40391 -0.30617,0.81501 -0.47852,1.2361 -0.17236,0.4211 -0.35788,0.85183 -0.55707,1.2945 -0.1992,0.44266 -0.41182,0.89769 -0.63924,1.36632 -0.22742,0.46863 -0.46955,0.95107 -0.72657,1.45004 -0.25702,0.49898 -0.52901,1.01401 -0.817,1.54771 -0.288,0.5337 -0.59174,1.08599 -0.9121,1.65881 -0.32035,0.57283 -0.65722,1.16651 -1.0113,1.78284 -0.51856,0.87562 -1.03369,1.73426 -1.54461,2.57607 -0.51092,0.84181 -1.01808,1.66687 -1.52136,2.4753 -0.50327,0.80843 -1.00246,1.60008 -1.4981,2.37557 -0.49564,0.77548 -0.98736,1.5344 -1.47536,2.27738 -0.488,0.74297 -0.97226,1.46985 -1.45262,2.18074 -0.48037,0.7109 -0.95716,1.4059 -1.42989,2.08515 -0.47273,0.67925 -0.94154,1.34305 -1.40663,1.99109 -0.4651,0.64804 -0.92644,1.2803 -1.3839,1.89756 -0.45746,0.61726 -0.91081,1.21918 -1.36064,1.80609 -0.44982,0.58691 -0.89622,1.15918 -1.33842,1.71617 -0.44219,0.557 -0.8806,1.09875 -1.31516,1.62626 -0.0219,0.0266 -0.0432,0.051 -0.0651,0.0775 1.81453,-0.25165 9.01417,-6.51807 12.76563,-11.12956 8.5941,-10.56399 12.99952,-23.07404 11.68456,-33.17953 -1.20223,-9.23918 -5.38978,-16.783353 -13.17077,-23.726723 -1.93172,-1.72377 -2.14508,-1.49298 -2.70733,-1.32291 -1.92707,1.14579 -2.14761,1.048007 -0.84748,1.75253 z"
sodipodi:nodetypes="cssscssssssssssssssssssssssssssssssssssscsssssssssssccsscc" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 100.81415,134.55672 c -2.613864,-0.11093 -2.896844,0.31251 -4.813676,-1.43755 -1.8001,-1.90704 -2.224465,-2.79101 -2.24341,-4.51313 -0.01966,-1.78671 0.0581,-1.99561 1.60434,-5.63226 3.30378,-7.77016 7.260176,-15.56447 9.109986,-17.94715 2.77204,-3.57059 6.7396,-6.179423 11.18926,-7.521773 3.34849,-1.01016 9.09281,-0.86199 12.68493,0.32721 11.38024,3.767503 17.47147,15.775673 13.71295,27.033553 -2.20249,6.59712 -5.72057,10.16997 -9.8469,10.16997 z"
id="path3272"
sodipodi:nodetypes="ccsssssscc" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.377953;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
id="path16756"
sodipodi:type="arc"
sodipodi:cx="97.313911"
sodipodi:cy="141.57806"
sodipodi:rx="1.5739406"
sodipodi:ry="1.5739406"
sodipodi:start="0.57990659"
sodipodi:end="0.54828965"
sodipodi:arc-type="arc"
d="m 98.630535,142.4405 a 1.5739406,1.5739406 0 0 1 -2.168624,0.46096 1.5739406,1.5739406 0 0 1 -0.478091,-2.16491 1.5739406,1.5739406 0 0 1 2.161065,-0.49519 1.5739406,1.5739406 0 0 1 0.512255,2.15709"
sodipodi:open="true" />
<path
id="rect20090"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
d="m 98.542336,130.27149 31.024354,0.54286 c 1.17552,0.0206 2.12219,0.94649 2.12219,2.12218 0,1.1757 -0.94667,2.14276 -2.12219,2.12219 l -31.024354,-0.54286 c -1.175513,-0.0206 -2.122189,-0.94649 -2.122189,-2.12219 0,-1.17569 0.946676,-2.14275 2.122189,-2.12218 z"
sodipodi:nodetypes="sssssss" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 95.913493,179.95992 c -5.06264,-1.04405 -10.8119,-4.79262 -13.62787,-8.88549 -4.297169,-6.24572 -5.356359,-12.81158 -3.341019,-20.71068 3.609809,-14.14857 14.086349,-39.6859 19.638949,-47.87138 3.969187,-5.851261 9.298937,-9.722411 16.097997,-11.692431 2.30613,-0.6682 4.45831,-0.93852 7.86666,-1.00422 1.97685,-0.03811 5.29289,0.29142 8.44033,1.37883 3.93773,1.33876 5.19157,1.825243 7.70631,3.635523 3.28778,2.34611 6.39237,5.783278 8.21204,9.321468 2.34718,4.56389 3.17486,7.43793 3.3952,12.26847 0.32592,7.14516 -0.95256,11.19873 -6.6179,21.05994 -8.13144,13.33839 -9.93436,16.02958 -19.23356,27.24303 -1.88331,2.37684 -5.10587,6.0049 -7.16123,8.06236 -3.02143,3.0245 -4.24368,3.98612 -6.38286,5.02178 -4.8517,2.34889 -10.30616,3.13935 -14.993047,2.1728 z"
id="path5762"
sodipodi:nodetypes="ssssssccssccsss" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="12.321217mm"
height="12.3mm"
viewBox="0 0 12.321217 12.3"
version="1.1"
id="svg3988"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
sodipodi:docname="sony_800n_case.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview3990"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
fit-margin-left="2"
fit-margin-right="2"
fit-margin-bottom="1"
fit-margin-top="1"
inkscape:zoom="10.248373"
inkscape:cx="27.662928"
inkscape:cy="19.076199"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<sodipodi:guide
position="14.349871,-1.5160295"
orientation="0,-1"
id="guide4472" />
<sodipodi:guide
position="-3.9933874,14.528046"
orientation="1,0"
id="guide14199" />
</sodipodi:namedview>
<defs
id="defs3985" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-81.704318,-153.92826)">
<g
id="g26612"
transform="matrix(0.10330033,0,0,0.09696175,75.13823,137.28434)"
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.99595;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1">
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.99595;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 72.96681,225.65437 c 0.223576,0.58263 2.250534,1.71014 4.308817,2.39697 2.122774,0.70836 5.258828,1.34722 8.366393,1.70453 2.48165,0.28534 37.1587,1.1115 37.1587,1.1115 h 3.21119 c 0,0 34.67708,-0.82616 37.15873,-1.1115 3.10756,-0.35731 6.24361,-0.99617 8.36639,-1.70453 2.05828,-0.68683 4.08524,-1.81434 4.30882,-2.39697"
id="path23413"
sodipodi:nodetypes="cssccssc" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:4.99595;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 116.98218,265.2035 c -12.08548,-0.56413 -19.153432,-1.85996 -24.277133,-4.45093 -9.494531,-4.80122 -16.040643,-14.2392 -18.553206,-26.74943 -0.997929,-4.96876 -1.79383,-13.53037 -1.363114,-14.66323 1.002805,-2.63759 7.912285,-7.1158 15.890039,-10.29877 5.230526,-2.08687 12.919394,-3.81264 21.636084,-4.85622 5.58344,-0.66846 22.56789,-0.66846 28.15133,0 8.59247,1.02871 16.20658,2.72438 21.46386,4.78001 7.8805,3.08133 15.05476,7.72504 16.07321,10.40376 0.27311,0.71833 -0.11096,6.58993 -0.70631,10.79799 -1.49912,10.59604 -5.14752,18.6992 -11.07883,24.60625 -7.38953,7.3593 -14.41912,9.57903 -33.08072,10.44589 -6.13715,0.28508 -7.75734,0.28333 -14.15521,-0.0153 z"
id="path21760" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -100,6 +100,8 @@ import static nodomain.freeyourgadget.gadgetbridge.util.GB.NOTIFICATION_ID_ERROR
import androidx.multidex.MultiDex; import androidx.multidex.MultiDex;
import com.jakewharton.threetenabp.AndroidThreeTen;
/** /**
* Main Application class that initializes and provides access to certain things like * Main Application class that initializes and provides access to certain things like
* logging and DB access. * logging and DB access.
@ -115,7 +117,7 @@ public class GBApplication extends Application {
private static SharedPreferences sharedPrefs; private static SharedPreferences sharedPrefs;
private static final String PREFS_VERSION = "shared_preferences_version"; private static final String PREFS_VERSION = "shared_preferences_version";
//if preferences have to be migrated, increment the following and add the migration logic in migratePrefs below; see http://stackoverflow.com/questions/16397848/how-can-i-migrate-android-preferences-with-a-new-version //if preferences have to be migrated, increment the following and add the migration logic in migratePrefs below; see http://stackoverflow.com/questions/16397848/how-can-i-migrate-android-preferences-with-a-new-version
private static final int CURRENT_PREFS_VERSION = 11; private static final int CURRENT_PREFS_VERSION = 14;
private static LimitedQueue mIDSenderLookup = new LimitedQueue(16); private static LimitedQueue mIDSenderLookup = new LimitedQueue(16);
private static Prefs prefs; private static Prefs prefs;
@ -191,6 +193,9 @@ public class GBApplication extends Application {
return; return;
} }
// Initialize the timezones library
AndroidThreeTen.init(this);
sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context); sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
prefs = new Prefs(sharedPrefs); prefs = new Prefs(sharedPrefs);
gbPrefs = new GBPrefs(prefs); gbPrefs = new GBPrefs(prefs);
@ -380,6 +385,9 @@ public class GBApplication extends Application {
return VERSION.SDK_INT >= Build.VERSION_CODES.Q; return VERSION.SDK_INT >= Build.VERSION_CODES.Q;
} }
public static boolean isRunningTwelveOrLater() {
return VERSION.SDK_INT >= 31; // Build.VERSION_CODES.S, but our target SDK is lower
}
public static boolean isRunningPieOrLater() { public static boolean isRunningPieOrLater() {
return VERSION.SDK_INT >= Build.VERSION_CODES.P; return VERSION.SDK_INT >= Build.VERSION_CODES.P;
@ -430,11 +438,9 @@ public class GBApplication extends Application {
@TargetApi(Build.VERSION_CODES.M) @TargetApi(Build.VERSION_CODES.M)
public static int getGrantedInterruptionFilter() { public static int getGrantedInterruptionFilter() {
if (prefs.getBoolean("notification_filter", false) && GBApplication.isRunningMarshmallowOrLater()) { if (GBApplication.isRunningMarshmallowOrLater() && notificationManager.isNotificationPolicyAccessGranted()) {
if (notificationManager.isNotificationPolicyAccessGranted()) {
return notificationManager.getCurrentInterruptionFilter(); return notificationManager.getCurrentInterruptionFilter();
} }
}
return NotificationManager.INTERRUPTION_FILTER_ALL; return NotificationManager.INTERRUPTION_FILTER_ALL;
} }
@ -1072,6 +1078,71 @@ public class GBApplication extends Application {
Log.w(TAG, "error acquiring DB lock"); Log.w(TAG, "error acquiring DB lock");
} }
} }
if (oldVersion < 12) {
// Convert preferences that were wrongly migrated to int, since Android saves them as Strings internally
editor.putString("inactivity_warnings_threshold", String.valueOf(prefs.getInt("inactivity_warnings_threshold", 60)));
editor.putString("fitness_goal", String.valueOf(prefs.getInt("fitness_goal", 8000)));
}
if (oldVersion < 13) {
try (DBHandler db = acquireDB()) {
final DaoSession daoSession = db.getDaoSession();
final List<Device> activeDevices = DBHelper.getActiveDevices(daoSession);
for (Device dbDevice : activeDevices) {
final SharedPreferences deviceSharedPrefs = GBApplication.getDeviceSpecificSharedPrefs(dbDevice.getIdentifier());
final SharedPreferences.Editor deviceSharedPrefsEdit = deviceSharedPrefs.edit();
if (dbDevice.getManufacturer().equals("Huami")) {
deviceSharedPrefsEdit.putBoolean("inactivity_warnings_enable", prefs.getBoolean("inactivity_warnings_enable", false));
deviceSharedPrefsEdit.putString("inactivity_warnings_threshold", prefs.getString("inactivity_warnings_threshold", "60"));
deviceSharedPrefsEdit.putString("inactivity_warnings_start", prefs.getString("inactivity_warnings_start", "06:00"));
deviceSharedPrefsEdit.putString("inactivity_warnings_end", prefs.getString("inactivity_warnings_end", "22:00"));
deviceSharedPrefsEdit.putBoolean("inactivity_warnings_dnd", prefs.getBoolean("inactivity_warnings_dnd", false));
deviceSharedPrefsEdit.putString("inactivity_warnings_dnd_start", prefs.getString("inactivity_warnings_dnd_start", "12:00"));
deviceSharedPrefsEdit.putString("inactivity_warnings_dnd_end", prefs.getString("inactivity_warnings_dnd_end", "14:00"));
deviceSharedPrefsEdit.putBoolean("fitness_goal_notification", prefs.getBoolean("mi2_goal_notification", false));
}
// Not removing the first 4 preferences since they're still used by some devices (ZeTime)
editor.remove("inactivity_warnings_dnd");
editor.remove("inactivity_warnings_dnd_start");
editor.remove("inactivity_warnings_dnd_end");
editor.remove("mi2_goal_notification");
deviceSharedPrefsEdit.apply();
}
} catch (Exception e) {
Log.w(TAG, "error acquiring DB lock");
}
}
if (oldVersion < 14) {
try (DBHandler db = acquireDB()) {
final DaoSession daoSession = db.getDaoSession();
final List<Device> activeDevices = DBHelper.getActiveDevices(daoSession);
for (Device dbDevice : activeDevices) {
final SharedPreferences deviceSharedPrefs = GBApplication.getDeviceSpecificSharedPrefs(dbDevice.getIdentifier());
final SharedPreferences.Editor deviceSharedPrefsEdit = deviceSharedPrefs.edit();
if (DeviceType.MIBAND.equals(dbDevice.getType()) || dbDevice.getManufacturer().equals("Huami")) {
deviceSharedPrefsEdit.putBoolean("heartrate_sleep_detection", prefs.getBoolean("mi_hr_sleep_detection", false));
deviceSharedPrefsEdit.putString("heartrate_measurement_interval", prefs.getString("heartrate_measurement_interval", "0"));
}
// Not removing heartrate_measurement_interval since it's still used by some devices (ZeTime)
editor.remove("mi_hr_sleep_detection");
deviceSharedPrefsEdit.apply();
}
} catch (Exception e) {
Log.w(TAG, "error acquiring DB lock");
}
}
editor.putString(PREFS_VERSION, Integer.toString(CURRENT_PREFS_VERSION)); editor.putString(PREFS_VERSION, Integer.toString(CURRENT_PREFS_VERSION));
editor.apply(); editor.apply();
} }

View File

@ -0,0 +1,218 @@
/* Copyright (C) 2022 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.activities;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.adapter.GBWorldClockListAdapter;
import nodomain.freeyourgadget.gadgetbridge.database.DBHandler;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.entities.User;
import nodomain.freeyourgadget.gadgetbridge.entities.WorldClock;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
public class ConfigureWorldClocks extends AbstractGBActivity {
private static final Logger LOG = LoggerFactory.getLogger(ConfigureWorldClocks.class);
private static final int REQ_CONFIGURE_WORLD_CLOCK = 1;
private GBWorldClockListAdapter mGBWorldClockListAdapter;
private GBDevice gbDevice;
private BroadcastReceiver timeTickBroadcastReceiver;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_configure_world_clocks);
gbDevice = getIntent().getParcelableExtra(GBDevice.EXTRA_DEVICE);
mGBWorldClockListAdapter = new GBWorldClockListAdapter(this);
final RecyclerView worldClocksRecyclerView = findViewById(R.id.world_clock_list);
worldClocksRecyclerView.setHasFixedSize(true);
worldClocksRecyclerView.setLayoutManager(new LinearLayoutManager(this));
worldClocksRecyclerView.setAdapter(mGBWorldClockListAdapter);
updateWorldClocksFromDB();
final FloatingActionButton fab = findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(gbDevice);
int deviceSlots = coordinator.getWorldClocksSlotCount();
if (mGBWorldClockListAdapter.getItemCount() >= deviceSlots) {
// No more free slots
new AlertDialog.Builder(v.getContext())
.setTitle(R.string.world_clock_no_free_slots_title)
.setMessage(getBaseContext().getString(R.string.world_clock_no_free_slots_description, String.format(Locale.getDefault(), "%d", deviceSlots)))
.setIcon(R.drawable.ic_warning)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(final DialogInterface dialog, final int whichButton) {
}
})
.show();
return;
}
final WorldClock worldClock;
try (DBHandler db = GBApplication.acquireDB()) {
final DaoSession daoSession = db.getDaoSession();
final Device device = DBHelper.getDevice(gbDevice, daoSession);
final User user = DBHelper.getUser(daoSession);
worldClock = createDefaultWorldClock(device, user);
} catch (final Exception e) {
LOG.error("Error accessing database", e);
return;
}
configureWorldClock(worldClock);
}
});
}
@Override
protected void onStart() {
super.onStart();
timeTickBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(final Context context, Intent intent) {
if (Intent.ACTION_TIME_TICK.equals(intent.getAction())) {
// Refresh the UI, to update the current time in each timezone
mGBWorldClockListAdapter.notifyDataSetChanged();
}
}
};
registerReceiver(timeTickBroadcastReceiver, new IntentFilter(Intent.ACTION_TIME_TICK));
}
@Override
protected void onStop() {
super.onStop();
if (timeTickBroadcastReceiver != null) {
unregisterReceiver(timeTickBroadcastReceiver);
}
}
@Override
protected void onResume() {
super.onResume();
// Refresh to update the current time on each clock
mGBWorldClockListAdapter.notifyDataSetChanged();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQ_CONFIGURE_WORLD_CLOCK && resultCode == 1) {
updateWorldClocksFromDB();
sendWorldClocksToDevice();
}
}
private WorldClock createDefaultWorldClock(@NonNull Device device, @NonNull User user) {
final WorldClock worldClock = new WorldClock();
final String timezone = TimeZone.getDefault().getID();
worldClock.setTimeZoneId(timezone);
final String[] timezoneParts = timezone.split("/");
worldClock.setLabel(timezoneParts[timezoneParts.length - 1]);
worldClock.setDeviceId(device.getId());
worldClock.setUserId(user.getId());
worldClock.setWorldClockId(UUID.randomUUID().toString());
return worldClock;
}
/**
* Reads the available worldClocks from the database and updates the view afterwards.
*/
private void updateWorldClocksFromDB() {
final List<WorldClock> worldClocks = DBHelper.getWorldClocks(gbDevice);
mGBWorldClockListAdapter.setWorldClockList(worldClocks);
mGBWorldClockListAdapter.notifyDataSetChanged();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// back button
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
public void configureWorldClock(final WorldClock worldClock) {
final Intent startIntent = new Intent(getApplicationContext(), WorldClockDetails.class);
startIntent.putExtra(GBDevice.EXTRA_DEVICE, gbDevice);
startIntent.putExtra(WorldClock.EXTRA_WORLD_CLOCK, worldClock);
startActivityForResult(startIntent, REQ_CONFIGURE_WORLD_CLOCK);
}
public void deleteWorldClock(final WorldClock worldClock) {
DBHelper.delete(worldClock);
updateWorldClocksFromDB();
sendWorldClocksToDevice();
}
private void sendWorldClocksToDevice() {
if (gbDevice.isInitialized()) {
GBApplication.deviceService().onSetWorldClocks(mGBWorldClockListAdapter.getWorldClockList());
}
}
}

View File

@ -0,0 +1,174 @@
/* Copyright (C) 2022 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.activities;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextWatcher;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.TimeZone;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.database.DBHelper;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.entities.WorldClock;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.util.GB;
public class WorldClockDetails extends AbstractGBActivity {
private static final Logger LOG = LoggerFactory.getLogger(WorldClockDetails.class);
private WorldClock worldClock;
private GBDevice device;
ArrayAdapter<String> timezoneAdapter;
TextView worldClockTimezone;
EditText worldClockLabel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_world_clock_details);
worldClock = (WorldClock) getIntent().getSerializableExtra(WorldClock.EXTRA_WORLD_CLOCK);
if (worldClock == null) {
GB.toast("No worldClock provided to WorldClockDetails Activity", Toast.LENGTH_LONG, GB.ERROR);
finish();
return;
}
worldClockTimezone = findViewById(R.id.world_clock_timezone);
worldClockLabel = findViewById(R.id.world_clock_label);
device = getIntent().getParcelableExtra(GBDevice.EXTRA_DEVICE);
final DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(device);
final String[] timezoneIDs = TimeZone.getAvailableIDs();
timezoneAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, timezoneIDs);
final View cardTimezone = findViewById(R.id.card_timezone);
cardTimezone.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new AlertDialog.Builder(WorldClockDetails.this).setAdapter(timezoneAdapter, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
worldClock.setTimeZoneId(timezoneIDs[i]);
updateUiFromWorldClock();
}
}).create().show();
}
});
worldClockLabel.setFilters(new InputFilter[]{new InputFilter.LengthFilter(coordinator.getWorldClocksLabelLength())});
worldClockLabel.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(final CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(final CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(final Editable s) {
worldClock.setLabel(s.toString());
}
});
final FloatingActionButton fab = findViewById(R.id.fab_save);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
updateWorldClock();
WorldClockDetails.this.setResult(1);
finish();
}
});
updateUiFromWorldClock();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
// back button
// TODO confirm when exiting without saving
finish();
return true;
}
return super.onOptionsItemSelected(item);
}
private void updateWorldClock() {
DBHelper.store(worldClock);
}
@Override
protected void onSaveInstanceState(Bundle state) {
super.onSaveInstanceState(state);
state.putSerializable("worldClock", worldClock);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
worldClock = (WorldClock) savedInstanceState.getSerializable("worldClock");
updateUiFromWorldClock();
}
public void updateUiFromWorldClock() {
final String oldTimezone = worldClockTimezone.getText().toString();
worldClockTimezone.setText(worldClock.getTimeZoneId());
// Check if the label was still the default (the timezone city name)
// If so, and if the user changed the timezone, update the label to match the new city name
if (!oldTimezone.equals(worldClock.getTimeZoneId())) {
final String[] oldTimezoneParts = oldTimezone.split("/");
final String[] newTimezoneParts = worldClock.getTimeZoneId().split("/");
final String newLabel = newTimezoneParts[newTimezoneParts.length - 1];
final String oldLabel = oldTimezoneParts[oldTimezoneParts.length - 1];
final String userLabel = worldClockLabel.getText().toString();
if (userLabel.equals(oldLabel)) {
// The label was still the original, so let's override it with the new city
worldClock.setLabel(newLabel);
}
}
worldClockLabel.setText(worldClock.getLabel());
}
}

View File

@ -48,20 +48,7 @@ public class DeviceSettingsActivity extends AbstractGBActivity implements
if (savedInstanceState == null) { if (savedInstanceState == null) {
Fragment fragment = getSupportFragmentManager().findFragmentByTag(DeviceSpecificSettingsFragment.FRAGMENT_TAG); Fragment fragment = getSupportFragmentManager().findFragmentByTag(DeviceSpecificSettingsFragment.FRAGMENT_TAG);
if (fragment == null) { if (fragment == null) {
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(device); fragment = DeviceSpecificSettingsFragment.newInstance(device);
int[] supportedSettings = coordinator.getSupportedDeviceSpecificSettings(device);
String[] supportedLanguages = coordinator.getSupportedLanguageSettings(device);
if (supportedLanguages != null) {
supportedSettings = ArrayUtils.insert(0, supportedSettings, R.xml.devicesettings_language_generic);
}
if (coordinator.supportsActivityTracking()) {
supportedSettings = ArrayUtils.addAll(supportedSettings, R.xml.devicesettings_chartstabs);
supportedSettings = ArrayUtils.addAll(supportedSettings, R.xml.devicesettings_device_card_activity_card_preferences);
}
final DeviceSpecificSettingsCustomizer deviceSpecificSettingsCustomizer = coordinator.getDeviceSpecificSettingsCustomizer(device);
fragment = DeviceSpecificSettingsFragment.newInstance(device.getAddress(), supportedSettings, supportedLanguages, deviceSpecificSettingsCustomizer);
} }
getSupportFragmentManager() getSupportFragmentManager()
.beginTransaction() .beginTransaction()
@ -73,21 +60,7 @@ public class DeviceSettingsActivity extends AbstractGBActivity implements
@Override @Override
public boolean onPreferenceStartScreen(PreferenceFragmentCompat caller, PreferenceScreen preferenceScreen) { public boolean onPreferenceStartScreen(PreferenceFragmentCompat caller, PreferenceScreen preferenceScreen) {
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(device); final PreferenceFragmentCompat fragment = DeviceSpecificSettingsFragment.newInstance(device);
int[] supportedSettings = coordinator.getSupportedDeviceSpecificSettings(device);
String[] supportedLanguages = coordinator.getSupportedLanguageSettings(device);
if (supportedLanguages != null) {
supportedSettings = ArrayUtils.insert(0, supportedSettings, R.xml.devicesettings_language_generic);
}
if (coordinator.supportsActivityTracking()) {
supportedSettings = ArrayUtils.addAll(supportedSettings, R.xml.devicesettings_chartstabs);
supportedSettings = ArrayUtils.addAll(supportedSettings, R.xml.devicesettings_device_card_activity_card_preferences);
}
final DeviceSpecificSettingsCustomizer deviceSpecificSettingsCustomizer = coordinator.getDeviceSpecificSettingsCustomizer(device);
PreferenceFragmentCompat fragment = DeviceSpecificSettingsFragment.newInstance(device.getAddress(), supportedSettings, supportedLanguages, deviceSpecificSettingsCustomizer);
Bundle args = fragment.getArguments(); Bundle args = fragment.getArguments();
args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, preferenceScreen.getKey()); args.putString(PreferenceFragmentCompat.ARG_PREFERENCE_ROOT, preferenceScreen.getKey());
fragment.setArguments(args); fragment.setArguments(args);

View File

@ -63,6 +63,7 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_ACTIVATE_DISPLAY_ON_LIFT = "activate_display_on_lift_wrist"; public static final String PREF_ACTIVATE_DISPLAY_ON_LIFT = "activate_display_on_lift_wrist";
public static final String PREF_DISPLAY_ON_LIFT_START = "display_on_lift_start"; public static final String PREF_DISPLAY_ON_LIFT_START = "display_on_lift_start";
public static final String PREF_DISPLAY_ON_LIFT_END = "display_on_lift_end"; public static final String PREF_DISPLAY_ON_LIFT_END = "display_on_lift_end";
public static final String PREF_DISPLAY_ON_LIFT_SENSITIVITY = "display_on_lift_sensitivity";
public static final String PREF_SLEEP_TIME = "prefs_enable_sleep_time"; public static final String PREF_SLEEP_TIME = "prefs_enable_sleep_time";
public static final String PREF_SLEEP_TIME_START = "prefs_sleep_time_start"; public static final String PREF_SLEEP_TIME_START = "prefs_sleep_time_start";
@ -87,6 +88,13 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_INACTIVITY_DND_START = "inactivity_warnings_dnd_start"; public static final String PREF_INACTIVITY_DND_START = "inactivity_warnings_dnd_start";
public static final String PREF_INACTIVITY_DND_END = "inactivity_warnings_dnd_end"; public static final String PREF_INACTIVITY_DND_END = "inactivity_warnings_dnd_end";
public static final String PREF_HEARTRATE_USE_FOR_SLEEP_DETECTION = "heartrate_sleep_detection";
public static final String PREF_HEARTRATE_MEASUREMENT_INTERVAL = "heartrate_measurement_interval";
public static final String PREF_HEARTRATE_ACTIVITY_MONITORING = "heartrate_activity_monitoring";
public static final String PREF_HEARTRATE_ALERT_ENABLED = "heartrate_alert_enabled";
public static final String PREF_HEARTRATE_ALERT_THRESHOLD = "heartrate_alert_threshold";
public static final String PREF_HEARTRATE_STRESS_MONITORING = "heartrate_stress_monitoring";
public static final String PREF_AUTOHEARTRATE_SWITCH = "pref_autoheartrate_switch"; public static final String PREF_AUTOHEARTRATE_SWITCH = "pref_autoheartrate_switch";
public static final String PREF_AUTOHEARTRATE_SLEEP = "pref_autoheartrate_sleep"; public static final String PREF_AUTOHEARTRATE_SLEEP = "pref_autoheartrate_sleep";
public static final String PREF_AUTOHEARTRATE_INTERVAL = "pref_autoheartrate_interval"; public static final String PREF_AUTOHEARTRATE_INTERVAL = "pref_autoheartrate_interval";
@ -116,6 +124,8 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_KEY_VIBRATION = "key_vibration"; public static final String PREF_KEY_VIBRATION = "key_vibration";
public static final String PREF_FAKE_RING_DURATION = "fake_ring_duration"; public static final String PREF_FAKE_RING_DURATION = "fake_ring_duration";
public static final String PREF_WORLD_CLOCKS = "pref_world_clocks";
public static final String PREF_ANTILOST_ENABLED = "pref_antilost_enabled"; public static final String PREF_ANTILOST_ENABLED = "pref_antilost_enabled";
public static final String PREF_HYDRATION_SWITCH = "pref_hydration_switch"; public static final String PREF_HYDRATION_SWITCH = "pref_hydration_switch";
public static final String PREF_HYDRATION_PERIOD = "pref_hydration_period"; public static final String PREF_HYDRATION_PERIOD = "pref_hydration_period";
@ -141,8 +151,25 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_GALAXY_BUDS_EQUALIZER_MODE = "pref_galaxy_buds_equalizer_mode"; public static final String PREF_GALAXY_BUDS_EQUALIZER_MODE = "pref_galaxy_buds_equalizer_mode";
public static final String PREF_GALAXY_BUDS_TOUCH_LEFT = "pref_galaxy_buds_touch_left"; public static final String PREF_GALAXY_BUDS_TOUCH_LEFT = "pref_galaxy_buds_touch_left";
public static final String PREF_GALAXY_BUDS_TOUCH_RIGHT = "pref_galaxy_buds_touch_right"; public static final String PREF_GALAXY_BUDS_TOUCH_RIGHT = "pref_galaxy_buds_touch_right";
public static final String PREF_GALAXY_BUDS_TOUCH_RIGHT_SWITCH = "pref_galaxy_buds_touch_right_switch";
public static final String PREF_GALAXY_BUDS_TOUCH_LEFT_SWITCH = "pref_galaxy_buds_touch_left_switch";
public static final String PREF_GALAXY_BUDS_LIVE_ANC = "pref_galaxy_buds_live_anc"; public static final String PREF_GALAXY_BUDS_LIVE_ANC = "pref_galaxy_buds_live_anc";
public static final String PREF_GALAXY_BUDS_PRESSURE_RELIEF = "pref_galaxy_buds_live_pressure_relief"; public static final String PREF_GALAXY_BUDS_PRESSURE_RELIEF = "pref_galaxy_buds_live_pressure_relief";
public static final String PREF_GALAXY_BUDS_AMBIENT_SOUND = "pref_galaxy_buds_ambient_sound";
public static final String PREF_GALAXY_BUDS_PRO_NOISE_CONTROL="pref_galaxy_buds_pro_noise_control";
public static final String PREF_GALAXY_PRO_DOUBLE_TAP_EDGE ="pref_galaxy_pro_double_tap_edge";
public static final String PREF_GALAXY_BUDS_PRO_IN_EAR_DETECTION ="pref_galaxy_buds_pro_in_ear_detection";
public static final String PREF_GALAXY_BUDS_PRO_VOICE_DETECT ="pref_galaxy_buds_pro_voice_detect";
public static final String PREF_GALAXY_BUDS_PRO_VOICE_DETECT_DURATION ="pref_galaxy_buds_pro_voice_detect_duration";
public static final String PREF_GALAXY_BUDS_PRO_BALANCE="pref_galaxy_buds_pro_balance";
public static final String PREF_GALAXY_BUDS_PRO_READ_NOTIFICATIONS_OUTLOUD ="pref_galaxy_buds_pro_read_notifications_outloud";
public static final String PREF_GALAXY_BUDS_AMBIENT_MODE_DURING_CALL ="pref_galaxy_buds_ambient_mode_during_call";
public static final String PREF_GALAXY_BUDS_PRO_AMBIENT_VOLUME_RIGHT ="pref_galaxy_buds_pro_ambient_volume_right";
public static final String PREF_GALAXY_BUDS_PRO_AMBIENT_VOLUME_LEFT="pref_galaxy_buds_pro_ambient_volume_left";
public static final String PREF_GALAXY_BUDS_PRO_AMBIENT_SOUND_TONE ="pref_galaxy_buds_pro_ambient_sound_tone";
public static final String PREFS_NOISE_CONTROL_WITH_ONE_EARBUD ="pref_galaxy_buds_noise_controls_with_one_earbud";
public static final String PREF_GALAXY_BUDS_PRO_ANC_LEVEL="pref_galaxy_buds_pro_anc_level";
public static final String PREFS_GALAXY_BUDS_SEAMLESS_CONNECTION="prefs_galaxy_buds_seamless_connection";
public static final String PREF_SONY_AUDIO_CODEC = "pref_sony_audio_codec"; public static final String PREF_SONY_AUDIO_CODEC = "pref_sony_audio_codec";
public static final String PREF_SONY_AMBIENT_SOUND_CONTROL = "pref_sony_ambient_sound_control"; public static final String PREF_SONY_AMBIENT_SOUND_CONTROL = "pref_sony_ambient_sound_control";
@ -186,7 +213,11 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_UM25_SHOW_THRESHOLD_NOTIFICATION = "um25_current_threshold_notify"; public static final String PREF_UM25_SHOW_THRESHOLD_NOTIFICATION = "um25_current_threshold_notify";
public static final String PREF_UM25_SHOW_THRESHOLD = "um25_current_threshold"; public static final String PREF_UM25_SHOW_THRESHOLD = "um25_current_threshold";
public static final String PREF_VESC_MINIMUM_VOLTAGE = "vesc_minimum_battery_voltage";
public static final String PREF_VESC_MAXIMUM_VOLTAGE = "vesc_maximum_battery_voltage";
public static final String PREF_SOUNDS = "sounds"; public static final String PREF_SOUNDS = "sounds";
public static final String PREF_AUTH_KEY = "authkey"; public static final String PREF_AUTH_KEY = "authkey";
public static final String PREF_USER_FITNESS_GOAL = "fitness_goal"; public static final String PREF_USER_FITNESS_GOAL = "fitness_goal";
public static final String PREF_USER_FITNESS_GOAL_NOTIFICATION = "fitness_goal_notification";
} }

View File

@ -20,6 +20,9 @@ import android.os.Parcelable;
import androidx.preference.Preference; import androidx.preference.Preference;
import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
/** /**
* A device-specific preference handler, that allows for concrete implementations to customize the preferences in * A device-specific preference handler, that allows for concrete implementations to customize the preferences in
* the {@link DeviceSpecificSettingsFragment}. * the {@link DeviceSpecificSettingsFragment}.
@ -35,8 +38,13 @@ public interface DeviceSpecificSettingsCustomizer extends Parcelable {
/** /**
* Customize the settings on the {@link DeviceSpecificSettingsFragment}. * Customize the settings on the {@link DeviceSpecificSettingsFragment}.
*
* @param handler the {@link DeviceSpecificSettingsHandler} * @param handler the {@link DeviceSpecificSettingsHandler}
* @param prefs the {@link android.content.SharedPreferences}
*/ */
void customizeSettings(final DeviceSpecificSettingsHandler handler); void customizeSettings(final DeviceSpecificSettingsHandler handler, Prefs prefs);
/**
* Keys of preferences which should print its values as a summary below the preference name.
*/
Set<String> getPreferenceKeysWithSummary();
} }

View File

@ -43,15 +43,20 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet;
import java.util.Objects; import java.util.Objects;
import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.ConfigureWorldClocks;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager; import nodomain.freeyourgadget.gadgetbridge.devices.DeviceManager;
import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst; import nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst;
import nodomain.freeyourgadget.gadgetbridge.devices.makibeshr3.MakibesHR3Constants;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst; import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec; import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs; import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
import nodomain.freeyourgadget.gadgetbridge.util.XTimePreference; import nodomain.freeyourgadget.gadgetbridge.util.XTimePreference;
import nodomain.freeyourgadget.gadgetbridge.util.XTimePreferenceFragment; import nodomain.freeyourgadget.gadgetbridge.util.XTimePreferenceFragment;
@ -70,6 +75,7 @@ import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF
import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF_EXPOSE_HR_THIRDPARTY; import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF_EXPOSE_HR_THIRDPARTY;
import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF_SHORTCUTS; import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF_SHORTCUTS;
import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF_SHORTCUTS_SORTABLE; import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF_SHORTCUTS_SORTABLE;
import static nodomain.freeyourgadget.gadgetbridge.devices.huami.HuamiConst.PREF_WORKOUT_ACTIVITY_TYPES_SORTABLE;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DATEFORMAT; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_DATEFORMAT;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_NIGHT_MODE; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_NIGHT_MODE;
@ -89,6 +95,8 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
private DeviceSpecificSettingsCustomizer deviceSpecificSettingsCustomizer; private DeviceSpecificSettingsCustomizer deviceSpecificSettingsCustomizer;
private GBDevice device;
private void setSettingsFileSuffix(String settingsFileSuffix, @NonNull int[] supportedSettings, String[] supportedLanguages) { private void setSettingsFileSuffix(String settingsFileSuffix, @NonNull int[] supportedSettings, String[] supportedLanguages) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("settingsFileSuffix", settingsFileSuffix); args.putString("settingsFileSuffix", settingsFileSuffix);
@ -103,6 +111,12 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
setArguments(args); setArguments(args);
} }
private void setDevice(final GBDevice device) {
final Bundle args = getArguments() != null ? getArguments() : new Bundle();
args.putParcelable("device", device);
setArguments(args);
}
@Override @Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
Bundle arguments = getArguments(); Bundle arguments = getArguments();
@ -113,6 +127,7 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
int[] supportedSettings = arguments.getIntArray("supportedSettings"); int[] supportedSettings = arguments.getIntArray("supportedSettings");
String[] supportedLanguages = arguments.getStringArray("supportedLanguages"); String[] supportedLanguages = arguments.getStringArray("supportedLanguages");
this.deviceSpecificSettingsCustomizer = arguments.getParcelable("deviceSpecificSettingsCustomizer"); this.deviceSpecificSettingsCustomizer = arguments.getParcelable("deviceSpecificSettingsCustomizer");
this.device = arguments.getParcelable("device");
if (settingsFileSuffix == null || supportedSettings == null) { if (settingsFileSuffix == null || supportedSettings == null) {
return; return;
@ -329,11 +344,62 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
}); });
} }
final Preference enableHeartrateSleepSupport = findPreference(PREF_HEARTRATE_USE_FOR_SLEEP_DETECTION);
if (enableHeartrateSleepSupport != null) {
enableHeartrateSleepSupport.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
GBApplication.deviceService().onEnableHeartRateSleepSupport(Boolean.TRUE.equals(newVal));
return true;
}
});
}
final ListPreference heartrateMeasurementInterval = findPreference(PREF_HEARTRATE_MEASUREMENT_INTERVAL);
if (heartrateMeasurementInterval != null) {
final SwitchPreference activityMonitoring = findPreference(PREF_HEARTRATE_ACTIVITY_MONITORING);
final SwitchPreference heartrateAlertEnabled = findPreference(PREF_HEARTRATE_ALERT_ENABLED);
final SwitchPreference stressMonitoring = findPreference(PREF_HEARTRATE_STRESS_MONITORING);
heartrateMeasurementInterval.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
public boolean onPreferenceChange(final Preference preference, final Object newVal) {
GBApplication.deviceService().onSetHeartRateMeasurementInterval(Integer.parseInt((String) newVal));
final boolean isMeasurementIntervalEnabled = !newVal.equals("0");
if (activityMonitoring != null) {
activityMonitoring.setEnabled(isMeasurementIntervalEnabled);
}
if (heartrateAlertEnabled != null) {
heartrateAlertEnabled.setEnabled(isMeasurementIntervalEnabled);
}
if (stressMonitoring != null) {
stressMonitoring.setEnabled(isMeasurementIntervalEnabled);
}
return true;
}
});
final boolean isMeasurementIntervalEnabled = !heartrateMeasurementInterval.getValue().equals("0");
if (activityMonitoring != null) {
activityMonitoring.setEnabled(isMeasurementIntervalEnabled);
}
if (heartrateAlertEnabled != null) {
heartrateAlertEnabled.setEnabled(isMeasurementIntervalEnabled);
}
if (stressMonitoring != null) {
stressMonitoring.setEnabled(isMeasurementIntervalEnabled);
}
}
addPreferenceHandlerFor(PREF_SWIPE_UNLOCK); addPreferenceHandlerFor(PREF_SWIPE_UNLOCK);
addPreferenceHandlerFor(PREF_MI2_DATEFORMAT); addPreferenceHandlerFor(PREF_MI2_DATEFORMAT);
addPreferenceHandlerFor(PREF_DATEFORMAT); addPreferenceHandlerFor(PREF_DATEFORMAT);
addPreferenceHandlerFor(PREF_DISPLAY_ITEMS); addPreferenceHandlerFor(PREF_DISPLAY_ITEMS);
addPreferenceHandlerFor(PREF_DISPLAY_ITEMS_SORTABLE); addPreferenceHandlerFor(PREF_DISPLAY_ITEMS_SORTABLE);
addPreferenceHandlerFor(PREF_WORKOUT_ACTIVITY_TYPES_SORTABLE);
addPreferenceHandlerFor(PREF_SHORTCUTS); addPreferenceHandlerFor(PREF_SHORTCUTS);
addPreferenceHandlerFor(PREF_SHORTCUTS_SORTABLE); addPreferenceHandlerFor(PREF_SHORTCUTS_SORTABLE);
addPreferenceHandlerFor(PREF_LANGUAGE); addPreferenceHandlerFor(PREF_LANGUAGE);
@ -378,6 +444,10 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
addPreferenceHandlerFor(PREF_AUTOHEARTRATE_INTERVAL); addPreferenceHandlerFor(PREF_AUTOHEARTRATE_INTERVAL);
addPreferenceHandlerFor(PREF_AUTOHEARTRATE_START); addPreferenceHandlerFor(PREF_AUTOHEARTRATE_START);
addPreferenceHandlerFor(PREF_AUTOHEARTRATE_END); addPreferenceHandlerFor(PREF_AUTOHEARTRATE_END);
addPreferenceHandlerFor(PREF_HEARTRATE_ACTIVITY_MONITORING);
addPreferenceHandlerFor(PREF_HEARTRATE_ALERT_THRESHOLD);
addPreferenceHandlerFor(PREF_HEARTRATE_ALERT_ENABLED);
addPreferenceHandlerFor(PREF_HEARTRATE_STRESS_MONITORING);
addPreferenceHandlerFor(PREF_DO_NOT_DISTURB_NOAUTO); addPreferenceHandlerFor(PREF_DO_NOT_DISTURB_NOAUTO);
addPreferenceHandlerFor(PREF_DO_NOT_DISTURB_NOAUTO_START); addPreferenceHandlerFor(PREF_DO_NOT_DISTURB_NOAUTO_START);
addPreferenceHandlerFor(PREF_DO_NOT_DISTURB_NOAUTO_END); addPreferenceHandlerFor(PREF_DO_NOT_DISTURB_NOAUTO_END);
@ -415,7 +485,6 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
addPreferenceHandlerFor(PREF_NOTHING_EAR1_INEAR); addPreferenceHandlerFor(PREF_NOTHING_EAR1_INEAR);
addPreferenceHandlerFor(PREF_NOTHING_EAR1_AUDIOMODE); addPreferenceHandlerFor(PREF_NOTHING_EAR1_AUDIOMODE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_MODE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS); addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_VOLUME); addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_VOLUME);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_LOCK_TOUCH); addPreferenceHandlerFor(PREF_GALAXY_BUDS_LOCK_TOUCH);
@ -427,6 +496,23 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
addPreferenceHandlerFor(PREF_GALAXY_BUDS_TOUCH_RIGHT); addPreferenceHandlerFor(PREF_GALAXY_BUDS_TOUCH_RIGHT);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_LIVE_ANC); addPreferenceHandlerFor(PREF_GALAXY_BUDS_LIVE_ANC);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRESSURE_RELIEF); addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRESSURE_RELIEF);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_ANC_LEVEL);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_SOUND);
addPreferenceHandlerFor(PREF_GALAXY_PRO_DOUBLE_TAP_EDGE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_IN_EAR_DETECTION);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_VOICE_DETECT);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_VOICE_DETECT_DURATION);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_BALANCE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_READ_NOTIFICATIONS_OUTLOUD);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_MODE_DURING_CALL);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_AMBIENT_VOLUME_RIGHT);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_AMBIENT_VOLUME_LEFT);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_PRO_AMBIENT_SOUND_TONE);
addPreferenceHandlerFor(PREFS_NOISE_CONTROL_WITH_ONE_EARBUD);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_MODE);
addPreferenceHandlerFor(PREFS_GALAXY_BUDS_SEAMLESS_CONNECTION);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_TOUCH_LEFT_SWITCH);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_TOUCH_RIGHT_SWITCH);
addPreferenceHandlerFor(PREF_SONY_AMBIENT_SOUND_CONTROL); addPreferenceHandlerFor(PREF_SONY_AMBIENT_SOUND_CONTROL);
addPreferenceHandlerFor(PREF_SONY_FOCUS_VOICE); addPreferenceHandlerFor(PREF_SONY_FOCUS_VOICE);
@ -455,6 +541,7 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
addPreferenceHandlerFor(PREF_QC35_NOISE_CANCELLING_LEVEL); addPreferenceHandlerFor(PREF_QC35_NOISE_CANCELLING_LEVEL);
addPreferenceHandlerFor(PREF_USER_FITNESS_GOAL); addPreferenceHandlerFor(PREF_USER_FITNESS_GOAL);
addPreferenceHandlerFor(PREF_USER_FITNESS_GOAL_NOTIFICATION);
addPreferenceHandlerFor(PREF_UM25_SHOW_THRESHOLD_NOTIFICATION); addPreferenceHandlerFor(PREF_UM25_SHOW_THRESHOLD_NOTIFICATION);
addPreferenceHandlerFor(PREF_UM25_SHOW_THRESHOLD); addPreferenceHandlerFor(PREF_UM25_SHOW_THRESHOLD);
@ -516,6 +603,7 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
} }
String displayOnLiftState = prefs.getString(PREF_ACTIVATE_DISPLAY_ON_LIFT, PREF_DO_NOT_DISTURB_OFF); String displayOnLiftState = prefs.getString(PREF_ACTIVATE_DISPLAY_ON_LIFT, PREF_DO_NOT_DISTURB_OFF);
boolean displayOnLiftScheduled = displayOnLiftState.equals(PREF_DO_NOT_DISTURB_SCHEDULED); boolean displayOnLiftScheduled = displayOnLiftState.equals(PREF_DO_NOT_DISTURB_SCHEDULED);
boolean displayOnLiftOff = displayOnLiftState.equals(PREF_DO_NOT_DISTURB_OFF);
final Preference rotateWristCycleInfo = findPreference(PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO); final Preference rotateWristCycleInfo = findPreference(PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO);
if (rotateWristCycleInfo != null) { if (rotateWristCycleInfo != null) {
@ -553,16 +641,32 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
}); });
} }
final Preference displayOnLiftSensitivity = findPreference(PREF_DISPLAY_ON_LIFT_SENSITIVITY);
if (displayOnLiftSensitivity != null) {
displayOnLiftSensitivity.setEnabled(!displayOnLiftOff);
displayOnLiftSensitivity.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
notifyPreferenceChanged(PREF_DISPLAY_ON_LIFT_SENSITIVITY);
return true;
}
});
}
final Preference displayOnLift = findPreference(PREF_ACTIVATE_DISPLAY_ON_LIFT); final Preference displayOnLift = findPreference(PREF_ACTIVATE_DISPLAY_ON_LIFT);
if (displayOnLift != null) { if (displayOnLift != null) {
displayOnLift.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { displayOnLift.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override @Override
public boolean onPreferenceChange(Preference preference, Object newVal) { public boolean onPreferenceChange(Preference preference, Object newVal) {
final boolean scheduled = PREF_DO_NOT_DISTURB_SCHEDULED.equals(newVal.toString()); final boolean scheduled = PREF_DO_NOT_DISTURB_SCHEDULED.equals(newVal.toString());
final boolean off = PREF_DO_NOT_DISTURB_OFF.equals(newVal.toString());
Objects.requireNonNull(displayOnLiftStart).setEnabled(scheduled); Objects.requireNonNull(displayOnLiftStart).setEnabled(scheduled);
Objects.requireNonNull(displayOnLiftEnd).setEnabled(scheduled); Objects.requireNonNull(displayOnLiftEnd).setEnabled(scheduled);
if (rotateWristCycleInfo != null) { if (rotateWristCycleInfo != null) {
rotateWristCycleInfo.setEnabled(!PREF_DO_NOT_DISTURB_OFF.equals(newVal.toString())); rotateWristCycleInfo.setEnabled(!off);
}
if (displayOnLiftSensitivity != null) {
displayOnLiftSensitivity.setEnabled(!off);
} }
notifyPreferenceChanged(PREF_ACTIVATE_DISPLAY_ON_LIFT); notifyPreferenceChanged(PREF_ACTIVATE_DISPLAY_ON_LIFT);
return true; return true;
@ -570,6 +674,19 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
}); });
} }
final Preference worldClocks = findPreference(PREF_WORLD_CLOCKS);
if (worldClocks != null) {
worldClocks.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(Preference preference) {
final Intent intent = new Intent(getContext(), ConfigureWorldClocks.class);
intent.putExtra(GBDevice.EXTRA_DEVICE, device);
startActivity(intent);
return true;
}
});
}
final Preference cannedMessagesDismissCall = findPreference("canned_messages_dismisscall_send"); final Preference cannedMessagesDismissCall = findPreference("canned_messages_dismisscall_send");
if (cannedMessagesDismissCall != null) { if (cannedMessagesDismissCall != null) {
cannedMessagesDismissCall.setOnPreferenceClickListener(new androidx.preference.Preference.OnPreferenceClickListener() { cannedMessagesDismissCall.setOnPreferenceClickListener(new androidx.preference.Preference.OnPreferenceClickListener() {
@ -597,6 +714,7 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
setInputTypeFor(DeviceSettingsPreferenceConst.PREF_FIND_PHONE_DURATION, InputType.TYPE_CLASS_NUMBER); setInputTypeFor(DeviceSettingsPreferenceConst.PREF_FIND_PHONE_DURATION, InputType.TYPE_CLASS_NUMBER);
setInputTypeFor(DeviceSettingsPreferenceConst.PREF_RESERVER_ALARMS_CALENDAR, InputType.TYPE_CLASS_NUMBER); setInputTypeFor(DeviceSettingsPreferenceConst.PREF_RESERVER_ALARMS_CALENDAR, InputType.TYPE_CLASS_NUMBER);
setInputTypeFor(DeviceSettingsPreferenceConst.PREF_RESERVER_REMINDERS_CALENDAR, InputType.TYPE_CLASS_NUMBER); setInputTypeFor(DeviceSettingsPreferenceConst.PREF_RESERVER_REMINDERS_CALENDAR, InputType.TYPE_CLASS_NUMBER);
setInputTypeFor(DeviceSettingsPreferenceConst.PREF_INACTIVITY_THRESHOLD, InputType.TYPE_CLASS_NUMBER);
String deviceActionsFellSleepSelection = prefs.getString(PREF_DEVICE_ACTION_FELL_SLEEP_SELECTION, PREF_DEVICE_ACTION_SELECTION_OFF); String deviceActionsFellSleepSelection = prefs.getString(PREF_DEVICE_ACTION_FELL_SLEEP_SELECTION, PREF_DEVICE_ACTION_SELECTION_OFF);
final Preference deviceActionsFellSleep = findPreference(PREF_DEVICE_ACTION_FELL_SLEEP_SELECTION); final Preference deviceActionsFellSleep = findPreference(PREF_DEVICE_ACTION_FELL_SLEEP_SELECTION);
@ -683,17 +801,32 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
} }
if (deviceSpecificSettingsCustomizer != null) { if (deviceSpecificSettingsCustomizer != null) {
deviceSpecificSettingsCustomizer.customizeSettings(this); deviceSpecificSettingsCustomizer.customizeSettings(this, prefs);
} }
} }
static DeviceSpecificSettingsFragment newInstance(String settingsFileSuffix, static DeviceSpecificSettingsFragment newInstance(GBDevice device) {
@NonNull int[] supportedSettings, final DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(device);
String[] supportedLanguages, int[] supportedSettings = coordinator.getSupportedDeviceSpecificSettings(device);
DeviceSpecificSettingsCustomizer deviceSpecificSettingsCustomizer) { String[] supportedLanguages = coordinator.getSupportedLanguageSettings(device);
if (supportedLanguages != null) {
supportedSettings = ArrayUtils.insert(0, supportedSettings, R.xml.devicesettings_language_generic);
}
if (coordinator.supportsActivityTracking()) {
supportedSettings = ArrayUtils.addAll(supportedSettings, R.xml.devicesettings_chartstabs);
supportedSettings = ArrayUtils.addAll(supportedSettings, R.xml.devicesettings_device_card_activity_card_preferences);
}
final DeviceSpecificSettingsCustomizer deviceSpecificSettingsCustomizer = coordinator.getDeviceSpecificSettingsCustomizer(device);
final String settingsFileSuffix = device.getAddress();
final DeviceSpecificSettingsFragment fragment = new DeviceSpecificSettingsFragment(); final DeviceSpecificSettingsFragment fragment = new DeviceSpecificSettingsFragment();
fragment.setSettingsFileSuffix(settingsFileSuffix, supportedSettings, supportedLanguages); fragment.setSettingsFileSuffix(settingsFileSuffix, supportedSettings, supportedLanguages);
fragment.setDeviceSpecificSettingsCustomizer(deviceSpecificSettingsCustomizer); fragment.setDeviceSpecificSettingsCustomizer(deviceSpecificSettingsCustomizer);
fragment.setDevice(device);
return fragment; return fragment;
} }
@ -747,7 +880,8 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
} }
} }
private void setInputTypeFor(final String preferenceKey, final int editTypeFlags) { @Override
public void setInputTypeFor(final String preferenceKey, final int editTypeFlags) {
EditTextPreference textPreference = findPreference(preferenceKey); EditTextPreference textPreference = findPreference(preferenceKey);
if (textPreference != null) { if (textPreference != null) {
textPreference.setOnBindEditTextListener(new EditTextPreference.OnBindEditTextListener() { textPreference.setOnBindEditTextListener(new EditTextPreference.OnBindEditTextListener() {
@ -759,6 +893,21 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
} }
} }
/**
* Keys of preferences which should print its values as a summary below the preference name.
*/
protected Set<String> getPreferenceKeysWithSummary() {
final Set<String> keysWithSummary = new HashSet<>();
keysWithSummary.add(PREF_INACTIVITY_THRESHOLD);
if (deviceSpecificSettingsCustomizer != null) {
keysWithSummary.addAll(deviceSpecificSettingsCustomizer.getPreferenceKeysWithSummary());
}
return keysWithSummary;
}
/** /**
* Reload the preferences in the current screen. This is needed when the user enters or exists a PreferenceScreen, * Reload the preferences in the current screen. This is needed when the user enters or exists a PreferenceScreen,
* otherwise the settings won't be reloaded by the {@link SharedPreferencesChangeHandler}, as the preferences return * otherwise the settings won't be reloaded by the {@link SharedPreferencesChangeHandler}, as the preferences return
@ -790,7 +939,7 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) { public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
LOG.debug("Preference changed: {}", key); LOG.debug("Preference changed: {}", key);
if(key == null){ if (key == null){
LOG.warn("Preference null, ignoring"); LOG.warn("Preference null, ignoring");
return; return;
} }
@ -820,6 +969,11 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat imp
LOG.warn("Unknown preference class {}, ignoring", preference.getClass()); LOG.warn("Unknown preference class {}, ignoring", preference.getClass());
} }
if (getPreferenceKeysWithSummary().contains(key)) {
final String summary = prefs.getString(key, preference.getSummary() != null ? preference.getSummary().toString() : "");
preference.setSummary(summary);
}
if (deviceSpecificSettingsCustomizer != null) { if (deviceSpecificSettingsCustomizer != null) {
deviceSpecificSettingsCustomizer.onPreferenceChange(preference, DeviceSpecificSettingsFragment.this); deviceSpecificSettingsCustomizer.onPreferenceChange(preference, DeviceSpecificSettingsFragment.this);
} }

View File

@ -53,4 +53,12 @@ public interface DeviceSpecificSettingsHandler {
* @param extraListener the extra listener. * @param extraListener the extra listener.
*/ */
void addPreferenceHandlerFor(final String preferenceKey, Preference.OnPreferenceChangeListener extraListener); void addPreferenceHandlerFor(final String preferenceKey, Preference.OnPreferenceChangeListener extraListener);
/**
* Sets the input type flags for an EditText preference.
*
* @param preferenceKey the preference key.
* @param editTypeFlags the edit type {@link android.text.InputType} flags.
*/
void setInputTypeFor(final String preferenceKey, final int editTypeFlags);
} }

View File

@ -0,0 +1,132 @@
/* Copyright (C) 2022 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.adapter;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.ConfigureWorldClocks;
import nodomain.freeyourgadget.gadgetbridge.entities.WorldClock;
/**
* Adapter for displaying WorldClock instances.
*/
public class GBWorldClockListAdapter extends RecyclerView.Adapter<GBWorldClockListAdapter.ViewHolder> {
private final Context mContext;
private ArrayList<WorldClock> worldClockList;
public GBWorldClockListAdapter(final Context context) {
this.mContext = context;
}
public void setWorldClockList(final List<WorldClock> worldClocks) {
this.worldClockList = new ArrayList<>(worldClocks);
}
public ArrayList<WorldClock> getWorldClockList() {
return worldClockList;
}
@NonNull
@Override
public GBWorldClockListAdapter.ViewHolder onCreateViewHolder(@NonNull final ViewGroup parent, final int viewType) {
final View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_world_clock, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, final int position) {
final WorldClock worldClock = worldClockList.get(position);
holder.container.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
((ConfigureWorldClocks) mContext).configureWorldClock(worldClock);
}
});
holder.container.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
new AlertDialog.Builder(v.getContext())
.setTitle(v.getContext().getString(R.string.world_clock_delete_confirm_title, worldClock.getLabel()))
.setMessage(R.string.world_clock_delete_confirm_description)
.setIcon(R.drawable.ic_warning)
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(final DialogInterface dialog, final int whichButton) {
((ConfigureWorldClocks) mContext).deleteWorldClock(worldClock);
}
})
.setNegativeButton(android.R.string.no, null)
.show();
return true;
}
});
holder.worldClockLabel.setText(worldClock.getLabel());
holder.worldClockTimezone.setText(worldClock.getTimeZoneId());
final DateFormat df = new SimpleDateFormat("HH:mm", GBApplication.getLanguage());
df.setTimeZone(TimeZone.getTimeZone(worldClock.getTimeZoneId()));
holder.worldClockCurrentTime.setText(df.format(new Date()));
}
@Override
public int getItemCount() {
return worldClockList.size();
}
static class ViewHolder extends RecyclerView.ViewHolder {
final CardView container;
final TextView worldClockTimezone;
final TextView worldClockLabel;
final TextView worldClockCurrentTime;
ViewHolder(View view) {
super(view);
container = view.findViewById(R.id.card_view);
worldClockTimezone = view.findViewById(R.id.world_clock_item_timezone);
worldClockLabel = view.findViewById(R.id.world_clock_item_label);
worldClockCurrentTime = view.findViewById(R.id.world_clock_current_time);
}
}
}

View File

@ -62,6 +62,8 @@ import nodomain.freeyourgadget.gadgetbridge.entities.TagDao;
import nodomain.freeyourgadget.gadgetbridge.entities.User; import nodomain.freeyourgadget.gadgetbridge.entities.User;
import nodomain.freeyourgadget.gadgetbridge.entities.UserAttributes; import nodomain.freeyourgadget.gadgetbridge.entities.UserAttributes;
import nodomain.freeyourgadget.gadgetbridge.entities.UserDao; import nodomain.freeyourgadget.gadgetbridge.entities.UserDao;
import nodomain.freeyourgadget.gadgetbridge.entities.WorldClock;
import nodomain.freeyourgadget.gadgetbridge.entities.WorldClockDao;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser; import nodomain.freeyourgadget.gadgetbridge.model.ActivityUser;
import nodomain.freeyourgadget.gadgetbridge.model.ValidByDate; import nodomain.freeyourgadget.gadgetbridge.model.ValidByDate;
@ -658,6 +660,28 @@ public class DBHelper {
return Collections.emptyList(); return Collections.emptyList();
} }
@NonNull
public static List<WorldClock> getWorldClocks(@NonNull GBDevice gbDevice) {
try (DBHandler db = GBApplication.acquireDB()) {
final DaoSession daoSession = db.getDaoSession();
final User user = getUser(daoSession);
final Device dbDevice = DBHelper.findDevice(gbDevice, daoSession);
if (dbDevice != null) {
final WorldClockDao worldClockDao = daoSession.getWorldClockDao();
final Long deviceId = dbDevice.getId();
final QueryBuilder<WorldClock> qb = worldClockDao.queryBuilder();
qb.where(
WorldClockDao.Properties.UserId.eq(user.getId()),
WorldClockDao.Properties.DeviceId.eq(deviceId)).orderAsc(WorldClockDao.Properties.WorldClockId);
return qb.build().list();
}
} catch (final Exception e) {
LOG.error("Error reading world clocks from db", e);
}
return Collections.emptyList();
}
public static void store(final Reminder reminder) { public static void store(final Reminder reminder) {
try (DBHandler db = GBApplication.acquireDB()) { try (DBHandler db = GBApplication.acquireDB()) {
final DaoSession daoSession = db.getDaoSession(); final DaoSession daoSession = db.getDaoSession();
@ -667,6 +691,15 @@ public class DBHelper {
} }
} }
public static void store(final WorldClock worldClock) {
try (DBHandler db = GBApplication.acquireDB()) {
final DaoSession daoSession = db.getDaoSession();
daoSession.insertOrReplace(worldClock);
} catch (final Exception e) {
LOG.error("Error acquiring database", e);
}
}
public static void delete(final Reminder reminder) { public static void delete(final Reminder reminder) {
try (DBHandler db = GBApplication.acquireDB()) { try (DBHandler db = GBApplication.acquireDB()) {
final DaoSession daoSession = db.getDaoSession(); final DaoSession daoSession = db.getDaoSession();
@ -676,6 +709,15 @@ public class DBHelper {
} }
} }
public static void delete(final WorldClock worldClock) {
try (DBHandler db = GBApplication.acquireDB()) {
final DaoSession daoSession = db.getDaoSession();
daoSession.delete(worldClock);
} catch (final Exception e) {
LOG.error("Error acquiring database", e);
}
}
public static void clearSession() { public static void clearSession() {
try (DBHandler dbHandler = GBApplication.acquireDB()) { try (DBHandler dbHandler = GBApplication.acquireDB()) {
DaoSession session = dbHandler.getDaoSession(); DaoSession session = dbHandler.getDaoSession();

View File

@ -232,6 +232,16 @@ public abstract class AbstractDeviceCoordinator implements DeviceCoordinator {
return 0; return 0;
} }
@Override
public int getWorldClocksSlotCount() {
return 0;
}
@Override
public int getWorldClocksLabelLength() {
return 10;
}
@Override @Override
public boolean supportsRgbLedColor() { public boolean supportsRgbLedColor() {
return false; return false;

View File

@ -331,6 +331,16 @@ public interface DeviceCoordinator {
*/ */
int getReminderSlotCount(); int getReminderSlotCount();
/**
* Indicates the maximum number of slots available for world clocks in the device.
*/
int getWorldClocksSlotCount();
/**
* Indicates the maximum label length for a world clock in the device.
*/
int getWorldClocksLabelLength();
/** /**
* Indicates whether the device has an led which supports custom colors * Indicates whether the device has an led which supports custom colors
*/ */

View File

@ -32,6 +32,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec; import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.Reminder; import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec; import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
/** /**
* Specifies all events that Gadgetbridge intends to send to the gadget device. * Specifies all events that Gadgetbridge intends to send to the gadget device.
@ -49,6 +50,8 @@ public interface EventHandler {
void onSetReminders(ArrayList<? extends Reminder> reminders); void onSetReminders(ArrayList<? extends Reminder> reminders);
void onSetWorldClocks(ArrayList<? extends WorldClock> clocks);
void onSetCallState(CallSpec callSpec); void onSetCallState(CallSpec callSpec);
void onSetCannedMessages(CannedMessagesSpec cannedMessagesSpec); void onSetCannedMessages(CannedMessagesSpec cannedMessagesSpec);
@ -57,6 +60,13 @@ public interface EventHandler {
void onSetMusicInfo(MusicSpec musicSpec); void onSetMusicInfo(MusicSpec musicSpec);
/**
* Sets the current phone media volume.
*
* @param volume the volume percentage (0 to 100).
*/
void onSetPhoneVolume(final float volume);
void onEnableRealtimeSteps(boolean enable); void onEnableRealtimeSteps(boolean enable);
void onInstallApp(Uri uri); void onInstallApp(Uri uri);

View File

@ -1,26 +1,14 @@
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds; package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig; import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class GalaxyBudsDeviceCoordinator extends AbstractDeviceCoordinator { public class GalaxyBudsDeviceCoordinator extends GalaxyBudsGenericCoordinator {
@NonNull @NonNull
@Override @Override
@ -53,100 +41,6 @@ public class GalaxyBudsDeviceCoordinator extends AbstractDeviceCoordinator {
return new BatteryConfig[]{battery1, battery2}; return new BatteryConfig[]{battery1, battery2};
} }
@Override
public int getBondingStyle() {
return BONDING_STYLE_BOND;
}
@Nullable
@Override
public Class<? extends Activity> getPairingActivity() {
return null;
}
@Override
public boolean supportsActivityDataFetching() {
return false;
}
@Override
public boolean supportsActivityTracking() {
return false;
}
@Override
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice
device, DaoSession session) {
return null;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;
}
@Override
public boolean supportsScreenshots() {
return false;
}
@Override
public int getAlarmSlotCount() {
return 0;
}
@Override
public boolean supportsSmartWakeup(GBDevice device) {
return false;
}
@Override
public boolean supportsHeartRateMeasurement(GBDevice device) {
return false;
}
@Override
public String getManufacturer() {
return "Samsung";
}
@Override
public boolean supportsAppsManagement() {
return false;
}
@Override
public Class<? extends Activity> getAppsManagementActivity() {
return null;
}
@Override
public boolean supportsCalendarEvents() {
return false;
}
@Override
public boolean supportsRealtimeData() {
return false;
}
@Override
public boolean supportsWeather() {
return false;
}
@Override
public boolean supportsFindDevice() {
return true;
}
@Override
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device
device, @NonNull DaoSession session) throws GBException {
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{

View File

@ -0,0 +1,114 @@
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
public abstract class GalaxyBudsGenericCoordinator extends AbstractDeviceCoordinator {
@Override
public int getBondingStyle() {
return BONDING_STYLE_BOND;
}
@Nullable
@Override
public Class<? extends Activity> getPairingActivity() {
return null;
}
@Override
public boolean supportsActivityDataFetching() {
return false;
}
@Override
public boolean supportsActivityTracking() {
return false;
}
@Override
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice
device, DaoSession session) {
return null;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;
}
@Override
public boolean supportsScreenshots() {
return false;
}
@Override
public int getAlarmSlotCount() {
return 0;
}
@Override
public boolean supportsSmartWakeup(GBDevice device) {
return false;
}
@Override
public boolean supportsHeartRateMeasurement(GBDevice device) {
return false;
}
@Override
public String getManufacturer() {
return "Samsung";
}
@Override
public boolean supportsAppsManagement() {
return false;
}
@Override
public Class<? extends Activity> getAppsManagementActivity() {
return null;
}
@Override
public boolean supportsCalendarEvents() {
return false;
}
@Override
public boolean supportsRealtimeData() {
return false;
}
@Override
public boolean supportsWeather() {
return false;
}
@Override
public boolean supportsFindDevice() {
return true;
}
@Override
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device
device, @NonNull DaoSession session) throws GBException {
}
}

View File

@ -1,26 +1,14 @@
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds; package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig; import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class GalaxyBudsLiveDeviceCoordinator extends AbstractDeviceCoordinator { public class GalaxyBudsLiveDeviceCoordinator extends GalaxyBudsGenericCoordinator {
@NonNull @NonNull
@Override @Override
@ -54,99 +42,6 @@ public class GalaxyBudsLiveDeviceCoordinator extends AbstractDeviceCoordinator {
return new BatteryConfig[]{battery1, battery2, battery3}; return new BatteryConfig[]{battery1, battery2, battery3};
} }
@Override
public int getBondingStyle() {
return BONDING_STYLE_BOND;
}
@Nullable
@Override
public Class<? extends Activity> getPairingActivity() {
return null;
}
@Override
public boolean supportsActivityDataFetching() {
return false;
}
@Override
public boolean supportsActivityTracking() {
return false;
}
@Override
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice
device, DaoSession session) {
return null;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;
}
@Override
public boolean supportsScreenshots() {
return false;
}
@Override
public int getAlarmSlotCount() {
return 0;
}
@Override
public boolean supportsSmartWakeup(GBDevice device) {
return false;
}
@Override
public boolean supportsHeartRateMeasurement(GBDevice device) {
return false;
}
@Override
public String getManufacturer() {
return "Samsung";
}
@Override
public boolean supportsAppsManagement() {
return false;
}
@Override
public Class<? extends Activity> getAppsManagementActivity() {
return null;
}
@Override
public boolean supportsCalendarEvents() {
return false;
}
@Override
public boolean supportsRealtimeData() {
return false;
}
@Override
public boolean supportsWeather() {
return false;
}
@Override
public boolean supportsFindDevice() {
return true;
}
@Override
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device
device, @NonNull DaoSession session) throws GBException {
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {

View File

@ -0,0 +1,57 @@
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesSettingsCustomizer;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class GalaxyBudsProDeviceCoordinator extends GalaxyBudsGenericCoordinator {
@NonNull
@Override
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
String name = candidate.getName();
if (name != null && (
name.startsWith("Galaxy Buds Pro (")
)) {
return DeviceType.GALAXY_BUDS_PRO;
}
return DeviceType.UNKNOWN;
}
@Override
public DeviceSpecificSettingsCustomizer getDeviceSpecificSettingsCustomizer(final GBDevice device) {
return new GalaxyBudsSettingsCustomizer(device);
}
@Override
public DeviceType getDeviceType() {
return DeviceType.GALAXY_BUDS_PRO;
}
@Override
public int getBatteryCount() {
return 3;
}
@Override
public BatteryConfig[] getBatteryConfig() {
BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_buds_pro_case, R.string.battery_case);
BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_buds_pro_left, R.string.left_earbud);
BatteryConfig battery3 = new BatteryConfig(2, R.drawable.ic_buds_pro_right, R.string.right_earbud);
return new BatteryConfig[]{battery1, battery2, battery3};
}
@Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_galaxy_buds_pro,
};
}
}

View File

@ -0,0 +1,241 @@
/* Copyright (C) 2021 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOLUME;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_ANC_LEVEL;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_BALANCE;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_PRO_NOISE_CONTROL;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_LEFT;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_LEFT_SWITCH;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_RIGHT;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_RIGHT_SWITCH;
import android.os.Parcel;
import androidx.preference.Preference;
import java.util.Collections;
import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsHandler;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public class GalaxyBudsSettingsCustomizer implements DeviceSpecificSettingsCustomizer {
final GBDevice device;
public GalaxyBudsSettingsCustomizer(final GBDevice device) {
this.device = device;
}
@Override
public void onPreferenceChange(final Preference preference, final DeviceSpecificSettingsHandler handler) {
}
@Override
public void customizeSettings(final DeviceSpecificSettingsHandler handler, Prefs prefs) {
final Preference pref_galaxy_buds_pro_balance = handler.findPreference(PREF_GALAXY_BUDS_PRO_BALANCE);
if (pref_galaxy_buds_pro_balance != null) {
pref_galaxy_buds_pro_balance.setSummary(String.valueOf((prefs.getInt(PREF_GALAXY_BUDS_PRO_BALANCE, 16) - 16)));
pref_galaxy_buds_pro_balance.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
String newValue = String.valueOf((int) newVal - 16);
pref_galaxy_buds_pro_balance.setSummary(newValue);
handler.notifyPreferenceChanged(PREF_GALAXY_BUDS_PRO_BALANCE);
return true;
}
});
}
final Preference pref_galaxy_buds_pro_noise_control = handler.findPreference(PREF_GALAXY_BUDS_PRO_NOISE_CONTROL);
String pref_galaxy_buds_pro_noise_control_value = prefs.getString(PREF_GALAXY_BUDS_PRO_NOISE_CONTROL, "0");
final Preference pref_galaxy_buds_pro_anc_level = handler.findPreference(PREF_GALAXY_BUDS_PRO_ANC_LEVEL);
final Preference pref_galaxy_buds_ambient_volume = handler.findPreference(PREF_GALAXY_BUDS_AMBIENT_VOLUME);
if (pref_galaxy_buds_pro_noise_control != null) {
switch (pref_galaxy_buds_pro_noise_control_value) {
case "0":
pref_galaxy_buds_pro_anc_level.setEnabled(false);
pref_galaxy_buds_ambient_volume.setEnabled(false);
break;
case "1":
pref_galaxy_buds_pro_anc_level.setEnabled(true);
pref_galaxy_buds_ambient_volume.setEnabled(false);
break;
case "2":
pref_galaxy_buds_pro_anc_level.setEnabled(false);
pref_galaxy_buds_ambient_volume.setEnabled(true);
break;
}
pref_galaxy_buds_pro_noise_control.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
handler.notifyPreferenceChanged(PREF_GALAXY_BUDS_PRO_NOISE_CONTROL);
switch (newVal.toString()) {
case "0":
pref_galaxy_buds_pro_anc_level.setEnabled(false);
pref_galaxy_buds_ambient_volume.setEnabled(false);
break;
case "1":
pref_galaxy_buds_pro_anc_level.setEnabled(true);
pref_galaxy_buds_ambient_volume.setEnabled(false);
break;
case "2":
pref_galaxy_buds_pro_anc_level.setEnabled(false);
pref_galaxy_buds_ambient_volume.setEnabled(true);
break;
}
return true;
}
});
}
final Preference pref_galaxy_buds_touch_right = handler.findPreference(PREF_GALAXY_BUDS_TOUCH_RIGHT);
String pref_galaxy_buds_touch_right_value = prefs.getString(PREF_GALAXY_BUDS_TOUCH_RIGHT, "1");
final Preference pref_galaxy_buds_touch_right_switch = handler.findPreference(PREF_GALAXY_BUDS_TOUCH_RIGHT_SWITCH);
if (pref_galaxy_buds_touch_right != null) {
switch (pref_galaxy_buds_touch_right_value) {
case "2":
pref_galaxy_buds_touch_right_switch.setEnabled(true);
break;
default:
pref_galaxy_buds_touch_right_switch.setEnabled(false);
}
pref_galaxy_buds_touch_right.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
handler.notifyPreferenceChanged(PREF_GALAXY_BUDS_TOUCH_RIGHT);
switch (newVal.toString()) {
case "2":
pref_galaxy_buds_touch_right_switch.setEnabled(true);
break;
default:
pref_galaxy_buds_touch_right_switch.setEnabled(false);
}
return true;
}
});
}
final Preference pref_galaxy_buds_touch_left = handler.findPreference(PREF_GALAXY_BUDS_TOUCH_LEFT);
String pref_galaxy_buds_touch_left_value = prefs.getString(PREF_GALAXY_BUDS_TOUCH_LEFT, "1");
final Preference pref_galaxy_buds_touch_left_switch = handler.findPreference(PREF_GALAXY_BUDS_TOUCH_LEFT_SWITCH);
if (pref_galaxy_buds_touch_left != null) {
switch (pref_galaxy_buds_touch_left_value) {
case "2":
pref_galaxy_buds_touch_left_switch.setEnabled(true);
break;
default:
pref_galaxy_buds_touch_left_switch.setEnabled(false);
}
pref_galaxy_buds_touch_left.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
handler.notifyPreferenceChanged(PREF_GALAXY_BUDS_TOUCH_LEFT);
switch (newVal.toString()) {
case "2":
pref_galaxy_buds_touch_left_switch.setEnabled(true);
break;
default:
pref_galaxy_buds_touch_left_switch.setEnabled(false);
}
return true;
}
});
}
/*
final Preference pref_galaxy_buds_ambient_mode = handler.findPreference(PREF_GALAXY_BUDS_AMBIENT_SOUND);
boolean is_pref_galaxy_buds_ambient_mode_enabled = prefs.getBoolean(PREF_GALAXY_BUDS_AMBIENT_SOUND, false);
final Preference pref_galaxy_buds_ambient_voice_focus_preference = handler.findPreference(PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS_PREFERENCE);
if (pref_galaxy_buds_ambient_mode != null) {
if (is_pref_galaxy_buds_ambient_mode_enabled) {
pref_galaxy_buds_ambient_voice_focus_preference.setEnabled(true);
} else {
pref_galaxy_buds_ambient_voice_focus_preference.setEnabled(false);
}
pref_galaxy_buds_ambient_mode.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
handler.notifyPreferenceChanged(PREF_GALAXY_BUDS_AMBIENT_SOUND);
if ((boolean) newVal) {
pref_galaxy_buds_ambient_voice_focus_preference.setEnabled(true);
} else {
pref_galaxy_buds_ambient_voice_focus_preference.setEnabled(false);
}
return true;
}
});
}
*/
}
@Override
public Set<String> getPreferenceKeysWithSummary() {
return Collections.emptySet();
}
public static final Creator<GalaxyBudsSettingsCustomizer> CREATOR = new Creator<GalaxyBudsSettingsCustomizer>() {
@Override
public GalaxyBudsSettingsCustomizer createFromParcel(final Parcel in) {
final GBDevice device = in.readParcelable(GalaxyBudsSettingsCustomizer.class.getClassLoader());
return new GalaxyBudsSettingsCustomizer(device);
}
@Override
public GalaxyBudsSettingsCustomizer[] newArray(final int size) {
return new GalaxyBudsSettingsCustomizer[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(final Parcel dest, final int flags) {
dest.writeParcelable(device, 0);
}
}

View File

@ -0,0 +1,22 @@
/* Copyright (C) 2022 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami;
public enum ActivateDisplayOnLiftSensitivity {
NORMAL,
SENSITIVE
}

View File

@ -59,6 +59,7 @@ public class HuamiConst {
public static final String PREF_DISPLAY_ITEMS = "display_items"; public static final String PREF_DISPLAY_ITEMS = "display_items";
public static final String PREF_DISPLAY_ITEMS_SORTABLE = "display_items_sortable"; public static final String PREF_DISPLAY_ITEMS_SORTABLE = "display_items_sortable";
public static final String PREF_WORKOUT_ACTIVITY_TYPES_SORTABLE = "workout_activity_types_sortable";
public static final String PREF_SHORTCUTS = "shortcuts"; public static final String PREF_SHORTCUTS = "shortcuts";
public static final String PREF_SHORTCUTS_SORTABLE = "shortcuts_sortable"; public static final String PREF_SHORTCUTS_SORTABLE = "shortcuts_sortable";
public static final String PREF_EXPOSE_HR_THIRDPARTY = "expose_hr_thirdparty"; public static final String PREF_EXPOSE_HR_THIRDPARTY = "expose_hr_thirdparty";
@ -74,6 +75,7 @@ public class HuamiConst {
public static final String PREF_BUTTON_ACTION_SELECTION_BROADCAST = "BROADCAST"; public static final String PREF_BUTTON_ACTION_SELECTION_BROADCAST = "BROADCAST";
public static final String PREF_BUTTON_ACTION_SELECTION_FITNESS_APP_START = "FITNESS_CONTROL_START"; public static final String PREF_BUTTON_ACTION_SELECTION_FITNESS_APP_START = "FITNESS_CONTROL_START";
public static final String PREF_BUTTON_ACTION_SELECTION_FITNESS_APP_STOP = "FITNESS_CONTROL_STOP"; public static final String PREF_BUTTON_ACTION_SELECTION_FITNESS_APP_STOP = "FITNESS_CONTROL_STOP";
public static final String PREF_BUTTON_ACTION_SELECTION_FITNESS_APP_TOGGLE = "FITNESS_CONTROL_TOGGLE";
public static final String PREF_DEVICE_ACTION_SELECTION_OFF = "UNKNOWN"; public static final String PREF_DEVICE_ACTION_SELECTION_OFF = "UNKNOWN";
public static final String PREF_DEVICE_ACTION_SELECTION_BROADCAST = "BROADCAST"; public static final String PREF_DEVICE_ACTION_SELECTION_BROADCAST = "BROADCAST";
@ -84,6 +86,39 @@ public class HuamiConst {
public static final String PREF_DEVICE_ACTION_START_NON_WEAR_SELECTION = "events_forwarding_startnonwear_action_selection"; public static final String PREF_DEVICE_ACTION_START_NON_WEAR_SELECTION = "events_forwarding_startnonwear_action_selection";
public static final String PREF_DEVICE_ACTION_START_NON_WEAR_BROADCAST = "prefs_events_forwarding_startnonwear_broadcast"; public static final String PREF_DEVICE_ACTION_START_NON_WEAR_BROADCAST = "prefs_events_forwarding_startnonwear_broadcast";
/**
* The suffixes match the enum {@link nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiVibrationPatternNotificationType}.
*/
// profile
public static final String PREF_HUAMI_VIBRATION_PROFILE_PREFIX = "huami_vibration_profile_";
public static final String PREF_HUAMI_VIBRATION_PROFILE_APP_ALERTS = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "app_alerts";
public static final String PREF_HUAMI_VIBRATION_PROFILE_INCOMING_CALL = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "incoming_call";
public static final String PREF_HUAMI_VIBRATION_PROFILE_INCOMING_SMS = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "incoming_sms";
public static final String PREF_HUAMI_VIBRATION_PROFILE_GOAL_NOTIFICATION = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "goal_notification";
public static final String PREF_HUAMI_VIBRATION_PROFILE_ALARM = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "alarm";
public static final String PREF_HUAMI_VIBRATION_PROFILE_IDLE_ALERTS = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "idle_alerts";
public static final String PREF_HUAMI_VIBRATION_PROFILE_EVENT_REMINDER = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "event_reminder";
public static final String PREF_HUAMI_VIBRATION_PROFILE_FIND_BAND = PREF_HUAMI_VIBRATION_PROFILE_PREFIX + "find_band";
// count
public static final String PREF_HUAMI_VIBRATION_COUNT_PREFIX = "huami_vibration_count_";
public static final String PREF_HUAMI_VIBRATION_COUNT_APP_ALERTS = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "app_alerts";
public static final String PREF_HUAMI_VIBRATION_COUNT_INCOMING_CALL = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "incoming_call";
public static final String PREF_HUAMI_VIBRATION_COUNT_INCOMING_SMS = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "incoming_sms";
public static final String PREF_HUAMI_VIBRATION_COUNT_GOAL_NOTIFICATION = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "goal_notification";
public static final String PREF_HUAMI_VIBRATION_COUNT_ALARM = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "alarm";
public static final String PREF_HUAMI_VIBRATION_COUNT_IDLE_ALERTS = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "idle_alerts";
public static final String PREF_HUAMI_VIBRATION_COUNT_EVENT_REMINDER = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "event_reminder";
public static final String PREF_HUAMI_VIBRATION_COUNT_FIND_BAND = PREF_HUAMI_VIBRATION_COUNT_PREFIX + "find_band";
// try
public static final String PREF_HUAMI_VIBRATION_TRY_PREFIX = "huami_vibration_try_";
public static final String PREF_HUAMI_VIBRATION_TRY_APP_ALERTS = PREF_HUAMI_VIBRATION_TRY_PREFIX + "app_alerts";
public static final String PREF_HUAMI_VIBRATION_TRY_INCOMING_CALL = PREF_HUAMI_VIBRATION_TRY_PREFIX + "incoming_call";
public static final String PREF_HUAMI_VIBRATION_TRY_INCOMING_SMS = PREF_HUAMI_VIBRATION_TRY_PREFIX + "incoming_sms";
public static final String PREF_HUAMI_VIBRATION_TRY_GOAL_NOTIFICATION = PREF_HUAMI_VIBRATION_TRY_PREFIX + "goal_notification";
public static final String PREF_HUAMI_VIBRATION_TRY_ALARM = PREF_HUAMI_VIBRATION_TRY_PREFIX + "alarm";
public static final String PREF_HUAMI_VIBRATION_TRY_IDLE_ALERTS = PREF_HUAMI_VIBRATION_TRY_PREFIX + "idle_alerts";
public static final String PREF_HUAMI_VIBRATION_TRY_EVENT_REMINDER = PREF_HUAMI_VIBRATION_TRY_PREFIX + "event_reminder";
public static final String PREF_HUAMI_VIBRATION_TRY_FIND_BAND = PREF_HUAMI_VIBRATION_TRY_PREFIX + "find_band";
public static int toActivityKind(int rawType) { public static int toActivityKind(int rawType) {
switch (rawType) { switch (rawType) {

View File

@ -35,6 +35,7 @@ import java.text.SimpleDateFormat;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.Locale;
import de.greenrobot.dao.query.QueryBuilder; import de.greenrobot.dao.query.QueryBuilder;
import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.GBApplication;
@ -42,6 +43,7 @@ import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity; import nodomain.freeyourgadget.gadgetbridge.activities.SettingsActivity;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst; import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider; import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.DateTimeDisplay; import nodomain.freeyourgadget.gadgetbridge.devices.miband.DateTimeDisplay;
@ -50,11 +52,13 @@ import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBand2SampleProvider
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst; import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandPairingActivity; import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandPairingActivity;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandService; import nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandService;
import nodomain.freeyourgadget.gadgetbridge.devices.miband.VibrationProfile;
import nodomain.freeyourgadget.gadgetbridge.entities.AbstractActivitySample; import nodomain.freeyourgadget.gadgetbridge.entities.AbstractActivitySample;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession; import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device; import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySampleDao; import nodomain.freeyourgadget.gadgetbridge.entities.MiBandActivitySampleDao;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiVibrationPatternNotificationType;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs; import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public abstract class HuamiCoordinator extends AbstractDeviceCoordinator { public abstract class HuamiCoordinator extends AbstractDeviceCoordinator {
@ -166,6 +170,14 @@ public abstract class HuamiCoordinator extends AbstractDeviceCoordinator {
return getTimePreference(DeviceSettingsPreferenceConst.PREF_DISPLAY_ON_LIFT_END, "00:00", deviceAddress); return getTimePreference(DeviceSettingsPreferenceConst.PREF_DISPLAY_ON_LIFT_END, "00:00", deviceAddress);
} }
public static ActivateDisplayOnLiftSensitivity getDisplayOnLiftSensitivity(String deviceAddress) {
final SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(deviceAddress);
final String pref = prefs.getString(DeviceSettingsPreferenceConst.PREF_DISPLAY_ON_LIFT_SENSITIVITY, "sensitive");
return ActivateDisplayOnLiftSensitivity.valueOf(pref.toUpperCase(Locale.ROOT));
}
public static DisconnectNotificationSetting getDisconnectNotificationSetting(Context context, String deviceAddress) { public static DisconnectNotificationSetting getDisconnectNotificationSetting(Context context, String deviceAddress) {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress)); Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
@ -197,9 +209,9 @@ public abstract class HuamiCoordinator extends AbstractDeviceCoordinator {
return prefs.getBoolean(HuamiConst.PREF_USE_CUSTOM_FONT, false); return prefs.getBoolean(HuamiConst.PREF_USE_CUSTOM_FONT, false);
} }
public static boolean getGoalNotification() { public static boolean getGoalNotification(String deviceAddress) {
Prefs prefs = GBApplication.getPrefs(); SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(deviceAddress);
return prefs.getBoolean(MiBandConst.PREF_MI2_GOAL_NOTIFICATION, false); return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_USER_FITNESS_GOAL_NOTIFICATION, false);
} }
public static boolean getRotateWristToSwitchInfo(String deviceAddress) { public static boolean getRotateWristToSwitchInfo(String deviceAddress) {
@ -207,35 +219,35 @@ public abstract class HuamiCoordinator extends AbstractDeviceCoordinator {
return prefs.getBoolean(MiBandConst.PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO, false); return prefs.getBoolean(MiBandConst.PREF_MI2_ROTATE_WRIST_TO_SWITCH_INFO, false);
} }
public static boolean getInactivityWarnings() { public static boolean getInactivityWarnings(String deviceAddress) {
Prefs prefs = GBApplication.getPrefs(); SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(deviceAddress);
return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_INACTIVITY_ENABLE, false); return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_INACTIVITY_ENABLE, false);
} }
public static int getInactivityWarningsThreshold() { public static int getInactivityWarningsThreshold(String deviceAddress) {
Prefs prefs = GBApplication.getPrefs(); Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return prefs.getInt(DeviceSettingsPreferenceConst.PREF_INACTIVITY_THRESHOLD, 60); return prefs.getInt(DeviceSettingsPreferenceConst.PREF_INACTIVITY_THRESHOLD, 60);
} }
public static boolean getInactivityWarningsDnd() { public static boolean getInactivityWarningsDnd(String deviceAddress) {
Prefs prefs = GBApplication.getPrefs(); SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(deviceAddress);
return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND, false); return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND, false);
} }
public static Date getInactivityWarningsStart() { public static Date getInactivityWarningsStart(String deviceAddress) {
return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_START, "06:00"); return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_START, "06:00", deviceAddress);
} }
public static Date getInactivityWarningsEnd() { public static Date getInactivityWarningsEnd(String deviceAddress) {
return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_END, "22:00"); return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_END, "22:00", deviceAddress);
} }
public static Date getInactivityWarningsDndStart() { public static Date getInactivityWarningsDndStart(String deviceAddress) {
return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND_START, "12:00"); return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND_START, "12:00", deviceAddress);
} }
public static Date getInactivityWarningsDndEnd() { public static Date getInactivityWarningsDndEnd(String deviceAddress) {
return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND_END, "14:00"); return getTimePreference(DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND_END, "14:00", deviceAddress);
} }
public static Date getDoNotDisturbStart(String deviceAddress) { public static Date getDoNotDisturbStart(String deviceAddress) {
@ -256,11 +268,47 @@ public abstract class HuamiCoordinator extends AbstractDeviceCoordinator {
return prefs.getBoolean(HuamiConst.PREF_EXPOSE_HR_THIRDPARTY, false); return prefs.getBoolean(HuamiConst.PREF_EXPOSE_HR_THIRDPARTY, false);
} }
public static int getHeartRateMeasurementInterval(String deviceAddress) {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return GBApplication.getPrefs().getInt(DeviceSettingsPreferenceConst.PREF_HEARTRATE_MEASUREMENT_INTERVAL, 0) / 60;
}
public static boolean getHeartrateActivityMonitoring(String deviceAddress) throws IllegalArgumentException {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_HEARTRATE_ACTIVITY_MONITORING, false);
}
public static boolean getHeartrateAlert(String deviceAddress) throws IllegalArgumentException {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_HEARTRATE_ALERT_ENABLED, false);
}
public static int getHeartrateAlertThreshold(String deviceAddress) throws IllegalArgumentException {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return prefs.getInt(DeviceSettingsPreferenceConst.PREF_HEARTRATE_ALERT_THRESHOLD, 150);
}
public static boolean getHeartrateStressMonitoring(String deviceAddress) throws IllegalArgumentException {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_HEARTRATE_STRESS_MONITORING, false);
}
public static boolean getBtConnectedAdvertising(String deviceAddress) { public static boolean getBtConnectedAdvertising(String deviceAddress) {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress)); Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_BT_CONNECTED_ADVERTISEMENT, false); return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_BT_CONNECTED_ADVERTISEMENT, false);
} }
public static VibrationProfile getVibrationProfile(String deviceAddress, HuamiVibrationPatternNotificationType notificationType) {
Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
final String vibrationProfileId = prefs.getString(
HuamiConst.PREF_HUAMI_VIBRATION_PROFILE_PREFIX + notificationType.name().toLowerCase(Locale.ROOT),
VibrationProfile.ID_MEDIUM
);
final int vibrationProfileCount = prefs.getInt(HuamiConst.PREF_HUAMI_VIBRATION_COUNT_PREFIX + notificationType.name().toLowerCase(Locale.ROOT), 2);
return VibrationProfile.getProfile(vibrationProfileId, (short) vibrationProfileCount);
}
protected static Date getTimePreference(String key, String defaultValue, String deviceAddress) { protected static Date getTimePreference(String key, String defaultValue, String deviceAddress) {
Prefs prefs; Prefs prefs;
@ -344,4 +392,9 @@ public abstract class HuamiCoordinator extends AbstractDeviceCoordinator {
public int getReminderSlotCount() { public int getReminderSlotCount() {
return 22; // At least, Mi Fit still allows more return 22; // At least, Mi Fit still allows more
} }
@Override
public DeviceSpecificSettingsCustomizer getDeviceSpecificSettingsCustomizer(final GBDevice device) {
return new HuamiSettingsCustomizer(device);
}
} }

View File

@ -149,6 +149,8 @@ public class HuamiService {
public static final byte[] COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01}; public static final byte[] COMMAND_ENABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01};
public static final byte[] COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x00}; public static final byte[] COMMAND_DISABLE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x00};
public static final byte[] COMMAND_SCHEDULE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00}; public static final byte[] COMMAND_SCHEDULE_DISPLAY_ON_LIFT_WRIST = new byte[]{ENDPOINT_DISPLAY, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00};
public static final byte[] COMMAND_DISPLAY_ON_LIFT_WRIST_SPEED_NORMAL = new byte[]{ENDPOINT_DISPLAY, 0x23, 0x00, 0x00};
public static final byte[] COMMAND_DISPLAY_ON_LIFT_WRIST_SPEED_SENSITIVE = new byte[]{ENDPOINT_DISPLAY, 0x23, 0x00, 0x01};
public static final byte[] COMMAND_ENABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x01}; public static final byte[] COMMAND_ENABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x01};
public static final byte[] COMMAND_DISABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x00}; public static final byte[] COMMAND_DISABLE_GOAL_NOTIFICATION = new byte[]{ENDPOINT_DISPLAY, 0x06, 0x00, 0x00};
public static final byte[] COMMAND_ENABLE_ROTATE_WRIST_TO_SWITCH_INFO = new byte[]{ENDPOINT_DISPLAY, 0x0d, 0x00, 0x01}; public static final byte[] COMMAND_ENABLE_ROTATE_WRIST_TO_SWITCH_INFO = new byte[]{ENDPOINT_DISPLAY, 0x0d, 0x00, 0x01};
@ -163,10 +165,16 @@ public class HuamiService {
public static final byte[] COMMAND_ENABLE_DISCONNECT_NOTIFCATION = new byte[]{ENDPOINT_DISPLAY, 0x0c, 0x00, 0x01, 0, 0, 0, 0}; public static final byte[] COMMAND_ENABLE_DISCONNECT_NOTIFCATION = new byte[]{ENDPOINT_DISPLAY, 0x0c, 0x00, 0x01, 0, 0, 0, 0};
public static final byte[] COMMAND_DISABLE_DISCONNECT_NOTIFCATION = new byte[]{ENDPOINT_DISPLAY, 0x0c, 0x00, 0x00, 0, 0, 0, 0}; public static final byte[] COMMAND_DISABLE_DISCONNECT_NOTIFCATION = new byte[]{ENDPOINT_DISPLAY, 0x0c, 0x00, 0x00, 0, 0, 0, 0};
public static final byte[] COMMAND_REQUEST_ALARMS = new byte[]{0x0d}; public static final byte COMMAND_ALARMS = 0x0d;
public static final byte[] COMMAND_REQUEST_ALARMS_WITH_TIMES = new byte[]{(byte) 0xff,0x01,0x00,0x00,0x00}; public static final byte COMMAND_ALARMS_WITH_TIMES = 0x01;
public static final byte COMMAND_WORKOUT_ACTIVITY_TYPES = 0x11;
public static final byte COMMAND_GPS_VERSION = 0x0e;
public static final byte[] COMMAND_REQUEST_GPS_VERSION = new byte[]{0x0e}; public static final byte[] COMMAND_REQUEST_ALARMS = new byte[]{COMMAND_ALARMS};
public static final byte[] COMMAND_REQUEST_ALARMS_WITH_TIMES = new byte[]{(byte) 0xff, COMMAND_ALARMS_WITH_TIMES, 0x00, 0x00, 0x00};
public static final byte[] COMMAND_REQUEST_WORKOUT_ACTIVITY_TYPES = new byte[]{(byte) 0xff, COMMAND_WORKOUT_ACTIVITY_TYPES, 0x00, 0x00, 0x00};
public static final byte[] COMMAND_REQUEST_GPS_VERSION = new byte[]{COMMAND_GPS_VERSION};
// The third byte controls the threshold, in minutes // The third byte controls the threshold, in minutes
// The last 8 bytes represent 2 separate time intervals for the inactivity warnings // The last 8 bytes represent 2 separate time intervals for the inactivity warnings

View File

@ -0,0 +1,104 @@
/* Copyright (C) 2022 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huami;
import android.os.Parcel;
import android.text.InputType;
import androidx.preference.Preference;
import java.util.HashSet;
import java.util.Locale;
import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsHandler;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiVibrationPatternNotificationType;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public class HuamiSettingsCustomizer implements DeviceSpecificSettingsCustomizer {
final GBDevice device;
public HuamiSettingsCustomizer(final GBDevice device) {
this.device = device;
}
@Override
public void onPreferenceChange(final Preference preference, final DeviceSpecificSettingsHandler handler) {
// Nothing to do here
}
@Override
public void customizeSettings(final DeviceSpecificSettingsHandler handler, Prefs prefs) {
for (HuamiVibrationPatternNotificationType notificationType : HuamiVibrationPatternNotificationType.values()) {
final String typeKey = notificationType.name().toLowerCase(Locale.ROOT);
handler.addPreferenceHandlerFor(HuamiConst.PREF_HUAMI_VIBRATION_PROFILE_PREFIX + typeKey);
handler.addPreferenceHandlerFor(HuamiConst.PREF_HUAMI_VIBRATION_COUNT_PREFIX + typeKey);
handler.setInputTypeFor(HuamiConst.PREF_HUAMI_VIBRATION_COUNT_PREFIX + typeKey, InputType.TYPE_CLASS_NUMBER);
final String tryPrefKey = HuamiConst.PREF_HUAMI_VIBRATION_TRY_PREFIX + typeKey;
final Preference tryPref = handler.findPreference(tryPrefKey);
if (tryPref != null) {
tryPref.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
@Override
public boolean onPreferenceClick(final Preference preference) {
GBApplication.deviceService().onSendConfiguration(tryPrefKey);
return true;
}
});
}
}
}
@Override
public Set<String> getPreferenceKeysWithSummary() {
final Set<String> keysWithSummary = new HashSet<>();
for (HuamiVibrationPatternNotificationType notificationType : HuamiVibrationPatternNotificationType.values()) {
final String typeKey = notificationType.name().toLowerCase(Locale.ROOT);
keysWithSummary.add(HuamiConst.PREF_HUAMI_VIBRATION_COUNT_PREFIX + typeKey);
}
return keysWithSummary;
}
public static final Creator<HuamiSettingsCustomizer> CREATOR = new Creator<HuamiSettingsCustomizer>() {
@Override
public HuamiSettingsCustomizer createFromParcel(final Parcel in) {
final GBDevice device = in.readParcelable(HuamiSettingsCustomizer.class.getClassLoader());
return new HuamiSettingsCustomizer(device);
}
@Override
public HuamiSettingsCustomizer[] newArray(final int size) {
return new HuamiSettingsCustomizer[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(final Parcel dest, final int flags) {
dest.writeParcelable(device, 0);
}
}

View File

@ -85,16 +85,31 @@ public class AmazfitBand5Coordinator extends HuamiCoordinator {
return true; return true;
} }
@Override
public int getWorldClocksSlotCount() {
return 20; // as enforced by Mi Fit
}
@Override
public int getWorldClocksLabelLength() {
return 30; // at least
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitband5, R.xml.devicesettings_amazfitband5,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_dateformat, R.xml.devicesettings_dateformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_nightmode, R.xml.devicesettings_nightmode,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display_sensitivity,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_swipeunlock, R.xml.devicesettings_swipeunlock,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -83,8 +83,11 @@ public class AmazfitBipCoordinator extends HuamiCoordinator {
R.xml.devicesettings_amazfitbip, R.xml.devicesettings_amazfitbip,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -72,8 +72,11 @@ public class AmazfitBipLiteCoordinator extends AmazfitBipCoordinator {
R.xml.devicesettings_amazfitbip, R.xml.devicesettings_amazfitbip,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_bt_connected_advertisement, R.xml.devicesettings_bt_connected_advertisement,

View File

@ -82,14 +82,28 @@ public class AmazfitBipSCoordinator extends HuamiCoordinator {
return true; return true;
} }
@Override
public int getWorldClocksSlotCount() {
return 20; // as enforced by Mi Fit
}
@Override
public int getWorldClocksLabelLength() {
return 30; // at least
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitbips, R.xml.devicesettings_amazfitbips,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,
R.xml.devicesettings_expose_hr_thirdparty, R.xml.devicesettings_expose_hr_thirdparty,

View File

@ -93,15 +93,30 @@ public class AmazfitBipUCoordinator extends HuamiCoordinator {
return 0; return 0;
} }
@Override
public int getWorldClocksSlotCount() {
return 20; // as enforced by Mi Fit
}
@Override
public int getWorldClocksLabelLength() {
return 30; // at least
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitbipu, R.xml.devicesettings_amazfitbipu,
R.xml.devicesettings_vibrationpatterns,
//R.xml.devicesettings_canned_dismisscall_16, //R.xml.devicesettings_canned_dismisscall_16,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display_sensitivity,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,
R.xml.devicesettings_expose_hr_thirdparty, R.xml.devicesettings_expose_hr_thirdparty,

View File

@ -93,14 +93,29 @@ public class AmazfitBipUProCoordinator extends HuamiCoordinator {
return 0; return 0;
} }
@Override
public int getWorldClocksSlotCount() {
return 20; // as enforced by Mi Fit
}
@Override
public int getWorldClocksLabelLength() {
return 30; // at least
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitbipupro, R.xml.devicesettings_amazfitbipupro,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display_sensitivity,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,
R.xml.devicesettings_expose_hr_thirdparty, R.xml.devicesettings_expose_hr_thirdparty,

View File

@ -90,9 +90,12 @@ public class AmazfitCorCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitcor, R.xml.devicesettings_amazfitcor,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -92,9 +92,12 @@ public class AmazfitCor2Coordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitcor, R.xml.devicesettings_amazfitcor,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -90,8 +90,11 @@ public class AmazfitGTRCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr, R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -91,8 +91,11 @@ public class AmazfitGTRLiteCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr, R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -96,8 +96,11 @@ public class AmazfitGTR2Coordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr2, R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -96,8 +96,11 @@ public class AmazfitGTR2eCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr2, R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -90,8 +90,11 @@ public class AmazfitGTSCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr, R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -96,8 +96,11 @@ public class AmazfitGTS2Coordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr2, R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -65,8 +65,11 @@ public class AmazfitGTS2MiniCoordinator extends AmazfitGTS2Coordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgts2mini, R.xml.devicesettings_amazfitgts2mini,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -96,8 +96,11 @@ public class AmazfitGTS2eCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr2, R.xml.devicesettings_amazfitgtsgtr2,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -84,8 +84,11 @@ public class AmazfitNeoCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitneo, R.xml.devicesettings_amazfitneo,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_expose_hr_thirdparty, R.xml.devicesettings_expose_hr_thirdparty,
R.xml.devicesettings_bt_connected_advertisement, R.xml.devicesettings_bt_connected_advertisement,

View File

@ -90,8 +90,11 @@ public class AmazfitTRexCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfittrex, R.xml.devicesettings_amazfittrex,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -90,8 +90,11 @@ public class AmazfitTRexProCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfittrexpro, R.xml.devicesettings_amazfittrexpro,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -91,7 +91,10 @@ public class AmazfitVergeLCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitvergel, R.xml.devicesettings_amazfitvergel,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -93,11 +93,14 @@ public class AmazfitXCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitx, R.xml.devicesettings_amazfitx,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_dateformat, R.xml.devicesettings_dateformat,
R.xml.devicesettings_nightmode, R.xml.devicesettings_nightmode,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_swipeunlock, R.xml.devicesettings_swipeunlock,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -84,9 +84,12 @@ public class MiBand2Coordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_miband2, R.xml.devicesettings_miband2,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_donotdisturb_withauto, R.xml.devicesettings_donotdisturb_withauto,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_rotatewrist_cycleinfo, R.xml.devicesettings_rotatewrist_cycleinfo,
R.xml.devicesettings_buttonactions, R.xml.devicesettings_buttonactions,
R.xml.devicesettings_reserve_alarms_calendar, R.xml.devicesettings_reserve_alarms_calendar,

View File

@ -87,8 +87,11 @@ public class MiBand2HRXCoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_miband2, R.xml.devicesettings_miband2,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_donotdisturb_withauto, R.xml.devicesettings_donotdisturb_withauto,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_rotatewrist_cycleinfo, R.xml.devicesettings_rotatewrist_cycleinfo,
R.xml.devicesettings_pairingkey, R.xml.devicesettings_pairingkey,
R.xml.devicesettings_transliteration R.xml.devicesettings_transliteration

View File

@ -103,11 +103,14 @@ public class MiBand3Coordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_miband3, R.xml.devicesettings_miband3,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_dateformat, R.xml.devicesettings_dateformat,
R.xml.devicesettings_nightmode, R.xml.devicesettings_nightmode,
R.xml.devicesettings_donotdisturb_withauto, R.xml.devicesettings_donotdisturb_withauto,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_donotdisturb_lift_wrist, R.xml.devicesettings_donotdisturb_lift_wrist,
R.xml.devicesettings_swipeunlock, R.xml.devicesettings_swipeunlock,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,

View File

@ -89,12 +89,16 @@ public class MiBand4Coordinator extends HuamiCoordinator {
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_miband3, R.xml.devicesettings_miband3,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_dateformat, R.xml.devicesettings_dateformat,
R.xml.devicesettings_nightmode, R.xml.devicesettings_nightmode,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_swipeunlock, R.xml.devicesettings_swipeunlock,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -85,16 +85,36 @@ public class MiBand5Coordinator extends HuamiCoordinator {
return true; return true;
} }
@Override
public int getReminderSlotCount() {
return 50; // as enforced by Zepp Life
}
@Override
public int getWorldClocksSlotCount() {
return 20; // as enforced by Mi Fit
}
@Override
public int getWorldClocksLabelLength() {
return 30; // at least
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_miband5, R.xml.devicesettings_miband5,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_dateformat, R.xml.devicesettings_dateformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_nightmode, R.xml.devicesettings_nightmode,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display_sensitivity,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_swipeunlock, R.xml.devicesettings_swipeunlock,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -70,16 +70,31 @@ public class MiBand6Coordinator extends HuamiCoordinator {
return true; return true;
} }
@Override
public int getWorldClocksSlotCount() {
return 20; // as enforced by Mi Fit
}
@Override
public int getWorldClocksLabelLength() {
return 30; // at least
}
@Override @Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_miband6, R.xml.devicesettings_miband6,
R.xml.devicesettings_vibrationpatterns,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.heartrate_sleep_alert_activity_stress,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_custom_emoji_font, R.xml.devicesettings_custom_emoji_font,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_dateformat, R.xml.devicesettings_dateformat,
R.xml.devicesettings_world_clocks,
R.xml.devicesettings_nightmode, R.xml.devicesettings_nightmode,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display_sensitivity,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_swipeunlock, R.xml.devicesettings_swipeunlock,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_reserve_reminders_calendar, R.xml.devicesettings_reserve_reminders_calendar,

View File

@ -90,8 +90,11 @@ public class ZeppECoordinator extends HuamiCoordinator {
return new int[]{ return new int[]{
R.xml.devicesettings_amazfitgtsgtr, R.xml.devicesettings_amazfitgtsgtr,
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_goal_notification,
R.xml.devicesettings_timeformat, R.xml.devicesettings_timeformat,
R.xml.devicesettings_liftwrist_display, R.xml.devicesettings_liftwrist_display,
R.xml.devicesettings_inactivity_dnd,
R.xml.devicesettings_disconnectnotification, R.xml.devicesettings_disconnectnotification,
R.xml.devicesettings_sync_calendar, R.xml.devicesettings_sync_calendar,
R.xml.devicesettings_expose_hr_thirdparty, R.xml.devicesettings_expose_hr_thirdparty,

View File

@ -24,10 +24,8 @@ public final class MiBandConst {
public static final String PREF_MIBAND_ADDRESS = "development_miaddr"; // FIXME: should be prefixed mi_ public static final String PREF_MIBAND_ADDRESS = "development_miaddr"; // FIXME: should be prefixed mi_
public static final String PREF_MIBAND_ALARMS = "mi_alarms"; public static final String PREF_MIBAND_ALARMS = "mi_alarms";
public static final String PREF_MIBAND_DONT_ACK_TRANSFER = "mi_dont_ack_transfer"; public static final String PREF_MIBAND_DONT_ACK_TRANSFER = "mi_dont_ack_transfer";
public static final String PREF_MIBAND_USE_HR_FOR_SLEEP_DETECTION = "mi_hr_sleep_detection";
public static final String PREF_MIBAND_DEVICE_TIME_OFFSET_HOURS = "device_time_offset_hours"; public static final String PREF_MIBAND_DEVICE_TIME_OFFSET_HOURS = "device_time_offset_hours";
public static final String PREF_MI2_DATEFORMAT = "mi2_dateformat"; public static final String PREF_MI2_DATEFORMAT = "mi2_dateformat";
public static final String PREF_MI2_GOAL_NOTIFICATION = "mi2_goal_notification";
public static final String PREF_MI2_DISPLAY_ITEM_CLOCK = "clock"; public static final String PREF_MI2_DISPLAY_ITEM_CLOCK = "clock";
public static final String PREF_MI2_DISPLAY_ITEM_STEPS = "steps"; public static final String PREF_MI2_DISPLAY_ITEM_STEPS = "steps";
public static final String PREF_MI2_DISPLAY_ITEM_DISTANCE = "distance"; public static final String PREF_MI2_DISPLAY_ITEM_DISTANCE = "distance";

View File

@ -245,9 +245,9 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator {
return prefs.getInt(MiBandConst.PREF_MIBAND_DEVICE_TIME_OFFSET_HOURS, 0); return prefs.getInt(MiBandConst.PREF_MIBAND_DEVICE_TIME_OFFSET_HOURS, 0);
} }
public static boolean getHeartrateSleepSupport(String miBandAddress) throws IllegalArgumentException { public static boolean getHeartrateSleepSupport(String deviceAddress) throws IllegalArgumentException {
Prefs prefs = GBApplication.getPrefs(); Prefs prefs = new Prefs(GBApplication.getDeviceSpecificSharedPrefs(deviceAddress));
return prefs.getBoolean(MiBandConst.PREF_MIBAND_USE_HR_FOR_SLEEP_DETECTION, false); return prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_HEARTRATE_USE_FOR_SLEEP_DETECTION, false);
} }
public static int getReservedAlarmSlots(String miBandAddress) throws IllegalArgumentException { public static int getReservedAlarmSlots(String miBandAddress) throws IllegalArgumentException {
@ -265,6 +265,7 @@ public class MiBandCoordinator extends AbstractDeviceCoordinator {
public int[] getSupportedDeviceSpecificSettings(GBDevice device) { public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{ return new int[]{
R.xml.devicesettings_wearlocation, R.xml.devicesettings_wearlocation,
R.xml.devicesettings_heartrate_sleep,
R.xml.devicesettings_lowlatency_fwupdate, R.xml.devicesettings_lowlatency_fwupdate,
R.xml.devicesettings_reserve_alarms_calendar, R.xml.devicesettings_reserve_alarms_calendar,
R.xml.devicesettings_fake_timeoffset R.xml.devicesettings_fake_timeoffset

View File

@ -37,18 +37,10 @@ import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
import nodomain.freeyourgadget.gadgetbridge.util.GB; import nodomain.freeyourgadget.gadgetbridge.util.GB;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs; import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_ENABLE;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_START;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_END;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_THRESHOLD; import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_THRESHOLD;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND_START;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_INACTIVITY_DND_END;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.ORIGIN_ALARM_CLOCK; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.ORIGIN_ALARM_CLOCK;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.ORIGIN_INCOMING_CALL; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.ORIGIN_INCOMING_CALL;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MI2_GOAL_NOTIFICATION;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MIBAND_ADDRESS; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MIBAND_ADDRESS;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.PREF_MIBAND_USE_HR_FOR_SLEEP_DETECTION;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.VIBRATION_COUNT; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.VIBRATION_COUNT;
import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.getNotificationPrefKey; import static nodomain.freeyourgadget.gadgetbridge.devices.miband.MiBandConst.getNotificationPrefKey;
import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_NAME; import static nodomain.freeyourgadget.gadgetbridge.model.ActivityUser.PREF_USER_NAME;
@ -64,138 +56,6 @@ public class MiBandPreferencesActivity extends AbstractSettingsActivity {
Prefs prefs = GBApplication.getPrefs(); Prefs prefs = GBApplication.getPrefs();
final Preference enableHeartrateSleepSupport = findPreference(PREF_MIBAND_USE_HR_FOR_SLEEP_DETECTION);
enableHeartrateSleepSupport.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
GBApplication.deviceService().onEnableHeartRateSleepSupport(Boolean.TRUE.equals(newVal));
return true;
}
});
final Preference heartrateMeasurementInterval = findPreference("heartrate_measurement_interval");
heartrateMeasurementInterval.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
GBApplication.deviceService().onSetHeartRateMeasurementInterval(Integer.parseInt((String) newVal));
return true;
}
});
final Preference goalNotification = findPreference(PREF_MI2_GOAL_NOTIFICATION);
goalNotification.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_MI2_GOAL_NOTIFICATION);
}
});
return true;
}
});
final Preference inactivityWarnings = findPreference(PREF_INACTIVITY_ENABLE);
inactivityWarnings.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_INACTIVITY_ENABLE);
}
});
return true;
}
});
final Preference inactivityWarningsThreshold = findPreference(PREF_INACTIVITY_THRESHOLD);
inactivityWarningsThreshold.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_INACTIVITY_THRESHOLD);
}
});
return true;
}
});
final Preference inactivityWarningsStart = findPreference(PREF_INACTIVITY_START);
inactivityWarningsStart.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_INACTIVITY_START);
}
});
return true;
}
});
final Preference inactivityWarningsEnd = findPreference(PREF_INACTIVITY_END);
inactivityWarningsEnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_INACTIVITY_END);
}
});
return true;
}
});
final Preference inactivityWarningsDnd = findPreference(PREF_INACTIVITY_DND);
inactivityWarningsDnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_INACTIVITY_DND);
}
});
return true;
}
});
final Preference inactivityWarningsDndStart = findPreference(PREF_INACTIVITY_DND_START);
inactivityWarningsDndStart.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_INACTIVITY_DND_START);
}
});
return true;
}
});
final Preference inactivityWarningsDndEnd = findPreference(PREF_INACTIVITY_DND_END);
inactivityWarningsDndEnd.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newVal) {
invokeLater(new Runnable() {
@Override
public void run() {
GBApplication.deviceService().onSendConfiguration(PREF_INACTIVITY_DND_END);
}
});
return true;
}
});
final Preference fitnessGoal = findPreference(ActivityUser.PREF_USER_STEPS_GOAL); final Preference fitnessGoal = findPreference(ActivityUser.PREF_USER_STEPS_GOAL);
fitnessGoal.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { fitnessGoal.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override @Override

View File

@ -79,6 +79,10 @@ public class VibrationProfile {
* @param repeat how often the sequence shall be repeated * @param repeat how often the sequence shall be repeated
*/ */
public VibrationProfile(String id, int[] onOffSequence, short repeat) { public VibrationProfile(String id, int[] onOffSequence, short repeat) {
if (onOffSequence.length % 2 != 0) {
throw new IllegalArgumentException("Each on duration must have a subsequent off duration");
}
this.id = id; this.id = id;
this.repeat = repeat; this.repeat = repeat;
this.onOffSequence = onOffSequence; this.onOffSequence = onOffSequence;

View File

@ -0,0 +1,38 @@
/* Copyright (C) 2022 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones;
public enum SonyHeadphonesCapabilities {
BatterySingle,
BatteryDual,
BatteryCase,
PowerOffFromPhone,
AmbientSoundControl,
WindNoiseReduction,
AncOptimizer,
AudioSettingsOnlyOnSbcCodec,
AudioUpsampling,
ButtonModesLeftRight,
VoiceNotifications,
AutomaticPowerOffWhenTakenOff,
AutomaticPowerOffByTime,
TouchSensorSingle,
Equalizer,
SoundPosition,
SurroundMode,
PauseWhenTakenOff
}

View File

@ -23,7 +23,18 @@ import android.net.Uri;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import org.apache.commons.lang3.ArrayUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.GBException; import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer; import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
@ -32,6 +43,7 @@ import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device; import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample; import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
public abstract class SonyHeadphonesCoordinator extends AbstractDeviceCoordinator { public abstract class SonyHeadphonesCoordinator extends AbstractDeviceCoordinator {
@Override @Override
@ -123,4 +135,113 @@ public abstract class SonyHeadphonesCoordinator extends AbstractDeviceCoordinato
public boolean supportsFindDevice() { public boolean supportsFindDevice() {
return false; return false;
} }
@Override
public boolean supportsPowerOff() {
return supports(SonyHeadphonesCapabilities.PowerOffFromPhone);
}
@Override
public int getBatteryCount() {
if (supports(SonyHeadphonesCapabilities.BatterySingle)) {
if (supports(SonyHeadphonesCapabilities.BatteryDual)) {
throw new IllegalStateException("A device can't have both single and dual battery");
} else if(supports(SonyHeadphonesCapabilities.BatteryCase)) {
throw new IllegalStateException("Devices with single battery + case are not supported by the protocol");
}
}
int batteryCount = 0;
if (supports(SonyHeadphonesCapabilities.BatterySingle)) {
batteryCount += 1;
}
if (supports(SonyHeadphonesCapabilities.BatteryCase)) {
batteryCount += 1;
}
if (supports(SonyHeadphonesCapabilities.BatteryDual)) {
batteryCount += 2;
}
return batteryCount;
}
@Override
public int[] getSupportedDeviceSpecificSettings(final GBDevice device) {
final List<Integer> settings = new ArrayList<>();
if (supports(SonyHeadphonesCapabilities.AmbientSoundControl)) {
if (supports(SonyHeadphonesCapabilities.WindNoiseReduction)) {
settings.add(R.xml.devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction);
} else {
settings.add(R.xml.devicesettings_sony_headphones_ambient_sound_control);
}
if (supports(SonyHeadphonesCapabilities.AncOptimizer)) {
settings.add(R.xml.devicesettings_sony_headphones_anc_optimizer);
}
}
addSettingsUnderHeader(settings, R.xml.devicesettings_header_other, new LinkedHashMap<SonyHeadphonesCapabilities, Integer>() {{
put(SonyHeadphonesCapabilities.AudioSettingsOnlyOnSbcCodec, R.xml.devicesettings_sony_warning_wh1000xm3);
put(SonyHeadphonesCapabilities.Equalizer, R.xml.devicesettings_sony_headphones_equalizer);
put(SonyHeadphonesCapabilities.SoundPosition, R.xml.devicesettings_sony_headphones_sound_position);
put(SonyHeadphonesCapabilities.SurroundMode, R.xml.devicesettings_sony_headphones_surround_mode);
put(SonyHeadphonesCapabilities.AudioUpsampling, R.xml.devicesettings_sony_headphones_audio_upsampling);
}});
addSettingsUnderHeader(settings, R.xml.devicesettings_header_system, new LinkedHashMap<SonyHeadphonesCapabilities, Integer>() {{
put(SonyHeadphonesCapabilities.ButtonModesLeftRight, R.xml.devicesettings_sony_headphones_button_modes_left_right);
put(SonyHeadphonesCapabilities.TouchSensorSingle, R.xml.devicesettings_sony_headphones_touch_sensor_single);
put(SonyHeadphonesCapabilities.PauseWhenTakenOff, R.xml.devicesettings_sony_headphones_pause_when_taken_off);
put(SonyHeadphonesCapabilities.AutomaticPowerOffWhenTakenOff, R.xml.devicesettings_automatic_power_off_when_taken_off);
put(SonyHeadphonesCapabilities.AutomaticPowerOffByTime, R.xml.devicesettings_automatic_power_off_by_time);
put(SonyHeadphonesCapabilities.VoiceNotifications, R.xml.devicesettings_sony_headphones_notifications_voice_guide);
}});
settings.add(R.xml.devicesettings_sony_headphones_device_info);
return ArrayUtils.toPrimitive(settings.toArray(new Integer[0]));
}
public List<SonyHeadphonesCapabilities> getCapabilities() {
return Collections.emptyList();
}
public boolean supports(final SonyHeadphonesCapabilities capability) {
return getCapabilities().contains(capability);
}
/**
* Add the preference screens for capabilities under a header. The header is also only added if at least one capability is supported by the device.
*
* @param settings the list of settings to update
* @param header the header to add, if any capability supported
* @param capabilities the map of capability to preference screen
*/
private void addSettingsUnderHeader(final List<Integer> settings,
final int header,
final Map<SonyHeadphonesCapabilities, Integer> capabilities) {
final Set<SonyHeadphonesCapabilities> supportedCapabilities = new HashSet<>(capabilities.keySet());
for (SonyHeadphonesCapabilities capability : capabilities.keySet()) {
if (!supports(capability)) {
supportedCapabilities.remove(capability);
}
}
if (supportedCapabilities.isEmpty()) {
// None of the capabilities in the map are supported
return;
}
settings.add(header);
for (Map.Entry<SonyHeadphonesCapabilities, Integer> capabilitiesSetting : capabilities.entrySet()) {
if (supports(capabilitiesSetting.getKey())) {
settings.add(capabilitiesSetting.getValue());
}
}
}
} }

View File

@ -47,8 +47,10 @@ import androidx.preference.ListPreference;
import androidx.preference.Preference; import androidx.preference.Preference;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Set;
import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer; import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSpecificSettingsCustomizer;
@ -57,6 +59,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.prefs.Ambien
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.sony.headphones.protocol.impl.v1.params.NoiseCancellingOptimizerStatus; import nodomain.freeyourgadget.gadgetbridge.service.devices.sony.headphones.protocol.impl.v1.params.NoiseCancellingOptimizerStatus;
import nodomain.freeyourgadget.gadgetbridge.util.Prefs;
public class SonyHeadphonesSettingsCustomizer implements DeviceSpecificSettingsCustomizer { public class SonyHeadphonesSettingsCustomizer implements DeviceSpecificSettingsCustomizer {
private ProgressDialog ancOptimizerProgressDialog; private ProgressDialog ancOptimizerProgressDialog;
@ -114,7 +117,7 @@ public class SonyHeadphonesSettingsCustomizer implements DeviceSpecificSettingsC
} }
@Override @Override
public void customizeSettings(final DeviceSpecificSettingsHandler handler) { public void customizeSettings(final DeviceSpecificSettingsHandler handler, Prefs prefs) {
// Only enable the focus on voice check and voice level slider if the ambient sound control mode is ambient sound // Only enable the focus on voice check and voice level slider if the ambient sound control mode is ambient sound
final ListPreference ambientSoundControl = handler.findPreference(PREF_SONY_AMBIENT_SOUND_CONTROL); final ListPreference ambientSoundControl = handler.findPreference(PREF_SONY_AMBIENT_SOUND_CONTROL);
@ -185,6 +188,11 @@ public class SonyHeadphonesSettingsCustomizer implements DeviceSpecificSettingsC
} }
} }
@Override
public Set<String> getPreferenceKeysWithSummary() {
return Collections.emptySet();
}
public static final Creator<SonyHeadphonesSettingsCustomizer> CREATOR = new Creator<SonyHeadphonesSettingsCustomizer>() { public static final Creator<SonyHeadphonesSettingsCustomizer> CREATOR = new Creator<SonyHeadphonesSettingsCustomizer>() {
@Override @Override
public SonyHeadphonesSettingsCustomizer createFromParcel(final Parcel in) { public SonyHeadphonesSettingsCustomizer createFromParcel(final Parcel in) {

View File

@ -0,0 +1,74 @@
/* Copyright (C) 2022 Ngô Minh Quang
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinators;
import androidx.annotation.NonNull;
import java.util.Arrays;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class SonyWF1000XM3Coordinator extends SonyHeadphonesCoordinator {
@NonNull
@Override
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
if (candidate.getName().contains("WF-1000XM3")) {
return DeviceType.SONY_WF_1000XM3;
}
return DeviceType.UNKNOWN;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.SONY_WF_1000XM3;
}
@Override
public BatteryConfig[] getBatteryConfig() {
final BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_tws_case, R.string.battery_case);
final BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_galaxy_buds_l, R.string.left_earbud);
final BatteryConfig battery3 = new BatteryConfig(2, R.drawable.ic_galaxy_buds_r, R.string.right_earbud);
return new BatteryConfig[]{battery1, battery2, battery3};
}
@Override
public List<SonyHeadphonesCapabilities> getCapabilities() {
return Arrays.asList(
SonyHeadphonesCapabilities.BatteryDual,
SonyHeadphonesCapabilities.BatteryCase,
SonyHeadphonesCapabilities.PowerOffFromPhone,
SonyHeadphonesCapabilities.AmbientSoundControl,
SonyHeadphonesCapabilities.WindNoiseReduction,
SonyHeadphonesCapabilities.Equalizer,
SonyHeadphonesCapabilities.AudioUpsampling,
SonyHeadphonesCapabilities.ButtonModesLeftRight,
SonyHeadphonesCapabilities.PauseWhenTakenOff,
SonyHeadphonesCapabilities.AutomaticPowerOffWhenTakenOff,
SonyHeadphonesCapabilities.VoiceNotifications
);
}
}

View File

@ -18,9 +18,12 @@ package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinator
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import java.util.Arrays;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig; import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
@ -41,37 +44,27 @@ public class SonyWFSP800NCoordinator extends SonyHeadphonesCoordinator {
return DeviceType.SONY_WF_SP800N; return DeviceType.SONY_WF_SP800N;
} }
@Override
public int getBatteryCount() {
return 3;
}
@Override
public boolean supportsPowerOff() {
return true;
}
@Override @Override
public BatteryConfig[] getBatteryConfig() { public BatteryConfig[] getBatteryConfig() {
final BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_tws_case, R.string.battery_case); final BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_sony_wf_800n_case, R.string.battery_case);
final BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_galaxy_buds_l, R.string.left_earbud); final BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_sony_wf_800n_left, R.string.left_earbud);
final BatteryConfig battery3 = new BatteryConfig(2, R.drawable.ic_galaxy_buds_r, R.string.right_earbud); final BatteryConfig battery3 = new BatteryConfig(2, R.drawable.ic_sony_wf_800n_right, R.string.right_earbud);
return new BatteryConfig[]{battery1, battery2, battery3}; return new BatteryConfig[]{battery1, battery2, battery3};
} }
@Override @Override
public int[] getSupportedDeviceSpecificSettings(final GBDevice device) { public List<SonyHeadphonesCapabilities> getCapabilities() {
return new int[]{ return Arrays.asList(
R.xml.devicesettings_sony_headphones_ambient_sound_control, SonyHeadphonesCapabilities.BatteryDual,
R.xml.devicesettings_header_other, SonyHeadphonesCapabilities.BatteryCase,
R.xml.devicesettings_sony_headphones_equalizer, SonyHeadphonesCapabilities.PowerOffFromPhone,
R.xml.devicesettings_header_system, SonyHeadphonesCapabilities.AmbientSoundControl,
R.xml.devicesettings_sony_headphones_button_modes_left_right, SonyHeadphonesCapabilities.Equalizer,
R.xml.devicesettings_sony_headphones_pause_when_taken_off, SonyHeadphonesCapabilities.ButtonModesLeftRight,
R.xml.devicesettings_automatic_power_off_when_taken_off, SonyHeadphonesCapabilities.PauseWhenTakenOff,
R.xml.devicesettings_sony_headphones_notifications_voice_guide, SonyHeadphonesCapabilities.AutomaticPowerOffWhenTakenOff,
R.xml.devicesettings_sony_headphones_device_info SonyHeadphonesCapabilities.VoiceNotifications
}; );
} }
} }

View File

@ -18,9 +18,11 @@ package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinator
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.R; import java.util.Arrays;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
@ -41,21 +43,20 @@ public class SonyWH1000XM3Coordinator extends SonyHeadphonesCoordinator {
} }
@Override @Override
public int[] getSupportedDeviceSpecificSettings(final GBDevice device) { public List<SonyHeadphonesCapabilities> getCapabilities() {
return new int[]{ return Arrays.asList(
R.xml.devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction, SonyHeadphonesCapabilities.BatterySingle,
R.xml.devicesettings_sony_headphones_anc_optimizer, SonyHeadphonesCapabilities.AmbientSoundControl,
R.xml.devicesettings_header_other, SonyHeadphonesCapabilities.WindNoiseReduction,
R.xml.devicesettings_sony_warning_wh1000xm3, SonyHeadphonesCapabilities.AncOptimizer,
R.xml.devicesettings_sony_headphones_equalizer, SonyHeadphonesCapabilities.AudioSettingsOnlyOnSbcCodec,
R.xml.devicesettings_sony_headphones_sound_position, SonyHeadphonesCapabilities.Equalizer,
R.xml.devicesettings_sony_headphones_surround_mode, SonyHeadphonesCapabilities.SoundPosition,
R.xml.devicesettings_sony_headphones_audio_upsampling, SonyHeadphonesCapabilities.SurroundMode,
R.xml.devicesettings_header_system, SonyHeadphonesCapabilities.AudioUpsampling,
R.xml.devicesettings_sony_headphones_touch_sensor_single, SonyHeadphonesCapabilities.TouchSensorSingle,
R.xml.devicesettings_automatic_power_off_by_time, SonyHeadphonesCapabilities.AutomaticPowerOffByTime,
R.xml.devicesettings_sony_headphones_notifications_voice_guide, SonyHeadphonesCapabilities.VoiceNotifications
R.xml.devicesettings_sony_headphones_device_info );
};
} }
} }

View File

@ -18,9 +18,11 @@ package nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.coordinator
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import nodomain.freeyourgadget.gadgetbridge.R; import java.util.Arrays;
import java.util.List;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCapabilities;
import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.sony.headphones.SonyHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate; import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType; import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
@ -41,22 +43,21 @@ public class SonyWH1000XM4Coordinator extends SonyHeadphonesCoordinator {
} }
@Override @Override
public int[] getSupportedDeviceSpecificSettings(final GBDevice device) { public List<SonyHeadphonesCapabilities> getCapabilities() {
return new int[]{ return Arrays.asList(
// TODO: Function of [CUSTOM] button // TODO: Function of [CUSTOM] button
R.xml.devicesettings_sony_headphones_ambient_sound_control_wind_noise_reduction,
R.xml.devicesettings_sony_headphones_anc_optimizer,
R.xml.devicesettings_header_other,
R.xml.devicesettings_sony_headphones_equalizer,
R.xml.devicesettings_sony_headphones_audio_upsampling,
R.xml.devicesettings_header_system,
// TODO R.xml.devicesettings_connect_two_devices, // TODO R.xml.devicesettings_connect_two_devices,
// TODO R.xml.devicesettings_sony_headphones_speak_to_chat_with_settings, // TODO R.xml.devicesettings_sony_headphones_speak_to_chat_with_settings,
R.xml.devicesettings_sony_headphones_touch_sensor_single, SonyHeadphonesCapabilities.BatterySingle,
R.xml.devicesettings_sony_headphones_pause_when_taken_off, SonyHeadphonesCapabilities.AmbientSoundControl,
R.xml.devicesettings_automatic_power_off_when_taken_off, SonyHeadphonesCapabilities.WindNoiseReduction,
R.xml.devicesettings_sony_headphones_notifications_voice_guide, SonyHeadphonesCapabilities.AncOptimizer,
R.xml.devicesettings_sony_headphones_device_info SonyHeadphonesCapabilities.Equalizer,
}; SonyHeadphonesCapabilities.AudioUpsampling,
SonyHeadphonesCapabilities.TouchSensorSingle,
SonyHeadphonesCapabilities.PauseWhenTakenOff,
SonyHeadphonesCapabilities.AutomaticPowerOffWhenTakenOff,
SonyHeadphonesCapabilities.VoiceNotifications
);
} }
} }

View File

@ -73,7 +73,7 @@ public class VescControlActivity extends AbstractGBActivity {
private void restoreValues(){ private void restoreValues(){
rpmEditText.setText(String.valueOf(preferences.getInt(PREFS_KEY_LAST_RPM, 0))); rpmEditText.setText(String.valueOf(preferences.getInt(PREFS_KEY_LAST_RPM, 0)));
breakCurrentEditText.setText(String.valueOf(preferences.getInt(PREFS_KEY_LAST_BREAK_CURRENT, 0))); breakCurrentEditText.setText(String.valueOf(preferences.getInt(PREFS_KEY_LAST_BREAK_CURRENT, 0) / 1000));
} }
@Override @Override
@ -184,7 +184,11 @@ public class VescControlActivity extends AbstractGBActivity {
currentBreakCurrentMa = 0; currentBreakCurrentMa = 0;
return; return;
} }
try {
VescControlActivity.this.currentBreakCurrentMa = Integer.parseInt(text) * 1000; VescControlActivity.this.currentBreakCurrentMa = Integer.parseInt(text) * 1000;
}catch (NumberFormatException e){
VescControlActivity.this.currentBreakCurrentMa = 0;
}
} }
}); });

View File

@ -24,6 +24,7 @@ import android.os.ParcelUuid;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.GBException; import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler; import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
@ -38,9 +39,11 @@ import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class VescCoordinator extends AbstractDeviceCoordinator { public class VescCoordinator extends AbstractDeviceCoordinator {
public final static String UUID_SERVICE_SERIAL_HM10 = "0000ffe0-0000-1000-8000-00805f9b34fb"; public final static String UUID_SERVICE_SERIAL_HM10 = "0000ffe0-0000-1000-8000-00805f9b34fb";
public final static String UUID_CHARACTERISTIC_SERIAL_TX_HM10 = "0000ffe1-0000-1000-8000-00805f9b34fb"; public final static String UUID_CHARACTERISTIC_SERIAL_TX_HM10 = "0000ffe1-0000-1000-8000-00805f9b34fb";
public final static String UUID_CHARACTERISTIC_SERIAL_RX_HM10 = "0000ffe1-0000-1000-8000-00805f9b34fb";
public final static String UUID_SERVICE_SERIAL_NRF = "0000ffe0-0000-1000-8000-00805f9b34fb"; public final static String UUID_SERVICE_SERIAL_NRF = "0000ffe0-0000-1000-8000-00805f9b34fb";
public final static String UUID_CHARACTERISTIC_SERIAL_TX_NRF = "0000ffe0-0000-1000-8000-00805f9b34fb"; public final static String UUID_CHARACTERISTIC_SERIAL_TX_NRF = "0000ffe0-0000-1000-8000-00805f9b34fb";
public final static String UUID_CHARACTERISTIC_SERIAL_RX_NRF = "0000ffe1-0000-1000-8000-00805f9b34fb";
@Override @Override
@ -48,6 +51,13 @@ public class VescCoordinator extends AbstractDeviceCoordinator {
} }
@Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_vesc
};
}
@Override @Override
public DeviceType getSupportedType(GBDeviceCandidate candidate) { public DeviceType getSupportedType(GBDeviceCandidate candidate) {
ParcelUuid[] uuids = candidate.getServiceUuids(); ParcelUuid[] uuids = candidate.getServiceUuids();
@ -77,7 +87,7 @@ public class VescCoordinator extends AbstractDeviceCoordinator {
@Override @Override
public boolean supportsActivityDataFetching() { public boolean supportsActivityDataFetching() {
return false; return true;
} }
@Override @Override

View File

@ -494,7 +494,7 @@ public class NotificationListener extends NotificationListenerService {
private void handleCallNotification(StatusBarNotification sbn) { private void handleCallNotification(StatusBarNotification sbn) {
String app = sbn.getPackageName(); String app = sbn.getPackageName();
LOG.debug("got call from: " + app); LOG.debug("got call from: " + app);
if (app.equals("com.android.dialer") || app.equals("com.android.incallui") || app.equals("com.google.android.dialer")) { if (app.equals("com.android.dialer") || app.equals("com.android.incallui") || app.equals("com.google.android.dialer") || app.equals("com.asus.asusincallui") || app.equals("com.samsung.android.incallui")) {
LOG.debug("Ignoring non-voip call"); LOG.debug("Ignoring non-voip call");
return; return;
} }

View File

@ -113,4 +113,13 @@ public class OpenTracksController extends Activity {
} }
GBApplication.app().setOpenTracksObserver(null); GBApplication.app().setOpenTracksObserver(null);
} }
public static void toggleRecording(Context context) {
OpenTracksContentObserver openTracksObserver = GBApplication.app().getOpenTracksObserver();
if (openTracksObserver == null) {
startRecording(context);
} else {
stopRecording(context);
}
}
} }

View File

@ -107,22 +107,28 @@ public class PhoneCallReceiver extends BroadcastReceiver {
if ("never".equals(prefs.getString("notification_mode_calls", "always"))) { if ("never".equals(prefs.getString("notification_mode_calls", "always"))) {
return; return;
} }
int dndSuppressed = 0;
switch (GBApplication.getGrantedInterruptionFilter()) { switch (GBApplication.getGrantedInterruptionFilter()) {
case NotificationManager.INTERRUPTION_FILTER_ALL: case NotificationManager.INTERRUPTION_FILTER_ALL:
break; break;
case NotificationManager.INTERRUPTION_FILTER_ALARMS: case NotificationManager.INTERRUPTION_FILTER_ALARMS:
case NotificationManager.INTERRUPTION_FILTER_NONE: case NotificationManager.INTERRUPTION_FILTER_NONE:
return; dndSuppressed = 1;
break;
case NotificationManager.INTERRUPTION_FILTER_PRIORITY: case NotificationManager.INTERRUPTION_FILTER_PRIORITY:
if (GBApplication.isPriorityNumber(Policy.PRIORITY_CATEGORY_CALLS, mSavedNumber)) { if (GBApplication.isPriorityNumber(Policy.PRIORITY_CATEGORY_CALLS, mSavedNumber)) {
break; break;
} }
// FIXME: Handle Repeat callers if it is enabled in Do Not Disturb // FIXME: Handle Repeat callers if it is enabled in Do Not Disturb
dndSuppressed = 1;
}
if (prefs.getBoolean("notification_filter", false) && dndSuppressed == 1) {
return; return;
} }
CallSpec callSpec = new CallSpec(); CallSpec callSpec = new CallSpec();
callSpec.number = mSavedNumber; callSpec.number = mSavedNumber;
callSpec.command = callCommand; callSpec.command = callCommand;
callSpec.dndSuppressed = dndSuppressed;
GBApplication.deviceService().onSetCallState(callSpec); GBApplication.deviceService().onSetCallState(callSpec);
} }
mLastState = state; mLastState = state;

View File

@ -87,18 +87,24 @@ public class SMSReceiver extends BroadcastReceiver {
dismissAllAction.type = NotificationSpec.Action.TYPE_SYNTECTIC_DISMISS_ALL; dismissAllAction.type = NotificationSpec.Action.TYPE_SYNTECTIC_DISMISS_ALL;
notificationSpec.attachedActions.add(dismissAllAction); notificationSpec.attachedActions.add(dismissAllAction);
int dndSuppressed = 0;
switch (GBApplication.getGrantedInterruptionFilter()) { switch (GBApplication.getGrantedInterruptionFilter()) {
case NotificationManager.INTERRUPTION_FILTER_ALL: case NotificationManager.INTERRUPTION_FILTER_ALL:
break; break;
case NotificationManager.INTERRUPTION_FILTER_ALARMS: case NotificationManager.INTERRUPTION_FILTER_ALARMS:
case NotificationManager.INTERRUPTION_FILTER_NONE: case NotificationManager.INTERRUPTION_FILTER_NONE:
return; dndSuppressed = 1;
break;
case NotificationManager.INTERRUPTION_FILTER_PRIORITY: case NotificationManager.INTERRUPTION_FILTER_PRIORITY:
if (GBApplication.isPriorityNumber(Policy.PRIORITY_CATEGORY_MESSAGES, notificationSpec.phoneNumber)) { if (GBApplication.isPriorityNumber(Policy.PRIORITY_CATEGORY_MESSAGES, notificationSpec.phoneNumber)) {
break; break;
} }
dndSuppressed = 1;
}
if (prefs.getBoolean("notification_filter", false) && dndSuppressed == 1) {
return; return;
} }
notificationSpec.dndSuppressed = dndSuppressed;
GBApplication.deviceService().onNotification(notificationSpec); GBApplication.deviceService().onNotification(notificationSpec);
} }
} }

View File

@ -43,6 +43,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec; import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.Reminder; import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec; import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService; import nodomain.freeyourgadget.gadgetbridge.service.DeviceCommunicationService;
import nodomain.freeyourgadget.gadgetbridge.util.RtlUtils; import nodomain.freeyourgadget.gadgetbridge.util.RtlUtils;
@ -200,7 +201,8 @@ public class GBDeviceService implements DeviceService {
Intent intent = createIntent().setAction(ACTION_CALLSTATE) Intent intent = createIntent().setAction(ACTION_CALLSTATE)
.putExtra(EXTRA_CALL_PHONENUMBER, callSpec.number) .putExtra(EXTRA_CALL_PHONENUMBER, callSpec.number)
.putExtra(EXTRA_CALL_DISPLAYNAME, callSpec.name) .putExtra(EXTRA_CALL_DISPLAYNAME, callSpec.name)
.putExtra(EXTRA_CALL_COMMAND, callSpec.command); .putExtra(EXTRA_CALL_COMMAND, callSpec.command)
.putExtra(EXTRA_CALL_DNDSUPPRESSED, callSpec.dndSuppressed);
invokeService(intent); invokeService(intent);
} }
@ -223,6 +225,13 @@ public class GBDeviceService implements DeviceService {
invokeService(intent); invokeService(intent);
} }
@Override
public void onSetPhoneVolume(final float volume) {
Intent intent = createIntent().setAction(ACTION_SET_PHONE_VOLUME)
.putExtra(EXTRA_PHONE_VOLUME, volume);
invokeService(intent);
}
@Override @Override
public void onSetReminders(ArrayList<? extends Reminder> reminders) { public void onSetReminders(ArrayList<? extends Reminder> reminders) {
Intent intent = createIntent().setAction(ACTION_SET_REMINDERS) Intent intent = createIntent().setAction(ACTION_SET_REMINDERS)
@ -230,6 +239,13 @@ public class GBDeviceService implements DeviceService {
invokeService(intent); invokeService(intent);
} }
@Override
public void onSetWorldClocks(ArrayList<? extends WorldClock> clocks) {
Intent intent = createIntent().setAction(ACTION_SET_WORLD_CLOCKS)
.putExtra(EXTRA_WORLD_CLOCKS, clocks);
invokeService(intent);
}
@Override @Override
public void onSetMusicInfo(MusicSpec musicSpec) { public void onSetMusicInfo(MusicSpec musicSpec) {
Intent intent = createIntent().setAction(ACTION_SETMUSICINFO) Intent intent = createIntent().setAction(ACTION_SETMUSICINFO)

View File

@ -17,6 +17,8 @@
package nodomain.freeyourgadget.gadgetbridge.model; package nodomain.freeyourgadget.gadgetbridge.model;
import java.util.Objects;
public class BatteryConfig { public class BatteryConfig {
private final int batteryIndex; private final int batteryIndex;
@ -41,6 +43,16 @@ public class BatteryConfig {
return batteryLabel; return batteryLabel;
} }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof BatteryConfig)) return false;
BatteryConfig that = (BatteryConfig) o;
return getBatteryIndex() == that.getBatteryIndex() && getBatteryIcon() == that.getBatteryIcon() && getBatteryLabel() == that.getBatteryLabel();
}
@Override
public int hashCode() {
return Objects.hash(getBatteryIndex(), getBatteryIcon(), getBatteryLabel());
}
} }

View File

@ -28,4 +28,5 @@ public class CallSpec {
public String number; public String number;
public String name; public String name;
public int command; public int command;
public int dndSuppressed;
} }

View File

@ -39,6 +39,7 @@ public interface DeviceService extends EventHandler {
String ACTION_SETTIME = PREFIX + ".action.settime"; String ACTION_SETTIME = PREFIX + ".action.settime";
String ACTION_SETMUSICINFO = PREFIX + ".action.setmusicinfo"; String ACTION_SETMUSICINFO = PREFIX + ".action.setmusicinfo";
String ACTION_SETMUSICSTATE = PREFIX + ".action.setmusicstate"; String ACTION_SETMUSICSTATE = PREFIX + ".action.setmusicstate";
String ACTION_SET_PHONE_VOLUME = PREFIX + ".action.set_phone_volume";
String ACTION_REQUEST_DEVICEINFO = PREFIX + ".action.request_deviceinfo"; String ACTION_REQUEST_DEVICEINFO = PREFIX + ".action.request_deviceinfo";
String ACTION_REQUEST_APPINFO = PREFIX + ".action.request_appinfo"; String ACTION_REQUEST_APPINFO = PREFIX + ".action.request_appinfo";
String ACTION_REQUEST_SCREENSHOT = PREFIX + ".action.request_screenshot"; String ACTION_REQUEST_SCREENSHOT = PREFIX + ".action.request_screenshot";
@ -56,6 +57,7 @@ public interface DeviceService extends EventHandler {
String ACTION_SET_ALARMS = PREFIX + ".action.set_alarms"; String ACTION_SET_ALARMS = PREFIX + ".action.set_alarms";
String ACTION_SAVE_ALARMS = PREFIX + ".action.save_alarms"; String ACTION_SAVE_ALARMS = PREFIX + ".action.save_alarms";
String ACTION_SET_REMINDERS = PREFIX + ".action.set_reminders"; String ACTION_SET_REMINDERS = PREFIX + ".action.set_reminders";
String ACTION_SET_WORLD_CLOCKS = PREFIX + ".action.set_world_clocks";
String ACTION_ENABLE_REALTIME_STEPS = PREFIX + ".action.enable_realtime_steps"; String ACTION_ENABLE_REALTIME_STEPS = PREFIX + ".action.enable_realtime_steps";
String ACTION_REALTIME_SAMPLES = PREFIX + ".action.realtime_samples"; String ACTION_REALTIME_SAMPLES = PREFIX + ".action.realtime_samples";
String ACTION_ENABLE_REALTIME_HEARTRATE_MEASUREMENT = PREFIX + ".action.realtime_hr_measurement"; String ACTION_ENABLE_REALTIME_HEARTRATE_MEASUREMENT = PREFIX + ".action.realtime_hr_measurement";
@ -89,6 +91,7 @@ public interface DeviceService extends EventHandler {
String EXTRA_CALL_COMMAND = "call_command"; String EXTRA_CALL_COMMAND = "call_command";
String EXTRA_CALL_PHONENUMBER = "call_phonenumber"; String EXTRA_CALL_PHONENUMBER = "call_phonenumber";
String EXTRA_CALL_DISPLAYNAME = "call_displayname"; String EXTRA_CALL_DISPLAYNAME = "call_displayname";
String EXTRA_CALL_DNDSUPPRESSED = "call_dndsuppressed";
String EXTRA_CANNEDMESSAGES = "cannedmessages"; String EXTRA_CANNEDMESSAGES = "cannedmessages";
String EXTRA_CANNEDMESSAGES_TYPE = "cannedmessages_type"; String EXTRA_CANNEDMESSAGES_TYPE = "cannedmessages_type";
String EXTRA_MUSIC_ARTIST = "music_artist"; String EXTRA_MUSIC_ARTIST = "music_artist";
@ -102,6 +105,7 @@ public interface DeviceService extends EventHandler {
String EXTRA_MUSIC_REPEAT = "music_repeat"; String EXTRA_MUSIC_REPEAT = "music_repeat";
String EXTRA_MUSIC_POSITION = "music_position"; String EXTRA_MUSIC_POSITION = "music_position";
String EXTRA_MUSIC_RATE = "music_rate"; String EXTRA_MUSIC_RATE = "music_rate";
String EXTRA_PHONE_VOLUME = "phone_volume";
String EXTRA_APP_UUID = "app_uuid"; String EXTRA_APP_UUID = "app_uuid";
String EXTRA_APP_START = "app_start"; String EXTRA_APP_START = "app_start";
String EXTRA_APP_CONFIG = "app_config"; String EXTRA_APP_CONFIG = "app_config";
@ -110,6 +114,7 @@ public interface DeviceService extends EventHandler {
String EXTRA_CONFIG = "config"; String EXTRA_CONFIG = "config";
String EXTRA_ALARMS = "alarms"; String EXTRA_ALARMS = "alarms";
String EXTRA_REMINDERS = "reminders"; String EXTRA_REMINDERS = "reminders";
String EXTRA_WORLD_CLOCKS = "world_clocks";
String EXTRA_CONNECT_FIRST_TIME = "connect_first_time"; String EXTRA_CONNECT_FIRST_TIME = "connect_first_time";
String EXTRA_BOOLEAN_ENABLE = "enable_realtime_steps"; String EXTRA_BOOLEAN_ENABLE = "enable_realtime_steps";
String EXTRA_INTERVAL_SECONDS = "interval_seconds"; String EXTRA_INTERVAL_SECONDS = "interval_seconds";

View File

@ -61,7 +61,7 @@ public enum DeviceType {
AMAZFITGTR2E(34, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_gtr2e), AMAZFITGTR2E(34, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_gtr2e),
AMAZFITGTS2E(35, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled,R.string .devicetype_amazfit_gts2e), AMAZFITGTS2E(35, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled,R.string .devicetype_amazfit_gts2e),
AMAZFITX(36, R.drawable.ic_device_miband2, R.drawable.ic_device_miband2_disabled, R.string.devicetype_amazfit_x), AMAZFITX(36, R.drawable.ic_device_miband2, R.drawable.ic_device_miband2_disabled, R.string.devicetype_amazfit_x),
MIBAND6(37, R.drawable.ic_device_miband2, R.drawable.ic_device_miband2_disabled, R.string.devicetype_miband6), MIBAND6(37, R.drawable.ic_device_miband6, R.drawable.ic_device_miband6_disabled, R.string.devicetype_miband6),
AMAZFITTREXPRO(38, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_trex_pro), AMAZFITTREXPRO(38, R.drawable.ic_device_zetime, R.drawable.ic_device_zetime_disabled, R.string.devicetype_amazfit_trex_pro),
AMAZFITPOP(39, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled, R.string.devicetype_amazfit_pop), AMAZFITPOP(39, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled, R.string.devicetype_amazfit_pop),
AMAZFITPOPPRO(10040, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled, R.string.devicetype_amazfit_pop_pro), AMAZFITPOPPRO(10040, R.drawable.ic_device_amazfit_bip, R.drawable.ic_device_amazfit_bip_disabled, R.string.devicetype_amazfit_pop_pro),
@ -103,11 +103,13 @@ public enum DeviceType {
UM25(350, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_um25), UM25(350, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_um25),
DOMYOS_T540(400, R.drawable.ic_device_lovetoy, R.drawable.ic_device_lovetoy_disabled, R.string.devicetype_domyos_t540), DOMYOS_T540(400, R.drawable.ic_device_lovetoy, R.drawable.ic_device_lovetoy_disabled, R.string.devicetype_domyos_t540),
NOTHING_EAR1(410, R.drawable.ic_device_nothingear, R.drawable.ic_device_nothingear_disabled, R.string.devicetype_nothingear1), NOTHING_EAR1(410, R.drawable.ic_device_nothingear, R.drawable.ic_device_nothingear_disabled, R.string.devicetype_nothingear1),
GALAXY_BUDS_PRO(418, R.drawable.ic_device_galaxy_buds_pro, R.drawable.ic_device_galaxy_buds_pro_disabled, R.string.devicetype_galaxybuds_pro),
GALAXY_BUDS_LIVE(419, R.drawable.ic_device_galaxy_buds_live, R.drawable.ic_device_galaxy_buds_live_disabled, R.string.devicetype_galaxybuds_live), GALAXY_BUDS_LIVE(419, R.drawable.ic_device_galaxy_buds_live, R.drawable.ic_device_galaxy_buds_live_disabled, R.string.devicetype_galaxybuds_live),
GALAXY_BUDS(420, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_galaxybuds), GALAXY_BUDS(420, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_galaxybuds),
SONY_WH_1000XM3(430, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_sony_wh_1000xm3), SONY_WH_1000XM3(430, R.drawable.ic_device_sony_overhead, R.drawable.ic_device_sony_overhead_disabled, R.string.devicetype_sony_wh_1000xm3),
SONY_WF_SP800N(431, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_wf_sp800n), SONY_WF_SP800N(431, R.drawable.ic_device_sony_wf_800n, R.drawable.ic_device_sony_wf_800n_disabled, R.string.devicetype_sony_wf_sp800n),
SONY_WH_1000XM4(432, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_sony_wh_1000xm4), SONY_WH_1000XM4(432, R.drawable.ic_device_sony_overhead, R.drawable.ic_device_sony_overhead_disabled, R.string.devicetype_sony_wh_1000xm4),
SONY_WF_1000XM3(433, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_sony_wf_1000xm3),
BOSE_QC35(440, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_bose_qc35), BOSE_QC35(440, R.drawable.ic_device_headphones, R.drawable.ic_device_headphones_disabled, R.string.devicetype_bose_qc35),
VESC_NRF(500, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc), VESC_NRF(500, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc),
VESC_HM10(501, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc), VESC_HM10(501, R.drawable.ic_device_vesc, R.drawable.ic_device_vesc_disabled, R.string.devicetype_vesc),

View File

@ -0,0 +1,30 @@
/* Copyright (C) 2022 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.model;
import java.io.Serializable;
public interface WorldClock extends Serializable {
/**
* The {@link android.os.Bundle} name for transferring parceled world clocks.
*/
String EXTRA_WORLD_CLOCK = "world_clock";
String getWorldClockId();
String getLabel();
String getTimeZoneId();
}

View File

@ -75,6 +75,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationType; import nodomain.freeyourgadget.gadgetbridge.model.NotificationType;
import nodomain.freeyourgadget.gadgetbridge.model.Reminder; import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec; import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
import nodomain.freeyourgadget.gadgetbridge.service.receivers.AutoConnectIntervalReceiver; import nodomain.freeyourgadget.gadgetbridge.service.receivers.AutoConnectIntervalReceiver;
import nodomain.freeyourgadget.gadgetbridge.service.receivers.GBAutoFetchReceiver; import nodomain.freeyourgadget.gadgetbridge.service.receivers.GBAutoFetchReceiver;
import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper; import nodomain.freeyourgadget.gadgetbridge.util.DeviceHelper;
@ -119,7 +120,9 @@ import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SE
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_FM_FREQUENCY; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_FM_FREQUENCY;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_HEARTRATE_MEASUREMENT_INTERVAL; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_HEARTRATE_MEASUREMENT_INTERVAL;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_LED_COLOR; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_LED_COLOR;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_PHONE_VOLUME;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_REMINDERS; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_REMINDERS;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_SET_WORLD_CLOCKS;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_START; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_START;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_STARTAPP; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_STARTAPP;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_TEST_NEW_FUNCTION; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.ACTION_TEST_NEW_FUNCTION;
@ -138,6 +141,7 @@ import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CAL
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALENDAREVENT_TYPE; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALENDAREVENT_TYPE;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALL_COMMAND; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALL_COMMAND;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALL_DISPLAYNAME; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALL_DISPLAYNAME;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALL_DNDSUPPRESSED;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALL_PHONENUMBER; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CALL_PHONENUMBER;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CANNEDMESSAGES; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CANNEDMESSAGES;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CANNEDMESSAGES_TYPE; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_CANNEDMESSAGES_TYPE;
@ -172,12 +176,14 @@ import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_NOT
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_NOTIFICATION_SUBJECT; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_NOTIFICATION_SUBJECT;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_NOTIFICATION_TITLE; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_NOTIFICATION_TITLE;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_NOTIFICATION_TYPE; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_NOTIFICATION_TYPE;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_PHONE_VOLUME;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_RECORDED_DATA_TYPES; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_RECORDED_DATA_TYPES;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_REMINDERS; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_REMINDERS;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_RESET_FLAGS; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_RESET_FLAGS;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_URI; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_URI;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_VIBRATION_INTENSITY; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_VIBRATION_INTENSITY;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_WEATHER; import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_WEATHER;
import static nodomain.freeyourgadget.gadgetbridge.model.DeviceService.EXTRA_WORLD_CLOCKS;
public class DeviceCommunicationService extends Service implements SharedPreferences.OnSharedPreferenceChangeListener { public class DeviceCommunicationService extends Service implements SharedPreferences.OnSharedPreferenceChangeListener {
private static final Logger LOG = LoggerFactory.getLogger(DeviceCommunicationService.class); private static final Logger LOG = LoggerFactory.getLogger(DeviceCommunicationService.class);
@ -506,6 +512,7 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
callSpec.command = intent.getIntExtra(EXTRA_CALL_COMMAND, CallSpec.CALL_UNDEFINED); callSpec.command = intent.getIntExtra(EXTRA_CALL_COMMAND, CallSpec.CALL_UNDEFINED);
callSpec.number = intent.getStringExtra(EXTRA_CALL_PHONENUMBER); callSpec.number = intent.getStringExtra(EXTRA_CALL_PHONENUMBER);
callSpec.name = sanitizeNotifText(intent.getStringExtra(EXTRA_CALL_DISPLAYNAME)); callSpec.name = sanitizeNotifText(intent.getStringExtra(EXTRA_CALL_DISPLAYNAME));
callSpec.dndSuppressed = intent.getIntExtra(EXTRA_CALL_DNDSUPPRESSED, 0);
mDeviceSupport.onSetCallState(callSpec); mDeviceSupport.onSetCallState(callSpec);
break; break;
case ACTION_SETCANNEDMESSAGES: case ACTION_SETCANNEDMESSAGES:
@ -530,6 +537,10 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
musicSpec.trackNr = intent.getIntExtra(EXTRA_MUSIC_TRACKNR, 0); musicSpec.trackNr = intent.getIntExtra(EXTRA_MUSIC_TRACKNR, 0);
mDeviceSupport.onSetMusicInfo(musicSpec); mDeviceSupport.onSetMusicInfo(musicSpec);
break; break;
case ACTION_SET_PHONE_VOLUME:
float phoneVolume = intent.getFloatExtra(EXTRA_PHONE_VOLUME, 0);
mDeviceSupport.onSetPhoneVolume(phoneVolume);
break;
case ACTION_SETMUSICSTATE: case ACTION_SETMUSICSTATE:
MusicStateSpec stateSpec = new MusicStateSpec(); MusicStateSpec stateSpec = new MusicStateSpec();
stateSpec.shuffle = intent.getByteExtra(EXTRA_MUSIC_SHUFFLE, (byte) 0); stateSpec.shuffle = intent.getByteExtra(EXTRA_MUSIC_SHUFFLE, (byte) 0);
@ -586,6 +597,10 @@ public class DeviceCommunicationService extends Service implements SharedPrefere
ArrayList<? extends Reminder> reminders = (ArrayList<? extends Reminder>) intent.getSerializableExtra(EXTRA_REMINDERS); ArrayList<? extends Reminder> reminders = (ArrayList<? extends Reminder>) intent.getSerializableExtra(EXTRA_REMINDERS);
mDeviceSupport.onSetReminders(reminders); mDeviceSupport.onSetReminders(reminders);
break; break;
case ACTION_SET_WORLD_CLOCKS:
ArrayList<? extends WorldClock> clocks = (ArrayList<? extends WorldClock>) intent.getSerializableExtra(EXTRA_WORLD_CLOCKS);
mDeviceSupport.onSetWorldClocks(clocks);
break;
case ACTION_ENABLE_REALTIME_STEPS: { case ACTION_ENABLE_REALTIME_STEPS: {
boolean enable = intent.getBooleanExtra(EXTRA_BOOLEAN_ENABLE, false); boolean enable = intent.getBooleanExtra(EXTRA_BOOLEAN_ENABLE, false);
mDeviceSupport.onEnableRealtimeSteps(enable); mDeviceSupport.onEnableRealtimeSteps(enable);

View File

@ -380,6 +380,9 @@ public class DeviceSupportFactory {
case GALAXY_BUDS_LIVE: case GALAXY_BUDS_LIVE:
deviceSupport = new ServiceDeviceSupport(new GalaxyBudsDeviceSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); deviceSupport = new ServiceDeviceSupport(new GalaxyBudsDeviceSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break; break;
case GALAXY_BUDS_PRO:
deviceSupport = new ServiceDeviceSupport(new GalaxyBudsDeviceSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break;
case SONY_WH_1000XM3: case SONY_WH_1000XM3:
deviceSupport = new ServiceDeviceSupport(new SonyHeadphonesSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); deviceSupport = new ServiceDeviceSupport(new SonyHeadphonesSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break; break;
@ -389,6 +392,9 @@ public class DeviceSupportFactory {
case SONY_WF_SP800N: case SONY_WF_SP800N:
deviceSupport = new ServiceDeviceSupport(new SonyHeadphonesSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); deviceSupport = new ServiceDeviceSupport(new SonyHeadphonesSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break; break;
case SONY_WF_1000XM3:
deviceSupport = new ServiceDeviceSupport(new SonyHeadphonesSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break;
case VESC_NRF: case VESC_NRF:
case VESC_HM10: case VESC_HM10:
deviceSupport = new ServiceDeviceSupport(new VescDeviceSupport(gbDevice.getType()), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); deviceSupport = new ServiceDeviceSupport(new VescDeviceSupport(gbDevice.getType()), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));

View File

@ -39,6 +39,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec; import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
import nodomain.freeyourgadget.gadgetbridge.model.Reminder; import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec; import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
/** /**
* Wraps another device support instance and supports busy-checking and throttling of events. * Wraps another device support instance and supports busy-checking and throttling of events.
@ -206,6 +207,14 @@ public class ServiceDeviceSupport implements DeviceSupport {
delegate.onSetMusicInfo(musicSpec); delegate.onSetMusicInfo(musicSpec);
} }
@Override
public void onSetPhoneVolume(float volume) {
if (checkBusy("set phone volume")) {
return;
}
delegate.onSetPhoneVolume(volume);
}
@Override @Override
public void onInstallApp(Uri uri) { public void onInstallApp(Uri uri) {
if (checkBusy("install app")) { if (checkBusy("install app")) {
@ -318,6 +327,14 @@ public class ServiceDeviceSupport implements DeviceSupport {
delegate.onSetReminders(reminders); delegate.onSetReminders(reminders);
} }
@Override
public void onSetWorldClocks(ArrayList<? extends WorldClock> clocks) {
if (checkBusy("set world clocks")) {
return;
}
delegate.onSetWorldClocks(clocks);
}
@Override @Override
public void onEnableRealtimeSteps(boolean enable) { public void onEnableRealtimeSteps(boolean enable) {
if (checkBusy("enable realtime steps: " + enable)) { if (checkBusy("enable realtime steps: " + enable)) {

View File

@ -38,6 +38,7 @@ import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.Logging; import nodomain.freeyourgadget.gadgetbridge.Logging;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.Reminder; import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
import nodomain.freeyourgadget.gadgetbridge.service.AbstractDeviceSupport; import nodomain.freeyourgadget.gadgetbridge.service.AbstractDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.CheckInitializedAction; import nodomain.freeyourgadget.gadgetbridge.service.btle.actions.CheckInitializedAction;
import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.AbstractBleProfile; import nodomain.freeyourgadget.gadgetbridge.service.btle.profiles.AbstractBleProfile;
@ -373,11 +374,21 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
} }
@Override
public void onSetPhoneVolume(final float volume) {
}
@Override @Override
public void onSetReminders(ArrayList<? extends Reminder> reminders) { public void onSetReminders(ArrayList<? extends Reminder> reminders) {
} }
@Override
public void onSetWorldClocks(ArrayList<? extends WorldClock> clocks) {
}
@Override @Override
public void onConnectionStateChange(BluetoothDevice device, int status, int newState) { public void onConnectionStateChange(BluetoothDevice device, int status, int newState) {

View File

@ -31,7 +31,8 @@ public class GalaxyBudsIOThread extends BtClassicIoThread {
if (gbDevice.getType().equals(DeviceType.GALAXY_BUDS)) { if (gbDevice.getType().equals(DeviceType.GALAXY_BUDS)) {
return galaxyBudsProtocol.UUID_GALAXY_BUDS_DEVICE_CTRL; return galaxyBudsProtocol.UUID_GALAXY_BUDS_DEVICE_CTRL;
} }
if (gbDevice.getType().equals(DeviceType.GALAXY_BUDS_LIVE)) { if (gbDevice.getType().equals(DeviceType.GALAXY_BUDS_LIVE)
|| gbDevice.getType().equals(DeviceType.GALAXY_BUDS_PRO)) {
return galaxyBudsProtocol.UUID_GALAXY_BUDS_LIVE_DEVICE_CTRL; return galaxyBudsProtocol.UUID_GALAXY_BUDS_LIVE_DEVICE_CTRL;
} }
return galaxyBudsProtocol.UUID_GALAXY_BUDS_DEVICE_CTRL; return galaxyBudsProtocol.UUID_GALAXY_BUDS_DEVICE_CTRL;

Some files were not shown because too many files have changed in this diff Show More