From 2b7535f7589bfbf26556dd1edc554869571ecc79 Mon Sep 17 00:00:00 2001 From: Mark Heinis Date: Tue, 9 Oct 2018 10:14:50 +0200 Subject: [PATCH 01/49] Experimental, working on a new way of navigating Experimental, working on a new way of navigating --- app/build.gradle | 2 +- .../domoticz/Fragments/MainPager.java | 108 ++++++++++++++++++ app/src/main/res/layout/mainpager.xml | 19 +++ app/src/main/res/menu/menu_bottom.xml | 32 ++++++ app/src/main/res/values/drawer_actions.xml | 24 +--- app/version.properties | 4 +- domoticzapi/version.properties | 4 +- 7 files changed, 168 insertions(+), 25 deletions(-) create mode 100644 app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java create mode 100644 app/src/main/res/layout/mainpager.xml create mode 100644 app/src/main/res/menu/menu_bottom.xml diff --git a/app/build.gradle b/app/build.gradle index 3a9b2abd7..93e6191bb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -198,7 +198,7 @@ dependencies { implementation("com.mikepenz:materialdrawer:6.0.9@aar") { transitive = true } - + implementation 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1' implementation 'com.github.matthiasrobbers:shortbread:1.0.2' annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.0.1' implementation 'com.schibstedspain.android:leku:3.3.0' diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java new file mode 100644 index 000000000..6bee68626 --- /dev/null +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2015 Domoticz - Mark Heinis + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package nl.hnogames.domoticz.Fragments; + +import android.content.Context; +import android.content.Intent; +import android.graphics.Bitmap; +import android.graphics.drawable.BitmapDrawable; +import android.os.AsyncTask; +import android.os.Build; +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.support.design.widget.CoordinatorLayout; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v4.app.Fragment; +import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.GridLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.fastaccess.permission.base.PermissionFragmentHelper; +import com.fastaccess.permission.base.callback.OnPermissionCallback; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; + +import jp.wasabeef.recyclerview.adapters.SlideInBottomAnimationAdapter; +import nl.hnogames.domoticz.Adapters.CamerasAdapter; +import nl.hnogames.domoticz.CameraActivity; +import nl.hnogames.domoticz.Interfaces.DomoticzFragmentListener; +import nl.hnogames.domoticz.MainActivity; +import nl.hnogames.domoticz.R; +import nl.hnogames.domoticz.Utils.PermissionsUtil; +import nl.hnogames.domoticz.Utils.SerializableManager; +import nl.hnogames.domoticz.Utils.SharedPrefUtil; +import nl.hnogames.domoticz.Utils.UsefulBits; +import nl.hnogames.domoticz.app.DomoticzCardFragment; +import nl.hnogames.domoticz.app.DomoticzRecyclerFragment; +import nl.hnogames.domoticzapi.Containers.CameraInfo; +import nl.hnogames.domoticzapi.Interfaces.CameraReceiver; + +public class MainPager extends Fragment implements DomoticzFragmentListener { + + @SuppressWarnings("unused") + private static final String TAG = MainPager.class.getSimpleName(); + private Context context; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public View onCreateView(LayoutInflater inflater, + ViewGroup container, + Bundle savedInstanceState) { + RelativeLayout group = (RelativeLayout) inflater.inflate(R.layout.mainpager, null); + return group; + } + + @Override + public void onAttach(Context context) { + super.onAttach(context); + this.context = context; + if (getActionBar() != null) + getActionBar().setTitle(R.string.title_dashboard); + } + + public ActionBar getActionBar() { + return ((AppCompatActivity) context).getSupportActionBar(); + } + + @Override + public void onConnectionOk() { } + + @Override + public void onConnectionFailed() { } +} \ No newline at end of file diff --git a/app/src/main/res/layout/mainpager.xml b/app/src/main/res/layout/mainpager.xml new file mode 100644 index 000000000..1425c8f55 --- /dev/null +++ b/app/src/main/res/layout/mainpager.xml @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/menu_bottom.xml b/app/src/main/res/menu/menu_bottom.xml new file mode 100644 index 000000000..6a2c96a54 --- /dev/null +++ b/app/src/main/res/menu/menu_bottom.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/drawer_actions.xml b/app/src/main/res/values/drawer_actions.xml index 7028b2240..f2e8dc23a 100644 --- a/app/src/main/res/values/drawer_actions.xml +++ b/app/src/main/res/values/drawer_actions.xml @@ -21,17 +21,11 @@ --> - @string/title_wizard @string/title_dashboard - @string/title_scenes - @string/title_switches - @string/title_utilities - @string/title_temperature - @string/title_weather - @string/title_cameras @string/title_plans + @string/title_cameras @string/title_logs @string/title_events @string/title_vars @@ -42,14 +36,9 @@ nl.hnogames.domoticz.Fragments.Wizard - nl.hnogames.domoticz.Fragments.Dashboard - nl.hnogames.domoticz.Fragments.Scenes - nl.hnogames.domoticz.Fragments.Switches - nl.hnogames.domoticz.Fragments.Utilities - nl.hnogames.domoticz.Fragments.Temperature - nl.hnogames.domoticz.Fragments.Weather - nl.hnogames.domoticz.Fragments.Cameras + nl.hnogames.domoticz.Fragments.MainPager nl.hnogames.domoticz.Fragments.Plans + nl.hnogames.domoticz.Fragments.Cameras nl.hnogames.domoticz.Fragments.Logs nl.hnogames.domoticz.Fragments.Events nl.hnogames.domoticz.Fragments.UserVariables @@ -58,13 +47,8 @@ gmd_build gmd_dashboard - gmd_view_carousel - gmd_lightbulb_outline - gmd_dvr - gmd_opacity - gmd_wb_sunny - gmd_camera gmd_location_city + gmd_camera gmd_bug_report gmd_event gmd_assignment diff --git a/app/version.properties b/app/version.properties index 79607cde2..8d55ec758 100644 --- a/app/version.properties +++ b/app/version.properties @@ -1,4 +1,4 @@ -#Wed Oct 03 09:17:21 CEST 2018 -VERSION_BUILD=4336 +#Fri Oct 05 16:43:33 CEST 2018 +VERSION_BUILD=4348 VERSION_PATCH=476 VERSION_CODE=300 diff --git a/domoticzapi/version.properties b/domoticzapi/version.properties index 2c795099e..e839260d7 100644 --- a/domoticzapi/version.properties +++ b/domoticzapi/version.properties @@ -1,4 +1,4 @@ -#Wed Oct 03 09:17:21 CEST 2018 -VERSION_BUILD=3481 +#Fri Oct 05 16:43:33 CEST 2018 +VERSION_BUILD=3493 VERSION_PATCH=132 VERSION_CODE=132 From 65d84f561b68e8269f85bb2cac735b144403b30f Mon Sep 17 00:00:00 2001 From: HNO Mobile Date: Tue, 9 Oct 2018 22:20:03 +0200 Subject: [PATCH 02/49] Working on a new material view on the app Working on a new material view on the app --- app/build.gradle | 10 +- .../domoticz/Adapters/CamerasAdapter.java | 7 +- .../domoticz/Adapters/DashboardAdapter.java | 318 +++---- .../domoticz/Adapters/EventsAdapter.java | 13 +- .../domoticz/Adapters/LocationAdapter.java | 12 +- .../domoticz/Adapters/LogAdapter.java | 13 +- .../domoticz/Adapters/NFCAdapter.java | 12 +- .../domoticz/Adapters/PlansAdapter.java | 10 +- .../domoticz/Adapters/QRCodeAdapter.java | 2 +- .../domoticz/Adapters/SceneAdapter.java | 85 +- .../domoticz/Adapters/ServerAdapter.java | 11 +- .../domoticz/Adapters/SpeechAdapter.java | 14 +- .../domoticz/Adapters/SwitchesAdapter.java | 315 +++---- .../domoticz/Adapters/TemperatureAdapter.java | 93 +- .../domoticz/Adapters/TimersAdapter.java | 6 +- .../Adapters/UserVariablesAdapter.java | 15 +- .../domoticz/Adapters/UtilityAdapter.java | 55 +- .../domoticz/Adapters/WeatherAdapter.java | 41 +- .../domoticz/Adapters/WidgetsAdapter.java | 24 +- .../nl/hnogames/domoticz/CameraActivity.java | 2 +- .../domoticz/Containers/LocationInfo.java | 34 +- .../hnogames/domoticz/Fragments/Camera.java | 13 +- .../hnogames/domoticz/Fragments/Cameras.java | 4 +- .../domoticz/Fragments/Dashboard.java | 307 +++--- .../hnogames/domoticz/Fragments/Events.java | 8 + .../nl/hnogames/domoticz/Fragments/Graph.java | 165 ++-- .../nl/hnogames/domoticz/Fragments/Logs.java | 10 +- .../domoticz/Fragments/MainPager.java | 138 ++- .../nl/hnogames/domoticz/Fragments/Plans.java | 12 +- .../hnogames/domoticz/Fragments/Scenes.java | 26 +- .../hnogames/domoticz/Fragments/Switches.java | 237 ++--- .../domoticz/Fragments/Temperature.java | 31 +- .../domoticz/Fragments/UserVariables.java | 33 +- .../domoticz/Fragments/Utilities.java | 120 +-- .../hnogames/domoticz/Fragments/Weather.java | 56 +- .../hnogames/domoticz/Fragments/Wizard.java | 890 +++++++++--------- .../domoticz/GeoSettingsActivity.java | 192 ++-- .../nl/hnogames/domoticz/GraphActivity.java | 2 +- .../nl/hnogames/domoticz/MainActivity.java | 324 +++---- .../domoticz/NFCSettingsActivity.java | 150 +-- .../domoticz/Preference/Preference.java | 188 ++-- .../WearMultiSelectListPreference.java | 2 +- .../domoticz/QRCodeCaptureActivity.java | 4 +- .../domoticz/QRCodeSettingsActivity.java | 126 +-- .../domoticz/ServerListSettingsActivity.java | 2 +- .../domoticz/ServerSettingsActivity.java | 30 +- .../Service/FCMMessageInstanceService.java | 2 +- .../GeofenceTransitionsIntentService.java | 22 +- .../domoticz/Service/NFCServiceActivity.java | 12 +- .../Service/WearMessageListenerService.java | 14 +- .../hnogames/domoticz/SettingsActivity.java | 2 +- .../domoticz/SpeechSettingsActivity.java | 110 +-- .../domoticz/UI/ColorPickerDialog.java | 22 +- .../domoticz/UI/DeviceInfoDialog.java | 24 +- .../UI/FingerprintPasswordDialog.java | 52 +- .../UI/MjpegViewer/MjpegInputStream.java | 2 +- .../domoticz/UI/MultiSelectionSpinner.java | 12 +- .../domoticz/UI/NotificationInfoDialog.java | 22 +- .../hnogames/domoticz/UI/PasswordDialog.java | 52 +- .../hnogames/domoticz/UI/SceneInfoDialog.java | 22 +- .../UI/ScheduledTemperatureDialog.java | 2 +- .../domoticz/UI/SecurityPanelDialog.java | 34 +- .../domoticz/UI/SimpleTextDialog.java | 22 +- .../nl/hnogames/domoticz/UI/SortDialog.java | 22 +- .../nl/hnogames/domoticz/UI/SwitchDialog.java | 24 +- .../domoticz/UI/SwitchInfoDialog.java | 24 +- .../domoticz/UI/SwitchLogInfoDialog.java | 24 +- .../domoticz/UI/SwitchTimerInfoDialog.java | 22 +- .../domoticz/UI/TemperatureDialog.java | 26 +- .../domoticz/UI/TemperatureInfoDialog.java | 22 +- .../nl/hnogames/domoticz/UI/TextDialog.java | 26 +- .../domoticz/UI/UtilitiesInfoDialog.java | 22 +- .../domoticz/UI/WeatherInfoDialog.java | 22 +- .../nl/hnogames/domoticz/UpdateActivity.java | 96 +- .../domoticz/Utils/BitmapLruCache.java | 4 +- .../hnogames/domoticz/Utils/DeviceUtils.java | 2 +- .../domoticz/Utils/NotificationUtil.java | 68 +- .../domoticz/Utils/PermissionsUtil.java | 34 +- .../domoticz/Utils/SerializableManager.java | 8 +- .../domoticz/Utils/SharedPrefUtil.java | 16 +- .../hnogames/domoticz/Utils/UsefulBits.java | 93 +- .../domoticz/Welcome/SetupServerSettings.java | 110 +-- .../domoticz/Welcome/WelcomePage2.java | 4 +- .../domoticz/Welcome/WelcomePage3.java | 88 +- .../domoticz/Welcome/WelcomePage4.java | 4 +- .../domoticz/Welcome/WelcomeViewActivity.java | 28 +- .../SecurityWidgetConfigurationActivity.java | 38 +- .../Widgets/SecurityWidgetIntentService.java | 16 +- .../Widgets/SecurityWidgetProvider.java | 26 +- .../SmallWidgetConfigurationActivity.java | 52 +- .../Widgets/WidgetConfigurationActivity.java | 50 +- .../domoticz/Widgets/WidgetIntentService.java | 14 +- .../domoticz/Widgets/WidgetProviderLarge.java | 108 +-- .../domoticz/app/AppCompatAssistActivity.java | 14 +- .../app/AppCompatPermissionsActivity.java | 10 +- .../hnogames/domoticz/app/AppController.java | 6 +- .../domoticz/app/DomoticzCardFragment.java | 14 +- .../app/DomoticzDashboardFragment.java | 25 +- .../app/DomoticzRecyclerFragment.java | 57 +- .../baseline_dashboard_black_18.png | Bin 0 -> 153 bytes .../baseline_dashboard_black_24.png | Bin 0 -> 139 bytes .../baseline_dashboard_black_36.png | Bin 0 -> 170 bytes .../baseline_dashboard_black_48.png | Bin 0 -> 126 bytes .../drawable-hdpi/baseline_dvr_black_18.png | Bin 0 -> 210 bytes .../drawable-hdpi/baseline_dvr_black_24.png | Bin 0 -> 187 bytes .../drawable-hdpi/baseline_dvr_black_36.png | Bin 0 -> 286 bytes .../drawable-hdpi/baseline_dvr_black_48.png | Bin 0 -> 260 bytes .../baseline_highlight_black_18.png | Bin 0 -> 211 bytes .../baseline_highlight_black_24.png | Bin 0 -> 219 bytes .../baseline_highlight_black_36.png | Bin 0 -> 272 bytes .../baseline_highlight_black_48.png | Bin 0 -> 314 bytes .../baseline_opacity_black_18.png | Bin 0 -> 295 bytes .../baseline_opacity_black_24.png | Bin 0 -> 350 bytes .../baseline_opacity_black_36.png | Bin 0 -> 496 bytes .../baseline_opacity_black_48.png | Bin 0 -> 634 bytes .../baseline_view_carousel_black_18.png | Bin 0 -> 134 bytes .../baseline_view_carousel_black_24.png | Bin 0 -> 130 bytes .../baseline_view_carousel_black_36.png | Bin 0 -> 167 bytes .../baseline_view_carousel_black_48.png | Bin 0 -> 124 bytes .../baseline_wb_sunny_black_18.png | Bin 0 -> 315 bytes .../baseline_wb_sunny_black_24.png | Bin 0 -> 415 bytes .../baseline_wb_sunny_black_36.png | Bin 0 -> 540 bytes .../baseline_wb_sunny_black_48.png | Bin 0 -> 656 bytes .../baseline_dashboard_black_18.png | Bin 0 -> 123 bytes .../baseline_dashboard_black_24.png | Bin 0 -> 99 bytes .../baseline_dashboard_black_36.png | Bin 0 -> 139 bytes .../baseline_dashboard_black_48.png | Bin 0 -> 121 bytes .../drawable-mdpi/baseline_dvr_black_18.png | Bin 0 -> 170 bytes .../drawable-mdpi/baseline_dvr_black_24.png | Bin 0 -> 151 bytes .../drawable-mdpi/baseline_dvr_black_36.png | Bin 0 -> 187 bytes .../drawable-mdpi/baseline_dvr_black_48.png | Bin 0 -> 206 bytes .../baseline_highlight_black_18.png | Bin 0 -> 170 bytes .../baseline_highlight_black_24.png | Bin 0 -> 158 bytes .../baseline_highlight_black_36.png | Bin 0 -> 219 bytes .../baseline_highlight_black_48.png | Bin 0 -> 219 bytes .../baseline_opacity_black_18.png | Bin 0 -> 203 bytes .../baseline_opacity_black_24.png | Bin 0 -> 267 bytes .../baseline_opacity_black_36.png | Bin 0 -> 350 bytes .../baseline_opacity_black_48.png | Bin 0 -> 469 bytes .../baseline_view_carousel_black_18.png | Bin 0 -> 126 bytes .../baseline_view_carousel_black_24.png | Bin 0 -> 99 bytes .../baseline_view_carousel_black_36.png | Bin 0 -> 130 bytes .../baseline_view_carousel_black_48.png | Bin 0 -> 118 bytes .../baseline_wb_sunny_black_18.png | Bin 0 -> 249 bytes .../baseline_wb_sunny_black_24.png | Bin 0 -> 252 bytes .../baseline_wb_sunny_black_36.png | Bin 0 -> 415 bytes .../baseline_wb_sunny_black_48.png | Bin 0 -> 396 bytes .../baseline_dashboard_black_18.png | Bin 0 -> 139 bytes .../baseline_dashboard_black_24.png | Bin 0 -> 121 bytes .../baseline_dashboard_black_36.png | Bin 0 -> 126 bytes .../baseline_dashboard_black_48.png | Bin 0 -> 127 bytes .../drawable-xhdpi/baseline_dvr_black_18.png | Bin 0 -> 187 bytes .../drawable-xhdpi/baseline_dvr_black_24.png | Bin 0 -> 206 bytes .../drawable-xhdpi/baseline_dvr_black_36.png | Bin 0 -> 260 bytes .../drawable-xhdpi/baseline_dvr_black_48.png | Bin 0 -> 337 bytes .../baseline_highlight_black_18.png | Bin 0 -> 219 bytes .../baseline_highlight_black_24.png | Bin 0 -> 219 bytes .../baseline_highlight_black_36.png | Bin 0 -> 314 bytes .../baseline_highlight_black_48.png | Bin 0 -> 363 bytes .../baseline_opacity_black_18.png | Bin 0 -> 350 bytes .../baseline_opacity_black_24.png | Bin 0 -> 469 bytes .../baseline_opacity_black_36.png | Bin 0 -> 634 bytes .../baseline_opacity_black_48.png | Bin 0 -> 880 bytes .../baseline_view_carousel_black_18.png | Bin 0 -> 130 bytes .../baseline_view_carousel_black_24.png | Bin 0 -> 118 bytes .../baseline_view_carousel_black_36.png | Bin 0 -> 124 bytes .../baseline_view_carousel_black_48.png | Bin 0 -> 123 bytes .../baseline_wb_sunny_black_18.png | Bin 0 -> 415 bytes .../baseline_wb_sunny_black_24.png | Bin 0 -> 396 bytes .../baseline_wb_sunny_black_36.png | Bin 0 -> 656 bytes .../baseline_wb_sunny_black_48.png | Bin 0 -> 767 bytes .../baseline_dashboard_black_18.png | Bin 0 -> 170 bytes .../baseline_dashboard_black_24.png | Bin 0 -> 126 bytes .../baseline_dashboard_black_36.png | Bin 0 -> 171 bytes .../baseline_dashboard_black_48.png | Bin 0 -> 139 bytes .../drawable-xxhdpi/baseline_dvr_black_18.png | Bin 0 -> 286 bytes .../drawable-xxhdpi/baseline_dvr_black_24.png | Bin 0 -> 260 bytes .../drawable-xxhdpi/baseline_dvr_black_36.png | Bin 0 -> 401 bytes .../drawable-xxhdpi/baseline_dvr_black_48.png | Bin 0 -> 483 bytes .../baseline_highlight_black_18.png | Bin 0 -> 272 bytes .../baseline_highlight_black_24.png | Bin 0 -> 314 bytes .../baseline_highlight_black_36.png | Bin 0 -> 449 bytes .../baseline_highlight_black_48.png | Bin 0 -> 454 bytes .../baseline_opacity_black_18.png | Bin 0 -> 496 bytes .../baseline_opacity_black_24.png | Bin 0 -> 634 bytes .../baseline_opacity_black_36.png | Bin 0 -> 930 bytes .../baseline_opacity_black_48.png | Bin 0 -> 1234 bytes .../baseline_view_carousel_black_18.png | Bin 0 -> 167 bytes .../baseline_view_carousel_black_24.png | Bin 0 -> 124 bytes .../baseline_view_carousel_black_36.png | Bin 0 -> 160 bytes .../baseline_view_carousel_black_48.png | Bin 0 -> 135 bytes .../baseline_wb_sunny_black_18.png | Bin 0 -> 540 bytes .../baseline_wb_sunny_black_24.png | Bin 0 -> 656 bytes .../baseline_wb_sunny_black_36.png | Bin 0 -> 1037 bytes .../baseline_wb_sunny_black_48.png | Bin 0 -> 1061 bytes .../baseline_dashboard_black_18.png | Bin 0 -> 126 bytes .../baseline_dashboard_black_24.png | Bin 0 -> 127 bytes .../baseline_dashboard_black_36.png | Bin 0 -> 139 bytes .../baseline_dashboard_black_48.png | Bin 0 -> 141 bytes .../baseline_dvr_black_18.png | Bin 0 -> 260 bytes .../baseline_dvr_black_24.png | Bin 0 -> 337 bytes .../baseline_dvr_black_36.png | Bin 0 -> 483 bytes .../baseline_dvr_black_48.png | Bin 0 -> 721 bytes .../baseline_highlight_black_18.png | Bin 0 -> 314 bytes .../baseline_highlight_black_24.png | Bin 0 -> 363 bytes .../baseline_highlight_black_36.png | Bin 0 -> 454 bytes .../baseline_highlight_black_48.png | Bin 0 -> 587 bytes .../baseline_opacity_black_18.png | Bin 0 -> 634 bytes .../baseline_opacity_black_24.png | Bin 0 -> 880 bytes .../baseline_opacity_black_36.png | Bin 0 -> 1234 bytes .../baseline_opacity_black_48.png | Bin 0 -> 1632 bytes .../baseline_view_carousel_black_18.png | Bin 0 -> 124 bytes .../baseline_view_carousel_black_24.png | Bin 0 -> 123 bytes .../baseline_view_carousel_black_36.png | Bin 0 -> 135 bytes .../baseline_view_carousel_black_48.png | Bin 0 -> 138 bytes .../baseline_wb_sunny_black_18.png | Bin 0 -> 656 bytes .../baseline_wb_sunny_black_24.png | Bin 0 -> 767 bytes .../baseline_wb_sunny_black_36.png | Bin 0 -> 1061 bytes .../baseline_wb_sunny_black_48.png | Bin 0 -> 1602 bytes app/src/main/res/layout/activity_update.xml | 2 +- app/src/main/res/layout/camera_row.xml | 28 +- app/src/main/res/layout/dashboard_row.xml | 31 +- .../main/res/layout/dashboard_row_list.xml | 33 +- app/src/main/res/layout/dialog_location.xml | 4 +- app/src/main/res/layout/dialog_security.xml | 6 +- .../main/res/layout/dialog_temperature.xml | 4 +- app/src/main/res/layout/event_row_default.xml | 21 +- .../main/res/layout/fragment_add_server.xml | 4 +- .../res/layout/fragment_add_server_dark.xml | 4 +- app/src/main/res/layout/fragment_cameras.xml | 4 - app/src/main/res/layout/fragment_welcome2.xml | 2 +- app/src/main/res/layout/fragment_welcome3.xml | 2 +- .../res/layout/fragment_welcome3_dark.xml | 2 +- app/src/main/res/layout/geo_row_location.xml | 2 +- app/src/main/res/layout/log_all_buttons.xml | 89 +- .../layout/log_graph_buttons_row_default.xml | 48 +- .../layout/log_text_button_row_default.xml | 12 +- .../layout/log_timer_button_row_default.xml | 37 +- app/src/main/res/layout/logs_row_default.xml | 21 +- app/src/main/res/layout/mainpager.xml | 37 +- app/src/main/res/layout/nfc_row.xml | 2 +- app/src/main/res/layout/plan_row.xml | 23 +- app/src/main/res/layout/scene_row_default.xml | 27 +- app/src/main/res/layout/server_row.xml | 2 +- app/src/main/res/layout/speech_row.xml | 2 +- .../res/layout/temperature_row_default.xml | 25 +- .../main/res/layout/utilities_row_default.xml | 23 +- app/src/main/res/layout/vars_row_default.xml | 32 +- .../main/res/layout/weather_row_default.xml | 23 +- app/src/main/res/layout/widget_layout.xml | 2 +- .../main/res/layout/widget_layout_buttons.xml | 4 +- .../res/layout/widget_layout_buttons_dark.xml | 4 +- .../widget_layout_buttons_transparent.xml | 4 +- ...widget_layout_buttons_transparent_dark.xml | 4 +- .../main/res/layout/widget_layout_dark.xml | 2 +- .../res/layout/widget_layout_transparent.xml | 2 +- .../layout/widget_layout_transparent_dark.xml | 2 +- .../layout/widget_security_configuration.xml | 2 +- .../res/layout/widget_security_layout.xml | 6 +- .../layout/widget_security_layout_dark.xml | 6 +- .../widget_security_layout_transparent.xml | 6 +- ...idget_security_layout_transparent_dark.xml | 6 +- app/src/main/res/menu/menu_bottom.xml | 46 +- app/src/main/res/values/colors.xml | 8 +- app/src/main/res/values/drawer_actions.xml | 3 + app/src/main/res/values/styles.xml | 34 +- app/version.properties | 8 +- build.gradle | 1 + domoticzapi/version.properties | 8 +- 269 files changed, 3321 insertions(+), 3198 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi/baseline_dashboard_black_18.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_dashboard_black_24.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_dashboard_black_36.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_dashboard_black_48.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_dvr_black_18.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_dvr_black_24.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_dvr_black_36.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_dvr_black_48.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_highlight_black_18.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_highlight_black_24.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_highlight_black_36.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_highlight_black_48.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_opacity_black_18.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_opacity_black_24.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_opacity_black_36.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_opacity_black_48.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_view_carousel_black_18.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_view_carousel_black_24.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_view_carousel_black_36.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_view_carousel_black_48.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_18.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_24.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_36.png create mode 100644 app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_48.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dashboard_black_18.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dashboard_black_24.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dashboard_black_36.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dashboard_black_48.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dvr_black_18.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dvr_black_24.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dvr_black_36.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_dvr_black_48.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_highlight_black_18.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_highlight_black_24.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_highlight_black_36.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_highlight_black_48.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_opacity_black_18.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_opacity_black_24.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_opacity_black_36.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_opacity_black_48.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_view_carousel_black_18.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_view_carousel_black_24.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_view_carousel_black_36.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_view_carousel_black_48.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_18.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_24.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_36.png create mode 100644 app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_48.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dashboard_black_18.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dashboard_black_24.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dashboard_black_36.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dashboard_black_48.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dvr_black_18.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dvr_black_24.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dvr_black_36.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_dvr_black_48.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_highlight_black_18.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_highlight_black_24.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_highlight_black_36.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_highlight_black_48.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_opacity_black_18.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_opacity_black_24.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_opacity_black_36.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_opacity_black_48.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_18.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_24.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_36.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_48.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_wb_sunny_black_18.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_wb_sunny_black_24.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_wb_sunny_black_36.png create mode 100644 app/src/main/res/drawable-xhdpi/baseline_wb_sunny_black_48.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_18.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_24.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_48.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dvr_black_18.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dvr_black_24.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dvr_black_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_dvr_black_48.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_highlight_black_18.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_highlight_black_24.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_highlight_black_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_highlight_black_48.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_opacity_black_18.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_opacity_black_24.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_opacity_black_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_opacity_black_48.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_18.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_24.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_48.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_wb_sunny_black_18.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_wb_sunny_black_24.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_wb_sunny_black_36.png create mode 100644 app/src/main/res/drawable-xxhdpi/baseline_wb_sunny_black_48.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_18.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_24.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_48.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_18.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_24.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_48.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_18.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_24.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_48.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_18.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_24.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_48.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_view_carousel_black_18.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_view_carousel_black_24.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_view_carousel_black_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_view_carousel_black_48.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_18.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_24.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_36.png create mode 100644 app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_48.png diff --git a/app/build.gradle b/app/build.gradle index 93e6191bb..94a1e43fb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -45,6 +45,12 @@ android { throw new GradleException("Could not read version.properties!") } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + incremental = false; + } + //noinspection GroovyAssignabilityCheck buildTypes { release { @@ -192,12 +198,14 @@ dependencies { implementation 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar' implementation 'me.dm7.barcodescanner:zxing:1.9.8' implementation 'com.github.jd-alexander:LikeButton:0.2.3' - implementation 'jp.wasabeef:recyclerview-animators:2.2.4' + implementation 'jp.wasabeef:recyclerview-animators:2.3.0' implementation 'com.github.javiersantos:PiracyChecker:1.1' implementation 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar' + implementation("com.mikepenz:materialdrawer:6.0.9@aar") { transitive = true } + implementation 'it.sephiroth.android.library.bottomnavigation:bottom-navigation:2.0.1-rc1' implementation 'com.github.matthiasrobbers:shortbread:1.0.2' annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.0.1' diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java index 066eb9890..4eec122e7 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/CamerasAdapter.java @@ -70,12 +70,11 @@ public void setOnItemClickListener(onClickListener onClickListener) { @Override public DataObjectHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.camera_row, parent, false); + .inflate(R.layout.camera_row, parent, false); if (mSharedPrefs.darkThemeEnabled()) { - ((android.support.v7.widget.CardView) view.findViewById(R.id.row_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); + ((android.support.design.card.MaterialCardView) view.findViewById(R.id.row_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); } - return new DataObjectHolder(view); } @@ -109,7 +108,7 @@ public interface onClickListener { } public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; com.android.volley.toolbox.NetworkImageView camera; diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java index b0cebbd86..5a0db390d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/DashboardAdapter.java @@ -25,6 +25,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Color; +import android.support.design.chip.Chip; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -68,12 +69,12 @@ public class DashboardAdapter extends RecyclerView.Adapter data = null; @@ -143,10 +144,10 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row; if (showAsList) row = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.dashboard_row_list, parent, false); + .inflate(R.layout.dashboard_row_list, parent, false); else row = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.dashboard_row, parent, false); + .inflate(R.layout.dashboard_row, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) row.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -154,7 +155,7 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { (row.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(context, R.drawable.bordershadowdark)); if ((row.findViewById(R.id.row_global_wrapper)) != null) (row.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.background_dark)); - if ((row.findViewById(R.id.day_button)) != null) + /* if ((row.findViewById(R.id.day_button)) != null) (row.findViewById(R.id.day_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); if ((row.findViewById(R.id.year_button)) != null) (row.findViewById(R.id.year_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); @@ -167,7 +168,7 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { if ((row.findViewById(R.id.timer_button)) != null) (row.findViewById(R.id.timer_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); if ((row.findViewById(R.id.notifications_button)) != null) - (row.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + (row.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); */ if ((row.findViewById(R.id.on_button)) != null) (row.findViewById(R.id.on_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); if ((row.findViewById(R.id.off_button)) != null) @@ -218,7 +219,7 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, holder.pieView.setVisibility(View.GONE); if (mDeviceInfo.getSwitchTypeVal() == 0 && - (mDeviceInfo.getSwitchType() == null)) { + (mDeviceInfo.getSwitchType() == null)) { if (mDeviceInfo.getSubType() != null && mDeviceInfo.getSubType().equals(DomoticzValues.Device.Utility.SubType.SMARTWARES)) { setButtons(holder, Buttons.BUTTON_ON); setThermostatRowData(mDeviceInfo, holder); @@ -356,7 +357,7 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, default: throw new NullPointerException( - "No supported switch type defined in the adapter (setSwitchRowData)"); + "No supported switch type defined in the adapter (setSwitchRowData)"); } } } @@ -387,16 +388,16 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) - + ": " - + String.valueOf(mDeviceInfo.getData()); + + ": " + + String.valueOf(mDeviceInfo.getData()); holder.switch_battery_level.setText(text); if (mDeviceInfo.getUsage() != null && mDeviceInfo.getUsage().length() > 0) { @@ -419,10 +420,10 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (mDeviceInfo.getCounterToday() != null && mDeviceInfo.getCounterToday().length() > 0) holder.switch_battery_level.append(" " + context.getString(R.string.today) + ": " + mDeviceInfo.getCounterToday()); if (mDeviceInfo.getCounter() != null && mDeviceInfo.getCounter().length() > 0 && - !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) + !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) holder.switch_battery_level.append(" " + context.getString(R.string.total) + ": " + mDeviceInfo.getCounter()); if (mDeviceInfo.getType() != null && mDeviceInfo.getType().length() > 0 && - mDeviceInfo.getType().equals("Wind")) { + mDeviceInfo.getType().equals("Wind")) { text = context.getString(R.string.direction) + " " + mDeviceInfo.getDirection() + " " + mDeviceInfo.getDirectionStr(); holder.switch_battery_level.setText(text); } @@ -465,11 +466,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); holder.iconRow.setAlpha(1f); if (!mDeviceInfo.getStatusBoolean()) @@ -489,13 +490,13 @@ private void setSecurityPanelSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHo holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); @@ -521,11 +522,11 @@ public void onClick(View v) { } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -550,23 +551,23 @@ private void setOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); holder.switch_battery_level.setText(text); } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (holder.buttonOn != null) { if (mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.GROUP) || mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.SCENE)) @@ -630,22 +631,22 @@ private void setOnOffSwitchRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -716,24 +717,24 @@ public void onClick(View v) { String text; if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { String setPointText = - context.getString(R.string.set_point) + ": " + String.valueOf(setPoint); + context.getString(R.string.set_point) + ": " + String.valueOf(setPoint); holder.switch_battery_level.setText(setPointText); } Picasso.with(context).load(DomoticzIcons.getDrawableIcon( - mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - false, - false, - null)).into(holder.iconRow); + mDeviceInfo.getTypeImg(), + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + false, + false, + null)).into(holder.iconRow); } /** @@ -756,8 +757,8 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol if (holder.switch_battery_level != null) { String batteryText = context.getString(R.string.temperature) - + ": " - + mDeviceInfo.getData(); + + ": " + + mDeviceInfo.getData(); holder.switch_battery_level.setText(batteryText); } } else { @@ -765,17 +766,17 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol holder.signal_level.setVisibility(View.VISIBLE); if (holder.switch_battery_level != null) { String batteryLevelText = context.getString(R.string.temperature) - + ": " - + String.valueOf(temperature) - + " " + sign; + + ": " + + String.valueOf(temperature) + + " " + sign; holder.switch_battery_level.setText(batteryLevelText); } if (holder.signal_level != null) { String signalText = context.getString(R.string.set_point) - + ": " - + String.valueOf(mDeviceInfo.getSetPoint() - + " " + sign); + + ": " + + String.valueOf(mDeviceInfo.getSetPoint() + + " " + sign); holder.signal_level.setText(signalText); } } @@ -825,12 +826,12 @@ public void onClick(View v) { if ((sign.equals("C") && temperature < 0) || (sign.equals("F") && temperature < 30)) { Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), mDeviceInfo.getType(), mDeviceInfo.getSubType(), - (mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, - true, "Freezing")).into(holder.iconRow); + (mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, + true, "Freezing")).into(holder.iconRow); } else { Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), mDeviceInfo.getType(), mDeviceInfo.getSubType(), - (mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, - false, null)).into(holder.iconRow); + (mConfigInfo != null && temperature > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, + false, null)).into(holder.iconRow); } } @@ -859,8 +860,8 @@ private void setContactSwitchRowData(DevicesInfo mDevicesInfo, } String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) { holder.signal_level.setText(text); } @@ -897,11 +898,11 @@ public void onClick(View v) { } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDevicesInfo.getTypeImg(), - mDevicesInfo.getType(), - mDevicesInfo.getSwitchType(), - mDevicesInfo.getStatusBoolean(), - mDevicesInfo.getUseCustomImage(), - mDevicesInfo.getImage())).into(holder.iconRow); + mDevicesInfo.getType(), + mDevicesInfo.getSwitchType(), + mDevicesInfo.getStatusBoolean(), + mDevicesInfo.getUseCustomImage(), + mDevicesInfo.getImage())).into(holder.iconRow); if (!mDevicesInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -922,22 +923,22 @@ private void setPushOnOffSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHolder holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1003,17 +1004,17 @@ private void setBlindsRowData(DevicesInfo mDeviceInfo, if (holder.switch_status != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate( - context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate( + context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.switch_status.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); holder.switch_battery_level.setText(text); } @@ -1060,11 +1061,11 @@ public void onClick(View view) { }); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1087,15 +1088,15 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getStatus()); + String.valueOf(mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); } @@ -1107,7 +1108,7 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, holder.spSelector.setTag(mDeviceInfo.getIdx()); if (levelNames != null && levelNames.size() > loadLevel) { ArrayAdapter dataAdapter = new ArrayAdapter(context, - android.R.layout.simple_spinner_item, levelNames); + android.R.layout.simple_spinner_item, levelNames); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); holder.spSelector.setAdapter(dataAdapter); holder.spSelector.setSelection(loadLevel); @@ -1132,11 +1133,11 @@ public void onNothingSelected(AdapterView arg0) { }); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1162,29 +1163,29 @@ private void setDimmerRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getStatus()); + String.valueOf(mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1228,7 +1229,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = (TextView) seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); @@ -1245,7 +1246,7 @@ public void onStopTrackingTouch(SeekBar seekBar) { Switch dimmerOnOffSwitch = null; try { dimmerOnOffSwitch = (Switch) seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); + .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); if (progress == 0 && dimmerOnOffSwitch.isChecked()) { dimmerOnOffSwitch.setChecked(false); seekBar.setProgress(previousDimmerValue); @@ -1309,29 +1310,29 @@ private void setDimmerOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getStatus()); + String.valueOf(mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1379,7 +1380,7 @@ public void onClick(View v) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = (TextView) seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); } @@ -1445,12 +1446,12 @@ private void setModalSwitchRowData(DevicesInfo mDeviceInfo, holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); + getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); if (holder.buttonSetStatus != null) { @@ -1465,11 +1466,11 @@ public void onClick(View v) { } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); } /** @@ -1811,7 +1812,8 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { TextView switch_name, signal_level, switch_status, switch_battery_level, switch_dimmer_level; Switch onOffSwitch, dimmerOnOffSwitch; ImageButton buttonUp, buttonDown, buttonStop; - Button buttonOn, buttonLog, buttonTimer, buttonColor, buttonSetStatus, buttonSet, buttonOff; + Button buttonOn, buttonColor, buttonSetStatus, buttonSet, buttonOff; + Chip buttonLog, buttonTimer; Boolean isProtected; ImageView iconRow, iconMode; SeekBar dimmer; @@ -1822,28 +1824,28 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { public DataObjectHolder(View itemView) { super(itemView); - extraPanel = (LinearLayout) itemView.findViewById(R.id.extra_panel); - pieView = (PieView) itemView.findViewById(R.id.pieView); - buttonOn = (Button) itemView.findViewById(R.id.on_button); - buttonOff = (Button) itemView.findViewById(R.id.off_button); - onOffSwitch = (Switch) itemView.findViewById(R.id.switch_button); - signal_level = (TextView) itemView.findViewById(R.id.switch_signal_level); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - switch_name = (TextView) itemView.findViewById(R.id.switch_name); - switch_battery_level = (TextView) itemView.findViewById(R.id.switch_battery_level); - - switch_dimmer_level = (TextView) itemView.findViewById(R.id.switch_dimmer_level); - dimmerOnOffSwitch = (Switch) itemView.findViewById(R.id.switch_dimmer_switch); - dimmer = (SeekBar) itemView.findViewById(R.id.switch_dimmer); - spSelector = (Spinner) itemView.findViewById(R.id.spSelector); - buttonColor = (Button) itemView.findViewById(R.id.color_button); - buttonLog = (Button) itemView.findViewById(R.id.log_button); - buttonTimer = (Button) itemView.findViewById(R.id.timer_button); - buttonUp = (ImageButton) itemView.findViewById(R.id.switch_button_up); - buttonStop = (ImageButton) itemView.findViewById(R.id.switch_button_stop); - buttonDown = (ImageButton) itemView.findViewById(R.id.switch_button_down); - buttonSet = (Button) itemView.findViewById(R.id.set_button); - buttonSetStatus = (Button) itemView.findViewById(R.id.set_button); + extraPanel = itemView.findViewById(R.id.extra_panel); + pieView = itemView.findViewById(R.id.pieView); + buttonOn = itemView.findViewById(R.id.on_button); + buttonOff = itemView.findViewById(R.id.off_button); + onOffSwitch = itemView.findViewById(R.id.switch_button); + signal_level = itemView.findViewById(R.id.switch_signal_level); + iconRow = itemView.findViewById(R.id.rowIcon); + switch_name = itemView.findViewById(R.id.switch_name); + switch_battery_level = itemView.findViewById(R.id.switch_battery_level); + + switch_dimmer_level = itemView.findViewById(R.id.switch_dimmer_level); + dimmerOnOffSwitch = itemView.findViewById(R.id.switch_dimmer_switch); + dimmer = itemView.findViewById(R.id.switch_dimmer); + spSelector = itemView.findViewById(R.id.spSelector); + buttonColor = itemView.findViewById(R.id.color_button); + buttonLog = itemView.findViewById(R.id.log_button); + buttonTimer = itemView.findViewById(R.id.timer_button); + buttonUp = itemView.findViewById(R.id.switch_button_up); + buttonStop = itemView.findViewById(R.id.switch_button_stop); + buttonDown = itemView.findViewById(R.id.switch_button_down); + buttonSet = itemView.findViewById(R.id.set_button); + buttonSetStatus = itemView.findViewById(R.id.set_button); if (buttonLog != null) buttonLog.setVisibility(View.GONE); diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java index 683689a08..eb0ab6490 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/EventsAdapter.java @@ -82,7 +82,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.event_row_default, parent, false); + .inflate(R.layout.event_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) view.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -147,7 +147,7 @@ public interface onClickListener { } public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; TextView message; Switch buttonON; @@ -155,11 +155,10 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder public DataObjectHolder(View itemView) { super(itemView); - name = (TextView) itemView.findViewById(R.id.logs_name); - message = (TextView) itemView.findViewById(R.id.logs_message); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - buttonON = (Switch) itemView.findViewById(R.id.switch_button); - + name = itemView.findViewById(R.id.logs_name); + message = itemView.findViewById(R.id.logs_message); + iconRow = itemView.findViewById(R.id.rowIcon); + buttonON = itemView.findViewById(R.id.switch_button); itemView.setOnClickListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java index c94ff38e1..c38121e17 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/LocationAdapter.java @@ -99,11 +99,11 @@ public View getView(int position, View convertView, ViewGroup parent) { (convertView.findViewById(R.id.remove_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); } - holder.enable = (CheckBox) convertView.findViewById(R.id.enableSwitch); - holder.name = (TextView) convertView.findViewById(R.id.location_name); - holder.radius = (TextView) convertView.findViewById(R.id.location_radius); - holder.connectedSwitch = (TextView) convertView.findViewById(R.id.location_connectedSwitch); - holder.remove = (Button) convertView.findViewById(R.id.remove_button); + holder.enable = convertView.findViewById(R.id.enableSwitch); + holder.name = convertView.findViewById(R.id.location_name); + holder.radius = convertView.findViewById(R.id.location_radius); + holder.connectedSwitch = convertView.findViewById(R.id.location_connectedSwitch); + holder.remove = convertView.findViewById(R.id.remove_button); holder.name.setText(mLocationInfo.getName()); holder.radius.setText(context.getString(R.string.radius) + ": " + mLocationInfo.getRadius()); @@ -113,7 +113,7 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.connectedSwitch.setText(context.getString(R.string.connectedSwitch) + ": " + mLocationInfo.getSwitchIdx()); } else { holder.connectedSwitch.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mLocationInfo.getValue())) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java index 7e93809fe..c8dc2d246 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/LogAdapter.java @@ -77,7 +77,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.logs_row_default, parent, false); + .inflate(R.layout.logs_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { @@ -132,7 +132,7 @@ public interface onClickListener { public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; TextView datetime; TextView message; @@ -141,11 +141,10 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder public DataObjectHolder(View itemView) { super(itemView); - name = (TextView) itemView.findViewById(R.id.logs_name); - datetime = (TextView) itemView.findViewById(R.id.logs_datetime); - message = (TextView) itemView.findViewById(R.id.logs_message); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - + name = itemView.findViewById(R.id.logs_name); + datetime = itemView.findViewById(R.id.logs_datetime); + message = itemView.findViewById(R.id.logs_message); + iconRow = itemView.findViewById(R.id.rowIcon); itemView.setOnClickListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java index 5e9f207ff..8373dbbfc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/NFCAdapter.java @@ -103,11 +103,11 @@ public View getView(int position, View convertView, ViewGroup parent) { (convertView.findViewById(R.id.remove_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); } - holder.enable = (CheckBox) convertView.findViewById(R.id.enableNFC); - holder.nfc_name = (TextView) convertView.findViewById(R.id.nfc_name); - holder.nfc_tag_id = (TextView) convertView.findViewById(R.id.nfc_tag_id); - holder.nfc_switch_idx = (TextView) convertView.findViewById(R.id.nfc_switchidx); - holder.remove = (Button) convertView.findViewById(R.id.remove_button); + holder.enable = convertView.findViewById(R.id.enableNFC); + holder.nfc_name = convertView.findViewById(R.id.nfc_name); + holder.nfc_tag_id = convertView.findViewById(R.id.nfc_tag_id); + holder.nfc_switch_idx = convertView.findViewById(R.id.nfc_switchidx); + holder.remove = convertView.findViewById(R.id.remove_button); holder.nfc_name.setText(mNFCInfo.getName()); holder.nfc_tag_id.setText(mNFCInfo.getId()); @@ -118,7 +118,7 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) + ": " + mNFCInfo.getSwitchIdx()); } else { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mNFCInfo.getValue())) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java index 8b754e65a..55e4ab475 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/PlansAdapter.java @@ -59,10 +59,10 @@ public void setData(ArrayList data) { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.plan_row, parent, false); + .inflate(R.layout.plan_row, parent, false); if (mSharedPrefs.darkThemeEnabled()) { - ((android.support.v7.widget.CardView) view.findViewById(R.id.row_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); + ((android.support.design.card.MaterialCardView) view.findViewById(R.id.row_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); } return new DataObjectHolder(view); @@ -93,14 +93,14 @@ public interface onClickListener { } public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; TextView devices; public DataObjectHolder(View itemView) { super(itemView); - name = (TextView) itemView.findViewById(R.id.name); - devices = (TextView) itemView.findViewById(R.id.devices); + name = itemView.findViewById(R.id.name); + devices = itemView.findViewById(R.id.devices); itemView.setOnClickListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java index 0f4b4e728..fca32c396 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/QRCodeAdapter.java @@ -119,7 +119,7 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) + ": " + mQRCodeInfo.getSwitchIdx()); } else { holder.nfc_switch_idx.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mQRCodeInfo.getValue())) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java index bdad4798c..718db77b3 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/SceneAdapter.java @@ -23,6 +23,7 @@ import android.content.Context; import android.graphics.Color; +import android.support.design.chip.Chip; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -98,7 +99,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.scene_row_default, parent, false); + .inflate(R.layout.scene_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) view.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -126,14 +127,7 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position) (holder.itemView.findViewById(R.id.on_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); if ((holder.itemView.findViewById(R.id.off_button)) != null) (holder.itemView.findViewById(R.id.off_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); - if ((holder.itemView.findViewById(R.id.log_button)) != null) - (holder.itemView.findViewById(R.id.log_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); - if ((holder.itemView.findViewById(R.id.notifications_button)) != null) - (holder.itemView.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); - if ((holder.itemView.findViewById(R.id.timer_button)) != null) - (holder.itemView.findViewById(R.id.timer_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); } - if (holder.buttonTimer != null) holder.buttonTimer.setVisibility(View.GONE); if (holder.buttonNotifications != null) @@ -141,19 +135,19 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position) holder.switch_name.setText(mSceneInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mSceneInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mSceneInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); holder.switch_battery_level.setText(DomoticzValues.Scene.Type.SCENE); Picasso.with(context).load(DomoticzIcons.getDrawableIcon( - DomoticzValues.Scene.Type.SCENE.toLowerCase(), - null, - null, - false, - false, - null)).into(holder.iconRow); + DomoticzValues.Scene.Type.SCENE.toLowerCase(), + null, + null, + false, + false, + null)).into(holder.iconRow); if (holder.buttonOn != null) { holder.buttonOn.setId(mSceneInfo.getIdx()); @@ -202,12 +196,6 @@ public void onClick(View v) { (holder.itemView.findViewById(R.id.on_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); if ((holder.itemView.findViewById(R.id.off_button)) != null) (holder.itemView.findViewById(R.id.off_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); - if ((holder.itemView.findViewById(R.id.log_button)) != null) - (holder.itemView.findViewById(R.id.log_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); - if ((holder.itemView.findViewById(R.id.notifications_button)) != null) - (holder.itemView.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); - if ((holder.itemView.findViewById(R.id.timer_button)) != null) - (holder.itemView.findViewById(R.id.timer_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); } if (holder.buttonTimer != null) @@ -218,9 +206,9 @@ public void onClick(View v) { holder.switch_name.setText(mSceneInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mSceneInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mSceneInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); holder.switch_battery_level.setText(DomoticzValues.Scene.Type.GROUP); @@ -245,12 +233,12 @@ public void onClick(View v) { } Picasso.with(context).load(DomoticzIcons.getDrawableIcon( - DomoticzValues.Scene.Type.GROUP.toLowerCase(), - null, - null, - mSceneInfo.getStatusInBoolean(), - false, - null)).into(holder.iconRow); + DomoticzValues.Scene.Type.GROUP.toLowerCase(), + null, + null, + mSceneInfo.getStatusInBoolean(), + false, + null)).into(holder.iconRow); if (!mSceneInfo.getStatusInBoolean()) holder.iconRow.setAlpha(0.5f); @@ -282,7 +270,7 @@ public void onClick(View v) { }); } } else throw new NullPointerException("Scene type not supported in the adapter for:\n" - + mSceneInfo.toString()); + + mSceneInfo.toString()); holder.itemView.setOnLongClickListener(new View.OnLongClickListener() { @Override @@ -356,33 +344,34 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { ImageView iconRow; LikeButton likeButton; LinearLayout extraPanel; - Button buttonOn, buttonLog, buttonTimer, buttonNotifications, buttonOff; + Button buttonOn, buttonOff; + Chip buttonLog, buttonTimer, buttonNotifications; public DataObjectHolder(View itemView) { super(itemView); - buttonOn = (Button) itemView.findViewById(R.id.on_button); - signal_level = (TextView) itemView.findViewById(R.id.switch_signal_level); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - switch_name = (TextView) itemView.findViewById(R.id.switch_name); - switch_battery_level = (TextView) itemView.findViewById(R.id.switch_battery_level); + buttonOn = itemView.findViewById(R.id.on_button); + signal_level = itemView.findViewById(R.id.switch_signal_level); + iconRow = itemView.findViewById(R.id.rowIcon); + switch_name = itemView.findViewById(R.id.switch_name); + switch_battery_level = itemView.findViewById(R.id.switch_battery_level); - buttonLog = (Button) itemView.findViewById(R.id.log_button); - buttonTimer = (Button) itemView.findViewById(R.id.timer_button); - buttonNotifications = (Button) itemView.findViewById(R.id.notifications_button); - likeButton = (LikeButton) itemView.findViewById(R.id.fav_button); + buttonLog = itemView.findViewById(R.id.log_button); + buttonTimer = itemView.findViewById(R.id.timer_button); + buttonNotifications = itemView.findViewById(R.id.notifications_button); + likeButton = itemView.findViewById(R.id.fav_button); if (buttonTimer != null) buttonTimer.setVisibility(View.GONE); if (buttonNotifications != null) buttonNotifications.setVisibility(View.GONE); - likeButton = (LikeButton) itemView.findViewById(R.id.fav_button); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - buttonLog = (Button) itemView.findViewById(R.id.log_button); - buttonOff = (Button) itemView.findViewById(R.id.off_button); + likeButton = itemView.findViewById(R.id.fav_button); + iconRow = itemView.findViewById(R.id.rowIcon); + buttonLog = itemView.findViewById(R.id.log_button); + buttonOff = itemView.findViewById(R.id.off_button); - extraPanel = (LinearLayout) itemView.findViewById(R.id.extra_panel); + extraPanel = itemView.findViewById(R.id.extra_panel); if (extraPanel != null) extraPanel.setVisibility(View.GONE); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java index f73aff8e7..950e6b7a0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/ServerAdapter.java @@ -95,16 +95,15 @@ public View getView(int position, View convertView, ViewGroup parent) { if (mSharedPrefs.darkThemeEnabled()) { (convertView.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(context, R.drawable.bordershadowdark)); (convertView.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.background_dark)); - if ((convertView.findViewById(R.id.remove_button)) != null) (convertView.findViewById(R.id.remove_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); } - holder.enable = (CheckBox) convertView.findViewById(R.id.enableServer); - holder.server_name = (TextView) convertView.findViewById(R.id.server_name); - holder.server_remote_url = (TextView) convertView.findViewById(R.id.server_remote_ip); - holder.server_local_url = (TextView) convertView.findViewById(R.id.server_local_ip); - holder.remove = (Button) convertView.findViewById(R.id.remove_button); + holder.enable = convertView.findViewById(R.id.enableServer); + holder.server_name = convertView.findViewById(R.id.server_name); + holder.server_remote_url = convertView.findViewById(R.id.server_remote_ip); + holder.server_local_url = convertView.findViewById(R.id.server_local_ip); + holder.remove = convertView.findViewById(R.id.remove_button); holder.server_local_url.setText(context.getString(R.string.local) + ": " + mServerInfo.getLocalServerUrl()); holder.server_remote_url.setText(context.getString(R.string.remote) + ": " + mServerInfo.getRemoteServerUrl()); diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java index 36d8f0263..1bee12030 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/SpeechAdapter.java @@ -103,11 +103,11 @@ public View getView(int position, View convertView, ViewGroup parent) { (convertView.findViewById(R.id.remove_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); } - holder.enable = (CheckBox) convertView.findViewById(R.id.enableSpeech); - holder.Speech_name = (TextView) convertView.findViewById(R.id.speech_name); - holder.Speech_tag_id = (TextView) convertView.findViewById(R.id.speech_tag_id); - holder.Speech_switch_idx = (TextView) convertView.findViewById(R.id.speech_switchidx); - holder.remove = (Button) convertView.findViewById(R.id.remove_button); + holder.enable = convertView.findViewById(R.id.enableSpeech); + holder.Speech_name = convertView.findViewById(R.id.speech_name); + holder.Speech_tag_id = convertView.findViewById(R.id.speech_tag_id); + holder.Speech_switch_idx = convertView.findViewById(R.id.speech_switchidx); + holder.remove = convertView.findViewById(R.id.remove_button); holder.Speech_name.setText(mSpeechInfo.getName()); if (!UsefulBits.isEmpty(mSpeechInfo.getSwitchName())) { @@ -116,14 +116,14 @@ public View getView(int position, View convertView, ViewGroup parent) { holder.Speech_tag_id.setText(context.getString(R.string.connectedSwitch) + ": " + mSpeechInfo.getSwitchIdx()); } else { holder.Speech_tag_id.setText(context.getString(R.string.connectedSwitch) - + ": " + context.getString(R.string.not_available)); + + ": " + context.getString(R.string.not_available)); } if (!UsefulBits.isEmpty(mSpeechInfo.getValue())) holder.Speech_tag_id.setText(holder.Speech_tag_id.getText() + " - " + mSpeechInfo.getValue()); holder.Speech_switch_idx.setText("Commando's: \r\n" + "'" + mSpeechInfo.getName() + "' " + "\r\n'" + mSpeechInfo.getName() + " " + context.getString(R.string.button_state_on).toLowerCase() + "'\r\n" + - "'" + mSpeechInfo.getName() + " " + context.getString(R.string.button_state_off).toLowerCase() + "'"); + "'" + mSpeechInfo.getName() + " " + context.getString(R.string.button_state_off).toLowerCase() + "'"); holder.remove.setId(position); holder.remove.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java index 234c5ac39..61f17e14f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/SwitchesAdapter.java @@ -25,6 +25,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Color; +import android.support.design.chip.Chip; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -70,12 +71,12 @@ public class SwitchesAdapter extends RecyclerView.Adapter data = null; public ArrayList filteredData = null; @@ -151,7 +152,7 @@ public Filter getFilter() { public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View row = null; row = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.dashboard_row_list, parent, false); + .inflate(R.layout.dashboard_row_list, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) row.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -159,7 +160,7 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { (row.findViewById(R.id.row_wrapper)).setBackground(ContextCompat.getDrawable(context, R.drawable.bordershadowdark)); if ((row.findViewById(R.id.row_global_wrapper)) != null) (row.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.background_dark)); - if ((row.findViewById(R.id.day_button)) != null) + /* if ((row.findViewById(R.id.day_button)) != null) (row.findViewById(R.id.day_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); if ((row.findViewById(R.id.year_button)) != null) (row.findViewById(R.id.year_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); @@ -172,7 +173,7 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { if ((row.findViewById(R.id.timer_button)) != null) (row.findViewById(R.id.timer_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); if ((row.findViewById(R.id.notifications_button)) != null) - (row.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + (row.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); */ if ((row.findViewById(R.id.on_button)) != null) (row.findViewById(R.id.on_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); if ((row.findViewById(R.id.off_button)) != null) @@ -261,7 +262,7 @@ public boolean onLongClick(View v) { private void setSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHolder holder) { if (mDeviceInfo.getSwitchTypeVal() == 0 && - (mDeviceInfo.getSwitchType() == null)) { + (mDeviceInfo.getSwitchType() == null)) { switch (mDeviceInfo.getType()) { case DomoticzValues.Scene.Type.GROUP: setButtons(holder, Buttons.BUTTONS); @@ -394,7 +395,7 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo, default: throw new NullPointerException( - "No supported switch type defined in the adapter (setSwitchRowData)"); + "No supported switch type defined in the adapter (setSwitchRowData)"); } } } @@ -425,16 +426,16 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) - + ": " - + String.valueOf(mDeviceInfo.getData()); + + ": " + + String.valueOf(mDeviceInfo.getData()); holder.switch_battery_level.setText(text); if (mDeviceInfo.getUsage() != null && mDeviceInfo.getUsage().length() > 0) { @@ -444,7 +445,7 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (mDeviceInfo.getCounterToday() != null && mDeviceInfo.getCounterToday().length() > 0) holder.switch_battery_level.append(" " + context.getString(R.string.today) + ": " + mDeviceInfo.getCounterToday()); if (mDeviceInfo.getCounter() != null && mDeviceInfo.getCounter().length() > 0 && - !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) + !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) holder.switch_battery_level.append(" " + context.getString(R.string.total) + ": " + mDeviceInfo.getCounter()); if (mDeviceInfo.getType().equals("Wind")) { text = context.getString(R.string.direction) + " " + mDeviceInfo.getDirection() + " " + mDeviceInfo.getDirectionStr(); @@ -467,11 +468,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); holder.iconRow.setAlpha(1f); if (!mDeviceInfo.getStatusBoolean()) @@ -491,13 +492,13 @@ private void setSecurityPanelSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHo holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); @@ -523,11 +524,11 @@ public void onClick(View v) { } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -552,23 +553,23 @@ private void setOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); holder.switch_battery_level.setText(text); } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (holder.buttonOn != null) { if (mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.GROUP) || mDeviceInfo.getType().equals(DomoticzValues.Scene.Type.SCENE)) @@ -632,22 +633,22 @@ private void setOnOffSwitchRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -718,24 +719,24 @@ public void onClick(View v) { String text; if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { String setPointText = - context.getString(R.string.set_point) + ": " + String.valueOf(setPoint); + context.getString(R.string.set_point) + ": " + String.valueOf(setPoint); holder.switch_battery_level.setText(setPointText); } Picasso.with(context).load(DomoticzIcons.getDrawableIcon( - mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - false, - false, - null)).into(holder.iconRow); + mDeviceInfo.getTypeImg(), + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + false, + false, + null)).into(holder.iconRow); } /** @@ -757,8 +758,8 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol if (holder.switch_battery_level != null) { String batteryText = context.getString(R.string.temperature) - + ": " - + mDeviceInfo.getData(); + + ": " + + mDeviceInfo.getData(); holder.switch_battery_level.setText(batteryText); } } else { @@ -766,17 +767,17 @@ private void setTemperatureRowData(DevicesInfo mDeviceInfo, DataObjectHolder hol holder.signal_level.setVisibility(View.VISIBLE); if (holder.switch_battery_level != null) { String batteryLevelText = context.getString(R.string.temperature) - + ": " - + String.valueOf(temperature) - + " C"; + + ": " + + String.valueOf(temperature) + + " C"; holder.switch_battery_level.setText(batteryLevelText); } if (holder.signal_level != null) { String signalText = context.getString(R.string.set_point) - + ": " - + String.valueOf(mDeviceInfo.getSetPoint() - + " C"); + + ": " + + String.valueOf(mDeviceInfo.getSetPoint() + + " C"); holder.signal_level.setText(signalText); } } @@ -837,8 +838,8 @@ private void setContactSwitchRowData(DevicesInfo mDevicesInfo, } String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDevicesInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) { holder.signal_level.setText(text); } @@ -875,11 +876,11 @@ public void onClick(View v) { } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDevicesInfo.getTypeImg(), - mDevicesInfo.getType(), - mDevicesInfo.getSwitchType(), - mDevicesInfo.getStatusBoolean(), - mDevicesInfo.getUseCustomImage(), - mDevicesInfo.getImage())).into(holder.iconRow); + mDevicesInfo.getType(), + mDevicesInfo.getSwitchType(), + mDevicesInfo.getStatusBoolean(), + mDevicesInfo.getUseCustomImage(), + mDevicesInfo.getImage())).into(holder.iconRow); if (!mDevicesInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -900,22 +901,22 @@ private void setPushOnOffSwitchRowData(DevicesInfo mDeviceInfo, DataObjectHolder holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, mDeviceInfo.getLastUpdateDateTime().getTime()); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -981,17 +982,17 @@ private void setBlindsRowData(DevicesInfo mDeviceInfo, if (holder.switch_status != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate( - context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate( + context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.switch_status.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); holder.switch_battery_level.setText(text); } @@ -1038,11 +1039,11 @@ public void onClick(View view) { }); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1065,15 +1066,15 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getStatus()); + String.valueOf(mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); } @@ -1085,7 +1086,7 @@ private void setSelectorRowData(final DevicesInfo mDeviceInfo, holder.spSelector.setTag(mDeviceInfo.getIdx()); if (levelNames != null && levelNames.size() > loadLevel) { ArrayAdapter dataAdapter = new ArrayAdapter(context, - android.R.layout.simple_spinner_item, levelNames); + android.R.layout.simple_spinner_item, levelNames); dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); holder.spSelector.setAdapter(dataAdapter); holder.spSelector.setSelection(loadLevel); @@ -1110,11 +1111,11 @@ public void onNothingSelected(AdapterView arg0) { }); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1140,29 +1141,29 @@ private void setDimmerRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getStatus()); + String.valueOf(mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1206,7 +1207,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = (TextView) seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); @@ -1223,7 +1224,7 @@ public void onStopTrackingTouch(SeekBar seekBar) { Switch dimmerOnOffSwitch = null; try { dimmerOnOffSwitch = (Switch) seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); + .findViewById(mDeviceInfo.getIdx() + ID_SWITCH); if (progress == 0 && dimmerOnOffSwitch.isChecked()) { dimmerOnOffSwitch.setChecked(false); seekBar.setProgress(previousDimmerValue); @@ -1287,29 +1288,29 @@ private void setDimmerOnOffButtonRowData(final DevicesInfo mDeviceInfo, if (holder.signal_level != null) { text = context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + + ": " + + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); } if (holder.switch_battery_level != null) { text = context.getString(R.string.status) + ": " + - String.valueOf(mDeviceInfo.getStatus()); + String.valueOf(mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); } holder.switch_dimmer_level.setId(mDeviceInfo.getIdx() + ID_TEXTVIEW); String percentage = calculateDimPercentage( - mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); + mDeviceInfo.getMaxDimLevel(), mDeviceInfo.getLevel()); holder.switch_dimmer_level.setText(percentage); Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); if (!mDeviceInfo.getStatusBoolean()) holder.iconRow.setAlpha(0.5f); @@ -1357,7 +1358,7 @@ public void onClick(View v) { public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { String percentage = calculateDimPercentage(seekBar.getMax(), progress); TextView switch_dimmer_level = (TextView) seekBar.getRootView() - .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); + .findViewById(mDeviceInfo.getIdx() + ID_TEXTVIEW); if (switch_dimmer_level != null) switch_dimmer_level.setText(percentage); } @@ -1423,12 +1424,12 @@ private void setModalSwitchRowData(DevicesInfo mDeviceInfo, holder.switch_name.setText(mDeviceInfo.getName()); String text = context.getString(R.string.last_update) + ": " + - UsefulBits.getFormattedDate(context, - mDeviceInfo.getLastUpdateDateTime().getTime()); + UsefulBits.getFormattedDate(context, + mDeviceInfo.getLastUpdateDateTime().getTime()); holder.signal_level.setText(text); text = context.getString(R.string.status) + ": " + - getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); + getStatus(stateArrayRes, stateNamesArrayRes, mDeviceInfo.getStatus()); holder.switch_battery_level.setText(text); if (holder.buttonSetStatus != null) { @@ -1443,11 +1444,11 @@ public void onClick(View v) { } Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSwitchType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSwitchType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); } /** @@ -1797,7 +1798,8 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { TextView switch_name, signal_level, switch_status, switch_battery_level, switch_dimmer_level; Switch onOffSwitch, dimmerOnOffSwitch; ImageButton buttonUp, buttonDown, buttonStop; - Button buttonOn, buttonLog, buttonTimer, buttonColor, buttonSetStatus, buttonSet, buttonOff, buttonNotifications; + Button buttonOn, buttonColor, buttonSetStatus, buttonSet, buttonOff; + Chip buttonLog, buttonTimer, buttonNotifications; Boolean isProtected; LikeButton likeButton; ImageView iconRow, iconMode; @@ -1808,37 +1810,35 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { public DataObjectHolder(View itemView) { super(itemView); - buttonOn = (Button) itemView.findViewById(R.id.on_button); - buttonOff = (Button) itemView.findViewById(R.id.off_button); - buttonSetStatus = (Button) itemView.findViewById(R.id.set_button); - - onOffSwitch = (Switch) itemView.findViewById(R.id.switch_button); - signal_level = (TextView) itemView.findViewById(R.id.switch_signal_level); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - switch_name = (TextView) itemView.findViewById(R.id.switch_name); - switch_battery_level = (TextView) itemView.findViewById(R.id.switch_battery_level); - - switch_dimmer_level = (TextView) itemView.findViewById(R.id.switch_dimmer_level); - dimmerOnOffSwitch = (Switch) itemView.findViewById(R.id.switch_dimmer_switch); - dimmer = (SeekBar) itemView.findViewById(R.id.switch_dimmer); - spSelector = (Spinner) itemView.findViewById(R.id.spSelector); - buttonColor = (Button) itemView.findViewById(R.id.color_button); - buttonLog = (Button) itemView.findViewById(R.id.log_button); - buttonTimer = (Button) itemView.findViewById(R.id.timer_button); - buttonUp = (ImageButton) itemView.findViewById(R.id.switch_button_up); - buttonNotifications = (Button) itemView.findViewById(R.id.notifications_button); - buttonStop = (ImageButton) itemView.findViewById(R.id.switch_button_stop); - buttonDown = (ImageButton) itemView.findViewById(R.id.switch_button_down); - buttonSet = (Button) itemView.findViewById(R.id.set_button); - - likeButton = (LikeButton) itemView.findViewById(R.id.fav_button); - + buttonOn = itemView.findViewById(R.id.on_button); + buttonOff = itemView.findViewById(R.id.off_button); + buttonSetStatus = itemView.findViewById(R.id.set_button); + + onOffSwitch = itemView.findViewById(R.id.switch_button); + signal_level = itemView.findViewById(R.id.switch_signal_level); + iconRow = itemView.findViewById(R.id.rowIcon); + switch_name = itemView.findViewById(R.id.switch_name); + switch_battery_level = itemView.findViewById(R.id.switch_battery_level); + + switch_dimmer_level = itemView.findViewById(R.id.switch_dimmer_level); + dimmerOnOffSwitch = itemView.findViewById(R.id.switch_dimmer_switch); + dimmer = itemView.findViewById(R.id.switch_dimmer); + spSelector = itemView.findViewById(R.id.spSelector); + buttonColor = itemView.findViewById(R.id.color_button); + buttonLog = itemView.findViewById(R.id.log_button); + buttonTimer = itemView.findViewById(R.id.timer_button); + buttonUp = itemView.findViewById(R.id.switch_button_up); + buttonNotifications = itemView.findViewById(R.id.notifications_button); + buttonStop = itemView.findViewById(R.id.switch_button_stop); + buttonDown = itemView.findViewById(R.id.switch_button_down); + buttonSet = itemView.findViewById(R.id.set_button); + + likeButton = itemView.findViewById(R.id.fav_button); if (buttonLog != null) buttonLog.setVisibility(View.GONE); if (buttonTimer != null) buttonTimer.setVisibility(View.GONE); - - extraPanel = (LinearLayout) itemView.findViewById(R.id.extra_panel); + extraPanel = itemView.findViewById(R.id.extra_panel); if (extraPanel != null) extraPanel.setVisibility(View.GONE); } @@ -1869,7 +1869,6 @@ protected FilterResults performFiltering(CharSequence constraint) { } results.values = devicesInfos; results.count = devicesInfos.size(); - return results; } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java index 56f2968a4..3f9f285d0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/TemperatureAdapter.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.res.TypedArray; import android.graphics.Color; +import android.support.design.chip.Chip; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -104,7 +105,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.temperature_row_default, parent, false); + .inflate(R.layout.temperature_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) view.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -124,10 +125,20 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position) final TemperatureInfo mTemperatureInfo = filteredData.get(position); if (mSharedPrefs.darkThemeEnabled()) { - holder.dayButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); - holder.monthButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); - holder.yearButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); - holder.weekButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + /* if ((row.findViewById(R.id.day_button)) != null) + (row.findViewById(R.id.day_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.year_button)) != null) + (row.findViewById(R.id.year_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.month_button)) != null) + (row.findViewById(R.id.month_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.week_button)) != null) + (row.findViewById(R.id.week_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.log_button)) != null) + (row.findViewById(R.id.log_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.timer_button)) != null) + (row.findViewById(R.id.timer_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.notifications_button)) != null) + (row.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); */ if (holder.setButton != null) holder.setButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_status_dark)); @@ -138,20 +149,20 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position) int modeIconRes = 0; if ((!UsefulBits.isEmpty(sign) && sign.equals("C") && mTemperatureInfo.getTemperature() < 0) || - (!UsefulBits.isEmpty(sign) && sign.equals("F") && mTemperatureInfo.getTemperature() < 30)) { + (!UsefulBits.isEmpty(sign) && sign.equals("F") && mTemperatureInfo.getTemperature() < 30)) { Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mTemperatureInfo.getTypeImg(), - mTemperatureInfo.getType(), - null, - (mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, - true, - "Freezing")).into(holder.iconRow); + mTemperatureInfo.getType(), + null, + (mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, + true, + "Freezing")).into(holder.iconRow); } else { Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mTemperatureInfo.getTypeImg(), - mTemperatureInfo.getType(), - null, - (mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, - false, - null)).into(holder.iconRow); + mTemperatureInfo.getType(), + null, + (mConfigInfo != null && mTemperatureInfo.getTemperature() > mConfigInfo.getDegreeDaysBaseTemperature()) ? true : false, + false, + null)).into(holder.iconRow); } if (!UsefulBits.isEmpty(mTemperatureInfo.getHardwareName()) && mTemperatureInfo.getHardwareName().equalsIgnoreCase(DomoticzValues.Device.Hardware.EVOHOME)) { @@ -260,9 +271,9 @@ public void unLiked(LikeButton likeButton) { holder.data.setText(R.string.wind); holder.data.append(": " + mTemperatureInfo.getData() + " " + mTemperatureInfo.getDirection()); holder.data2.setText(context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mTemperatureInfo.getLastUpdateDateTime().getTime())); + + ": " + + UsefulBits.getFormattedDate(context, + mTemperatureInfo.getLastUpdateDateTime().getTime())); holder.data2.setVisibility(View.VISIBLE); } else { double temperature = mTemperatureInfo.getTemperature(); @@ -270,9 +281,9 @@ public void unLiked(LikeButton likeButton) { if (temperature <= 0 || setPoint <= 0) { holder.data.setText(context.getString(R.string.temperature) + ": " + mTemperatureInfo.getData()); holder.data2.setText(context.getString(R.string.last_update) - + ": " - + UsefulBits.getFormattedDate(context, - mTemperatureInfo.getLastUpdateDateTime().getTime())); + + ": " + + UsefulBits.getFormattedDate(context, + mTemperatureInfo.getLastUpdateDateTime().getTime())); holder.data2.setVisibility(View.VISIBLE); } else { holder.data.setText(context.getString(R.string.temperature) + ": " + mTemperatureInfo.getTemperature() + " " + sign); @@ -341,10 +352,10 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { ImageView iconRow; ImageView iconMode; Button setButton; - Button dayButton; - Button monthButton; - Button weekButton; - Button yearButton; + Chip dayButton; + Chip monthButton; + Chip weekButton; + Chip yearButton; Boolean isProtected; LikeButton likeButton; LinearLayout extraPanel; @@ -353,21 +364,21 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { public DataObjectHolder(View itemView) { super(itemView); - name = (TextView) itemView.findViewById(R.id.temperature_name); - data = (TextView) itemView.findViewById(R.id.temperature_data); - data2 = (TextView) itemView.findViewById(R.id.temperature_data2); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - iconMode = (ImageView) itemView.findViewById(R.id.mode_icon); - pieView = (PieView) itemView.findViewById(R.id.pieView); - - dayButton = (Button) itemView.findViewById(R.id.day_button); - monthButton = (Button) itemView.findViewById(R.id.month_button); - yearButton = (Button) itemView.findViewById(R.id.year_button); - weekButton = (Button) itemView.findViewById(R.id.week_button); - setButton = (Button) itemView.findViewById(R.id.set_button); - likeButton = (LikeButton) itemView.findViewById(R.id.fav_button); - - extraPanel = (LinearLayout) itemView.findViewById(R.id.extra_panel); + name = itemView.findViewById(R.id.temperature_name); + data = itemView.findViewById(R.id.temperature_data); + data2 = itemView.findViewById(R.id.temperature_data2); + iconRow = itemView.findViewById(R.id.rowIcon); + iconMode = itemView.findViewById(R.id.mode_icon); + pieView = itemView.findViewById(R.id.pieView); + + dayButton = itemView.findViewById(R.id.day_button); + monthButton = itemView.findViewById(R.id.month_button); + yearButton = itemView.findViewById(R.id.year_button); + weekButton = itemView.findViewById(R.id.week_button); + setButton = itemView.findViewById(R.id.set_button); + likeButton = itemView.findViewById(R.id.fav_button); + + extraPanel = itemView.findViewById(R.id.extra_panel); if (extraPanel != null) extraPanel.setVisibility(View.GONE); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java index bbd83d4db..2047c9469 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/TimersAdapter.java @@ -91,9 +91,9 @@ public View getView(int position, View convertView, ViewGroup parent) { (convertView.findViewById(R.id.row_global_wrapper)).setBackgroundColor(ContextCompat.getColor(context, R.color.background_dark)); } - holder.switch_name = (TextView) convertView.findViewById(R.id.switch_name); - holder.switch_status = (TextView) convertView.findViewById(R.id.switch_battery_level); - holder.signal_level = (TextView) convertView.findViewById(R.id.switch_signal_level); + holder.switch_name = convertView.findViewById(R.id.switch_name); + holder.switch_status = convertView.findViewById(R.id.switch_battery_level); + holder.signal_level = convertView.findViewById(R.id.switch_signal_level); holder.switch_name.setText(mSwitchTimerInfo.getActive()); String commando = ""; if (mSwitchTimerInfo.getCmd() == 0) diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java index e2cf197f5..4e28022c1 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/UserVariablesAdapter.java @@ -83,7 +83,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.vars_row_default, parent, false); + .inflate(R.layout.vars_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) view.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -134,7 +134,7 @@ public interface onClickListener { public static class DataObjectHolder extends RecyclerView.ViewHolder - implements View.OnClickListener { + implements View.OnClickListener { TextView name; TextView datetime; TextView message; @@ -144,12 +144,11 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder public DataObjectHolder(View itemView) { super(itemView); - name = (TextView) itemView.findViewById(R.id.logs_name); - datetime = (TextView) itemView.findViewById(R.id.logs_datetime); - message = (TextView) itemView.findViewById(R.id.logs_message); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - set = (Button) itemView.findViewById(R.id.set_uservar); - + name = itemView.findViewById(R.id.logs_name); + datetime = itemView.findViewById(R.id.logs_datetime); + message = itemView.findViewById(R.id.logs_message); + iconRow = itemView.findViewById(R.id.rowIcon); + set = itemView.findViewById(R.id.set_uservar); itemView.setOnClickListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java index 01e9bc087..b550beff4 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/UtilityAdapter.java @@ -23,6 +23,7 @@ import android.content.Context; import android.graphics.Color; +import android.support.design.chip.Chip; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; @@ -95,7 +96,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.utilities_row_default, parent, false); + .inflate(R.layout.utilities_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) view.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -121,7 +122,7 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position) final double setPoint = mUtilitiesInfo.getSetPoint(); if ((mUtilitiesInfo.getType() != null && DomoticzValues.Device.Utility.Type.THERMOSTAT.equalsIgnoreCase(mUtilitiesInfo.getType())) || - (mUtilitiesInfo.getSubType() != null && DomoticzValues.Device.Utility.SubType.SMARTWARES.equalsIgnoreCase(mUtilitiesInfo.getSubType()))) { + (mUtilitiesInfo.getSubType() != null && DomoticzValues.Device.Utility.SubType.SMARTWARES.equalsIgnoreCase(mUtilitiesInfo.getSubType()))) { setButtons(holder, Buttons.THERMOSTAT); CreateThermostatRow(holder, mUtilitiesInfo, setPoint); } else { @@ -249,7 +250,7 @@ private void CreateDefaultRow(DataObjectHolder holder, UtilitiesInfo mUtilitiesI if (mUtilitiesInfo.getCounterToday() != null && mUtilitiesInfo.getCounterToday().length() > 0) holder.data.append(" " + context.getString(R.string.today) + ": " + mUtilitiesInfo.getCounterToday()); if (mUtilitiesInfo.getCounter() != null && mUtilitiesInfo.getCounter().length() > 0 && - !mUtilitiesInfo.getCounter().equals(mUtilitiesInfo.getData())) + !mUtilitiesInfo.getCounter().equals(mUtilitiesInfo.getData())) holder.data.append(" " + context.getString(R.string.total) + ": " + mUtilitiesInfo.getCounter()); holder.dayButton.setId(mUtilitiesInfo.getIdx()); @@ -374,13 +375,13 @@ public void onClick(View v) { }); if (mUtilitiesInfo.getSubType() - .replace("Electric", "counter") - .replace("kWh", "counter") - .replace("Gas", "counter") - .replace("Energy", "counter") - .replace("Voltcraft", "counter") - .replace("SetPoint", "temp") - .replace("YouLess counter", "counter").contains("counter")) + .replace("Electric", "counter") + .replace("kWh", "counter") + .replace("Gas", "counter") + .replace("Energy", "counter") + .replace("Voltcraft", "counter") + .replace("SetPoint", "temp") + .replace("YouLess counter", "counter").contains("counter")) holder.weekButton.setVisibility(View.VISIBLE); holder.yearButton.setId(mUtilitiesInfo.getIdx()); @@ -466,11 +467,11 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { ImageView iconRow; Boolean isProtected; - Button dayButton; - Button monthButton; - Button yearButton; - Button weekButton; - Button buttonLog; + Chip dayButton; + Chip monthButton; + Chip yearButton; + Chip weekButton; + Chip buttonLog; Button on_button; LikeButton likeButton; @@ -479,20 +480,20 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { public DataObjectHolder(View itemView) { super(itemView); - dayButton = (Button) itemView.findViewById(R.id.day_button); - monthButton = (Button) itemView.findViewById(R.id.month_button); - yearButton = (Button) itemView.findViewById(R.id.year_button); - weekButton = (Button) itemView.findViewById(R.id.week_button); - likeButton = (LikeButton) itemView.findViewById(R.id.fav_button); + dayButton = itemView.findViewById(R.id.day_button); + monthButton = itemView.findViewById(R.id.month_button); + yearButton = itemView.findViewById(R.id.year_button); + weekButton = itemView.findViewById(R.id.week_button); + likeButton = itemView.findViewById(R.id.fav_button); - on_button = (Button) itemView.findViewById(R.id.on_button); - name = (TextView) itemView.findViewById(R.id.utilities_name); - iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); - buttonLog = (Button) itemView.findViewById(R.id.log_button); - data = (TextView) itemView.findViewById(R.id.utilities_data); - hardware = (TextView) itemView.findViewById(R.id.utilities_hardware); + on_button = itemView.findViewById(R.id.on_button); + name = itemView.findViewById(R.id.utilities_name); + iconRow = itemView.findViewById(R.id.rowIcon); + buttonLog = itemView.findViewById(R.id.log_button); + data = itemView.findViewById(R.id.utilities_data); + hardware = itemView.findViewById(R.id.utilities_hardware); - extraPanel = (LinearLayout) itemView.findViewById(R.id.extra_panel); + extraPanel = itemView.findViewById(R.id.extra_panel); if (extraPanel != null) extraPanel.setVisibility(View.GONE); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java index d34a240a3..7e25723df 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/WeatherAdapter.java @@ -23,6 +23,7 @@ import android.content.Context; import android.graphics.Color; +import android.support.design.chip.Chip; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; @@ -106,7 +107,7 @@ public Filter getFilter() { @Override public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.weather_row_default, parent, false); + .inflate(R.layout.weather_row_default, parent, false); if (mSharedPrefs.darkThemeEnabled()) { ((android.support.v7.widget.CardView) view.findViewById(R.id.card_global_wrapper)).setCardBackgroundColor(Color.parseColor("#3F3F3F")); @@ -136,12 +137,22 @@ public void onBindViewHolder(final DataObjectHolder holder, final int position) windSign = mConfigInfo.getWindSign(); } - if (mSharedPrefs.darkThemeEnabled()) { - holder.dayButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); - holder.monthButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); - holder.yearButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); - holder.weekButton.setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); - } + //if (mSharedPrefs.darkThemeEnabled()) { + /* if ((row.findViewById(R.id.day_button)) != null) + (row.findViewById(R.id.day_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.year_button)) != null) + (row.findViewById(R.id.year_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.month_button)) != null) + (row.findViewById(R.id.month_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.week_button)) != null) + (row.findViewById(R.id.week_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.log_button)) != null) + (row.findViewById(R.id.log_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.timer_button)) != null) + (row.findViewById(R.id.timer_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); + if ((row.findViewById(R.id.notifications_button)) != null) + (row.findViewById(R.id.notifications_button)).setBackground(ContextCompat.getDrawable(context, R.drawable.button_dark_status)); */ + // } holder.isProtected = mWeatherInfo.isProtected(); holder.name.setText(mWeatherInfo.getName()); @@ -298,10 +309,10 @@ public static class DataObjectHolder extends RecyclerView.ViewHolder { TextView hardware; ImageView iconRow; Boolean isProtected; - Button dayButton; - Button monthButton; - Button yearButton; - Button weekButton; + Chip dayButton; + Chip monthButton; + Chip yearButton; + Chip weekButton; LikeButton likeButton; LinearLayout extraPanel; PieView pieView; @@ -312,10 +323,10 @@ public DataObjectHolder(View itemView) { pieView = (PieView) itemView.findViewById(R.id.pieView); pieView.setVisibility(View.GONE); - dayButton = (Button) itemView.findViewById(R.id.day_button); - monthButton = (Button) itemView.findViewById(R.id.month_button); - yearButton = (Button) itemView.findViewById(R.id.year_button); - weekButton = (Button) itemView.findViewById(R.id.week_button); + dayButton = (Chip) itemView.findViewById(R.id.day_button); + monthButton = (Chip) itemView.findViewById(R.id.month_button); + yearButton = (Chip) itemView.findViewById(R.id.year_button); + weekButton = (Chip) itemView.findViewById(R.id.week_button); likeButton = (LikeButton) itemView.findViewById(R.id.fav_button); name = (TextView) itemView.findViewById(R.id.weather_name); iconRow = (ImageView) itemView.findViewById(R.id.rowIcon); diff --git a/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java b/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java index d74f3fb5e..a765685a5 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java +++ b/app/src/main/java/nl/hnogames/domoticz/Adapters/WidgetsAdapter.java @@ -117,10 +117,10 @@ private View setDefaultRowId(ViewHolder holder) { LayoutInflater inflater = ((Activity) context).getLayoutInflater(); View row = inflater.inflate(layoutResourceId, null); - holder.signal_level = (TextView) row.findViewById(R.id.switch_signal_level); - holder.iconRow = (ImageView) row.findViewById(R.id.rowIcon); - holder.switch_name = (TextView) row.findViewById(R.id.switch_name); - holder.switch_battery_level = (TextView) row.findViewById(R.id.switch_battery_level); + holder.signal_level = row.findViewById(R.id.switch_signal_level); + holder.iconRow = row.findViewById(R.id.rowIcon); + holder.switch_name = row.findViewById(R.id.switch_name); + holder.switch_battery_level = row.findViewById(R.id.switch_battery_level); return row; } @@ -133,11 +133,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, try { String text = context.getString(R.string.last_update) + ": " + - String.valueOf(mDeviceInfo.getLastUpdate().substring(mDeviceInfo.getLastUpdate().indexOf(" ") + 1)); + String.valueOf(mDeviceInfo.getLastUpdate().substring(mDeviceInfo.getLastUpdate().indexOf(" ") + 1)); if (holder.signal_level != null) holder.signal_level.setText(text); text = context.getString(R.string.data) + ": " + - String.valueOf(mDeviceInfo.getData()); + String.valueOf(mDeviceInfo.getData()); if (holder.switch_battery_level != null) holder.switch_battery_level.setText(text); if (mDeviceInfo.getUsage() != null && mDeviceInfo.getUsage().length() > 0) @@ -145,7 +145,7 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, if (mDeviceInfo.getCounterToday() != null && mDeviceInfo.getCounterToday().length() > 0) holder.switch_battery_level.append(" " + context.getString(R.string.today) + ": " + mDeviceInfo.getCounterToday()); if (mDeviceInfo.getCounter() != null && mDeviceInfo.getCounter().length() > 0 && - !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) + !mDeviceInfo.getCounter().equals(mDeviceInfo.getData())) holder.switch_battery_level.append(" " + context.getString(R.string.total) + ": " + mDeviceInfo.getCounter()); } catch (Exception ex) { holder.switch_battery_level.setText(""); @@ -158,11 +158,11 @@ private void setDefaultRowData(DevicesInfo mDeviceInfo, Picasso.with(context).load(R.drawable.qrcode).into(holder.iconRow); } else { Picasso.with(context).load(DomoticzIcons.getDrawableIcon(mDeviceInfo.getTypeImg(), - mDeviceInfo.getType(), - mDeviceInfo.getSubType(), - mDeviceInfo.getStatusBoolean(), - mDeviceInfo.getUseCustomImage(), - mDeviceInfo.getImage())).into(holder.iconRow); + mDeviceInfo.getType(), + mDeviceInfo.getSubType(), + mDeviceInfo.getStatusBoolean(), + mDeviceInfo.getUseCustomImage(), + mDeviceInfo.getImage())).into(holder.iconRow); } holder.iconRow.setAlpha(1f); diff --git a/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java b/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java index 540ec3236..a71b47075 100644 --- a/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/CameraActivity.java @@ -55,7 +55,7 @@ protected void onCreate(Bundle savedInstanceState) { if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportFragmentManager().beginTransaction().replace(android.R.id.content, - camera).commit(); + camera).commit(); camera.setImage(imageUrl); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java b/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java index 36ad6e917..58573c4fe 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java +++ b/app/src/main/java/nl/hnogames/domoticz/Containers/LocationInfo.java @@ -131,23 +131,23 @@ public Geofence toGeofence() { try { // Build a new Geofence object. return new Geofence.Builder() - // Set the request ID of the geofence. This is a string to identify this - // geofence. - .setRequestId(String.valueOf(id)) - // Set the circular region of this geofence. - .setCircularRegion( - latLng.latitude, latLng.longitude, radius - ) - // Set the expiration duration of the geofence. This geofence gets automatically - // removed after this period of time. - .setExpirationDuration(Geofence.NEVER_EXPIRE) - // Set the transition types of interest. Alerts are only generated for these - // transition. We track entry and exit transitions in this sample. - .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | - Geofence.GEOFENCE_TRANSITION_EXIT) - .setLoiteringDelay(3000) - // Create the geofence. - .build(); + // Set the request ID of the geofence. This is a string to identify this + // geofence. + .setRequestId(String.valueOf(id)) + // Set the circular region of this geofence. + .setCircularRegion( + latLng.latitude, latLng.longitude, radius + ) + // Set the expiration duration of the geofence. This geofence gets automatically + // removed after this period of time. + .setExpirationDuration(Geofence.NEVER_EXPIRE) + // Set the transition types of interest. Alerts are only generated for these + // transition. We track entry and exit transitions in this sample. + .setTransitionTypes(Geofence.GEOFENCE_TRANSITION_DWELL | + Geofence.GEOFENCE_TRANSITION_EXIT) + .setLoiteringDelay(3000) + // Create the geofence. + .build(); } catch (Exception ex) { // Wrong LocationInfo data detected return null; diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java index 0702f5cc3..8e4d966d1 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Camera.java @@ -80,6 +80,11 @@ public void onAttach(Context context) { super.onAttach(context); mSharedPrefs = new SharedPrefUtil(context); } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } private void processImage() { // Get access to the URI for the bitmap @@ -102,10 +107,10 @@ public void setImage(String url) { File file = new File(url); Uri uri = Uri.fromFile(file); Picasso.with(getActivity()) - .load(uri) - .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) - .networkPolicy(NetworkPolicy.NO_CACHE) - .into(root); + .load(uri) + .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) + .networkPolicy(NetworkPolicy.NO_CACHE) + .into(root); } } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java index 87ab18174..9b9f79e60 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Cameras.java @@ -97,6 +97,7 @@ public void refreshFragment() { @Override public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); super.onActivityCreated(savedInstanceState); } @@ -122,6 +123,7 @@ private void processImage(Bitmap savePic, String title) { @Override public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); this.context = context; mSharedPrefs = new SharedPrefUtil(context); if (getActionBar() != null) @@ -219,7 +221,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { } } AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_storage), neededPermission); + getActivity().getString(R.string.permission_desc_storage), neededPermission); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java index 4dcf7139e..100ff6403 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Dashboard.java @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Color; import android.os.AsyncTask; +import android.os.Bundle; import android.os.Parcelable; import android.support.design.widget.CoordinatorLayout; import android.support.design.widget.Snackbar; @@ -53,6 +54,7 @@ import nl.hnogames.domoticz.UI.TemperatureDialog; import nl.hnogames.domoticz.Utils.SerializableManager; import nl.hnogames.domoticz.Utils.UsefulBits; +import nl.hnogames.domoticz.app.AppController; import nl.hnogames.domoticz.app.DomoticzDashboardFragment; import nl.hnogames.domoticzapi.Containers.DevicesInfo; import nl.hnogames.domoticzapi.Domoticz; @@ -63,7 +65,7 @@ @DebugLog public class Dashboard extends DomoticzDashboardFragment implements DomoticzFragmentListener, - switchesClickListener { + switchesClickListener { public static final String PERMANENT_OVERRIDE = "PermanentOverride"; public static final String AUTO = "Auto"; @@ -80,14 +82,20 @@ public class Dashboard extends DomoticzDashboardFragment implements DomoticzFrag private SlideInBottomAnimationAdapter alphaSlideIn; + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + if (getActionBar() != null) + getActionBar().setTitle(R.string.title_dashboard); + } @Override @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; - if (getActionBar() != null) - getActionBar().setTitle(R.string.title_dashboard); } @Override @@ -185,8 +193,8 @@ private void createListView(ArrayList switches) { String switchType = mExtendedStatusInfo.getSwitchType(); if (!name.startsWith(Domoticz.HIDDEN_CHARACTER) && - (appSupportedSwitchesValues.contains(switchTypeVal) && appSupportedSwitchesNames.contains(switchType)) || - UsefulBits.isEmpty(switchType)) { + (appSupportedSwitchesValues.contains(switchTypeVal) && appSupportedSwitchesNames.contains(switchType)) || + UsefulBits.isEmpty(switchType)) { if (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) { supportedSwitches.add(mExtendedStatusInfo); } else { @@ -195,15 +203,15 @@ private void createListView(ArrayList switches) { if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(mContext.getString(R.string.filter_on) + ": " + super.getSort()); if ((super.getSort().equals(mContext.getString(R.string.filterOn_on)) && mExtendedStatusInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { + mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { supportedSwitches.add(mExtendedStatusInfo); } if ((super.getSort().equals(mContext.getString(R.string.filterOn_off)) && !mExtendedStatusInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { + mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { supportedSwitches.add(mExtendedStatusInfo); } if (super.getSort().equals(mContext.getString(R.string.filterOn_static)) && - !mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { + !mDomoticz.isOnOffSwitch(mExtendedStatusInfo)) { supportedSwitches.add(mExtendedStatusInfo); } } @@ -253,9 +261,9 @@ public void onRefresh() { private void showInfoDialog(final DevicesInfo mSwitch) { DeviceInfoDialog infoDialog = new DeviceInfoDialog( - mContext, - mSwitch, - R.layout.dialog_switch_info); + mContext, + mSwitch, + R.layout.dialog_switch_info); infoDialog.setIdx(String.valueOf(mSwitch.getIdx())); infoDialog.setLastUpdate(mSwitch.getLastUpdate()); @@ -327,7 +335,7 @@ public void onSwitchClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -361,7 +369,7 @@ private void toggleSwitch(final DevicesInfo clickedSwitch, final boolean checked int jsonAction; int jsonUrl = DomoticzValues.Json.Url.Set.SWITCHES; if (clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else jsonAction = DomoticzValues.Device.Switch.Action.ON; } else { @@ -431,7 +439,7 @@ public void onButtonClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -509,7 +517,7 @@ public void onLikeButtonClick(int idx, boolean checked) { @DebugLog public void onColorButtonClick(final int idx) { ColorPickerDialog colorDialog = new ColorPickerDialog( - mContext, idx); + mContext, idx); colorDialog.show(); colorDialog.onDismissListener(new ColorPickerDialog.DismissListener() { @Override @@ -517,7 +525,7 @@ public void onColorButtonClick(final int idx) { public void onDismiss(final int selectedColor) { if (getDevice(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -558,34 +566,34 @@ private void setColor(int selectedColor, final int idx, final String password) { isWhite = true; } mDomoticz.setRGBColorAction(idx, - DomoticzValues.Json.Url.Set.RGBCOLOR, - hue, - getDevice(idx).getLevel(), - isWhite, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getDevice(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.color_set); - } - - @Override - @DebugLog - public void onError(Exception error) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + DomoticzValues.Json.Url.Set.RGBCOLOR, + hue, + getDevice(idx).getLevel(), + isWhite, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getDevice(idx).getName(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.error_color); + ((MainActivity) getActivity()).Talk(R.string.color_set); } - } - }); + + @Override + @DebugLog + public void onError(Exception error) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.error_color); + } + } + }); } @Override @@ -606,8 +614,8 @@ public void onThermostatClick(final int idx) { if (tempUtil != null) { TemperatureDialog tempDialog = new TemperatureDialog( - mContext, - tempUtil.getSetPoint()); + mContext, + tempUtil.getSetPoint()); tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @Override @@ -617,7 +625,7 @@ public void onDialogAction(final double newSetPoint, DialogAction dialogAction) if (dialogAction == DialogAction.POSITIVE) { if (tempUtil.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -628,22 +636,22 @@ public void onDismiss(final String password) { if (newSetPoint < tempUtil.getSetPoint()) action = DomoticzValues.Device.Thermostat.Action.MIN; mDomoticz.setAction(idx, jsonUrl, action, newSetPoint, password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - successHandling(result, false); - processDashboard(); - } - - @Override - @DebugLog - public void onError(Exception error) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } - }); + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + successHandling(result, false); + processDashboard(); + } + + @Override + @DebugLog + public void onError(Exception error) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } + }); } @Override @@ -656,20 +664,20 @@ public void onCancel() { if (newSetPoint < tempUtil.getSetPoint()) action = DomoticzValues.Device.Thermostat.Action.MIN; mDomoticz.setAction(idx, jsonUrl, action, newSetPoint, null, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - successHandling(result, false); - processDashboard(); - } - - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error, coordinatorLayout); - } - }); + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + successHandling(result, false); + processDashboard(); + } + + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error, coordinatorLayout); + } + }); } } } @@ -704,13 +712,13 @@ public void onError(Exception error) { TemperatureDialog tempDialog; if (evohomeZone) { tempDialog = new ScheduledTemperatureDialog( - mContext, - tempUtil.getSetPoint(), - !AUTO.equalsIgnoreCase(tempUtil.getStatus())); + mContext, + tempUtil.getSetPoint(), + !AUTO.equalsIgnoreCase(tempUtil.getStatus())); } else { tempDialog = new TemperatureDialog( - mContext, - tempUtil.getSetPoint()); + mContext, + tempUtil.getSetPoint()); } tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @@ -721,7 +729,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to " + String.valueOf(newSetPoint)); String params = "&setpoint=" + String.valueOf(newSetPoint) + - "&mode=" + PERMANENT_OVERRIDE; + "&mode=" + PERMANENT_OVERRIDE; // add query parameters mDomoticz.setDeviceUsed(idx, tempUtil.getName(), tempUtil.getDescription(), params, commandReceiver); @@ -729,7 +737,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to Auto"); String params = "&setpoint=" + String.valueOf(newSetPoint) + - "&mode=" + AUTO; + "&mode=" + AUTO; // add query parameters mDomoticz.setDeviceUsed(idx, tempUtil.getName(), tempUtil.getDescription(), params, commandReceiver); @@ -747,8 +755,8 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { @DebugLog public void onSecurityPanelButtonClick(int idx) { SecurityPanelDialog securityDialog = new SecurityPanelDialog( - mContext, mDomoticz, - getDevice(idx)); + mContext, mDomoticz, + getDevice(idx)); securityDialog.show(); securityDialog.onDismissListener(new SecurityPanelDialog.DismissListener() { @@ -764,52 +772,52 @@ public void onDismiss() { @DebugLog public void onStateButtonClick(final int idx, int itemsRes, final int[] stateIds) { new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(itemsRes) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { - if (getDevice(idx).isProtected()) { - PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); - passwordDialog.show(); - passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { - @Override - @DebugLog - public void onDismiss(String password) { - setState(idx, stateIds[which], password); - } + .title(R.string.choose_status) + .items(itemsRes) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { + if (getDevice(idx).isProtected()) { + PasswordDialog passwordDialog = new PasswordDialog( + mContext, mDomoticz); + passwordDialog.show(); + passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { + @Override + @DebugLog + public void onDismiss(String password) { + setState(idx, stateIds[which], password); + } - @Override - public void onCancel() { - } - }); - } else - setState(idx, stateIds[which], null); - } - }) - .show(); + @Override + public void onCancel() { + } + }); + } else + setState(idx, stateIds[which], null); + } + }) + .show(); } @Override @DebugLog public void onSelectorDimmerClick(final int idx, final String[] levelNames) { new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - for (int i = 0; i < levelNames.length; i++) { - if (levelNames[i].equals(text)) { - onDimmerChange(idx, i * 10, true); + .title(R.string.choose_status) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + for (int i = 0; i < levelNames.length; i++) { + if (levelNames[i].equals(text)) { + onDimmerChange(idx, i * 10, true); + } } } - } - }) - .show(); + }) + .show(); } @Override @@ -831,30 +839,30 @@ public boolean onItemLongClicked(int position) { private void setState(final int idx, int state, final String password) { mDomoticz.setModalAction(idx, - state, - 1, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.state_set); - processDashboard(); - } - - @Override - @DebugLog - public void onError(Exception error) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + state, + 1, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else - errorHandling(error, coordinatorLayout); - } - }); + ((MainActivity) getActivity()).Talk(R.string.state_set); + processDashboard(); + } + + @Override + @DebugLog + public void onError(Exception error) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else + errorHandling(error, coordinatorLayout); + } + }); } private DevicesInfo getSwitch(int idx) { @@ -878,7 +886,7 @@ public void onBlindClick(final int idx, final int jsonAction) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -979,7 +987,7 @@ public void onDimmerChange(int idx, final int value, final boolean selector) { final DevicesInfo clickedSwitch = getDevice(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -1000,8 +1008,8 @@ public void onCancel() { private void setDimmerState(DevicesInfo clickedSwitch, int value, final boolean selector, final String password) { if (clickedSwitch != null) { String text = String.format(mContext.getString(R.string.set_level_switch), - clickedSwitch.getName(), - !selector ? (value - 1) : ((value) / 10) + 1); + clickedSwitch.getName(), + !selector ? (value - 1) : ((value) / 10) + 1); UsefulBits.showSnackbar(mContext, coordinatorLayout, text, Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(text); @@ -1061,7 +1069,8 @@ protected Boolean doInBackground(Boolean... geto) { if (!mPhoneConnectionUtil.isNetworkAvailable()) { try { cacheSwitches = (ArrayList) SerializableManager.readSerializedObject(mContext, "Dashboard"); - } catch (Exception ex) { } + } catch (Exception ex) { + } } return true; } diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Events.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Events.java index 6fe09e10e..9b02f0330 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Events.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Events.java @@ -23,6 +23,7 @@ import android.content.Context; import android.os.AsyncTask; +import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import java.util.ArrayList; @@ -65,11 +66,18 @@ public void onConnectionFailed() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; if (getActionBar() != null) getActionBar().setTitle(R.string.title_events); } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } + @Override @DebugLog public void Filter(String text) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java index c7c92a25f..adb08219d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Graph.java @@ -101,11 +101,18 @@ public void onConnectionFailed() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); this.context = context; mDomoticz = new Domoticz(context, AppController.getInstance().getRequestQueue()); mSharedPrefs = new SharedPrefUtil(context); } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } + @Override @DebugLog public void onCreate(Bundle savedInstanceState) { @@ -192,12 +199,6 @@ public String getFormattedValue(float value, AxisBase axis) { return root; } - @Override - @DebugLog - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - } - public void getGraphs() { chart.setVisibility(View.GONE); new Thread() { @@ -471,7 +472,7 @@ private LineData generateData(View view) { } if ((addTemperature && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_temperature)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_temperature)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuest, ((TextView) view.findViewById(R.id.legend_temperature)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_blue_600)); dataSet.setDrawCircles(false); @@ -479,7 +480,7 @@ private LineData generateData(View view) { entries.add(dataSet); if ((addSetpoint && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_set_point)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_set_point)).getText().toString()))) { dataSet = new LineDataSet(valuesse, ((TextView) view.findViewById(R.id.legend_set_point)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_pink_600)); dataSet.setDrawCircles(false); @@ -508,7 +509,7 @@ private LineData generateData(View view) { } if ((addHumidity && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_humidity)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_humidity)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valueshu, ((TextView) view.findViewById(R.id.legend_humidity)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_orange_600)); dataSet.setDrawCircles(false); @@ -517,7 +518,7 @@ private LineData generateData(View view) { } if ((addBarometer && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_barometer)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_barometer)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesba, ((TextView) view.findViewById(R.id.legend_barometer)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_green_600)); dataSet.setDrawCircles(false); @@ -526,7 +527,7 @@ private LineData generateData(View view) { } if ((addCounter && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_counter)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_counter)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesc, ((TextView) view.findViewById(R.id.legend_counter)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_indigo_600)); dataSet.setDrawCircles(false); @@ -535,7 +536,7 @@ private LineData generateData(View view) { } if ((addPowerUsage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerusage)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerusage)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valueeu, ((TextView) view.findViewById(R.id.legend_powerusage)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_yellow_600)); dataSet.setDrawCircles(false); @@ -543,7 +544,7 @@ private LineData generateData(View view) { entries.add(dataSet); } if ((addPowerDelivery && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerdeliv)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_powerdeliv)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valueeg, ((TextView) view.findViewById(R.id.legend_powerdeliv)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_deep_purple_600)); dataSet.setDrawCircles(false); @@ -552,7 +553,7 @@ private LineData generateData(View view) { } if ((addPercentage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesv, ((TextView) view.findViewById(R.id.legend_percentage)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_yellow_600)); dataSet.setDrawCircles(false); @@ -580,7 +581,7 @@ private LineData generateData(View view) { } if ((addSecondPercentage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage2)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_percentage2)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesv2, ((TextView) view.findViewById(R.id.legend_percentage2)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_orange_600)); dataSet.setDrawCircles(false); @@ -589,7 +590,7 @@ private LineData generateData(View view) { } if ((addDirection && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_direction)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_direction)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesdi, ((TextView) view.findViewById(R.id.legend_direction)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_green_600)); dataSet.setDrawCircles(false); @@ -598,7 +599,7 @@ private LineData generateData(View view) { } if ((addSunPower && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_sunpower)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_sunpower)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesuv, ((TextView) view.findViewById(R.id.legend_sunpower)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_deep_purple_600)); dataSet.setDrawCircles(false); @@ -607,7 +608,7 @@ private LineData generateData(View view) { } if ((addSpeed && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_speed)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_speed)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuessp, ((TextView) view.findViewById(R.id.legend_speed)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_amber_600)); dataSet.setDrawCircles(false); @@ -616,7 +617,7 @@ private LineData generateData(View view) { } if ((addUsage && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_usage)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_usage)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesu, ((TextView) view.findViewById(R.id.legend_usage)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_orange_600)); dataSet.setDrawCircles(false); @@ -625,7 +626,7 @@ private LineData generateData(View view) { } if ((addRain && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_rain)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_rain)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesmm, ((TextView) view.findViewById(R.id.legend_rain)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_light_green_600)); dataSet.setDrawCircles(false); @@ -634,7 +635,7 @@ private LineData generateData(View view) { } if ((addCO2 && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesco2, ((TextView) view.findViewById(R.id.legend_co2)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_blue_600)); dataSet.setDrawCircles(false); @@ -643,7 +644,7 @@ private LineData generateData(View view) { } if ((addCO2Min && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2min)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2min)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesco2min, ((TextView) view.findViewById(R.id.legend_co2min)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_light_green_600)); dataSet.setDrawCircles(false); @@ -652,7 +653,7 @@ private LineData generateData(View view) { } if ((addCO2Max && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesco2max, ((TextView) view.findViewById(R.id.legend_co2max)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.md_red_400)); dataSet.setDrawCircles(false); @@ -661,7 +662,7 @@ private LineData generateData(View view) { } if ((addLux && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Lux)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Lux)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLux, ((TextView) view.findViewById(R.id.legend_Lux)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_blue_600)); dataSet.setDrawCircles(false); @@ -670,7 +671,7 @@ private LineData generateData(View view) { } if ((addLuxMin && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmin)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmin)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxmin, ((TextView) view.findViewById(R.id.legend_Luxmin)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.material_light_green_600)); dataSet.setDrawCircles(false); @@ -679,7 +680,7 @@ private LineData generateData(View view) { } if ((addLuxMax && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxmax, ((TextView) view.findViewById(R.id.legend_Luxmax)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.md_red_400)); dataSet.setDrawCircles(false); @@ -688,7 +689,7 @@ private LineData generateData(View view) { } if ((addLuxAvg && !enableFilters) || - (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()))) { + (filterLabels != null && filterLabels.contains(((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()))) { LineDataSet dataSet = new LineDataSet(valuesLuxAvg, ((TextView) view.findViewById(R.id.legend_LuxAvg)).getText().toString()); // add entries to dataset dataSet.setColor(ContextCompat.getColor(context, R.color.md_yellow_400)); dataSet.setDrawCircles(false); @@ -699,10 +700,10 @@ private LineData generateData(View view) { if (entries.size() > 1) { if (addTemperature) { (view.findViewById(R.id.legend_temperature)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); if (addSetpoint) { (view.findViewById(R.id.legend_set_point)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); } addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_temperature)).getText()); @@ -711,116 +712,116 @@ private LineData generateData(View view) { if (addHumidity) { addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_humidity)).getText()); (view.findViewById(R.id.legend_humidity)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); } if (addBarometer) { (view.findViewById(R.id.legend_barometer)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_barometer)).getText()); } if (addCounter) { (view.findViewById(R.id.legend_counter)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); ((TextView) view.findViewById(R.id.legend_counter)) - .setText(axisYLabel); + .setText(axisYLabel); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_counter)).getText()); } if (addPercentage) { (view.findViewById(R.id.legend_percentage)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_percentage)).getText()); } if (addSecondPercentage) { (view.findViewById(R.id.legend_percentage2)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_percentage2)).getText()); } if (addDirection) { (view.findViewById(R.id.legend_direction)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_direction)).getText()); } if (addSunPower) { (view.findViewById(R.id.legend_sunpower)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_sunpower)).getText()); } if (addSpeed) { (view.findViewById(R.id.legend_speed)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_speed)).getText()); } if (addUsage) { (view.findViewById(R.id.legend_usage)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_usage)).getText()); } if (addPowerDelivery) { (view.findViewById(R.id.legend_powerdeliv)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_powerdeliv)).getText()); } if (addPowerUsage) { (view.findViewById(R.id.legend_powerusage)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_powerusage)).getText()); } if (addRain) { (view.findViewById(R.id.legend_rain)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_rain)).getText()); } if (addCO2) { (view.findViewById(R.id.legend_co2)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_co2)).getText()); } if (addCO2Min) { (view.findViewById(R.id.legend_co2min)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_co2min)).getText()); } if (addCO2Max) { (view.findViewById(R.id.legend_co2max)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_co2max)).getText()); } if (addLux) { (view.findViewById(R.id.legend_Lux)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_Lux)).getText()); } if (addLuxMin) { (view.findViewById(R.id.legend_Luxmin)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_Luxmin)).getText()); } if (addLuxMax) { (view.findViewById(R.id.legend_Luxmax)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_Luxmax)).getText()); } if (addLuxAvg) { (view.findViewById(R.id.legend_LuxAvg)) - .setVisibility(View.VISIBLE); + .setVisibility(View.VISIBLE); addLabelFilters((String) ((TextView) view.findViewById(R.id.legend_LuxAvg)).getText()); } } @@ -867,41 +868,41 @@ public boolean onOptionsItemSelected(MenuItem item) { lineLabels.toArray(items); new MaterialDialog.Builder(context) - .title(context.getString(R.string.filter)) - .items(items) - .itemsCallbackMultiChoice(selectedFilters, new MaterialDialog.ListCallbackMultiChoice() { - @Override - @DebugLog - public boolean onSelection(MaterialDialog dialog, Integer[] which, CharSequence[] text) { - selectedFilters = which; - enableFilters = true; - - if (text != null && text.length > 0) { - filterLabels = new ArrayList<>(); - - //set filters - for (CharSequence c : text) - filterLabels.add((String) c); - - LineData columnData = generateData(root); - if (columnData != null) { - chart.setData(columnData); - chart.invalidate(); // refresh - chart.setVisibility(View.VISIBLE); - chart.animateX(1000); - if (getActivity() != null) - getActivity().invalidateOptionsMenu(); + .title(context.getString(R.string.filter)) + .items(items) + .itemsCallbackMultiChoice(selectedFilters, new MaterialDialog.ListCallbackMultiChoice() { + @Override + @DebugLog + public boolean onSelection(MaterialDialog dialog, Integer[] which, CharSequence[] text) { + selectedFilters = which; + enableFilters = true; + + if (text != null && text.length > 0) { + filterLabels = new ArrayList<>(); + + //set filters + for (CharSequence c : text) + filterLabels.add((String) c); + + LineData columnData = generateData(root); + if (columnData != null) { + chart.setData(columnData); + chart.invalidate(); // refresh + chart.setVisibility(View.VISIBLE); + chart.animateX(1000); + if (getActivity() != null) + getActivity().invalidateOptionsMenu(); + } + } else { + enableFilters = false; + Toast.makeText(context, context.getString(R.string.filter_graph_empty), Toast.LENGTH_SHORT).show(); } - } else { - enableFilters = false; - Toast.makeText(context, context.getString(R.string.filter_graph_empty), Toast.LENGTH_SHORT).show(); + return true; } - return true; - } - }) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .show(); + }) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .show(); return true; default: break; diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java index e770de971..0f4c6049c 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Logs.java @@ -23,6 +23,7 @@ import android.content.Context; import android.os.AsyncTask; +import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import java.util.ArrayList; @@ -38,13 +39,11 @@ import nl.hnogames.domoticzapi.Interfaces.LogsReceiver; public class Logs extends DomoticzRecyclerFragment implements DomoticzFragmentListener { - private LogAdapter adapter; private Context mContext; private String filter = ""; private SlideInBottomAnimationAdapter alphaSlideIn; - @Override public void onConnectionFailed() { new GetCachedDataTask().execute(); @@ -62,11 +61,18 @@ public void refreshFragment() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; if (getActionBar() != null) getActionBar().setTitle(R.string.title_logs); } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } + @Override @DebugLog public void Filter(String text) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java index 6bee68626..8c1d58ecc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java @@ -22,58 +22,30 @@ package nl.hnogames.domoticz.Fragments; import android.content.Context; -import android.content.Intent; -import android.graphics.Bitmap; -import android.graphics.drawable.BitmapDrawable; -import android.os.AsyncTask; -import android.os.Build; import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.design.widget.CoordinatorLayout; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.Snackbar; import android.support.v4.app.Fragment; -import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v4.app.FragmentStatePagerAdapter; +import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBar; -import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.GridLayoutManager; -import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; import android.widget.RelativeLayout; -import android.widget.TextView; -import com.fastaccess.permission.base.PermissionFragmentHelper; -import com.fastaccess.permission.base.callback.OnPermissionCallback; - -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; - -import jp.wasabeef.recyclerview.adapters.SlideInBottomAnimationAdapter; -import nl.hnogames.domoticz.Adapters.CamerasAdapter; -import nl.hnogames.domoticz.CameraActivity; +import it.sephiroth.android.library.bottomnavigation.BottomNavigation; import nl.hnogames.domoticz.Interfaces.DomoticzFragmentListener; -import nl.hnogames.domoticz.MainActivity; import nl.hnogames.domoticz.R; -import nl.hnogames.domoticz.Utils.PermissionsUtil; -import nl.hnogames.domoticz.Utils.SerializableManager; import nl.hnogames.domoticz.Utils.SharedPrefUtil; -import nl.hnogames.domoticz.Utils.UsefulBits; -import nl.hnogames.domoticz.app.DomoticzCardFragment; -import nl.hnogames.domoticz.app.DomoticzRecyclerFragment; -import nl.hnogames.domoticzapi.Containers.CameraInfo; -import nl.hnogames.domoticzapi.Interfaces.CameraReceiver; public class MainPager extends Fragment implements DomoticzFragmentListener { - - @SuppressWarnings("unused") private static final String TAG = MainPager.class.getSimpleName(); private Context context; + private FragmentStatePagerAdapter adapterViewPager; + private BottomNavigation bottomNavigation; + private ViewPager vpPager; + private SharedPrefUtil mSharedPrefs; @Override public void onCreate(Bundle savedInstanceState) { @@ -84,7 +56,43 @@ public void onCreate(Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + if (mSharedPrefs == null) + mSharedPrefs = new SharedPrefUtil(getActivity()); RelativeLayout group = (RelativeLayout) inflater.inflate(R.layout.mainpager, null); + + vpPager = group.findViewById(R.id.vpPager); + bottomNavigation = group.findViewById(R.id.BottomNavigation); + if (mSharedPrefs.darkThemeEnabled()) { + bottomNavigation.setBackgroundColor(getResources().getColor(R.color.background_dark)); + } + adapterViewPager = new MainPagerAdapter(((AppCompatActivity) context), 5); + vpPager.setAdapter(adapterViewPager); + vpPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() { + @Override + public void onPageScrolled(int i, float v, int i1) { + // bottomNavigation.setSelectedIndex(i, false); + } + + @Override + public void onPageSelected(int position) { + bottomNavigation.setSelectedIndex(position, false); + } + + @Override + public void onPageScrollStateChanged(int i) { + } + }); + bottomNavigation.setOnMenuItemClickListener(new BottomNavigation.OnMenuItemSelectionListener() { + @Override + public void onMenuItemSelect(int itemId, int position, boolean fromUser) { + if (fromUser) vpPager.setCurrentItem(position); + } + @Override + public void onMenuItemReselect(int itemId, int position, boolean fromUser) { + if (fromUser) vpPager.setCurrentItem(position); + } + }); + return group; } @@ -92,8 +100,18 @@ public View onCreateView(LayoutInflater inflater, public void onAttach(Context context) { super.onAttach(context); this.context = context; + SetTitle(R.string.title_dashboard); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } + + private void SetTitle(int title) { if (getActionBar() != null) - getActionBar().setTitle(R.string.title_dashboard); + getActionBar().setTitle(title); } public ActionBar getActionBar() { @@ -101,8 +119,52 @@ public ActionBar getActionBar() { } @Override - public void onConnectionOk() { } + public void onConnectionOk() { + Log.i(TAG,"Connection OK MainPager"); + } @Override - public void onConnectionFailed() { } + public void onConnectionFailed() { + Log.i(TAG, "Connection Failed MainPager"); + } + + public static class MainPagerAdapter extends FragmentStatePagerAdapter { + private final int mCount; + + public MainPagerAdapter(final AppCompatActivity activity, int count) { + super(activity.getSupportFragmentManager()); + this.mCount = count; + } + + // Returns total number of pages + @Override + public int getCount() { + return mCount; + } + + // Returns the fragment to display for that page + @Override + public Fragment getItem(int position) { + switch (position) { + case 0: + return new Dashboard(); + case 1: + return new Switches(); + case 2: + return new Scenes(); + case 3: + return new Temperature(); + case 4: + return new Weather(); + default: + return null; + } + } + + // Returns the page title for the top indicator + @Override + public CharSequence getPageTitle(int position) { + return "Page " + position; + } + } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java index b50926783..4edc227c8 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Plans.java @@ -82,11 +82,6 @@ public void refreshFragment() { processPlans(); } - @Override - public void onActivityCreated(Bundle savedInstanceState) { - super.onActivityCreated(savedInstanceState); - } - public void processPlans() { new GetCachedDataTask().execute(); } @@ -94,12 +89,19 @@ public void processPlans() { @Override public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; mSharedPrefs = new SharedPrefUtil(mContext); if (getActionBar() != null) getActionBar().setTitle(R.string.title_plans); } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } + @Override public void errorHandling(Exception error, CoordinatorLayout coordinatorLayout) { if (error != null) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java index bb8acf812..ea34066f6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Scenes.java @@ -23,6 +23,7 @@ import android.content.Context; import android.os.AsyncTask; +import android.os.Bundle; import android.os.Parcelable; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; @@ -56,7 +57,7 @@ import nl.hnogames.domoticzapi.Interfaces.setCommandReceiver; public class Scenes extends DomoticzRecyclerFragment implements DomoticzFragmentListener, - ScenesClickListener { + ScenesClickListener { @SuppressWarnings("unused") private static final String TAG = Scenes.class.getSimpleName(); @@ -78,10 +79,17 @@ public void onConnectionFailed() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; + initAnimation(); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); if (getActionBar() != null) getActionBar().setTitle(R.string.title_scenes); - initAnimation(); } @Override @@ -192,9 +200,9 @@ private SceneInfo getScene(int idx) { private void showInfoDialog(final SceneInfo mSceneInfo) { SceneInfoDialog infoDialog = new SceneInfoDialog( - getActivity(), - mSceneInfo, - R.layout.dialog_scene_info); + getActivity(), + mSceneInfo, + R.layout.dialog_scene_info); infoDialog.setIdx(String.valueOf(mSceneInfo.getIdx())); infoDialog.setLastUpdate(mSceneInfo.getLastUpdate()); infoDialog.setIsFavorite(mSceneInfo.getFavoriteBoolean()); @@ -255,7 +263,7 @@ public void onSceneClick(int idx, final boolean action) { final SceneInfo clickedScene = getScene(idx); if (clickedScene.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - getActivity(), mDomoticz); + getActivity(), mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -337,9 +345,9 @@ private void showLogDialog(ArrayList switchLogs) { Toast.makeText(getContext(), "No logs found.", Toast.LENGTH_LONG).show(); } else { SwitchLogInfoDialog infoDialog = new SwitchLogInfoDialog( - getActivity(), - switchLogs, - R.layout.dialog_switch_logs); + getActivity(), + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java index 06253aea8..eb5641d61 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Switches.java @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Color; import android.os.AsyncTask; +import android.os.Bundle; import android.os.Parcelable; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; @@ -70,7 +71,7 @@ import nl.hnogames.domoticzapi.Interfaces.setCommandReceiver; public class Switches extends DomoticzRecyclerFragment implements DomoticzFragmentListener, - switchesClickListener { + switchesClickListener { @SuppressWarnings("unused") private static final String TAG = Switches.class.getSimpleName(); @@ -101,11 +102,17 @@ public void refreshFragment() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; + initAnimation(); + } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); if (getActionBar() != null) getActionBar().setTitle(R.string.title_switches); - initAnimation(); } @Override @@ -162,8 +169,8 @@ private void createListView(ArrayList switches) { String switchType = mDevicesInfo.getSwitchType(); if (!name.startsWith(Domoticz.HIDDEN_CHARACTER) && - appSupportedSwitchesValues.contains(switchTypeVal) && - appSupportedSwitchesNames.contains(switchType)) { + appSupportedSwitchesValues.contains(switchTypeVal) && + appSupportedSwitchesNames.contains(switchType)) { if (UsefulBits.isEmpty(super.getSort()) || super.getSort().equals(mContext.getString(R.string.filterOn_all))) { supportedSwitches.add(mDevicesInfo); } else { @@ -172,15 +179,15 @@ private void createListView(ArrayList switches) { if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(mContext.getString(R.string.filter_on) + ": " + super.getSort()); if ((super.getSort().equals(mContext.getString(R.string.filterOn_on)) && mDevicesInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mDevicesInfo)) { + mDomoticz.isOnOffSwitch(mDevicesInfo)) { supportedSwitches.add(mDevicesInfo); } if ((super.getSort().equals(mContext.getString(R.string.filterOn_off)) && !mDevicesInfo.getStatusBoolean()) && - mDomoticz.isOnOffSwitch(mDevicesInfo)) { + mDomoticz.isOnOffSwitch(mDevicesInfo)) { supportedSwitches.add(mDevicesInfo); } if (super.getSort().equals(mContext.getString(R.string.filterOn_static)) && - !mDomoticz.isOnOffSwitch(mDevicesInfo)) { + !mDomoticz.isOnOffSwitch(mDevicesInfo)) { supportedSwitches.add(mDevicesInfo); } } @@ -224,9 +231,9 @@ public void onRefresh() { private void showInfoDialog(final DevicesInfo mSwitch) { SwitchInfoDialog infoDialog = new SwitchInfoDialog( - mContext, - mSwitch, - R.layout.dialog_switch_info); + mContext, + mSwitch, + R.layout.dialog_switch_info); infoDialog.setIdx(String.valueOf(mSwitch.getIdx())); infoDialog.setLastUpdate(mSwitch.getLastUpdate()); infoDialog.setSignalLevel(String.valueOf(mSwitch.getSignalLevel())); @@ -247,9 +254,9 @@ private void showLogDialog(ArrayList switchLogs) { Toast.makeText(mContext, "No logs found.", Toast.LENGTH_LONG).show(); } else { SwitchLogInfoDialog infoDialog = new SwitchLogInfoDialog( - mContext, - switchLogs, - R.layout.dialog_switch_logs); + mContext, + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } @@ -259,9 +266,9 @@ private void showTimerDialog(ArrayList switchLogs) { Toast.makeText(mContext, "No timer found.", Toast.LENGTH_LONG).show(); } else { SwitchTimerInfoDialog infoDialog = new SwitchTimerInfoDialog( - mContext, - switchLogs, - R.layout.dialog_switch_logs); + mContext, + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } @@ -271,8 +278,8 @@ private void showNotificationDialog(ArrayList notificationInfo Toast.makeText(mContext, "No notifications found.", Toast.LENGTH_LONG).show(); } else { NotificationInfoDialog infoDialog = new NotificationInfoDialog( - mContext, - notificationInfo); + mContext, + notificationInfo); infoDialog.show(); } } @@ -349,7 +356,7 @@ public void onLikeButtonClick(int idx, boolean checked) { @DebugLog public void onColorButtonClick(final int idx) { ColorPickerDialog colorDialog = new ColorPickerDialog( - mContext, idx); + mContext, idx); colorDialog.show(); colorDialog.onDismissListener(new ColorPickerDialog.DismissListener() { @@ -358,7 +365,7 @@ public void onColorButtonClick(final int idx) { public void onDismiss(final int selectedColor) { if (getSwitch(idx).isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -398,34 +405,34 @@ private void setColor(int selectedColor, final int idx, final String password) { } mDomoticz.setRGBColorAction(idx, - DomoticzValues.Json.Url.Set.RGBCOLOR, - hue, - getSwitch(idx).getLevel(), - isWhite, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.color_set); - } - - @Override - @DebugLog - public void onError(Exception error) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + DomoticzValues.Json.Url.Set.RGBCOLOR, + hue, + getSwitch(idx).getLevel(), + isWhite, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.color_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.error_color); + ((MainActivity) getActivity()).Talk(R.string.color_set); } - } - }); + + @Override + @DebugLog + public void onError(Exception error) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.error_color, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.error_color); + } + } + }); } @Override @@ -484,8 +491,8 @@ public void onSetTemperatureClick(int idx) { @DebugLog public void onSecurityPanelButtonClick(int idx) { SecurityPanelDialog securityDialog = new SecurityPanelDialog( - mContext, mDomoticz, - getSwitch(idx)); + mContext, mDomoticz, + getSwitch(idx)); securityDialog.show(); securityDialog.onDismissListener(new SecurityPanelDialog.DismissListener() { @@ -501,32 +508,32 @@ public void onDismiss() { @DebugLog public void onStateButtonClick(final int idx, int itemsRes, final int[] stateIds) { new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(itemsRes) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { - if (getSwitch(idx).isProtected()) { - PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); - passwordDialog.show(); - passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { - @Override - @DebugLog - public void onDismiss(String password) { - setState(idx, stateIds[which], password); - } + .title(R.string.choose_status) + .items(itemsRes) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, final int which, CharSequence text) { + if (getSwitch(idx).isProtected()) { + PasswordDialog passwordDialog = new PasswordDialog( + mContext, mDomoticz); + passwordDialog.show(); + passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { + @Override + @DebugLog + public void onDismiss(String password) { + setState(idx, stateIds[which], password); + } - @Override - public void onCancel() { - } - }); - } else - setState(idx, stateIds[which], null); - } - }) - .show(); + @Override + public void onCancel() { + } + }); + } else + setState(idx, stateIds[which], null); + } + }) + .show(); ; } @@ -534,20 +541,20 @@ public void onCancel() { @DebugLog public void onSelectorDimmerClick(final int idx, final String[] levelNames) { new MaterialDialog.Builder(mContext) - .title(R.string.choose_status) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - @DebugLog - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - for (int i = 0; i < levelNames.length; i++) { - if (levelNames[i].equals(text)) { - onDimmerChange(idx, i * 10, true); + .title(R.string.choose_status) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + @DebugLog + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + for (int i = 0; i < levelNames.length; i++) { + if (levelNames[i].equals(text)) { + onDimmerChange(idx, i * 10, true); + } } } - } - }) - .show(); + }) + .show(); } @Override @@ -590,30 +597,30 @@ public boolean onItemLongClicked(int position) { private void setState(final int idx, int state, final String password) { mDomoticz.setModalAction(idx, - state, - 1, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); - if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.state_set); - getSwitchesData(); - } - - @Override - @DebugLog - public void onError(Exception error) { - if (!UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + state, + 1, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.state_set) + ": " + getSwitch(idx).getName(), Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) - ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); - } else - errorHandling(error); - } - }); + ((MainActivity) getActivity()).Talk(R.string.state_set); + getSwitchesData(); + } + + @Override + @DebugLog + public void onError(Exception error) { + if (!UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(mContext, coordinatorLayout, R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + if (getActivity() instanceof MainActivity) + ((MainActivity) getActivity()).Talk(R.string.security_wrong_code); + } else + errorHandling(error); + } + }); } private DevicesInfo getSwitch(int idx) { @@ -637,7 +644,7 @@ public void onSwitchClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -671,7 +678,7 @@ private void toggleSwitch(DevicesInfo clickedSwitch, boolean checked, final Stri int jsonAction; int jsonUrl = DomoticzValues.Json.Url.Set.SWITCHES; if (clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else jsonAction = DomoticzValues.Device.Switch.Action.ON; } else { @@ -712,7 +719,7 @@ public void onButtonClick(int idx, final boolean checked) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -779,7 +786,7 @@ public void onBlindClick(final int idx, final int jsonAction) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -858,7 +865,7 @@ public void onDimmerChange(int idx, final int value, final boolean selector) { final DevicesInfo clickedSwitch = getSwitch(idx); if (clickedSwitch.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -879,8 +886,8 @@ public void onCancel() { private void setDimmerState(DevicesInfo clickedSwitch, int value, final boolean selector, final String password) { if (clickedSwitch != null) { String text = String.format(mContext.getString(R.string.set_level_switch), - clickedSwitch.getName(), - !selector ? (value - 1) : ((value) / 10) + 1); + clickedSwitch.getName(), + !selector ? (value - 1) : ((value) / 10) + 1); UsefulBits.showSnackbar(mContext, coordinatorLayout, text, Snackbar.LENGTH_SHORT); if (getActivity() instanceof MainActivity) ((MainActivity) getActivity()).Talk(text); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java index af39bf118..69a131333 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Temperature.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.os.AsyncTask; +import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; @@ -80,7 +81,6 @@ public void onConnectionFailed() { public void refreshFragment() { if (mSwipeRefreshLayout != null) mSwipeRefreshLayout.setRefreshing(true); - processTemperature(); } @@ -88,10 +88,17 @@ public void refreshFragment() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; + initAnimation(); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); if (getActionBar() != null) getActionBar().setTitle(R.string.title_temperature); - initAnimation(); } @Override @@ -153,9 +160,9 @@ public void onRefresh() { private void showInfoDialog(final TemperatureInfo mTemperatureInfo) { TemperatureInfoDialog infoDialog = new TemperatureInfoDialog( - mContext, - mTemperatureInfo, - R.layout.dialog_utilities_info); + mContext, + mTemperatureInfo, + R.layout.dialog_utilities_info); infoDialog.setIdx(String.valueOf(mTemperatureInfo.getIdx())); infoDialog.setLastUpdate(mTemperatureInfo.getLastUpdate()); infoDialog.setIsFavorite(mTemperatureInfo.getFavoriteBoolean()); @@ -263,13 +270,13 @@ public void onError(Exception error) { TemperatureDialog tempDialog; if (evohomeZone) { tempDialog = new ScheduledTemperatureDialog( - mContext, - t.getSetPoint(), - !"auto".equalsIgnoreCase(t.getStatus())); + mContext, + t.getSetPoint(), + !"auto".equalsIgnoreCase(t.getStatus())); } else { tempDialog = new TemperatureDialog( - mContext, - t.getSetPoint()); + mContext, + t.getSetPoint()); } tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @@ -280,7 +287,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to " + String.valueOf(newSetPoint)); String params = "&setpoint=" + String.valueOf(newSetPoint) + - "&mode=" + PERMANENT_OVERRIDE; + "&mode=" + PERMANENT_OVERRIDE; // add query parameters mDomoticz.setDeviceUsed(idx, t.getName(), t.getDescription(), params, commandReceiver); @@ -288,7 +295,7 @@ public void onDialogAction(double newSetPoint, DialogAction dialogAction) { addDebugText("Set idx " + idx + " to Auto"); String params = "&setpoint=" + String.valueOf(newSetPoint) + - "&mode=" + AUTO; + "&mode=" + AUTO; // add query parameters mDomoticz.setDeviceUsed(idx, t.getName(), t.getDescription(), params, commandReceiver); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java index 92c2ca1d0..b8305ebc2 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/UserVariables.java @@ -23,6 +23,7 @@ import android.content.Context; import android.os.AsyncTask; +import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; import android.text.InputType; @@ -46,7 +47,6 @@ import nl.hnogames.domoticzapi.Interfaces.setCommandReceiver; public class UserVariables extends DomoticzRecyclerFragment implements DomoticzFragmentListener, UserVariablesClickListener { - private ArrayList mUserVariableInfos; private UserVariablesAdapter adapter; private Context mContext; @@ -70,11 +70,18 @@ public void refreshFragment() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; if (getActionBar() != null) getActionBar().setTitle(R.string.title_vars); } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } + @Override @DebugLog public void Filter(String text) { @@ -142,19 +149,19 @@ public void errorHandling(Exception error) { @Override public void onUserVariableClick(final UserVariableInfo clickedVar) { new MaterialDialog.Builder(mContext) - .title(R.string.title_vars) - .content(clickedVar.getName() + " -> " + clickedVar.getTypeValue()) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(null, clickedVar.getValue(), new MaterialDialog.InputCallback() { - @Override - public void onInput(MaterialDialog dialog, CharSequence input) { - if (validateInput(String.valueOf(input), clickedVar.getType())) { - updateUserVariable(String.valueOf(input), clickedVar); - } else { - UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.var_input), Snackbar.LENGTH_SHORT); + .title(R.string.title_vars) + .content(clickedVar.getName() + " -> " + clickedVar.getTypeValue()) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(null, clickedVar.getValue(), new MaterialDialog.InputCallback() { + @Override + public void onInput(MaterialDialog dialog, CharSequence input) { + if (validateInput(String.valueOf(input), clickedVar.getType())) { + updateUserVariable(String.valueOf(input), clickedVar); + } else { + UsefulBits.showSnackbar(mContext, coordinatorLayout, mContext.getString(R.string.var_input), Snackbar.LENGTH_SHORT); + } } - } - }).show(); + }).show(); } private boolean validateInput(String input, String type) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java index 640b01c82..8de5526bf 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Utilities.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.os.AsyncTask; +import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; @@ -59,7 +60,7 @@ import nl.hnogames.domoticzapi.Interfaces.setCommandReceiver; public class Utilities extends DomoticzRecyclerFragment implements DomoticzFragmentListener, - UtilityClickListener { + UtilityClickListener { private ArrayList mUtilitiesInfos; private double thermostatSetPointValue; @@ -87,12 +88,19 @@ public void refreshFragment() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; if (getActionBar() != null) getActionBar().setTitle(R.string.title_utilities); initAnimation(); } + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); + } + @Override @DebugLog public void Filter(String text) { @@ -153,9 +161,9 @@ public void onRefresh() { private void showInfoDialog(final UtilitiesInfo mUtilitiesInfo) { UtilitiesInfoDialog infoDialog = new UtilitiesInfoDialog( - mContext, - mUtilitiesInfo, - R.layout.dialog_utilities_info); + mContext, + mUtilitiesInfo, + R.layout.dialog_utilities_info); infoDialog.setIdx(String.valueOf(mUtilitiesInfo.getIdx())); infoDialog.setLastUpdate(mUtilitiesInfo.getLastUpdate()); infoDialog.setIsFavorite(mUtilitiesInfo.getFavoriteBoolean()); @@ -190,24 +198,24 @@ private void changeFavorite(final UtilitiesInfo mUtilitiesInfo, final boolean is else jsonAction = DomoticzValues.Device.Favorite.OFF; mDomoticz.setAction(mUtilitiesInfo.getIdx(), - jsonUrl, - jsonAction, - 0, - null, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - successHandling(result, false); - mUtilitiesInfo.setFavoriteBoolean(isFavorite); - } + jsonUrl, + jsonAction, + 0, + null, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + successHandling(result, false); + mUtilitiesInfo.setFavoriteBoolean(isFavorite); + } - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error); - } - }); + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error); + } + }); } /** @@ -280,18 +288,18 @@ public void onLogClick(final UtilitiesInfo utility, final String range) { Replace so we get the right log */ String graphType = utility.getSubType() - .replace("Electric", "counter") - .replace("kWh", "counter") - .replace("Gas", "counter") - .replace("Energy", "counter") - .replace("Voltcraft", "counter") - .replace("Voltage", "counter") - .replace("SetPoint", "temp") - .replace("Lux", "counter") - .replace("BWR102", "counter") - .replace("Sound Level", "counter") - .replace("Pressure", "counter") - .replace("YouLess counter", "counter"); + .replace("Electric", "counter") + .replace("kWh", "counter") + .replace("Gas", "counter") + .replace("Energy", "counter") + .replace("Voltcraft", "counter") + .replace("Voltage", "counter") + .replace("SetPoint", "temp") + .replace("Lux", "counter") + .replace("BWR102", "counter") + .replace("Sound Level", "counter") + .replace("Pressure", "counter") + .replace("YouLess counter", "counter"); if (graphType.contains("counter")) graphType = "counter"; @@ -314,8 +322,8 @@ public void onThermostatClick(final int idx) { final UtilitiesInfo tempUtil = getUtility(idx); TemperatureDialog tempDialog = new TemperatureDialog( - mContext, - tempUtil.getSetPoint()); + mContext, + tempUtil.getSetPoint()); tempDialog.onDismissListener(new TemperatureDialog.DialogActionListener() { @Override @@ -326,7 +334,7 @@ public void onDialogAction(final double newSetPoint, DialogAction dialogAction) if (tempUtil != null) { if (tempUtil.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - mContext, mDomoticz); + mContext, mDomoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -363,24 +371,24 @@ public void setThermostatAction(final UtilitiesInfo tempUtil, action = DomoticzValues.Device.Thermostat.Action.MIN; mDomoticz.setAction(tempUtil.getIdx(), - jsonUrl, - action, - newSetPoint, - password, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - updateThermostatSetPointValue(tempUtil.getIdx(), thermostatSetPointValue); - successHandling(result, false); - } + jsonUrl, + action, + newSetPoint, + password, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + updateThermostatSetPointValue(tempUtil.getIdx(), thermostatSetPointValue); + successHandling(result, false); + } - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error); - } - }); + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error); + } + }); } @@ -448,9 +456,9 @@ private void showLogDialog(ArrayList switchLogs) { Toast.makeText(mContext, "No logs found.", Toast.LENGTH_LONG).show(); } else { SwitchLogInfoDialog infoDialog = new SwitchLogInfoDialog( - mContext, - switchLogs, - R.layout.dialog_switch_logs); + mContext, + switchLogs, + R.layout.dialog_switch_logs); infoDialog.show(); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java index 155e54c3c..d31e72bd8 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Weather.java @@ -24,6 +24,7 @@ import android.content.Context; import android.content.Intent; import android.os.AsyncTask; +import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; @@ -84,10 +85,17 @@ public void refreshFragment() { @DebugLog public void onAttach(Context context) { super.onAttach(context); + onAttachFragment(this); mContext = context; + initAnimation(); + } + + @Override + public void onActivityCreated(Bundle savedInstanceState) { + onAttachFragment(this); + super.onActivityCreated(savedInstanceState); if (getActionBar() != null) getActionBar().setTitle(R.string.title_weather); - initAnimation(); } @Override @@ -147,9 +155,9 @@ public void onRefresh() { private void showInfoDialog(final WeatherInfo mWeatherInfo) { WeatherInfoDialog infoDialog = new WeatherInfoDialog( - mContext, - mWeatherInfo, - R.layout.dialog_weather); + mContext, + mWeatherInfo, + R.layout.dialog_weather); infoDialog.setWeatherInfo(mWeatherInfo); infoDialog.show(); infoDialog.onDismissListener(new WeatherInfoDialog.DismissListener() { @@ -183,24 +191,24 @@ private void changeFavorite(final WeatherInfo mWeatherInfo, final boolean isFavo else jsonAction = DomoticzValues.Device.Favorite.OFF; mDomoticz.setAction(mWeatherInfo.getIdx(), - jsonUrl, - jsonAction, - 0, - null, - new setCommandReceiver() { - @Override - @DebugLog - public void onReceiveResult(String result) { - successHandling(result, false); - mWeatherInfo.setFavoriteBoolean(isFavorite); - } + jsonUrl, + jsonAction, + 0, + null, + new setCommandReceiver() { + @Override + @DebugLog + public void onReceiveResult(String result) { + successHandling(result, false); + mWeatherInfo.setFavoriteBoolean(isFavorite); + } - @Override - @DebugLog - public void onError(Exception error) { - errorHandling(error); - } - }); + @Override + @DebugLog + public void onError(Exception error) { + errorHandling(error); + } + }); } @Override @@ -227,9 +235,9 @@ public void onPause() { @DebugLog public void onLogClick(final WeatherInfo weather, final String range) { final String graphType = weather.getTypeImg() - .toLowerCase() - .replace("temperature", "temp") - .replace("visibility", "counter"); + .toLowerCase() + .replace("temperature", "temp") + .replace("visibility", "counter"); JSONObject language = null; Language languageObj = new SharedPrefUtil(mContext).getSavedLanguage(); diff --git a/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java b/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java index 528ad5308..00d8a91f0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java +++ b/app/src/main/java/nl/hnogames/domoticz/Fragments/Wizard.java @@ -155,495 +155,495 @@ public List generateCards(List cardsToGenerate) { for (String card : cardsToGenerate) { if (card.equalsIgnoreCase(WELCOME)) { cards.add((new Card.Builder(context) - .setTag(WELCOME) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_welcome_card_layout) - .setTitle(context.getString(R.string.wizard_welcome)) - .setTitleColor(titleColorLight) - .setDescription(context.getString(R.string.wizard_welcome_description)) - .setDescriptionColor(titleColorLight) - .setSubtitleColor(titleColorLight) - .setBackgroundColor(blueColor) - .addAction(R.id.ok_button, new WelcomeButtonAction(context) - .setText(context.getString(R.string.wizard_button_nice)) - .setTextColor(titleColorLight) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - }))).endConfig().build()); + .setTag(WELCOME) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_welcome_card_layout) + .setTitle(context.getString(R.string.wizard_welcome)) + .setTitleColor(titleColorLight) + .setDescription(context.getString(R.string.wizard_welcome_description)) + .setDescriptionColor(titleColorLight) + .setSubtitleColor(titleColorLight) + .setBackgroundColor(blueColor) + .addAction(R.id.ok_button, new WelcomeButtonAction(context) + .setText(context.getString(R.string.wizard_button_nice)) + .setTextColor(titleColorLight) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + }))).endConfig().build()); } if (card.equalsIgnoreCase(FAVORITE)) { cards.add(new Card.Builder(context) - .setTag(FAVORITE) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setBackgroundColor(otherColor) - .setTitle(context.getString(R.string.wizard_favorites)) - .setTitleColor(titleColorOther) - .setDescription(context.getString(R.string.wizard_favorites_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_switches)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(FAVORITE) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setBackgroundColor(otherColor) + .setTitle(context.getString(R.string.wizard_favorites)) + .setTitleColor(titleColorOther) + .setDescription(context.getString(R.string.wizard_favorites_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_switches)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(STARTUP)) { cards.add(new Card.Builder(context) - .setTag(STARTUP) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_startup)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_startup_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(STARTUP) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_startup)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_startup_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(GEOFENCE)) { cards.add(new Card.Builder(context) - .setTag(GEOFENCE) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_geo)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_geo_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(GEOFENCE) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_geo)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_geo_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(NFC)) { cards.add(new Card.Builder(context) - .setTag(NFC) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_nfc)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_nfc_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(NFC) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_nfc)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_nfc_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(QRCODE)) { cards.add(new Card.Builder(context) - .setTag(QRCODE) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_qrcode)) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_qrcode_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(QRCODE) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_qrcode)) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_qrcode_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(SPEECH)) { cards.add(new Card.Builder(context) - .setTag(SPEECH) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_speech)) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_speech_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(SPEECH) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_speech)) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_speech_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(WEAR)) { cards.add(new Card.Builder(context) - .setTag(WEAR) - .setDismissible() - .withProvider(new CardProvider()) - .setTitleColor(titleColorOther) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_wear)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_wear_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(WEAR) + .setDismissible() + .withProvider(new CardProvider()) + .setTitleColor(titleColorOther) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_wear)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_wear_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(AUTO)) { cards.add(new Card.Builder(context) - .setTag(AUTO) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setBackgroundColor(otherColor) - .setTitle(context.getString(R.string.wizard_auto)) - .setTitleColor(titleColorOther) - .setDescription(context.getString(R.string.wizard_auto_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(AUTO) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setBackgroundColor(otherColor) + .setTitle(context.getString(R.string.wizard_auto)) + .setTitleColor(titleColorOther) + .setDescription(context.getString(R.string.wizard_auto_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(NOTIFICATIONS)) { cards.add(new Card.Builder(context) - .setTag(NOTIFICATIONS) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_notifications)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_notifications_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(NOTIFICATIONS) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_notifications)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_notifications_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(MULTISERVER)) { cards.add(new Card.Builder(context) - .setTag(MULTISERVER) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_multiserver)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_multiserver_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_settings)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(MULTISERVER) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_multiserver)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_multiserver_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_settings)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + startActivityForResult(new Intent(context, SettingsActivity.class), iSettingsResultCode); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(GRAPH)) { cards.add(new Card.Builder(context) - .setTag(GRAPH) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_graph)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_graph_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_utilities)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Utilities"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(GRAPH) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_graph)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_graph_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_utilities)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Utilities"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(FILTER)) { cards.add(new Card.Builder(context) - .setTag(FILTER) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_filter)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_filter_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_nice)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + .setTag(FILTER) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_filter)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_filter_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_nice)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Switches"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(WIDGETS)) { cards.add(new Card.Builder(context) - .setTag(WIDGETS) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_widgets)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_widgets_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText("") - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); + .setTag(WIDGETS) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_widgets)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_widgets_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText("") + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_done)) - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - card.dismiss(); - } - })) - .endConfig() - .build()); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_done)) + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + card.dismiss(); + } + })) + .endConfig() + .build()); } if (card.equalsIgnoreCase(FINISH)) { cards.add(new Card.Builder(context) - .setTag(FINISH) - .setDismissible() - .withProvider(new CardProvider()) - .setLayout(R.layout.material_basic_buttons_card) - .setTitle(context.getString(R.string.wizard_menuitem)) - .setTitleColor(titleColorOther) - .setBackgroundColor(otherColor) - .setDescription(context.getString(R.string.wizard_menuitem_description)) - .addAction(R.id.left_text_button, new TextViewAction(context) - .setText(context.getString(R.string.wizard_button_wizard)) - .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - mSharedPrefs.removeWizard(); - ((MainActivity) getActivity()).drawNavigationMenu(null); - ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); - } - })) - .addAction(R.id.right_text_button, new TextViewAction(context) - .setText("") - .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) - .setListener(new OnActionClickListener() { - @Override - @DebugLog - public void onActionClicked(View view, Card card) { - mSharedPrefs.removeWizard(); - ((MainActivity) getActivity()).drawNavigationMenu(null); - ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); - ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); - } - })) - .endConfig() - .build()); + .setTag(FINISH) + .setDismissible() + .withProvider(new CardProvider()) + .setLayout(R.layout.material_basic_buttons_card) + .setTitle(context.getString(R.string.wizard_menuitem)) + .setTitleColor(titleColorOther) + .setBackgroundColor(otherColor) + .setDescription(context.getString(R.string.wizard_menuitem_description)) + .addAction(R.id.left_text_button, new TextViewAction(context) + .setText(context.getString(R.string.wizard_button_wizard)) + .setTextColor(ContextCompat.getColor(context, R.color.md_material_blue_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + mSharedPrefs.removeWizard(); + ((MainActivity) getActivity()).drawNavigationMenu(null); + ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); + } + })) + .addAction(R.id.right_text_button, new TextViewAction(context) + .setText("") + .setTextColor(ContextCompat.getColor(context, R.color.material_orange_600)) + .setListener(new OnActionClickListener() { + @Override + @DebugLog + public void onActionClicked(View view, Card card) { + mSharedPrefs.removeWizard(); + ((MainActivity) getActivity()).drawNavigationMenu(null); + ((MainActivity) getActivity()).removeFragmentStack("nl.hnogames.domoticz.Fragments.Wizard"); + ((MainActivity) getActivity()).changeFragment("nl.hnogames.domoticz.Fragments.Dashboard"); + } + })) + .endConfig() + .build()); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java index d509b2fa1..f0bcc0a68 100644 --- a/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/GeoSettingsActivity.java @@ -127,13 +127,13 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { geoSwitch.setChecked(false); geoNotificationSwitch.setEnabled(false); permissionHelper - .request(PermissionsUtil.INITIAL_LOCATION_PERMS); + .request(PermissionsUtil.INITIAL_LOCATION_PERMS); } else { if (!PermissionsUtil.canAccessStorage(GeoSettingsActivity.this)) { geoSwitch.setChecked(false); geoNotificationSwitch.setEnabled(false); permissionHelper - .request(PermissionsUtil.INITIAL_STORAGE_PERMS); + .request(PermissionsUtil.INITIAL_STORAGE_PERMS); } else { //all settings are correct mSharedPrefs.setGeofenceEnabled(true); @@ -175,8 +175,8 @@ protected void onResume() { } private void showSwitchesDialog( - final LocationInfo selectedLocation, - final ArrayList switches) { + final LocationInfo selectedLocation, + final ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -185,9 +185,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - GeoSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + GeoSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -221,18 +221,18 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final LocationInfo selectedLocation, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - selectedLocation.setValue(String.valueOf(text)); - mSharedPrefs.updateLocation(selectedLocation); - adapter.data = mSharedPrefs.getLocations(); - adapter.notifyDataSetChanged(); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + selectedLocation.setValue(String.valueOf(text)); + mSharedPrefs.updateLocation(selectedLocation); + adapter.data = mSharedPrefs.getLocations(); + adapter.notifyDataSetChanged(); + } + }) + .show(); } private void createListView() { @@ -288,7 +288,7 @@ private void showRemoveUndoSnackbar(final LocationInfo locationInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.geofence)); + getString(R.string.geofence)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override @@ -345,33 +345,33 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(GeoSettingsActivity.this, coordinatorLayout, GeoSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(locationInfo); - } - }, GeoSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(locationInfo); + } + }, GeoSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private boolean showNoDeviceAttachedDialog(final LocationInfo locationInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(locationInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(locationInfo); + result = true; + } + }) + .show(); return result; } @@ -386,64 +386,64 @@ protected void onActivityResult(int requestCode, int resultCode, final Intent da String name = data.getStringExtra(LocationPickerActivity.LOCATION_ADDRESS); if (nl.hnogames.domoticzapi.Utils.UsefulBits.isEmpty(name)) { new MaterialDialog.Builder(this) - .title(R.string.title_edit_location) - .content(R.string.Location_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(null, null, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - String name = String.valueOf(input); - if (!nl.hnogames.domoticzapi.Utils.UsefulBits.isEmpty(name)) { - final LocationInfo location = new LocationInfo(new Random().nextInt(999999), name, - new LatLng(data.getDoubleExtra(LocationPickerActivity.LATITUDE, 0), data.getDoubleExtra(LocationPickerActivity.LONGITUDE, 0)), - 500); - new MaterialDialog.Builder(GeoSettingsActivity.this) - .title(R.string.radius) - .content(R.string.radius) - .inputType(InputType.TYPE_CLASS_NUMBER) - .input("500", "500", new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - try { - location.setRadius(Integer.parseInt(String.valueOf(input))); - } catch (Exception ignored) { - } - mSharedPrefs.addLocation(location); - locations = mSharedPrefs.getLocations(); - - GeoUtils.geofencesAlreadyRegistered = false; - oGeoUtils.AddGeofences(); - - createListView(); - } - }).show(); + .title(R.string.title_edit_location) + .content(R.string.Location_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(null, null, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + String name = String.valueOf(input); + if (!nl.hnogames.domoticzapi.Utils.UsefulBits.isEmpty(name)) { + final LocationInfo location = new LocationInfo(new Random().nextInt(999999), name, + new LatLng(data.getDoubleExtra(LocationPickerActivity.LATITUDE, 0), data.getDoubleExtra(LocationPickerActivity.LONGITUDE, 0)), + 500); + new MaterialDialog.Builder(GeoSettingsActivity.this) + .title(R.string.radius) + .content(R.string.radius) + .inputType(InputType.TYPE_CLASS_NUMBER) + .input("500", "500", new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + try { + location.setRadius(Integer.parseInt(String.valueOf(input))); + } catch (Exception ignored) { + } + mSharedPrefs.addLocation(location); + locations = mSharedPrefs.getLocations(); + + GeoUtils.geofencesAlreadyRegistered = false; + oGeoUtils.AddGeofences(); + + createListView(); + } + }).show(); + } } - } - }).show(); + }).show(); } else { final LocationInfo location = new LocationInfo(new Random().nextInt(999999), name, - new LatLng(data.getDoubleExtra(LocationPickerActivity.LATITUDE, 0), data.getDoubleExtra(LocationPickerActivity.LONGITUDE, 0)), - 500); + new LatLng(data.getDoubleExtra(LocationPickerActivity.LATITUDE, 0), data.getDoubleExtra(LocationPickerActivity.LONGITUDE, 0)), + 500); new MaterialDialog.Builder(this) - .title(R.string.radius) - .content(R.string.radius) - .inputType(InputType.TYPE_CLASS_NUMBER) - .input("500", "500", new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - try { - location.setRadius(Integer.parseInt(String.valueOf(input))); - } catch (Exception ignored) { - } - mSharedPrefs.addLocation(location); - locations = mSharedPrefs.getLocations(); - - GeoUtils.geofencesAlreadyRegistered = false; - oGeoUtils.AddGeofences(); + .title(R.string.radius) + .content(R.string.radius) + .inputType(InputType.TYPE_CLASS_NUMBER) + .input("500", "500", new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + try { + location.setRadius(Integer.parseInt(String.valueOf(input))); + } catch (Exception ignored) { + } + mSharedPrefs.addLocation(location); + locations = mSharedPrefs.getLocations(); + + GeoUtils.geofencesAlreadyRegistered = false; + oGeoUtils.AddGeofences(); - createListView(); - } - }).show(); + createListView(); + } + }).show(); } } else permissionHelper.onActivityForResult(requestCode); @@ -487,7 +487,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionHelper.declinedPermissions(GeoSettingsActivity.this, PermissionsUtil.INITIAL_LOCATION_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(GeoSettingsActivity.this, permissionHelper, GeoSettingsActivity.this.getString(R.string.permission_title), - GeoSettingsActivity.this.getString(R.string.permission_desc_location), neededPermission); + GeoSettingsActivity.this.getString(R.string.permission_desc_location), neededPermission); if (!alert.isShowing()) { alert.show(); } @@ -528,7 +528,7 @@ public void onPermissionGranted(@NonNull String[] permissionName) { invalidateOptionsMenu(); } else { permissionHelper - .request(PermissionsUtil.INITIAL_STORAGE_PERMS); + .request(PermissionsUtil.INITIAL_STORAGE_PERMS); } } } diff --git a/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java b/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java index 2eb26b6ad..da0a1c6b3 100644 --- a/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/GraphActivity.java @@ -60,7 +60,7 @@ protected void onCreate(Bundle savedInstanceState) { if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportFragmentManager().beginTransaction().replace(android.R.id.content, - graph).commit(); + graph).commit(); } catch (Exception ex) { this.finish(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/MainActivity.java b/app/src/main/java/nl/hnogames/domoticz/MainActivity.java index f0c72a0f4..1d8d15674 100644 --- a/app/src/main/java/nl/hnogames/domoticz/MainActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/MainActivity.java @@ -198,9 +198,9 @@ protected void onCreate(Bundle savedInstanceState) { } else { if (mSharedPrefs.isStartupSecurityEnabled()) { Digitus.init(this, - getString(R.string.app_name_domoticz), - 69, - this); + getString(R.string.app_name_domoticz), + 69, + this); } else { new GeoUtils(this, this).AddGeofences(); buildScreen(); @@ -389,7 +389,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { if (!isSceneOrGroup) { if (inputJSONAction < 0) { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (!mDevicesInfo.getStatusBoolean()) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else { @@ -411,7 +411,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { } } else { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (inputJSONAction == 1) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else { @@ -668,10 +668,10 @@ private void setupMobileDevice() { private void appRate() { if (!BuildConfig.DEBUG) { AppRate.with(this) - .setInstallDays(0) // default 10, 0 means install day. - .setLaunchTimes(3) // default 10 - .setRemindInterval(2) // default 1 - .monitor(); + .setInstallDays(0) // default 10, 0 means install day. + .setLaunchTimes(3) // default 10 + .setRemindInterval(2) // default 1 + .monitor(); // Show a dialog if meets conditions AppRate.showRateDialogIfMeetsConditions(this); @@ -686,7 +686,7 @@ public void drawNavigationMenu(final ConfigInfo mConfig) { config = mServerUtil.getActiveServer().getConfigInfo(this); ProfileDrawerItem loggedinAccount = new ProfileDrawerItem().withName("Logged in").withEmail(domoticz.getUserCredentials(Domoticz.Authentication.USERNAME)) - .withIcon(R.mipmap.ic_launcher); + .withIcon(R.mipmap.ic_launcher); if (mSharedPrefs.darkThemeEnabled()) { loggedinAccount.withSelectedColorRes(R.color.material_indigo_600); } @@ -694,90 +694,90 @@ public void drawNavigationMenu(final ConfigInfo mConfig) { // Create the AccountHeader final ConfigInfo finalConfig = config; AccountHeader headerResult = new AccountHeaderBuilder() - .withActivity(this) - .withHeaderBackground(R.drawable.darkheader) - .addProfiles(loggedinAccount) - .withOnlyMainProfileImageVisible(true) - .withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() { - @Override - @DebugLog - public boolean onProfileChanged(View view, final IProfile profile, boolean current) { - if (!current) { - if (BuildConfig.LITE_VERSION || !mSharedPrefs.isAPKValidated()) { - if (getFragmentCoordinatorLayout() != null) { - Snackbar.make(getFragmentCoordinatorLayout(), getString(R.string.category_account) + " " + getString(R.string.premium_feature), Snackbar.LENGTH_LONG) - .setAction(R.string.upgrade, new View.OnClickListener() { - @Override - public void onClick(View view) { - UsefulBits.openPremiumAppStore(MainActivity.this); - } - }) - .setActionTextColor(ContextCompat.getColor(MainActivity.this, R.color.material_blue_600)) - .show(); - } - return false; - } else { - PasswordDialog passwordDialog = new PasswordDialog(MainActivity.this, null); - passwordDialog.show(); - passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { - @Override - @DebugLog - public void onDismiss(String password) { - if (UsefulBits.isEmpty(password)) { - UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - Talk(R.string.security_wrong_code); - drawNavigationMenu(finalConfig); - } else { - for (UserInfo user : finalConfig.getUsers()) { - if (user.getUsername().equals(profile.getEmail().getText())) { - String md5Pass = UsefulBits.getMd5String(password); - if (md5Pass.equals(user.getPassword())) { - //if correct set credentials in activeserver and recreate drawer - domoticz.setUserCredentials(user.getUsername(), password); - domoticz.LogOff(); - UsefulBits.getServerConfigForActiveServer(MainActivity.this, true, new ConfigReceiver() { - @Override - @DebugLog - public void onReceiveConfig(ConfigInfo settings) { - UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.user_switch, Snackbar.LENGTH_SHORT); - drawNavigationMenu(finalConfig); - } - - @Override - @DebugLog - public void onError(Exception error) { - } - }, finalConfig); - } else { - UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); - drawNavigationMenu(finalConfig); + .withActivity(this) + .withHeaderBackground(R.drawable.darkheader) + .addProfiles(loggedinAccount) + .withOnlyMainProfileImageVisible(true) + .withOnAccountHeaderListener(new AccountHeader.OnAccountHeaderListener() { + @Override + @DebugLog + public boolean onProfileChanged(View view, final IProfile profile, boolean current) { + if (!current) { + if (BuildConfig.LITE_VERSION || !mSharedPrefs.isAPKValidated()) { + if (getFragmentCoordinatorLayout() != null) { + Snackbar.make(getFragmentCoordinatorLayout(), getString(R.string.category_account) + " " + getString(R.string.premium_feature), Snackbar.LENGTH_LONG) + .setAction(R.string.upgrade, new View.OnClickListener() { + @Override + public void onClick(View view) { + UsefulBits.openPremiumAppStore(MainActivity.this); + } + }) + .setActionTextColor(ContextCompat.getColor(MainActivity.this, R.color.material_blue_600)) + .show(); + } + return false; + } else { + PasswordDialog passwordDialog = new PasswordDialog(MainActivity.this, null); + passwordDialog.show(); + passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { + @Override + @DebugLog + public void onDismiss(String password) { + if (UsefulBits.isEmpty(password)) { + UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + Talk(R.string.security_wrong_code); + drawNavigationMenu(finalConfig); + } else { + for (UserInfo user : finalConfig.getUsers()) { + if (user.getUsername().equals(profile.getEmail().getText())) { + String md5Pass = UsefulBits.getMd5String(password); + if (md5Pass.equals(user.getPassword())) { + //if correct set credentials in activeserver and recreate drawer + domoticz.setUserCredentials(user.getUsername(), password); + domoticz.LogOff(); + UsefulBits.getServerConfigForActiveServer(MainActivity.this, true, new ConfigReceiver() { + @Override + @DebugLog + public void onReceiveConfig(ConfigInfo settings) { + UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.user_switch, Snackbar.LENGTH_SHORT); + drawNavigationMenu(finalConfig); + } + + @Override + @DebugLog + public void onError(Exception error) { + } + }, finalConfig); + } else { + UsefulBits.showSnackbar(MainActivity.this, getFragmentCoordinatorLayout(), R.string.security_wrong_code, Snackbar.LENGTH_SHORT); + drawNavigationMenu(finalConfig); + } } } } } - } - @Override - public void onCancel() { - } - }); - } + @Override + public void onCancel() { + } + }); + } - drawNavigationMenu(finalConfig); + drawNavigationMenu(finalConfig); + } + return false; } - return false; - } - }) - .build(); + }) + .build(); if (config != null && - config.getUsers() != null) { + config.getUsers() != null) { for (UserInfo user : config.getUsers()) { ProfileDrawerItem profile = new ProfileDrawerItem().withName(user.getRightsValue(this) ).withEmail(user.getUsername()) - .withIcon(R.drawable.users) - .withEnabled(user.isEnabled()); + .withIcon(R.drawable.users) + .withEnabled(user.isEnabled()); if (mSharedPrefs.darkThemeEnabled()) { profile.withSelectedColorRes(R.color.material_indigo_600); @@ -788,39 +788,39 @@ public void onCancel() { } drawer = new DrawerBuilder() - .withActivity(this) - .withTranslucentStatusBar(false) - .withActionBarDrawerToggle(true) - .withAccountHeader(headerResult) - .withToolbar(toolbar) - .withSelectedItem(-1) - .withDrawerItems(getDrawerItems()) - .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { - @Override - @DebugLog - public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { - if (drawerItem != null) { - if (searchViewAction != null) { - searchViewAction.setQuery("", false); - searchViewAction.clearFocus(); - } + .withActivity(this) + .withTranslucentStatusBar(false) + .withActionBarDrawerToggle(true) + .withAccountHeader(headerResult) + .withToolbar(toolbar) + .withSelectedItem(-1) + .withDrawerItems(getDrawerItems()) + .withOnDrawerItemClickListener(new Drawer.OnDrawerItemClickListener() { + @Override + @DebugLog + public boolean onItemClick(View view, int position, IDrawerItem drawerItem) { + if (drawerItem != null) { + if (searchViewAction != null) { + searchViewAction.setQuery("", false); + searchViewAction.clearFocus(); + } - if (drawerItem.getTag() != null && String.valueOf(drawerItem.getTag()).equals("Settings")) { - stopCameraTimer(); - startActivityForResult(new Intent(MainActivity.this, SettingsActivity.class), iSettingsResultCode); - } else if (drawerItem.getTag() != null) { - changeFragment(String.valueOf(drawerItem.getTag())); - stopCameraTimer(); + if (drawerItem.getTag() != null && String.valueOf(drawerItem.getTag()).equals("Settings")) { + stopCameraTimer(); + startActivityForResult(new Intent(MainActivity.this, SettingsActivity.class), iSettingsResultCode); + } else if (drawerItem.getTag() != null) { + changeFragment(String.valueOf(drawerItem.getTag())); + stopCameraTimer(); - invalidateOptionsMenu(); - if (onPhone) - drawer.closeDrawer(); + invalidateOptionsMenu(); + if (onPhone) + drawer.closeDrawer(); + } } + return false; } - return false; - } - }) - .build(); + }) + .build(); drawer.addStickyFooterItem(createSecondaryDrawerItem(this.getString(R.string.action_settings), "gmd_settings", "Settings")); } @@ -845,8 +845,8 @@ private List getDrawerItems() { private SecondaryDrawerItem createSecondaryDrawerItem(String title, String icon, String fragmentID) { SecondaryDrawerItem item = new SecondaryDrawerItem(); item.withName(title) - .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.material_indigo_600) - .withTag(fragmentID); + .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.material_indigo_600) + .withTag(fragmentID); if (mSharedPrefs.darkThemeEnabled()) { item.withIconColorRes(R.color.white); item.withSelectedColorRes(R.color.material_indigo_600); @@ -858,8 +858,8 @@ private SecondaryDrawerItem createSecondaryDrawerItem(String title, String icon, private PrimaryDrawerItem createPrimaryDrawerItem(String title, String icon, String fragmentID) { PrimaryDrawerItem item = new PrimaryDrawerItem(); item.withName(title) - .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.material_indigo_600) - .withTag(fragmentID); + .withIcon(GoogleMaterial.Icon.valueOf(icon)).withIconColorRes(R.color.material_indigo_600) + .withTag(fragmentID); if (mSharedPrefs.darkThemeEnabled()) { item.withIconColorRes(R.color.white); item.withSelectedColorRes(R.color.material_indigo_600); @@ -899,8 +899,8 @@ public void onReceiveUpdate(ServerUpdateInfo serverUpdateInfo) { @DebugLog public void onError(Exception error) { String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - domoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForUpdates), + domoticz.getErrorMessage(error)); showSnackbar(message); if (mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) @@ -920,27 +920,27 @@ public void onReceiveVersion(String serverVersion) { if (!UsefulBits.isEmpty(serverVersion)) { if (mServerUtil.getActiveServer() != null && - mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) { + mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) { mServerUtil.getActiveServer() - .getServerUpdateInfo(MainActivity.this) - .setCurrentServerVersion(serverVersion); + .getServerUpdateInfo(MainActivity.this) + .setCurrentServerVersion(serverVersion); } String[] version - = serverVersion.split("\\."); + = serverVersion.split("\\."); // Update version is only revision number String updateVersion = (mServerUtil.getActiveServer() != null && - mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) ? - version[0] + "." - + mServerUtil.getActiveServer() - .getServerUpdateInfo(MainActivity.this) - .getUpdateRevisionNumber() : - version[0]; + mServerUtil.getActiveServer().getServerUpdateInfo(MainActivity.this) != null) ? + version[0] + "." + + mServerUtil.getActiveServer() + .getServerUpdateInfo(MainActivity.this) + .getUpdateRevisionNumber() : + version[0]; String message - = String.format(getString(R.string.update_available_enhanced), - serverVersion, - updateVersion); + = String.format(getString(R.string.update_available_enhanced), + serverVersion, + updateVersion); showSnackBarToUpdateServer(message); } } @@ -949,8 +949,8 @@ public void onReceiveVersion(String serverVersion) { @DebugLog public void onError(Exception error) { String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - domoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForUpdates), + domoticz.getErrorMessage(error)); showSnackbar(message); } }); @@ -1089,11 +1089,11 @@ public void onResults(Bundle results) { recognitionProgressView.setBackgroundColor(color); } int[] colors = { - ContextCompat.getColor(this, R.color.material_amber_600), - ContextCompat.getColor(this, R.color.material_blue_600), - ContextCompat.getColor(this, R.color.material_deep_purple_600), - ContextCompat.getColor(this, R.color.material_green_600), - ContextCompat.getColor(this, R.color.material_orange_600) + ContextCompat.getColor(this, R.color.material_amber_600), + ContextCompat.getColor(this, R.color.material_blue_600), + ContextCompat.getColor(this, R.color.material_deep_purple_600), + ContextCompat.getColor(this, R.color.material_green_600), + ContextCompat.getColor(this, R.color.material_orange_600) }; recognitionProgressView.setColors(colors); recognitionProgressView.setSpeechRecognizer(speechRecognizer); @@ -1152,8 +1152,8 @@ public void run() { return true; case R.id.action_sort: SortDialog infoDialog = new SortDialog( - this, - R.layout.dialog_switch_logs); + this, + R.layout.dialog_switch_logs); infoDialog.onDismissListener(new SortDialog.DismissListener() { @Override @DebugLog @@ -1194,7 +1194,7 @@ private void stopRecognitionAnimation() { @DebugLog private void showSpeechResults(Bundle results) { ArrayList matches = results - .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); + .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); if (matches == null) return; int jsonAction = -1; @@ -1289,37 +1289,37 @@ public void showServerDialog() { for (ServerInfo s : mServerUtil.getEnabledServerList()) { serverNames[count] = s.getServerName(); if (mServerUtil.getActiveServer() != null && - mServerUtil.getActiveServer().getServerName().equals(s.getServerName())) + mServerUtil.getActiveServer().getServerName().equals(s.getServerName())) selectionId = count; count++; } //show dialog with servers new MaterialDialog.Builder(this) - .title(R.string.choose_server) - .items(serverNames) - .itemsCallbackSingleChoice(selectionId, new MaterialDialog.ListCallbackSingleChoice() { - @Override - @DebugLog - public boolean onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) { - ServerInfo setNew = null; - for (ServerInfo s : mServerUtil.getEnabledServerList()) { - if (s.getServerName().contentEquals(text)) { - String message = String.format( - getString(R.string.switch_to_server), s.getServerName()); - showSnackbar(message); - setNew = s; + .title(R.string.choose_server) + .items(serverNames) + .itemsCallbackSingleChoice(selectionId, new MaterialDialog.ListCallbackSingleChoice() { + @Override + @DebugLog + public boolean onSelection(MaterialDialog dialog, View itemView, int which, CharSequence text) { + ServerInfo setNew = null; + for (ServerInfo s : mServerUtil.getEnabledServerList()) { + if (s.getServerName().contentEquals(text)) { + String message = String.format( + getString(R.string.switch_to_server), s.getServerName()); + showSnackbar(message); + setNew = s; + } } + if (setNew != null) { + mServerUtil.setActiveServer(setNew); + buildScreen(); + invalidateOptionsMenu(); + } + return false; } - if (setNew != null) { - mServerUtil.setActiveServer(setNew); - buildScreen(); - invalidateOptionsMenu(); - } - return false; - } - }) - .show(); + }) + .show(); } /** diff --git a/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java index 848c1e044..dcebca0b6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/NFCSettingsActivity.java @@ -69,16 +69,16 @@ public class NFCSettingsActivity extends AppCompatAssistActivity implements NFCClickListener { // list of NFC technologies detected: private final String[][] techList = new String[][]{ - new String[]{ - NfcA.class.getName(), - NfcB.class.getName(), - NfcF.class.getName(), - NfcV.class.getName(), - IsoDep.class.getName(), - MifareClassic.class.getName(), - MifareUltralight.class.getName(), - Ndef.class.getName() - } + new String[]{ + NfcA.class.getName(), + NfcB.class.getName(), + NfcF.class.getName(), + NfcV.class.getName(), + IsoDep.class.getName(), + MifareClassic.class.getName(), + MifareUltralight.class.getName(), + Ndef.class.getName() + } }; boolean result = false; @@ -178,22 +178,22 @@ protected void onNewIntent(Intent intent) { if (newTagFound) { UsefulBits.showSnackbar(this, coordinatorLayout, getString(R.string.nfc_tag_found) + ": " + tagID, Snackbar.LENGTH_SHORT); new MaterialDialog.Builder(this) - .title(R.string.nfc_tag_found) - .content(R.string.nfc_tag_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(R.string.category_nfc, 0, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - UsefulBits.showSnackbar(NFCSettingsActivity.this, coordinatorLayout, getString(R.string.nfc_saved) + ": " + input, Snackbar.LENGTH_SHORT); - NFCInfo newNFC = new NFCInfo(); - newNFC.setId(tagID); - newNFC.setName(String.valueOf(input)); - updateNFC(newNFC); + .title(R.string.nfc_tag_found) + .content(R.string.nfc_tag_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(R.string.category_nfc, 0, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + UsefulBits.showSnackbar(NFCSettingsActivity.this, coordinatorLayout, getString(R.string.nfc_saved) + ": " + input, Snackbar.LENGTH_SHORT); + NFCInfo newNFC = new NFCInfo(); + newNFC.setId(tagID); + newNFC.setName(String.valueOf(input)); + updateNFC(newNFC); + } + busyWithTag = false; } - busyWithTag = false; - } - }).show(); + }).show(); } else { UsefulBits.showSnackbar(NFCSettingsActivity.this, coordinatorLayout, R.string.nfc_exists, Snackbar.LENGTH_SHORT); busyWithTag = false; @@ -227,20 +227,20 @@ public boolean onItemLongClick(AdapterView parent, View view, final int posit private void showEditDialog(final NFCInfo mNFCInfo) { busyWithTag = true; new MaterialDialog.Builder(this) - .title(R.string.nfc_tag_edit) - .content(R.string.nfc_tag_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .negativeText(R.string.cancel) - .input(this.getString(R.string.category_nfc), mNFCInfo.getName(), new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - mNFCInfo.setName(String.valueOf(input)); - updateNFC(mNFCInfo); + .title(R.string.nfc_tag_edit) + .content(R.string.nfc_tag_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .negativeText(R.string.cancel) + .input(this.getString(R.string.category_nfc), mNFCInfo.getName(), new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + mNFCInfo.setName(String.valueOf(input)); + updateNFC(mNFCInfo); + } + busyWithTag = false; } - busyWithTag = false; - } - }).show(); + }).show(); } private void getSwitchesAndShowSwitchesDialog(final NFCInfo nfcInfo) { @@ -260,19 +260,19 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(NFCSettingsActivity.this, coordinatorLayout, NFCSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(nfcInfo); - } - }, NFCSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(nfcInfo); + } + }, NFCSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private void showSwitchesDialog( - final NFCInfo nfcInfo, - ArrayList switches) { + final NFCInfo nfcInfo, + ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -281,9 +281,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - NFCSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + NFCSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -312,16 +312,16 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final NFCInfo nfcInfo, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - nfcInfo.setValue(String.valueOf(text)); - updateNFC(nfcInfo); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + nfcInfo.setValue(String.valueOf(text)); + updateNFC(nfcInfo); + } + }) + .show(); } public void updateNFC(NFCInfo nfcInfo) { @@ -347,21 +347,21 @@ public void updateNFC(NFCInfo nfcInfo) { private boolean showNoDeviceAttachedDialog(final NFCInfo nfcInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation_nfc) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(nfcInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation_nfc) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(nfcInfo); + result = true; + } + }) + .show(); return result; } @@ -400,7 +400,7 @@ private void showRemoveUndoSnackbar(final NFCInfo nfcInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.nfc)); + getString(R.string.nfc)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java b/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java index 9f01f4198..e7979dce9 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java +++ b/app/src/main/java/nl/hnogames/domoticz/Preference/Preference.java @@ -470,24 +470,24 @@ public boolean onPreferenceChange(android.preference.Preference preference, Obje } else { if ((boolean) newValue) { new MaterialDialog.Builder(mContext) - .title(R.string.wizard_widgets) - .content(R.string.widget_warning) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - mSharedPrefs.SetWidgetsEnabled(true); - ((SettingsActivity) getActivity()).reloadSettings(); - } - }) - .onNegative(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - mSharedPrefs.SetWidgetsEnabled(false); - } - }) - .show(); + .title(R.string.wizard_widgets) + .content(R.string.widget_warning) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + mSharedPrefs.SetWidgetsEnabled(true); + ((SettingsActivity) getActivity()).reloadSettings(); + } + }) + .onNegative(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + mSharedPrefs.SetWidgetsEnabled(false); + } + }) + .show(); return false; } else { return true; @@ -537,9 +537,9 @@ public boolean onPreferenceClick(android.preference.Preference preference) { if (logs != null && logs.size() > 0) { Collections.reverse(logs); new MaterialDialog.Builder(mContext) - .title(mContext.getString(R.string.notification_show_title)) - .items((CharSequence[]) logs.toArray(new String[0])) - .show(); + .title(mContext.getString(R.string.notification_show_title)) + .items((CharSequence[]) logs.toArray(new String[0])) + .show(); } else UsefulBits.showSimpleToast(mContext, getString(R.string.notification_show_nothing), Toast.LENGTH_LONG); return true; @@ -570,19 +570,19 @@ public boolean onPreferenceClick(android.preference.Preference preference) { public boolean onPreferenceClick(android.preference.Preference preference) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { new MaterialDialog.Builder(mContext) - .title(R.string.category_Reset) - .content(R.string.are_you_sure_clear_settings) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @SuppressLint("NewApi") - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - ((ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE)) - .clearApplicationUserData(); - } - }) - .show(); + .title(R.string.category_Reset) + .content(R.string.are_you_sure_clear_settings) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @SuppressLint("NewApi") + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + ((ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE)) + .clearApplicationUserData(); + } + }) + .show(); } else { startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0); } @@ -619,18 +619,18 @@ public boolean onPreferenceChange(android.preference.Preference preference, Obje return false; } else { new MaterialDialog.Builder(mContext) - .title(R.string.category_startup_security) - .content(R.string.fingerprint_sure) - .positiveText(R.string.ok) - .negativeText(R.string.cancel) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - mSharedPrefs.setStartupSecurityEnabled(true); - ((SettingsActivity) getActivity()).reloadSettings(); - } - }) - .show(); + .title(R.string.category_startup_security) + .content(R.string.fingerprint_sure) + .positiveText(R.string.ok) + .negativeText(R.string.cancel) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + mSharedPrefs.setStartupSecurityEnabled(true); + ((SettingsActivity) getActivity()).reloadSettings(); + } + }) + .show(); return false; } @@ -686,20 +686,20 @@ public void onError(Exception error) { private void showRestartMessage() { new MaterialDialog.Builder(mContext) - .title(R.string.restart_required_title) - .content(mContext.getString(R.string.restart_required_msg) - + UsefulBits.newLine() - + UsefulBits.newLine() - + mContext.getString(R.string.restart_now)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - UsefulBits.restartApplication(getActivity()); - } - }) - .show(); + .title(R.string.restart_required_title) + .content(mContext.getString(R.string.restart_required_msg) + + UsefulBits.newLine() + + UsefulBits.newLine() + + mContext.getString(R.string.restart_now)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + UsefulBits.restartApplication(getActivity()); + } + }) + .show(); } private void handleInfoAndAbout() { @@ -732,29 +732,29 @@ public boolean onPreferenceClick(android.preference.Preference preference) { private void handleImportExportButtons() { SettingsFile = new File(Environment.getExternalStorageDirectory(), - "/Domoticz/DomoticzSettings.txt"); + "/Domoticz/DomoticzSettings.txt"); final String sPath = SettingsFile.getPath(). - substring(0, SettingsFile.getPath().lastIndexOf("/")); + substring(0, SettingsFile.getPath().lastIndexOf("/")); //noinspection unused boolean mkdirsResultIsOk = new File(sPath + "/").mkdirs(); android.preference.Preference exportButton = findPreference("export_settings"); exportButton.setOnPreferenceClickListener( - new android.preference.Preference.OnPreferenceClickListener() { - @Override - public boolean onPreferenceClick(android.preference.Preference preference) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - if (!PermissionsUtil.canAccessStorage(mContext)) { - permissionHelper.request(PermissionsUtil.INITIAL_STORAGE_PERMS); + new android.preference.Preference.OnPreferenceClickListener() { + @Override + public boolean onPreferenceClick(android.preference.Preference preference) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + if (!PermissionsUtil.canAccessStorage(mContext)) { + permissionHelper.request(PermissionsUtil.INITIAL_STORAGE_PERMS); + } else + exportSettings(); } else exportSettings(); - } else - exportSettings(); - return false; - } - }); + return false; + } + }); android.preference.Preference importButton = findPreference("import_settings"); importButton.setOnPreferenceClickListener(new android.preference.Preference.OnPreferenceClickListener() { @Override @@ -794,9 +794,9 @@ private void setVersionInfo() { PackageInfo pInfo = null; try { pInfo = mContext - .getPackageManager() - .getPackageInfo(mContext - .getPackageName(), 0); + .getPackageManager() + .getPackageInfo(mContext + .getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } @@ -813,9 +813,9 @@ private void setVersionInfo() { if (serverUtil.getActiveServer() != null) { if ((serverUtil.getActiveServer().getServerUpdateInfo(mContext) != null - && serverUtil.getActiveServer().getServerUpdateInfo(mContext).isUpdateAvailable() - && !UsefulBits.isEmpty(serverUtil.getActiveServer().getServerUpdateInfo(mContext).getCurrentServerVersion())) || - mSharedPrefs.isDebugEnabled()) { + && serverUtil.getActiveServer().getServerUpdateInfo(mContext).isUpdateAvailable() + && !UsefulBits.isEmpty(serverUtil.getActiveServer().getServerUpdateInfo(mContext).getCurrentServerVersion())) || + mSharedPrefs.isDebugEnabled()) { // Update is available or debugging is enabled String version; @@ -823,14 +823,14 @@ private void setVersionInfo() { version = mContext.getString(R.string.debug_test_text); else version = (serverUtil.getActiveServer().getServerUpdateInfo(mContext) != null) - ? serverUtil.getActiveServer().getServerUpdateInfo(mContext).getUpdateRevisionNumber() : ""; + ? serverUtil.getActiveServer().getServerUpdateInfo(mContext).getUpdateRevisionNumber() : ""; message = String.format(getString(R.string.update_available_enhanced), - serverUtil.getActiveServer().getServerUpdateInfo(mContext).getCurrentServerVersion(), - version); + serverUtil.getActiveServer().getServerUpdateInfo(mContext).getCurrentServerVersion(), + version); if (serverUtil.getActiveServer().getServerUpdateInfo(mContext) != null && - serverUtil.getActiveServer().getServerUpdateInfo(mContext).getSystemName() != null && - serverUtil.getActiveServer().getServerUpdateInfo(mContext).getSystemName().equalsIgnoreCase("linux")) { + serverUtil.getActiveServer().getServerUpdateInfo(mContext).getSystemName() != null && + serverUtil.getActiveServer().getServerUpdateInfo(mContext).getSystemName().equalsIgnoreCase("linux")) { // Only offer remote/auto update on Linux systems message += UsefulBits.newLine() + mContext.getString(R.string.click_to_update_server); domoticzVersion.setOnPreferenceClickListener(new android.preference.Preference.OnPreferenceClickListener() { @@ -844,8 +844,8 @@ public boolean onPreferenceClick(android.preference.Preference preference) { } } else { message = (serverUtil.getActiveServer().getServerUpdateInfo(mContext) != null && - !UsefulBits.isEmpty(serverUtil.getActiveServer().getServerUpdateInfo(mContext).getUpdateRevisionNumber())) - ? serverUtil.getActiveServer().getServerUpdateInfo(mContext).getUpdateRevisionNumber() : ""; + !UsefulBits.isEmpty(serverUtil.getActiveServer().getServerUpdateInfo(mContext).getUpdateRevisionNumber())) + ? serverUtil.getActiveServer().getServerUpdateInfo(mContext).getUpdateRevisionNumber() : ""; } domoticzVersion.setSummary(message); } @@ -869,14 +869,14 @@ private void showPremiumSnackbar(final String category) { public void run() { if (getView() != null) { Snackbar.make(getView(), category + " " + getString(R.string.premium_feature), Snackbar.LENGTH_LONG) - .setAction(R.string.upgrade, new View.OnClickListener() { - @Override - public void onClick(View view) { - UsefulBits.openPremiumAppStore(mContext); - } - }) - .setActionTextColor(ContextCompat.getColor(mContext, R.color.material_blue_600)) - .show(); + .setAction(R.string.upgrade, new View.OnClickListener() { + @Override + public void onClick(View view) { + UsefulBits.openPremiumAppStore(mContext); + } + }) + .setActionTextColor(ContextCompat.getColor(mContext, R.color.material_blue_600)) + .show(); } } }, (300)); diff --git a/app/src/main/java/nl/hnogames/domoticz/Preference/WearMultiSelectListPreference.java b/app/src/main/java/nl/hnogames/domoticz/Preference/WearMultiSelectListPreference.java index f48281576..5ce93c080 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Preference/WearMultiSelectListPreference.java +++ b/app/src/main/java/nl/hnogames/domoticz/Preference/WearMultiSelectListPreference.java @@ -73,7 +73,7 @@ public void onReceiveDevices(ArrayList mDevicesInfo) { if (!name.startsWith(Domoticz.HIDDEN_CHARACTER) //&& //appSupportedSwitchesValues.contains(switchTypeVal) && //appSupportedSwitchesNames.contains(switchType) - ) { + ) { supportedSwitches.add(mExtendedStatusInfo); } } diff --git a/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java b/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java index 0e8c07663..653c9e8cc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/QRCodeCaptureActivity.java @@ -42,7 +42,7 @@ public class QRCodeCaptureActivity extends AppCompatAssistActivity implements ZX public void onCreate(Bundle state) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { setSystemUiFlags(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | - View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); setFullscreenFlags(); } @@ -60,7 +60,7 @@ private void setSystemUiFlags(int flags) { private void setFullscreenFlags() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { int fullscreenFlags = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | - View.SYSTEM_UI_FLAG_FULLSCREEN; + View.SYSTEM_UI_FLAG_FULLSCREEN; setSystemUiFlags(fullscreenFlags); } diff --git a/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java index 328b69eaf..865b93cd4 100644 --- a/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/QRCodeSettingsActivity.java @@ -126,19 +126,19 @@ public boolean onItemLongClick(AdapterView parent, View view, final int posit private void showEditDialog(final QRCodeInfo mQRCodeInfo) { new MaterialDialog.Builder(this) - .title(R.string.qrcode_edit) - .content(R.string.qrcode_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .negativeText(R.string.cancel) - .input(this.getString(R.string.category_QRCode), mQRCodeInfo.getName(), new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - mQRCodeInfo.setName(String.valueOf(input)); - updateQRCode(mQRCodeInfo); + .title(R.string.qrcode_edit) + .content(R.string.qrcode_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .negativeText(R.string.cancel) + .input(this.getString(R.string.category_QRCode), mQRCodeInfo.getName(), new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + mQRCodeInfo.setName(String.valueOf(input)); + updateQRCode(mQRCodeInfo); + } } - } - }).show(); + }).show(); } private void getSwitchesAndShowSwitchesDialog(final QRCodeInfo qrInfo) { @@ -158,19 +158,19 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(QRCodeSettingsActivity.this, coordinatorLayout, QRCodeSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(qrInfo); - } - }, QRCodeSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(qrInfo); + } + }, QRCodeSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private void showSwitchesDialog( - final QRCodeInfo qrcodeInfo, - final ArrayList switches) { + final QRCodeInfo qrcodeInfo, + final ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -179,9 +179,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - QRCodeSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + QRCodeSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -211,16 +211,16 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final QRCodeInfo qrcodeInfo, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - qrcodeInfo.setValue(String.valueOf(text)); - updateQRCode(qrcodeInfo); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + qrcodeInfo.setValue(String.valueOf(text)); + updateQRCode(qrcodeInfo); + } + }) + .show(); } public void updateQRCode(QRCodeInfo qrcodeInfo) { @@ -246,21 +246,21 @@ public void updateQRCode(QRCodeInfo qrcodeInfo) { private boolean showNoDeviceAttachedDialog(final QRCodeInfo qrcodeInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation_qrcode) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(qrcodeInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation_qrcode) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(qrcodeInfo); + result = true; + } + }) + .show(); return result; } @@ -287,7 +287,7 @@ private void showRemoveUndoSnackbar(final QRCodeInfo qrcodeInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.qrcode)); + getString(R.string.qrcode)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override @@ -370,21 +370,21 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) { if (newTagFound) { UsefulBits.showSnackbar(this, coordinatorLayout, getString(R.string.qrcode_found) + ": " + QR_Code_ID, Snackbar.LENGTH_SHORT); new MaterialDialog.Builder(this) - .title(R.string.qrcode_found) - .content(R.string.qrcode_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .input(R.string.category_QRCode, 0, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - UsefulBits.showSnackbar(QRCodeSettingsActivity.this, coordinatorLayout, getString(R.string.qrcode_saved) + ": " + input, Snackbar.LENGTH_SHORT); - QRCodeInfo qrCodeInfo = new QRCodeInfo(); - qrCodeInfo.setId(QR_Code_ID); - qrCodeInfo.setName(String.valueOf(input)); - updateQRCode(qrCodeInfo); + .title(R.string.qrcode_found) + .content(R.string.qrcode_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .input(R.string.category_QRCode, 0, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + UsefulBits.showSnackbar(QRCodeSettingsActivity.this, coordinatorLayout, getString(R.string.qrcode_saved) + ": " + input, Snackbar.LENGTH_SHORT); + QRCodeInfo qrCodeInfo = new QRCodeInfo(); + qrCodeInfo.setId(QR_Code_ID); + qrCodeInfo.setName(String.valueOf(input)); + updateQRCode(qrCodeInfo); + } } - } - }).show(); + }).show(); } else { UsefulBits.showSnackbar(this, coordinatorLayout, R.string.qrcode_exists, Snackbar.LENGTH_SHORT); } diff --git a/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java index 80dc0da24..bcc33917d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/ServerListSettingsActivity.java @@ -157,7 +157,7 @@ private void showRemoveUndoSnackbar(final ServerInfo serverInfo) { removeServerFromListView(serverInfo); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, String.format(getString(R.string.something_deleted), - getString(R.string.server)), Snackbar.LENGTH_SHORT, new Snackbar.Callback() { + getString(R.string.server)), Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override public void onDismissed(Snackbar snackbar, int event) { super.onDismissed(snackbar, event); diff --git a/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java index 0b981ada0..ffee72193 100644 --- a/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/ServerSettingsActivity.java @@ -75,8 +75,8 @@ protected void onCreate(Bundle savedInstanceState) { if (!addNew && UsefulBits.isEmpty(updateName)) { Fragment serverSettings = WelcomePage3.newInstance(SETTINGS); getSupportFragmentManager().beginTransaction() - .replace(android.R.id.content, serverSettings) - .commit(); + .replace(android.R.id.content, serverSettings) + .commit(); } else { SetupServerSettings serverSettings = SetupServerSettings.newInstance(SETTINGS); @@ -88,8 +88,8 @@ protected void onCreate(Bundle savedInstanceState) { } getSupportFragmentManager().beginTransaction() - .replace(android.R.id.content, serverSettings) - .commit(); + .replace(android.R.id.content, serverSettings) + .commit(); } } @@ -127,17 +127,17 @@ public void ServerAdded(Boolean added) { public void onBackPressed() { if (addNew) { new AlertDialog.Builder(this) - .setIcon(android.R.drawable.ic_dialog_alert) - .setTitle(getString(R.string.dont_save_new_server)) - .setMessage(R.string.are_you_sure) - .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - ServerCancel(); - } - }) - .setNegativeButton(R.string.cancel, null) - .show(); + .setIcon(android.R.drawable.ic_dialog_alert) + .setTitle(getString(R.string.dont_save_new_server)) + .setMessage(R.string.are_you_sure) + .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + ServerCancel(); + } + }) + .setNegativeButton(R.string.cancel, null) + .show(); } else super.onBackPressed(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java b/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java index d2d52473b..0081c8137 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/FCMMessageInstanceService.java @@ -41,7 +41,7 @@ public void onMessageReceived(RemoteMessage remoteMessage) { } if (!UsefulBits.isEmpty(subject) && !UsefulBits.isEmpty(body) && - !body.equals(subject)) { + !body.equals(subject)) { String deviceid = decode(data.containsKey("deviceid") ? data.get("deviceid").toString() : ""); if (!UsefulBits.isEmpty(deviceid) && isDigitsOnly(deviceid) && Integer.valueOf(deviceid) > 0) diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java b/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java index d48ecf670..2e4c342e8 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/GeofenceTransitionsIntentService.java @@ -72,16 +72,16 @@ private void handleEnterExit(GeofencingEvent geoFenceEvent) { if (Geofence.GEOFENCE_TRANSITION_ENTER == transitionType || Geofence.GEOFENCE_TRANSITION_DWELL == transitionType) { for (Geofence geofence : geoFenceEvent.getTriggeringGeofences()) { LocationInfo locationFound = - mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); + mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); Log.d(TAG, "Triggered entering a geofence location: " - + locationFound.getName()); + + locationFound.getName()); if (mSharedPrefs.isGeofenceNotificationsEnabled()) { notificationTitle = String.format( - context.getString(R.string.geofence_location_entering), locationFound.getName()); + context.getString(R.string.geofence_location_entering), locationFound.getName()); notificationDescription = context.getString(R.string.geofence_location_entering_text); NotificationUtil.sendSimpleNotification(notificationTitle, - notificationDescription, 0, context); + notificationDescription, 0, context); } if (locationFound.getSwitchIdx() > 0) handleSwitch(locationFound.getSwitchIdx(), locationFound.getSwitchPassword(), 1, locationFound.getValue(), locationFound.isSceneOrGroup()); @@ -89,17 +89,17 @@ private void handleEnterExit(GeofencingEvent geoFenceEvent) { } else if (Geofence.GEOFENCE_TRANSITION_EXIT == transitionType) { for (Geofence geofence : geoFenceEvent.getTriggeringGeofences()) { LocationInfo locationFound - = mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); + = mSharedPrefs.getLocation(Integer.valueOf(geofence.getRequestId())); Log.d(TAG, "Triggered leaving a geofence location: " - + locationFound.getName()); + + locationFound.getName()); if (mSharedPrefs.isGeofenceNotificationsEnabled()) { notificationTitle = String.format( - context.getString(R.string.geofence_location_leaving), - locationFound.getName()); + context.getString(R.string.geofence_location_leaving), + locationFound.getName()); notificationDescription = context.getString(R.string.geofence_location_leaving_text); NotificationUtil.sendSimpleNotification(notificationTitle, - notificationDescription, 0, context); + notificationDescription, 0, context); } if (locationFound.getSwitchIdx() > 0) handleSwitch(locationFound.getSwitchIdx(), locationFound.getSwitchPassword(), 0, locationFound.getValue(), locationFound.isSceneOrGroup()); @@ -131,7 +131,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { if (!isSceneOrGroup) { if (inputJSONAction < 0) { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (!mDevicesInfo.getStatusBoolean()) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else { @@ -153,7 +153,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { } } else { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (inputJSONAction == 1) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else { diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java b/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java index 6f31c51c1..db3fd91fa 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/NFCServiceActivity.java @@ -101,7 +101,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { if (!isSceneOrGroup) { if (inputJSONAction < 0) { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (!mDevicesInfo.getStatusBoolean()) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else { @@ -123,7 +123,7 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { } } else { if (mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + mDevicesInfo.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (inputJSONAction == 1) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else { @@ -222,10 +222,10 @@ private int getSelectorValue(DevicesInfo mDevicesInfo, String value) { private void onErrorHandling(Exception error) { if (error != null) { Toast.makeText( - this, - "Domoticz: " + - getString(R.string.unable_to_get_switches), - Toast.LENGTH_SHORT).show(); + this, + "Domoticz: " + + getString(R.string.unable_to_get_switches), + Toast.LENGTH_SHORT).show(); if (domoticz != null && UsefulBits.isEmpty(domoticz.getErrorMessage(error))) Log.e(TAG, domoticz.getErrorMessage(error)); diff --git a/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java b/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java index 744582065..216df926a 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Service/WearMessageListenerService.java @@ -71,7 +71,7 @@ public void run() { NodeApi.GetConnectedNodesResult nodes = Wearable.NodeApi.getConnectedNodes(mApiClient).await(); for (Node node : nodes.getNodes()) { MessageApi.SendMessageResult result = Wearable.MessageApi.sendMessage( - mApiClient, node.getId(), path, text.getBytes()).await(); + mApiClient, node.getId(), path, text.getBytes()).await(); if (result.getStatus().isSuccess()) { Log.v("WEAR", "Message: {" + "my object" + "} sent to: " + node.getDisplayName()); @@ -132,7 +132,7 @@ public void onMessageReceived(MessageEvent messageEvent) { default: throw new NullPointerException( - "Toggle event received from wear device for unsupported switch type: " + selectedSwitch.getSwitchTypeVal()); + "Toggle event received from wear device for unsupported switch type: " + selectedSwitch.getSwitchTypeVal()); } //now send latest status getSwitches(); @@ -182,7 +182,7 @@ private void processAllSwitches(ArrayList extendedStatusSwitches) { String name = mDevicesInfo.getName(); if (!name.startsWith(Domoticz.HIDDEN_CHARACTER) && - mDevicesInfo.getFavoriteBoolean()) {//only dashboard switches.. + mDevicesInfo.getFavoriteBoolean()) {//only dashboard switches.. supportedSwitches.add(mDevicesInfo); } } @@ -221,9 +221,9 @@ private void processAllSwitches(ArrayList extendedStatusSwitches) { private void initGoogleApiClient() { mApiClient = new GoogleApiClient.Builder(this) - .addApi(Wearable.API) - .addConnectionCallbacks(this) - .build(); + .addApi(Wearable.API) + .addConnectionCallbacks(this) + .build(); mApiClient.connect(); } @@ -244,7 +244,7 @@ public void onSwitchToggle(DevicesInfo toggledDevice) { boolean checked = !toggledDevice.getStatusBoolean(); if (toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + toggledDevice.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else jsonAction = DomoticzValues.Device.Switch.Action.ON; } else { diff --git a/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java index 0c7c178e1..305642578 100644 --- a/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/SettingsActivity.java @@ -47,7 +47,7 @@ protected void onCreate(Bundle savedInstanceState) { if (getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); getFragmentManager().beginTransaction().replace(android.R.id.content, - new Preference()).commit(); + new Preference()).commit(); } @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java b/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java index e047dcc19..96b0953db 100644 --- a/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/SpeechSettingsActivity.java @@ -137,19 +137,19 @@ public boolean onItemLongClick(AdapterView parent, View view, final int posit private void showEditDialog(final SpeechInfo mSpeechInfo) { new MaterialDialog.Builder(this) - .title(R.string.Speech_edit) - .content(R.string.Speech_name) - .inputType(InputType.TYPE_CLASS_TEXT) - .negativeText(R.string.cancel) - .input(this.getString(R.string.category_Speech), mSpeechInfo.getName(), new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - if (!UsefulBits.isEmpty(String.valueOf(input))) { - mSpeechInfo.setName(String.valueOf(input)); - updateSpeech(mSpeechInfo); + .title(R.string.Speech_edit) + .content(R.string.Speech_name) + .inputType(InputType.TYPE_CLASS_TEXT) + .negativeText(R.string.cancel) + .input(this.getString(R.string.category_Speech), mSpeechInfo.getName(), new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + if (!UsefulBits.isEmpty(String.valueOf(input))) { + mSpeechInfo.setName(String.valueOf(input)); + updateSpeech(mSpeechInfo); + } } - } - }).show(); + }).show(); } private void getSwitchesAndShowSwitchesDialog(final SpeechInfo qrInfo) { @@ -169,19 +169,19 @@ public void onReceiveDevice(DevicesInfo mDevicesInfo) { @DebugLog public void onError(Exception error) { UsefulBits.showSnackbarWithAction(SpeechSettingsActivity.this, coordinatorLayout, SpeechSettingsActivity.this.getString(R.string.unable_to_get_switches), Snackbar.LENGTH_SHORT, - null, new View.OnClickListener() { - @Override - public void onClick(View v) { - getSwitchesAndShowSwitchesDialog(qrInfo); - } - }, SpeechSettingsActivity.this.getString(R.string.retry)); + null, new View.OnClickListener() { + @Override + public void onClick(View v) { + getSwitchesAndShowSwitchesDialog(qrInfo); + } + }, SpeechSettingsActivity.this.getString(R.string.retry)); } }, 0, "all"); } private void showSwitchesDialog( - final SpeechInfo SpeechInfo, - final ArrayList switches) { + final SpeechInfo SpeechInfo, + final ArrayList switches) { final ArrayList supportedSwitches = new ArrayList<>(); for (DevicesInfo d : switches) { @@ -190,9 +190,9 @@ private void showSwitchesDialog( } SwitchDialog infoDialog = new SwitchDialog( - SpeechSettingsActivity.this, supportedSwitches, - R.layout.dialog_switch_logs, - domoticz); + SpeechSettingsActivity.this, supportedSwitches, + R.layout.dialog_switch_logs, + domoticz); infoDialog.onDismissListener(new SwitchDialog.DismissListener() { @Override @@ -220,16 +220,16 @@ public void onDismiss(int selectedSwitchIDX, String selectedSwitchPassword, Stri private void showSelectorDialog(final SpeechInfo SpeechInfo, DevicesInfo selector) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - SpeechInfo.setValue(String.valueOf(text)); - updateSpeech(SpeechInfo); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + SpeechInfo.setValue(String.valueOf(text)); + updateSpeech(SpeechInfo); + } + }) + .show(); } public void updateSpeech(SpeechInfo SpeechInfo) { @@ -255,21 +255,21 @@ public void updateSpeech(SpeechInfo SpeechInfo) { private boolean showNoDeviceAttachedDialog(final SpeechInfo SpeechInfo) { new MaterialDialog.Builder(this) - .title(R.string.noSwitchSelected_title) - .content(getString(R.string.noSwitchSelected_explanation_Speech) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.noSwitchSelected_connectOneNow)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - getSwitchesAndShowSwitchesDialog(SpeechInfo); - result = true; - } - }) - .show(); + .title(R.string.noSwitchSelected_title) + .content(getString(R.string.noSwitchSelected_explanation_Speech) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.noSwitchSelected_connectOneNow)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + getSwitchesAndShowSwitchesDialog(SpeechInfo); + result = true; + } + }) + .show(); return result; } @@ -295,7 +295,7 @@ private void showRemoveUndoSnackbar(final SpeechInfo SpeechInfo) { // Show snackbar with undo option String text = String.format(getString(R.string.something_deleted), - getString(R.string.Speech)); + getString(R.string.Speech)); UsefulBits.showSnackbarWithAction(this, coordinatorLayout, text, Snackbar.LENGTH_SHORT, new Snackbar.Callback() { @Override @@ -353,11 +353,11 @@ public void onResults(Bundle results) { } int[] colors = { - ContextCompat.getColor(this, R.color.material_amber_600), - ContextCompat.getColor(this, R.color.material_blue_600), - ContextCompat.getColor(this, R.color.material_deep_purple_600), - ContextCompat.getColor(this, R.color.material_green_600), - ContextCompat.getColor(this, R.color.material_orange_600) + ContextCompat.getColor(this, R.color.material_amber_600), + ContextCompat.getColor(this, R.color.material_blue_600), + ContextCompat.getColor(this, R.color.material_deep_purple_600), + ContextCompat.getColor(this, R.color.material_green_600), + ContextCompat.getColor(this, R.color.material_orange_600) }; recognitionProgressView.setColors(colors); recognitionProgressView.setSpeechRecognizer(speechRecognizer); @@ -389,7 +389,7 @@ private void stopRecognitionAnimation() { private void showSpeechResults(Bundle results) { ArrayList matches = results - .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); + .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION); if (matches != null) processResult(matches.get(0).toLowerCase()); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/ColorPickerDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/ColorPickerDialog.java index b38baf60e..f3887ffec 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/ColorPickerDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/ColorPickerDialog.java @@ -53,20 +53,20 @@ public ColorPickerDialog(Context mContext, int idx) { if (mSharedPrefs.darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_color, true) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java index 6dae1b003..8e20ab40d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/DeviceInfoDialog.java @@ -62,22 +62,22 @@ public DeviceInfoDialog(Context mContext, if (mSharedPrefs.darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } @@ -132,7 +132,7 @@ public boolean onTouch(View v, MotionEvent event) { }); signalLevelIndicator.setMax(Domoticz.signalLevelMax * 100); ProgressBarAnimation anim = - new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); + new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); anim.setDuration(1000); signalLevelIndicator.startAnimation(anim); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java index 2639b1fda..ec6be2fe8 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/FingerprintPasswordDialog.java @@ -59,35 +59,35 @@ public FingerprintPasswordDialog(Context c, Domoticz mDomoticz) { mSharedPrefs = new SharedPrefUtil(c); if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_password, true) - .positiveText(android.R.string.ok) - .negativeText(android.R.string.cancel) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onDismiss(editPassword.getText().toString()); - } - }) - .onNegative(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onCancel(); - } - }); + .positiveText(android.R.string.ok) + .negativeText(android.R.string.cancel) + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onDismiss(editPassword.getText().toString()); + } + }) + .onNegative(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onCancel(); + } + }); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java b/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java index 8efd24670..9e14a33c0 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/MjpegViewer/MjpegInputStream.java @@ -62,7 +62,7 @@ private int getStartOfSequence(byte[] sequence) throws IOException { /*********************************************************************************************/ private int parseContentLength(byte[] headerBytes) - throws IOException, NumberFormatException { + throws IOException, NumberFormatException { ByteArrayInputStream headerIn = new ByteArrayInputStream(headerBytes); Properties props = new Properties(); props.load(headerIn); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java b/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java index 8db436345..887af9110 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/MultiSelectionSpinner.java @@ -52,7 +52,7 @@ public MultiSelectionSpinner(Context context) { super(context); simple_adapter = new ArrayAdapter<>(context, - android.R.layout.simple_spinner_item); + android.R.layout.simple_spinner_item); super.setAdapter(simple_adapter); } @@ -69,7 +69,7 @@ public MultiSelectionSpinner(Context context, AttributeSet attrs) { this.mContext = context; simple_adapter = new ArrayAdapter<>(context, - android.R.layout.simple_spinner_item); + android.R.layout.simple_spinner_item); super.setAdapter(simple_adapter); } @@ -81,7 +81,7 @@ public void onClick(DialogInterface dialog, int which, boolean isChecked) { simple_adapter.add(buildSelectedItemString()); } else { throw new IllegalArgumentException( - "Argument 'which' is out of bounds."); + "Argument 'which' is out of bounds."); } } @@ -97,7 +97,7 @@ public boolean performClick() { @Override public void setAdapter(SpinnerAdapter adapter) { throw new RuntimeException( - "setAdapter is not supported by MultiSelectSpinner."); + "setAdapter is not supported by MultiSelectSpinner."); } @SuppressWarnings("unused") @@ -162,7 +162,7 @@ public void setSelection(int index) { mSelection[index] = true; } else { throw new IllegalArgumentException("Index " + index - + " is out of bounds."); + + " is out of bounds."); } simple_adapter.clear(); simple_adapter.add(buildSelectedItemString()); @@ -178,7 +178,7 @@ public void setSelection(int[] selectedIndices) { mSelection[index] = true; } else { throw new IllegalArgumentException("Index " + index - + " is out of bounds."); + + " is out of bounds."); } } simple_adapter.clear(); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java index affbd5529..83590583f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/NotificationInfoDialog.java @@ -49,20 +49,20 @@ public NotificationInfoDialog(Context c, if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_switch_timer, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); } public void show() { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java index f0de84392..8d4d762bb 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/PasswordDialog.java @@ -59,35 +59,35 @@ public PasswordDialog(Context c, Domoticz mDomoticz) { mSharedPrefs = new SharedPrefUtil(c); if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_password, true) - .positiveText(android.R.string.ok) - .negativeText(android.R.string.cancel) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onDismiss(editPassword.getText().toString()); - } - }) - .onNegative(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(MaterialDialog dialog, DialogAction which) { - if (dismissListener != null) - dismissListener.onCancel(); - } - }); + .positiveText(android.R.string.ok) + .negativeText(android.R.string.cancel) + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onDismiss(editPassword.getText().toString()); + } + }) + .onNegative(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(MaterialDialog dialog, DialogAction which) { + if (dismissListener != null) + dismissListener.onCancel(); + } + }); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java index 8badb24b0..611678624 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SceneInfoDialog.java @@ -52,22 +52,22 @@ public SceneInfoDialog(Context mContext, this.info = info; if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java index 5b486f4d3..848729494 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/ScheduledTemperatureDialog.java @@ -31,7 +31,7 @@ public ScheduledTemperatureDialog(Context mContext, double temp, boolean canCanc if (canCancel) { getMaterialDialogBuilder() - .neutralText(R.string.follow_schedule); + .neutralText(R.string.follow_schedule); } } } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java index 205a19731..5be0ba112 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SecurityPanelDialog.java @@ -74,21 +74,21 @@ public SecurityPanelDialog(Context c, Domoticz mDomoticz, DevicesInfo panelInfo) mSharedPrefs = new SharedPrefUtil(c); if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_security, true) - .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .negativeText(android.R.string.cancel); + .theme(mSharedPrefs.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .negativeText(android.R.string.cancel); mdb.dismissListener(this); } @@ -166,11 +166,11 @@ private void setFields(boolean enabled) { private void processRequest(final int status) { setFields(false); InputMethodManager imm = - (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); + (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editPinCode.getWindowToken(), 0); final String password = - UsefulBits.getMd5String(editPinCode.getText().toString()); + UsefulBits.getMd5String(editPinCode.getText().toString()); if (validatePassword(password)) { if (mSettings.getSecOnDelay() <= 0 || status == DomoticzValues.Security.Status.DISARM) { @@ -186,8 +186,8 @@ public void onReceiveResult(String result) { public void onError(Exception error) { Log.e(TAG, domoticz.getErrorMessage(error)); Toast.makeText(mContext, - mContext.getString(R.string.security_generic_error), - Toast.LENGTH_SHORT).show(); + mContext.getString(R.string.security_generic_error), + Toast.LENGTH_SHORT).show(); setFields(true); } }); @@ -209,8 +209,8 @@ public void onReceiveResult(String result) { @Override public void onError(Exception error) { Toast.makeText(mContext, - mContext.getString(R.string.security_generic_error), - Toast.LENGTH_SHORT).show(); + mContext.getString(R.string.security_generic_error), + Toast.LENGTH_SHORT).show(); setFields(true); } }); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java index 6a258f114..3485a1a5e 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SimpleTextDialog.java @@ -46,15 +46,15 @@ public SimpleTextDialog(Context mContext) { if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); @@ -62,8 +62,8 @@ public SimpleTextDialog(Context mContext) { //noinspection ConstantConditions mdb.customView(R.layout.dialog_text, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); } public void setTitle(String title) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java index 60fc36998..eaacc72ce 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SortDialog.java @@ -48,19 +48,19 @@ public SortDialog(Context c, names = new String[]{mContext.getString(R.string.filterOn_on), mContext.getString(R.string.filterOn_off), mContext.getString(R.string.filterOn_static), mContext.getString(R.string.filterOn_all)}; if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .negativeText(android.R.string.cancel); + .negativeText(android.R.string.cancel); mdb.dismissListener(this); } @@ -74,7 +74,7 @@ public void show() { View view = md.getCustomView(); ListView listView = (ListView) view.findViewById(R.id.list); ArrayAdapter adapter = new ArrayAdapter<>(mContext, - android.R.layout.simple_list_item_1, android.R.id.text1, names); + android.R.layout.simple_list_item_1, android.R.id.text1, names); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java index 8831c7223..fab2b01ba 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchDialog.java @@ -57,20 +57,20 @@ public SwitchDialog(Context c, if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .negativeText(android.R.string.cancel); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .negativeText(android.R.string.cancel); mdb.dismissListener(this); } @@ -85,7 +85,7 @@ public void show() { ListView listView = (ListView) view.findViewById(R.id.list); String[] listData = processSwitches(); ArrayAdapter adapter = new ArrayAdapter<>(mContext, - android.R.layout.simple_list_item_1, android.R.id.text1, listData); + android.R.layout.simple_list_item_1, android.R.id.text1, listData); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, final int position, long id) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java index d508196b8..6b02f8b3f 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchInfoDialog.java @@ -60,22 +60,22 @@ public SwitchInfoDialog(Context mContext, if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } @@ -130,7 +130,7 @@ public boolean onTouch(View v, MotionEvent event) { }); signalLevelIndicator.setMax(Domoticz.signalLevelMax * 100); ProgressBarAnimation anim = - new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); + new ProgressBarAnimation(signalLevelIndicator, 5, signalLevelVal * 100); anim.setDuration(1000); signalLevelIndicator.startAnimation(anim); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java index 981547519..7e87d1a50 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchLogInfoDialog.java @@ -50,20 +50,20 @@ public SwitchLogInfoDialog(Context c, this.mContext = c; if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } @@ -79,7 +79,7 @@ public void show() { String[] listData = processLogs(); ArrayAdapter adapter = new ArrayAdapter<>(mContext, - android.R.layout.simple_list_item_1, android.R.id.text1, listData); + android.R.layout.simple_list_item_1, android.R.id.text1, listData); listView.setAdapter(adapter); md.show(); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java index 3467d2382..098e8a721 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/SwitchTimerInfoDialog.java @@ -50,20 +50,20 @@ public SwitchTimerInfoDialog(Context c, if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(layout, true) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); } public void show() { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java index b550aff51..dd7d53957 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureDialog.java @@ -63,22 +63,22 @@ public TemperatureDialog(Context mContext, double temp) { if (mSharedPrefUtil.darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); mdb.customView(R.layout.dialog_temperature, false) - .negativeText(android.R.string.cancel) - .theme(mSharedPrefUtil.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok) - .onAny(this); + .negativeText(android.R.string.cancel) + .theme(mSharedPrefUtil.darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok) + .onAny(this); ConfigInfo configInfo = new ServerUtil(mContext).getActiveServer().getConfigInfo(mContext); if (configInfo != null) { diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java index 4d1dd5a41..49d904a3d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/TemperatureInfoDialog.java @@ -52,22 +52,22 @@ public TemperatureInfoDialog(Context mContext, this.info = info; if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java index 4467b7eea..cf0f1808c 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/TextDialog.java @@ -35,9 +35,9 @@ import nl.hnogames.domoticz.Utils.SharedPrefUtil; public class TextDialog implements - DialogInterface.OnDismissListener, - DialogInterface.OnCancelListener, - MaterialDialog.SingleButtonCallback { + DialogInterface.OnDismissListener, + DialogInterface.OnCancelListener, + MaterialDialog.SingleButtonCallback { private final MaterialDialog.Builder mdb; private Context context; @@ -55,19 +55,19 @@ public TextDialog(Context context) { if ((new SharedPrefUtil(context)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(context) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(context); mdb.customView(R.layout.dialog_text, true).negativeText(android.R.string.cancel) - .theme((new SharedPrefUtil(context)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT); + .theme((new SharedPrefUtil(context)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT); mdb.dismissListener(this); mdb.cancelListener(this); mdb.onPositive(this); diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java index 67ad12d03..a97f7412c 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/UtilitiesInfoDialog.java @@ -52,22 +52,22 @@ public UtilitiesInfoDialog(Context mContext, this.info = info; if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java b/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java index da9750704..db842eb87 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java +++ b/app/src/main/java/nl/hnogames/domoticz/UI/WeatherInfoDialog.java @@ -50,22 +50,22 @@ public WeatherInfoDialog(Context mContext, this.info = info; if ((new SharedPrefUtil(mContext)).darkThemeEnabled()) { mdb = new MaterialDialog.Builder(mContext) - .titleColorRes(R.color.white) - .contentColor(Color.WHITE) // notice no 'res' postfix for literal color - .dividerColorRes(R.color.white) - .backgroundColorRes(R.color.primary) - .positiveColorRes(R.color.white) - .neutralColorRes(R.color.white) - .negativeColorRes(R.color.white) - .widgetColorRes(R.color.white) - .buttonRippleColorRes(R.color.white); + .titleColorRes(R.color.white) + .contentColor(Color.WHITE) // notice no 'res' postfix for literal color + .dividerColorRes(R.color.white) + .backgroundColorRes(R.color.primary) + .positiveColorRes(R.color.white) + .neutralColorRes(R.color.white) + .negativeColorRes(R.color.white) + .widgetColorRes(R.color.white) + .buttonRippleColorRes(R.color.white); } else mdb = new MaterialDialog.Builder(mContext); boolean wrapInScrollView = true; //noinspection ConstantConditions mdb.customView(layout, wrapInScrollView) - .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) - .positiveText(android.R.string.ok); + .theme((new SharedPrefUtil(mContext)).darkThemeEnabled() ? Theme.DARK : Theme.LIGHT) + .positiveText(android.R.string.ok); mdb.dismissListener(this); } diff --git a/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java b/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java index a726c137e..a88a70b94 100644 --- a/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/UpdateActivity.java @@ -99,16 +99,16 @@ public void onRefresh() { }); if (serverUtil.getActiveServer() != null && - serverUtil.getActiveServer().getServerUpdateInfo(this) != null) { + serverUtil.getActiveServer().getServerUpdateInfo(this) != null) { currentServerVersionValue.setText(serverUtil.getActiveServer() - .getServerUpdateInfo(this) - .getCurrentServerVersion()); + .getServerUpdateInfo(this) + .getCurrentServerVersion()); if (serverUtil.getActiveServer().getServerUpdateInfo(this).isUpdateAvailable()) { updateSummary.setText(R.string.server_update_available); updateServerVersionValue.setText(serverUtil.getActiveServer() - .getServerUpdateInfo(this) - .getUpdateRevisionNumber()); + .getServerUpdateInfo(this) + .getUpdateRevisionNumber()); } else if (mSharedPrefs.isDebugEnabled()) { String message = "Debugging: " + getString(R.string.server_update_available); updateSummary.setText(message); @@ -123,7 +123,7 @@ public void onClick(View v) { } }); if (!serverUtil.getActiveServer().getServerUpdateInfo(this).isUpdateAvailable() - && !mSharedPrefs.isDebugEnabled()) + && !mSharedPrefs.isDebugEnabled()) buttonUpdateServer.setEnabled(false); } } @@ -135,28 +135,28 @@ private void refreshData() { private void showServerUpdateWarningDialog() { new MaterialDialog.Builder(this) - .title(R.string.server_update) - .content(getString(R.string.update_server_warning) - + UsefulBits.newLine() - + UsefulBits.newLine() - + getString(R.string.continue_question)) - .positiveText(R.string.yes) - .negativeText(R.string.no) - .onPositive(new MaterialDialog.SingleButtonCallback() { - @Override - public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { - updateServer(); - } - }) - .show(); + .title(R.string.server_update) + .content(getString(R.string.update_server_warning) + + UsefulBits.newLine() + + UsefulBits.newLine() + + getString(R.string.continue_question)) + .positiveText(R.string.yes) + .negativeText(R.string.no) + .onPositive(new MaterialDialog.SingleButtonCallback() { + @Override + public void onClick(@NonNull MaterialDialog dialog, @NonNull DialogAction which) { + updateServer(); + } + }) + .show(); } @SuppressWarnings("unused") private void checkForUpdatePrerequisites() { MaterialDialog.Builder mdb = new MaterialDialog.Builder(this); mdb.title(R.string.msg_please_wait) - .content(R.string.please_wait_while_we_check) - .progress(true, 0); + .content(R.string.please_wait_while_we_check) + .progress(true, 0); progressDialog = mdb.build(); progressDialog.show(); @@ -174,8 +174,8 @@ public void onUpdateDownloadReady(boolean downloadOk) { public void onError(Exception error) { progressDialog.cancel(); String message = String.format( - getString(R.string.error_couldNotCheckForConfig), - mDomoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForConfig), + mDomoticz.getErrorMessage(error)); showSnackbar(message); } }); @@ -184,8 +184,8 @@ public void onError(Exception error) { private void showMessageUpdateNotReady() { String title = getString(R.string.server_update_not_ready); String message = getString(R.string.update_server_downloadNotReady1) - + UsefulBits.newLine() - + getString(R.string.update_server_downloadNotReady2); + + UsefulBits.newLine() + + getString(R.string.update_server_downloadNotReady2); showSimpleDialog(title, message); } @@ -195,13 +195,13 @@ private void updateServer() { final boolean showMinMax = false; final MaterialDialog dialog = new MaterialDialog.Builder(this) - .title(R.string.msg_please_wait) - .content(getString(R.string.please_wait_while_server_updated) - + UsefulBits.newLine() - + getString(R.string.this_take_minutes)) - .cancelable(false) - .progress(false, SERVER_UPDATE_TIME * 60, showMinMax) - .show(); + .title(R.string.msg_please_wait) + .content(getString(R.string.please_wait_while_server_updated) + + UsefulBits.newLine() + + getString(R.string.this_take_minutes)) + .cancelable(false) + .progress(false, SERVER_UPDATE_TIME * 60, showMinMax) + .show(); CountDownTimer mCountDownTimer = new CountDownTimer(SERVER_UPDATE_TIME * 60 * 1000, 1000) { @@ -220,8 +220,8 @@ public void onFinish() { mCountDownTimer.start(); if (!mSharedPrefs.isDebugEnabled() || serverUtil.getActiveServer() - .getServerUpdateInfo(this) - .isUpdateAvailable()) { + .getServerUpdateInfo(this) + .isUpdateAvailable()) { mDomoticz.updateDomoticzServer(null); // No feedback is provided when updating @@ -287,8 +287,8 @@ public void onReceiveUpdate(ServerUpdateInfo serverUpdateInfo) { @Override public void onError(Exception error) { String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - mDomoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForUpdates), + mDomoticz.getErrorMessage(error)); showSnackbar(message); serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).setUpdateRevisionNumber(""); updateServerVersionValue.setText(R.string.not_available); @@ -309,8 +309,8 @@ public void onReceiveVersion(String serverVersion) { if (!UsefulBits.isEmpty(serverVersion)) { if (serverUtil != null && - serverUtil.getActiveServer() != null && - serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) + serverUtil.getActiveServer() != null && + serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).setCurrentServerVersion(serverVersion); currentServerVersionValue.setText(serverVersion); } else currentServerVersionValue.setText(R.string.not_available); @@ -321,13 +321,13 @@ public void onError(Exception error) { mSwipeRefreshLayout.setRefreshing(false); String message = String.format( - getString(R.string.error_couldNotCheckForUpdates), - mDomoticz.getErrorMessage(error)); + getString(R.string.error_couldNotCheckForUpdates), + mDomoticz.getErrorMessage(error)); showSnackbar(message); if (serverUtil != null && - serverUtil.getActiveServer() != null && - serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) + serverUtil.getActiveServer() != null && + serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this) != null) serverUtil.getActiveServer().getServerUpdateInfo(UpdateActivity.this).setCurrentServerVersion(""); currentServerVersionValue.setText(R.string.not_available); @@ -337,7 +337,7 @@ public void onError(Exception error) { private void showSnackbar(String message) { CoordinatorLayout fragmentCoordinatorLayout = - findViewById(R.id.coordinatorLayout); + findViewById(R.id.coordinatorLayout); if (fragmentCoordinatorLayout != null) { UsefulBits.showSnackbar(this, fragmentCoordinatorLayout, message, Snackbar.LENGTH_SHORT); } @@ -345,9 +345,9 @@ private void showSnackbar(String message) { private void showSimpleDialog(String title, String message) { new MaterialDialog.Builder(this) - .title(title) - .content(message) - .positiveText(R.string.ok) - .show(); + .title(title) + .content(message) + .positiveText(R.string.ok) + .show(); } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java b/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java index f01a9e2b5..adc185976 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/BitmapLruCache.java @@ -27,8 +27,8 @@ import com.android.volley.toolbox.ImageLoader; public class BitmapLruCache - extends LruCache - implements ImageLoader.ImageCache { + extends LruCache + implements ImageLoader.ImageCache { public BitmapLruCache() { this(getDefaultLruCacheSize()); diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java b/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java index 082e5b3fd..03a07afcc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/DeviceUtils.java @@ -36,7 +36,7 @@ public static boolean isAutomatedToggableDevice(DevicesInfo mDeviceInfo) { if (mDeviceInfo.equals(null)) return false; if (mDeviceInfo.getSwitchTypeVal() == 0 && - (mDeviceInfo.getSwitchType() == null)) { + (mDeviceInfo.getSwitchType() == null)) { if (mDeviceInfo.getSubType() != null && mDeviceInfo.getSubType().equals(DomoticzValues.Device.Utility.SubType.SMARTWARES)) { return true; } else { diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java b/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java index dcd48d6b7..8f0ddd381 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/NotificationUtil.java @@ -82,16 +82,16 @@ public static void sendSimpleNotification(int idx, String title, String text, in } NotificationCompat.Builder builder = - new NotificationCompat.Builder(context) - .setSmallIcon(R.drawable.domoticz_white) - .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) - .setContentTitle(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + title : title) - .setContentText(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + text : text) - .setChannelId(CHANNEL_ID) - .setStyle(new NotificationCompat.BigTextStyle().setSummaryText(text)) - //.setGroupSummary(true) - //.setGroup(GROUP_KEY_NOTIFICATIONS) - .setAutoCancel(true); + new NotificationCompat.Builder(context) + .setSmallIcon(R.drawable.domoticz_white) + .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) + .setContentTitle(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + title : title) + .setContentText(alarmNot != null && alarmNot.contains(loggedNotification) ? context.getString(R.string.alarm) + ": " + text : text) + .setChannelId(CHANNEL_ID) + .setStyle(new NotificationCompat.BigTextStyle().setSummaryText(text)) + //.setGroupSummary(true) + //.setGroup(GROUP_KEY_NOTIFICATIONS) + .setAutoCancel(true); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { int nrOfNotifications = 1; @@ -124,7 +124,7 @@ public static void sendSimpleNotification(int idx, String title, String text, in } if (prefUtil.showAutoNotifications()) { builder.extend(new NotificationCompat.CarExtender() - .setUnreadConversation(getUnreadConversation(context, text))); + .setUnreadConversation(getUnreadConversation(context, text))); } mNotificationManager.notify(NOTIFICATION_ID, builder.build()); @@ -140,8 +140,8 @@ private static void CreateChannel(String channelid, int priority, boolean backgr SharedPrefUtil prefUtil = new SharedPrefUtil(context); NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); NotificationChannel channel = new NotificationChannel(channelid, - channelid, - GetPriority(priority)); + channelid, + GetPriority(priority)); if (!backgroundProcess) { channel.setShowBadge(true); @@ -164,12 +164,12 @@ public static Notification getForegroundServiceNotification(Context context, Str } return new NotificationCompat.Builder(context) - .setSmallIcon(R.drawable.domoticz_white) - .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) - .setContentTitle("Domoticz") - .setContentText("Processing widget request..") - .setChannelId(channelid) - .setContentIntent(contentIntent).build(); + .setSmallIcon(R.drawable.domoticz_white) + .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), R.mipmap.ic_launcher)) + .setContentTitle("Domoticz") + .setContentText("Processing widget request..") + .setChannelId(channelid) + .setContentIntent(contentIntent).build(); } private static int GetPriority(int priority) { @@ -224,41 +224,41 @@ public static void sendSimpleNotification(String title, String text, int priorit private static Intent getMessageReadIntent() { return new Intent() - .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) - .setAction(MESSAGE_READ_ACTION) - .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); + .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) + .setAction(MESSAGE_READ_ACTION) + .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); } private static PendingIntent getMessageReadPendingIntent(Context context) { return PendingIntent.getBroadcast(context, - NOTIFICATION_ID, - getMessageReadIntent(), - PendingIntent.FLAG_UPDATE_CURRENT); + NOTIFICATION_ID, + getMessageReadIntent(), + PendingIntent.FLAG_UPDATE_CURRENT); } private static Intent getMessageReplyIntent() { return new Intent() - .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) - .setAction(MESSAGE_REPLY_ACTION) - .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); + .addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES) + .setAction(MESSAGE_REPLY_ACTION) + .putExtra(MESSAGE_CONVERSATION_ID_KEY, NOTIFICATION_ID); } private static PendingIntent getMessageReplyPendingIntent(Context context) { return PendingIntent.getBroadcast(context, - NOTIFICATION_ID, - getMessageReplyIntent(), - PendingIntent.FLAG_UPDATE_CURRENT); + NOTIFICATION_ID, + getMessageReplyIntent(), + PendingIntent.FLAG_UPDATE_CURRENT); } private static RemoteInput getVoiceReplyRemoteInput() { return new RemoteInput.Builder(VOICE_REPLY_KEY) - .setLabel("Reply") - .build(); + .setLabel("Reply") + .build(); } private static NotificationCompat.CarExtender.UnreadConversation getUnreadConversation(Context context, String text) { NotificationCompat.CarExtender.UnreadConversation.Builder unreadConversationBuilder = - new NotificationCompat.CarExtender.UnreadConversation.Builder(UNREAD_CONVERSATION_BUILDER_NAME + text); + new NotificationCompat.CarExtender.UnreadConversation.Builder(UNREAD_CONVERSATION_BUILDER_NAME + text); unreadConversationBuilder.setReadPendingIntent(getMessageReadPendingIntent(context)); unreadConversationBuilder.setReplyAction(getMessageReplyPendingIntent(context), getVoiceReplyRemoteInput()); unreadConversationBuilder.addMessage(text); diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java b/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java index 68f19955c..47031844a 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/PermissionsUtil.java @@ -37,29 +37,29 @@ public class PermissionsUtil { //these permissions are needed for Wifi scanning public static final String[] INITIAL_LOCATION_PERMS = { - Manifest.permission.ACCESS_FINE_LOCATION, - Manifest.permission.ACCESS_COARSE_LOCATION, + Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION, }; //these permissions are needed for storing camera images public static final String[] INITIAL_STORAGE_PERMS = { - Manifest.permission.READ_EXTERNAL_STORAGE, - Manifest.permission.WRITE_EXTERNAL_STORAGE + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE }; //these permissions are needed for getting device id public static final String[] INITIAL_DEVICE_PERMS = { - Manifest.permission.READ_PHONE_STATE + Manifest.permission.READ_PHONE_STATE }; //these permissions are needed for scanning qrcodes public static final String[] INITIAL_CAMERA_PERMS = { - Manifest.permission.CAMERA + Manifest.permission.CAMERA }; //these permissions are needed for recording audio public static final String[] INITIAL_AUDIO_PERMS = { - Manifest.permission.RECORD_AUDIO + Manifest.permission.RECORD_AUDIO }; //these permissions are needed for fingerprint public static final String[] INITIAL_FINGERPRINT_PERMS = { - Manifest.permission.USE_FINGERPRINT + Manifest.permission.USE_FINGERPRINT }; //This range is from 0 to 255!! @@ -101,7 +101,7 @@ public static boolean canAccessAudioState(Context context) { private static boolean hasPermission(String permission, Context context) { // Using ContextCompat.checkSelfPermission will work on all API versions return (PackageManager.PERMISSION_GRANTED - == ContextCompat.checkSelfPermission(context, permission)); + == ContextCompat.checkSelfPermission(context, permission)); } public static AlertDialog getAlertDialog(Context context, final PermissionFragmentHelper permissionFragmentHelper, String title, String description, final String[] permissions) { @@ -114,8 +114,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionFragmentHelper permissionFragmentHelper, String title, String description, final String[] permissions, DialogInterface.OnClickListener oncancel) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.request_again), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -133,8 +133,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionFragmentHelper permissionFragmentHelper, String title, String description, final String permission) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, "Request", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -156,8 +156,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionHelper permissionFragmentHelper, String title, String description, final String[] permissions, DialogInterface.OnClickListener oncancel) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, context.getString(R.string.request_again), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -175,8 +175,8 @@ public void onClick(DialogInterface dialog, int which) { public static AlertDialog getAlertDialog(Context context, final PermissionHelper permissionFragmentHelper, String title, String description, final String permission) { AlertDialog builder = new AlertDialog.Builder(context) - .setTitle(title) - .create(); + .setTitle(title) + .create(); builder.setButton(DialogInterface.BUTTON_POSITIVE, "Request", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java b/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java index 10b17603c..97f4b6ad6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/SerializableManager.java @@ -56,10 +56,10 @@ public static void cleanAllSerializableObjects(Context context) { */ public static void saveSerializable(Context context, Object objectToSave, String fileName) { File SettingsFile = new File(Environment.getExternalStorageDirectory(), - "/Domoticz/DomoticzSettings.txt"); + "/Domoticz/DomoticzSettings.txt"); final String sPath = SettingsFile.getPath(). - substring(0, SettingsFile.getPath().lastIndexOf("/")); + substring(0, SettingsFile.getPath().lastIndexOf("/")); //noinspection unused boolean mkdirsResultIsOk = new File(sPath + "/").mkdirs(); @@ -85,10 +85,10 @@ public static Object readSerializedObject(Context context, String fileName) { Object objectToReturn = null; File SettingsFile = new File(Environment.getExternalStorageDirectory(), - "/Domoticz/DomoticzSettings.txt"); + "/Domoticz/DomoticzSettings.txt"); final String sPath = SettingsFile.getPath(). - substring(0, SettingsFile.getPath().lastIndexOf("/")); + substring(0, SettingsFile.getPath().lastIndexOf("/")); //noinspection unused boolean mkdirsResultIsOk = new File(sPath + "/").mkdirs(); diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java b/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java index 01d4f9aa0..7c7175cc1 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/SharedPrefUtil.java @@ -622,7 +622,7 @@ public int getStartupScreenIndex() { if (startupScreenSelectedValue == null) return 0; else { String[] startupScreenValues = - mContext.getResources().getStringArray(R.array.drawer_actions); + mContext.getResources().getStringArray(R.array.drawer_actions); int i = 0; for (String screen : startupScreenValues) { @@ -640,7 +640,7 @@ public int getStartupScreenIndex() { public void setStartupScreenIndex(int position) { String[] startupScreenValues = - mContext.getResources().getStringArray(R.array.drawer_actions); + mContext.getResources().getStringArray(R.array.drawer_actions); String startupScreenValue; try { @@ -871,7 +871,7 @@ public ArrayList getNFCList() { String jsonNFCs = prefs.getString(PREF_NFC_TAGS, null); Gson gson = new Gson(); NFCInfo[] item = gson.fromJson(jsonNFCs, - NFCInfo[].class); + NFCInfo[].class); nfcs = Arrays.asList(item); for (NFCInfo n : nfcs) { oReturnValue.add(n); @@ -895,7 +895,7 @@ public ArrayList getQRCodeList() { String jsonNFCs = prefs.getString(PREF_QR_CODES, null); Gson gson = new Gson(); QRCodeInfo[] item = gson.fromJson(jsonNFCs, - QRCodeInfo[].class); + QRCodeInfo[].class); qrs = Arrays.asList(item); for (QRCodeInfo n : qrs) { oReturnValue.add(n); @@ -919,7 +919,7 @@ public ArrayList getSpeechList() { String jsonNFCs = prefs.getString(PREF_SPEECH_COMMANDS, null); Gson gson = new Gson(); SpeechInfo[] item = gson.fromJson(jsonNFCs, - SpeechInfo[].class); + SpeechInfo[].class); qrs = Arrays.asList(item); for (SpeechInfo n : qrs) { oReturnValue.add(n); @@ -946,7 +946,7 @@ public ArrayList getLocations() { String jsonLocations = prefs.getString(PREF_GEOFENCE_LOCATIONS, null); Gson gson = new Gson(); LocationInfo[] locationItem = gson.fromJson(jsonLocations, - LocationInfo[].class); + LocationInfo[].class); locations = Arrays.asList(locationItem); for (LocationInfo l : locations) { @@ -959,8 +959,8 @@ public ArrayList getLocations() { if (incorrectDetected) { saveLocations(returnValue); Toast.makeText(mContext, - R.string.geofence_error_recreateLocations, - Toast.LENGTH_LONG).show(); + R.string.geofence_error_recreateLocations, + Toast.LENGTH_LONG).show(); } } else return null; diff --git a/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java b/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java index 3d71c0554..b29adeec6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java +++ b/app/src/main/java/nl/hnogames/domoticz/Utils/UsefulBits.java @@ -89,8 +89,8 @@ public static boolean isEmpty(String string) { //noinspection SimplifiableIfStatement if (string != null) return string.equalsIgnoreCase("") - || string.isEmpty() - || string.length() <= 0; + || string.isEmpty() + || string.length() <= 0; else return true; } @@ -158,7 +158,7 @@ public static String getMd5String(String password) { for (byte aHash : hash) { if ((0xff & aHash) < 0x10) { hexString.append("0" - + Integer.toHexString((0xFF & aHash))); + + Integer.toHexString((0xFF & aHash))); } else { hexString.append(Integer.toHexString(0xFF & aHash)); } @@ -296,9 +296,9 @@ public static void checkDownloadedLanguage(Context context, ServerUtil serverUti showSimpleToast(context, "Downloaded language files did not match the preferred language", Toast.LENGTH_SHORT); Log.d(TAG, "Downloaded language files did not match the preferred language:" + newLine() - + "Current downloaded language: " + downloadedLanguage + newLine() - + "Active language: " + activeLanguage + newLine() - + "Downloading the correct language"); + + "Current downloaded language: " + downloadedLanguage + newLine() + + "Active language: " + activeLanguage + newLine() + + "Downloading the correct language"); mSharedPrefs.getLanguageStringsFromServer(activeLanguage.toLowerCase(), serverUtil); } } @@ -371,14 +371,14 @@ public static void setScheduledTasks(Context context) { @SuppressWarnings("PointlessArithmeticExpression") PeriodicTask task = new PeriodicTask.Builder() - .setService(TaskService.class) // Service to start - .setPersisted(true) // Will survive reboots - .setTag(TASK_TAG_PERIODIC) // Schedule periodic - .setPeriod(60 * 60 * 24 * 1) // Every day - .setFlex(60 * 60 * 8) // Flex of 8 hours - .setRequiredNetwork(Task.NETWORK_STATE_UNMETERED) // Only un metered networks - .setRequiresCharging(true) // Only when charging - .build(); + .setService(TaskService.class) // Service to start + .setPersisted(true) // Will survive reboots + .setTag(TASK_TAG_PERIODIC) // Schedule periodic + .setPeriod(60 * 60 * 24 * 1) // Every day + .setFlex(60 * 60 * 8) // Flex of 8 hours + .setRequiredNetwork(Task.NETWORK_STATE_UNMETERED) // Only un metered networks + .setRequiresCharging(true) // Only when charging + .build(); mGcmNetworkManager.schedule(task); mSharedPrefUtil.setTaskIsScheduled(true); @@ -427,8 +427,8 @@ public void onReceiveAuthentication(AuthInfo auth) { ArrayList mDetailUserInfo = mUserInfo; //also add current user UserInfo currentUser = new UserInfo(domoticz.getUserCredentials(Domoticz.Authentication.USERNAME), - UsefulBits.getMd5String(domoticz.getUserCredentials(Domoticz.Authentication.PASSWORD)), - auth.getRights()); + UsefulBits.getMd5String(domoticz.getUserCredentials(Domoticz.Authentication.PASSWORD)), + auth.getRights()); mDetailUserInfo.add(currentUser); configInfo.setUsers(mDetailUserInfo); @@ -469,8 +469,8 @@ public void onError(Exception error) { public void onError(Exception error) { if (error != null && domoticz != null) showSimpleToast(context, String.format( - context.getString(R.string.error_couldNotCheckForConfig), - domoticz.getErrorMessage(error)), Toast.LENGTH_SHORT); + context.getString(R.string.error_couldNotCheckForConfig), + domoticz.getErrorMessage(error)), Toast.LENGTH_SHORT); if (receiver != null) receiver.onError(error); @@ -491,7 +491,7 @@ public static boolean checkPlayServicesAvailable(final Activity activity) { // Unresolvable error Log.e(TAG, "Google Play services is unavailable."); showSimpleToast(activity, - activity.getString(R.string.google_play_services_unavailable), Toast.LENGTH_SHORT); + activity.getString(R.string.google_play_services_unavailable), Toast.LENGTH_SHORT); return false; } } @@ -533,27 +533,27 @@ public static void showSnackbarWithAction(Context context, CoordinatorLayout coo View.OnClickListener onclickListener, String actiontext) { try { if (context != null && - coordinatorLayout != null && - !UsefulBits.isEmpty(message)) { + coordinatorLayout != null && + !UsefulBits.isEmpty(message)) { if (onclickListener == null || UsefulBits.isEmpty(actiontext)) { if (callback != null) { Snackbar.make(coordinatorLayout, message, length) - .setCallback(callback) - .show(); + .setCallback(callback) + .show(); } else { Snackbar.make(coordinatorLayout, message, length) - .show(); + .show(); } } else { if (callback != null) { Snackbar.make(coordinatorLayout, message, length) - .setAction(actiontext, onclickListener) - .setCallback(callback) - .show(); + .setAction(actiontext, onclickListener) + .setCallback(callback) + .show(); } else { Snackbar.make(coordinatorLayout, message, length) - .setAction(actiontext, onclickListener) - .show(); + .setAction(actiontext, onclickListener) + .show(); } } } @@ -572,8 +572,8 @@ public static void openPremiumAppStore(Context context) { if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) { ActivityInfo otherAppActivity = otherApp.activityInfo; ComponentName componentName = new ComponentName( - otherAppActivity.applicationInfo.packageName, - otherAppActivity.name + otherAppActivity.applicationInfo.packageName, + otherAppActivity.name ); rateIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); rateIntent.setComponent(componentName); @@ -608,26 +608,25 @@ public static void checkAPK(final Context context, final SharedPrefUtil mSharedP //TODO: Implement correct piracychecker for this app!! mSharedPrefs.setAPKValidated(true); return; - } - else { + } else { // release build PiracyChecker oPiracyChecker = new PiracyChecker(context); oPiracyChecker - .enableSigningCertificate(context.getString(R.string.APK_VALIDATE_PROD)) - .enableGooglePlayLicensing(context.getString(R.string.APK_LICENSE_PREMIUM)) - .enableInstallerId(InstallerID.GOOGLE_PLAY) - .callback(new PiracyCheckerCallback() { - @Override - public void allow() { - mSharedPrefs.setAPKValidated(true); - } + .enableSigningCertificate(context.getString(R.string.APK_VALIDATE_PROD)) + .enableGooglePlayLicensing(context.getString(R.string.APK_LICENSE_PREMIUM)) + .enableInstallerId(InstallerID.GOOGLE_PLAY) + .callback(new PiracyCheckerCallback() { + @Override + public void allow() { + mSharedPrefs.setAPKValidated(true); + } - @Override - public void dontAllow(@NonNull PiracyCheckerError piracyCheckerError, @Nullable PirateApp pirateApp) { - mSharedPrefs.setAPKValidated(false); - } - }) - .start(); + @Override + public void dontAllow(@NonNull PiracyCheckerError piracyCheckerError, @Nullable PirateApp pirateApp) { + mSharedPrefs.setAPKValidated(false); + } + }) + .start(); } } } \ No newline at end of file diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java index 7113e57ce..b82db2bcd 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/SetupServerSettings.java @@ -73,9 +73,9 @@ public class SetupServerSettings extends Fragment implements OnPermissionCallbac private ServerUtil mServerUtil; private EditText remote_server_input, remote_port_input, - remote_username_input, remote_password_input, - remote_directory_input, local_server_input, local_password_input, - local_username_input, local_port_input, local_directory_input, server_name_input; + remote_username_input, remote_password_input, + remote_directory_input, local_server_input, local_password_input, + local_username_input, local_port_input, local_directory_input, server_name_input; private Spinner remote_protocol_spinner, local_protocol_spinner, startScreen_spinner; private Switch localServer_switch; @@ -167,27 +167,27 @@ private void getLayoutReferences() { @Override public void onClick(View v) { new MaterialDialog.Builder(getContext()) - .title(R.string.welcome_ssid_button_prompt) - .content(R.string.welcome_msg_no_ssid_found) - .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) - .input(null, null, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); - final ArrayList ssidListFromPrefs = new ArrayList<>(); - if (ssidFromPrefs != null) { - if (ssidFromPrefs.size() > 0) { - for (String wifi : ssidFromPrefs) { - ssidListFromPrefs.add(wifi); + .title(R.string.welcome_ssid_button_prompt) + .content(R.string.welcome_msg_no_ssid_found) + .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) + .input(null, null, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); + final ArrayList ssidListFromPrefs = new ArrayList<>(); + if (ssidFromPrefs != null) { + if (ssidFromPrefs.size() > 0) { + for (String wifi : ssidFromPrefs) { + ssidListFromPrefs.add(wifi); + } } } - } - ssidListFromPrefs.add(String.valueOf(input)); - mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); - setSsid_spinner(); - } - }).show(); + ssidListFromPrefs.add(String.valueOf(input)); + mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); + setSsid_spinner(); + } + }).show(); } }); @@ -196,7 +196,7 @@ public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { v.findViewById(R.id.server_settings_title).setVisibility(View.GONE); final LinearLayout localServerSettingsLayout = (LinearLayout) - v.findViewById(R.id.local_server_settings); + v.findViewById(R.id.local_server_settings); localServer_switch = (Switch) v.findViewById(R.id.localServer_switch); localServer_switch.setChecked(false);//default setting localServer_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @@ -208,7 +208,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { }); final LinearLayout advancedSettings_layout = (LinearLayout) - v.findViewById(R.id.advancedSettings_layout); + v.findViewById(R.id.advancedSettings_layout); advancedSettings_switch = (Switch) v.findViewById(R.id.advancedSettings_switch); advancedSettings_layout.setVisibility(View.INVISIBLE); advancedSettings_switch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @@ -262,10 +262,10 @@ private void checkConnectionData() { if (!UsefulBits.isEmpty(status)) { showErrorPopup(getString(R.string.welcome_msg_connectionDataIncomplete) + "\n\n" + status + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else if (!mDomoticz.isUrlValid(newServer)) { showErrorPopup(getString(R.string.welcome_msg_connectionDataInvalid) + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else if (!isUpdateRequest && !mServerUtil.checkUniqueServerName(newServer)) { showErrorPopup("Server name must be unique!"); } else { @@ -275,15 +275,15 @@ private void checkConnectionData() { private void showErrorPopup(String error) { new AlertDialog.Builder(getActivity()) - .setIcon(android.R.drawable.ic_dialog_info) - .setTitle("Failed") - .setMessage(error) - .setPositiveButton(this.getString(R.string.yes), new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - } - }) - .show(); + .setIcon(android.R.drawable.ic_dialog_info) + .setTitle("Failed") + .setMessage(error) + .setPositiveButton(this.getString(R.string.yes), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + } + }) + .show(); } private void setPreferenceValues() { @@ -372,7 +372,7 @@ public void ReceiveSSIDs(CharSequence[] ssidFound) { private void setProtocol_spinner() { String[] protocols = getResources().getStringArray(R.array.remote_server_protocols); ArrayAdapter protocolAdapter - = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); + = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); remote_protocol_spinner.setAdapter(protocolAdapter); remote_protocol_spinner.setSelection(getPrefsDomoticzRemoteSecureIndex()); remote_protocol_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @@ -408,7 +408,7 @@ private void setStartScreen_spinner() { String[] startScreens = getResources().getStringArray(R.array.drawer_actions); ArrayAdapter startScreenAdapter - = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, startScreens); + = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, startScreens); startScreen_spinner.setAdapter(startScreenAdapter); if (mSharedPrefs != null) @@ -430,17 +430,17 @@ private void buildServerInfo() { newServer = new ServerInfo(); newServer.setRemoteServerUsername( - remote_username_input.getText().toString().trim()); + remote_username_input.getText().toString().trim()); newServer.setRemoteServerPassword( - remote_password_input.getText().toString().trim()); + remote_password_input.getText().toString().trim()); newServer.setRemoteServerUrl( - remote_server_input.getText().toString().trim()); + remote_server_input.getText().toString().trim()); newServer.setRemoteServerPort( - remote_port_input.getText().toString().trim()); + remote_port_input.getText().toString().trim()); newServer.setRemoteServerDirectory( - remote_directory_input.getText().toString().trim()); + remote_directory_input.getText().toString().trim()); newServer.setRemoteServerSecure( - getSpinnerDomoticzRemoteSecureBoolean()); + getSpinnerDomoticzRemoteSecureBoolean()); newServer.setEnabled(false); if (!localServer_switch.isChecked()) { @@ -448,17 +448,17 @@ private void buildServerInfo() { newServer.setIsLocalServerAddressDifferent(false); } else { newServer.setLocalServerUsername( - local_username_input.getText().toString().trim()); + local_username_input.getText().toString().trim()); newServer.setLocalServerPassword( - local_password_input.getText().toString().trim()); + local_password_input.getText().toString().trim()); newServer.setLocalServerUrl( - local_server_input.getText().toString().trim()); + local_server_input.getText().toString().trim()); newServer.setLocalServerPort( - local_port_input.getText().toString().trim()); + local_port_input.getText().toString().trim()); newServer.setLocalServerDirectory( - local_directory_input.getText().toString().trim()); + local_directory_input.getText().toString().trim()); newServer.setLocalServerSecure( - getSpinnerDomoticzLocalSecureBoolean()); + getSpinnerDomoticzLocalSecureBoolean()); newServer.setIsLocalServerAddressDifferent(true); } @@ -550,13 +550,13 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionFragmentHelper.declinedPermissions(this, PermissionsUtil.INITIAL_LOCATION_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - if (mPhoneConnectionUtil != null) - mPhoneConnectionUtil.stopReceiver(); - } - }); + getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if (mPhoneConnectionUtil != null) + mPhoneConnectionUtil.stopReceiver(); + } + }); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java index 17ed2eae1..73692edfc 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage2.java @@ -68,7 +68,7 @@ public void onClick(View v) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (!PermissionsUtil.canAccessStorage(getActivity())) { permissionFragmentHelper - .request(PermissionsUtil.INITIAL_STORAGE_PERMS); + .request(PermissionsUtil.INITIAL_STORAGE_PERMS); } else { importSettings(); } @@ -97,7 +97,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionFragmentHelper.declinedPermissions(this, PermissionsUtil.INITIAL_STORAGE_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_storage), neededPermission); + getActivity().getString(R.string.permission_desc_storage), neededPermission); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java index c9435bef6..41395c581 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage3.java @@ -70,9 +70,9 @@ public class WelcomePage3 extends Fragment implements OnPermissionCallback { private ServerUtil mServerUtil; private EditText remote_server_input, remote_port_input, - remote_username_input, remote_password_input, - remote_directory_input, local_server_input, local_password_input, - local_username_input, local_port_input, local_directory_input; + remote_username_input, remote_password_input, + remote_directory_input, local_server_input, local_password_input, + local_username_input, local_port_input, local_directory_input; private Spinner remote_protocol_spinner, local_protocol_spinner, startScreen_spinner; private Switch localServer_switch; @@ -152,27 +152,27 @@ private void getLayoutReferences() { @Override public void onClick(View v) { new MaterialDialog.Builder(getContext()) - .title(R.string.welcome_ssid_button_prompt) - .content(R.string.welcome_msg_no_ssid_found) - .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) - .input(null, null, new MaterialDialog.InputCallback() { - @Override - public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { - Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); - final ArrayList ssidListFromPrefs = new ArrayList<>(); - if (ssidFromPrefs != null) { - if (ssidFromPrefs.size() > 0) { - for (String wifi : ssidFromPrefs) { - ssidListFromPrefs.add(wifi); + .title(R.string.welcome_ssid_button_prompt) + .content(R.string.welcome_msg_no_ssid_found) + .inputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD) + .input(null, null, new MaterialDialog.InputCallback() { + @Override + public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { + Set ssidFromPrefs = mServerUtil.getActiveServer().getLocalServerSsid(); + final ArrayList ssidListFromPrefs = new ArrayList<>(); + if (ssidFromPrefs != null) { + if (ssidFromPrefs.size() > 0) { + for (String wifi : ssidFromPrefs) { + ssidListFromPrefs.add(wifi); + } } } - } - ssidListFromPrefs.add(String.valueOf(input)); - mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); + ssidListFromPrefs.add(String.valueOf(input)); + mServerUtil.getActiveServer().setLocalServerSsid(ssidListFromPrefs); - setSsid_spinner(); - } - }).show(); + setSsid_spinner(); + } + }).show(); } }); @@ -184,7 +184,7 @@ public void onInput(@NonNull MaterialDialog dialog, CharSequence input) { } final LinearLayout localServerSettingsLayout = (LinearLayout) - v.findViewById(R.id.local_server_settings); + v.findViewById(R.id.local_server_settings); localServer_switch = (Switch) v.findViewById(R.id.localServer_switch); localServer_switch.setChecked(mSharedPrefs.isAdvancedSettingsEnabled()); @@ -198,7 +198,7 @@ public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { localServerSettingsLayout.setVisibility(mServerUtil.getActiveServer().getIsLocalServerAddressDifferent() ? View.VISIBLE : View.GONE); final LinearLayout advancedSettings_layout = (LinearLayout) - v.findViewById(R.id.advancedSettings_layout); + v.findViewById(R.id.advancedSettings_layout); Switch advancedSettings_switch = (Switch) v.findViewById(R.id.advancedSettings_switch); advancedSettings_switch.setChecked(mSharedPrefs.isAdvancedSettingsEnabled()); @@ -315,7 +315,7 @@ public void ReceiveSSIDs(CharSequence[] ssidFound) { private void setProtocol_spinner() { String[] protocols = getResources().getStringArray(R.array.remote_server_protocols); ArrayAdapter protocolAdapter - = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); + = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, protocols); remote_protocol_spinner.setAdapter(protocolAdapter); remote_protocol_spinner.setSelection(getPrefsDomoticzRemoteSecureIndex()); remote_protocol_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @@ -348,7 +348,7 @@ public void onNothingSelected(AdapterView adapterView) { private void setStartScreen_spinner() { String[] startScreens = getResources().getStringArray(R.array.drawer_actions); ArrayAdapter startScreenAdapter - = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, startScreens); + = new ArrayAdapter<>(getActivity(), R.layout.spinner_list_item, startScreens); startScreen_spinner.setAdapter(startScreenAdapter); startScreen_spinner.setSelection(mSharedPrefs.getStartupScreenIndex()); startScreen_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @@ -366,17 +366,17 @@ public void onNothingSelected(AdapterView adapterView) { private void writePreferenceValues() { mServerUtil.getActiveServer().setRemoteServerUsername( - remote_username_input.getText().toString().trim()); + remote_username_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerPassword( - remote_password_input.getText().toString().trim()); + remote_password_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerUrl( - remote_server_input.getText().toString().trim()); + remote_server_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerPort( - remote_port_input.getText().toString().trim()); + remote_port_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerDirectory( - remote_directory_input.getText().toString().trim()); + remote_directory_input.getText().toString().trim()); mServerUtil.getActiveServer().setRemoteServerSecure( - getSpinnerDomoticzRemoteSecureBoolean()); + getSpinnerDomoticzRemoteSecureBoolean()); if (callingInstance == WELCOME_WIZARD) mSharedPrefs.setStartupScreenIndex(startScreenSelectedPosition); @@ -386,17 +386,17 @@ private void writePreferenceValues() { mServerUtil.getActiveServer().setIsLocalServerAddressDifferent(false); } else { mServerUtil.getActiveServer().setLocalServerUsername( - local_username_input.getText().toString().trim()); + local_username_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerPassword( - local_password_input.getText().toString().trim()); + local_password_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerUrl( - local_server_input.getText().toString().trim()); + local_server_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerPort( - local_port_input.getText().toString().trim()); + local_port_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerDirectory( - local_directory_input.getText().toString().trim()); + local_directory_input.getText().toString().trim()); mServerUtil.getActiveServer().setLocalServerSecure( - getSpinnerDomoticzLocalSecureBoolean()); + getSpinnerDomoticzLocalSecureBoolean()); mServerUtil.getActiveServer().setIsLocalServerAddressDifferent(true); } @@ -467,13 +467,13 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { Log.i("onPermissionDeclined", "Permission(s) " + Arrays.toString(permissionName) + " Declined"); String[] neededPermission = PermissionFragmentHelper.declinedPermissions(this, PermissionsUtil.INITIAL_LOCATION_PERMS); AlertDialog alert = PermissionsUtil.getAlertDialog(getActivity(), permissionFragmentHelper, getActivity().getString(R.string.permission_title), - getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - if (mPhoneConnectionUtil != null) - mPhoneConnectionUtil.stopReceiver(); - } - }); + getActivity().getString(R.string.permission_desc_location), neededPermission, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + if (mPhoneConnectionUtil != null) + mPhoneConnectionUtil.stopReceiver(); + } + }); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java index 5415dd11d..d4dee2714 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java @@ -80,10 +80,10 @@ private void checkConnectionData() { if (!mDomoticz.isConnectionDataComplete(mServerUtil.getActiveServer())) { setResultText(getString(R.string.welcome_msg_connectionDataIncomplete) + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else if (!mDomoticz.isUrlValid(mServerUtil.getActiveServer())) { setResultText(getString(R.string.welcome_msg_connectionDataInvalid) + "\n\n" - + getString(R.string.welcome_msg_correctOnPreviousPage)); + + getString(R.string.welcome_msg_correctOnPreviousPage)); } else { mDomoticz.getServerVersion(new VersionReceiver() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java index eb9061df3..4089c5f5b 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java @@ -57,26 +57,26 @@ protected void onCreate(Bundle savedInstanceState) { UsefulBits.checkAPK(this, new SharedPrefUtil(this)); addSlide(new SimpleSlide.Builder() - .image(R.mipmap.ic_launcher) - .title(R.string.app_name_domoticz) - .description(R.string.welcome_info_domoticz) - .background(R.color.black) - .build()); + .image(R.mipmap.ic_launcher) + .title(R.string.app_name_domoticz) + .description(R.string.welcome_info_domoticz) + .background(R.color.black) + .build()); addSlide(new FragmentSlide.Builder() - .background(R.color.welcome2_background) - .fragment(WelcomePage2.newInstance()) - .build()); + .background(R.color.welcome2_background) + .fragment(WelcomePage2.newInstance()) + .build()); addSlide(new FragmentSlide.Builder() - .background(!mSharedPrefs.darkThemeEnabled() ? R.color.welcome4_background : R.color.primary_dark) - .fragment(WelcomePage3.newInstance(WELCOME_WIZARD)) - .build()); + .background(!mSharedPrefs.darkThemeEnabled() ? R.color.welcome4_background : R.color.primary_dark) + .fragment(WelcomePage3.newInstance(WELCOME_WIZARD)) + .build()); addSlide(new FragmentSlide.Builder() - .background(!mSharedPrefs.darkThemeEnabled() ? R.color.welcome4_background : R.color.primary_dark) - .fragment(WelcomePage4.newInstance()) - .build()); + .background(!mSharedPrefs.darkThemeEnabled() ? R.color.welcome4_background : R.color.primary_dark) + .fragment(WelcomePage4.newInstance()) + .build()); addOnPageChangeListener(new ViewPager.OnPageChangeListener() { @Override diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java index a294b77d2..92cf3dd75 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetConfigurationActivity.java @@ -102,10 +102,10 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onClick(View view) { InputMethodManager imm = - (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE); + (InputMethodManager) getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(editPin.getWindowToken(), 0); final String password = - UsefulBits.getMd5String(editPin.getText().toString()); + UsefulBits.getMd5String(editPin.getText().toString()); if (UsefulBits.isEmpty(password)) { Toast.makeText(getApplicationContext(), getString(R.string.security_wrong_code), Toast.LENGTH_LONG).show(); return; @@ -119,7 +119,7 @@ public void onReceiveSettings(SettingsInfo settings) { if (validatePassword(password)) { if (sSecurityPanel != null) { getBackground(sSecurityPanel, password, getApplicationContext().getString(R.string.status) + ": " + - String.valueOf(sSecurityPanel.getData())); + String.valueOf(sSecurityPanel.getData())); } } else Toast.makeText(getApplicationContext(), getString(R.string.security_wrong_code), Toast.LENGTH_LONG).show(); @@ -134,7 +134,7 @@ public void onError(Exception error) { if (validatePassword(password)) { if (sSecurityPanel != null) { getBackground(sSecurityPanel, password, getApplicationContext().getString(R.string.status) + ": " + - String.valueOf(sSecurityPanel.getData())); + String.valueOf(sSecurityPanel.getData())); } } else Toast.makeText(getApplicationContext(), getString(R.string.security_wrong_code), Toast.LENGTH_LONG).show(); @@ -171,17 +171,17 @@ public void onError(Exception error) { private void getBackground(final DevicesInfo mSelectedSwitch, final String password, final String value) { new MaterialDialog.Builder(this) - .title(this.getString(R.string.widget_background)) - .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) - .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { - @Override - public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - showAppWidget(mSelectedSwitch, value, password, getWidgetLayout(String.valueOf(text))); - return true; - } - }) - .positiveText(R.string.ok) - .show(); + .title(this.getString(R.string.widget_background)) + .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) + .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { + @Override + public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + showAppWidget(mSelectedSwitch, value, password, getWidgetLayout(String.valueOf(text))); + return true; + } + }) + .positiveText(R.string.ok) + .show(); } private int getWidgetLayout(String background) { @@ -235,12 +235,12 @@ public void onReceiveDevices(final ArrayList mDevicesInfo) { boolean deviceFound = false; for (DevicesInfo d : mDevicesInfo) { if (!UsefulBits.isEmpty(d.getSwitchType()) && - d.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY)) { + d.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY)) { if (d.getSubType().equals(DomoticzValues.Device.SubType.Name.SECURITYPANEL)) { sSecurityPanel = d; txtTitle.setText(sSecurityPanel.getName()); txtStatus.setText(getApplicationContext().getString(R.string.status) + ": " + - String.valueOf(sSecurityPanel.getData())); + String.valueOf(sSecurityPanel.getData())); deviceFound = true; } } @@ -277,10 +277,10 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String value, String pin if (extras != null) { mAppWidgetId = extras.getInt(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); mSharedPrefs.setSecurityWidgetIDX(mAppWidgetId, idx, value, pin, layout); Intent startService = new Intent(SecurityWidgetConfigurationActivity.this, - SecurityWidgetProvider.UpdateSecurityWidgetService.class); + SecurityWidgetProvider.UpdateSecurityWidgetService.class); startService.putExtra(EXTRA_APPWIDGET_ID, mAppWidgetId); startService.setAction("FROM CONFIGURATION ACTIVITY"); startService(startService); diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java index d248fbaaa..e6c6f91c6 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetIntentService.java @@ -87,18 +87,18 @@ private void processRequest(final int idx, final int status, final String passwo public void onReceiveResult(String result) { if (action == DomoticzValues.Security.Status.ARMAWAY) { Toast.makeText(mContext, mContext.getString(R.string.status) + ": " + - mContext.getString(R.string.security_arm_away), - Toast.LENGTH_LONG).show(); + mContext.getString(R.string.security_arm_away), + Toast.LENGTH_LONG).show(); } else if (action == DomoticzValues.Security.Status.ARMHOME) { Toast.makeText(mContext, mContext.getString(R.string.status) + ": " + - mContext.getString(R.string.security_arm_home), - Toast.LENGTH_LONG).show(); + mContext.getString(R.string.security_arm_home), + Toast.LENGTH_LONG).show(); } else if (action == DomoticzValues.Security.Status.DISARM) { Toast.makeText(mContext, mContext.getString(R.string.status) + ": " + - mContext.getString(R.string.security_disarm), - Toast.LENGTH_LONG).show(); + mContext.getString(R.string.security_disarm), + Toast.LENGTH_LONG).show(); } WidgetUtils.RefreshWidgets(mContext); } @@ -107,8 +107,8 @@ public void onReceiveResult(String result) { public void onError(Exception error) { Log.e("SECURITYWIDGET", domoticz.getErrorMessage(error)); Toast.makeText(mContext, - mContext.getString(R.string.security_generic_error), - Toast.LENGTH_SHORT).show(); + mContext.getString(R.string.security_generic_error), + Toast.LENGTH_SHORT).show(); } }); } diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java index 2a0f52c22..1f8876273 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SecurityWidgetProvider.java @@ -87,7 +87,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, // Get all ids ComponentName thisWidget = new ComponentName(context, - SecurityWidgetProvider.class); + SecurityWidgetProvider.class); int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); if (allWidgetIds != null) { for (int mAppWidgetId : allWidgetIds) { @@ -114,10 +114,10 @@ public int onStartCommand(Intent intent, int flags, int startId) { this.startForeground(1337, NotificationUtil.getForegroundServiceNotification(this, "Widget")); } AppWidgetManager appWidgetManager = AppWidgetManager - .getInstance(UpdateSecurityWidgetService.this); + .getInstance(UpdateSecurityWidgetService.this); try { int incomingAppWidgetId = intent.getIntExtra(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (incomingAppWidgetId != INVALID_APPWIDGET_ID) { try { updateAppWidget(appWidgetManager, incomingAppWidgetId); @@ -166,24 +166,24 @@ public void onReceiveDevice(DevicesInfo s) { views = new RemoteViews(packageName, mSharedPrefs.getSecurityWidgetLayout(appWidgetId)); views.setTextViewText(R.id.title, s.getName()); views.setTextViewText(R.id.status, getApplicationContext().getString(R.string.status) + ": " + - String.valueOf(s.getData())); + String.valueOf(s.getData())); views.setOnClickPendingIntent(R.id.armhome, buildButtonPendingIntent( - UpdateSecurityWidgetService.this, - appWidgetId, - s.getIdx(), ACTION_WIDGET_ARMHOME, password)); + UpdateSecurityWidgetService.this, + appWidgetId, + s.getIdx(), ACTION_WIDGET_ARMHOME, password)); views.setViewVisibility(R.id.armhome, View.VISIBLE); views.setOnClickPendingIntent(R.id.armaway, buildButtonPendingIntent( - UpdateSecurityWidgetService.this, - appWidgetId, - s.getIdx(), ACTION_WIDGET_ARMAWAY, password)); + UpdateSecurityWidgetService.this, + appWidgetId, + s.getIdx(), ACTION_WIDGET_ARMAWAY, password)); views.setViewVisibility(R.id.armaway, View.VISIBLE); views.setOnClickPendingIntent(R.id.disarm, buildButtonPendingIntent( - UpdateSecurityWidgetService.this, - appWidgetId, - s.getIdx(), ACTION_WIDGET_DISARM, password)); + UpdateSecurityWidgetService.this, + appWidgetId, + s.getIdx(), ACTION_WIDGET_DISARM, password)); views.setViewVisibility(R.id.disarm, View.VISIBLE); views.setImageViewResource(R.id.rowIcon, DomoticzIcons.getDrawableIcon(s.getTypeImg(), s.getType(), s.getSwitchType(), true, s.getUseCustomImage(), s.getImage())); diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java index 058313191..2a147140b 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/SmallWidgetConfigurationActivity.java @@ -161,7 +161,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) if (mDeviceInfo.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - SmallWidgetConfigurationActivity.this, domoticz); + SmallWidgetConfigurationActivity.this, domoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -208,15 +208,15 @@ public void onError(Exception error) { private void showSelectorDialog(final DevicesInfo selector, final String pass) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - getBackground(selector, pass, String.valueOf(text)); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + getBackground(selector, pass, String.valueOf(text)); + } + }) + .show(); } private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { @@ -238,17 +238,17 @@ private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { private void getBackground(final DevicesInfo mSelectedSwitch, final String password, final String value) { new MaterialDialog.Builder(this) - .title(this.getString(R.string.widget_background)) - .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) - .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { - @Override - public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); - return true; - } - }) - .positiveText(R.string.ok) - .show(); + .title(this.getString(R.string.widget_background)) + .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) + .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { + @Override + public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); + return true; + } + }) + .positiveText(R.string.ok) + .show(); } private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String value, int layoutId) { @@ -258,7 +258,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String int idx = mSelectedSwitch.getIdx(); if (extras != null) { mAppWidgetId = extras.getInt(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (UsefulBits.isEmpty(mSelectedSwitch.getType())) { Log.i(TAG, "Widget without a type saved"); @@ -274,7 +274,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String } Intent startService = new Intent(SmallWidgetConfigurationActivity.this, - WidgetProviderSmall.UpdateWidgetService.class); + WidgetProviderSmall.UpdateWidgetService.class); startService.putExtra(EXTRA_APPWIDGET_ID, mAppWidgetId); startService.setAction("FROM CONFIGURATION ACTIVITY"); startService(startService); @@ -302,7 +302,7 @@ public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_search, menu); MenuItem searchMenuItem = menu.findItem(R.id.search); searchViewAction = (SearchView) MenuItemCompat - .getActionView(searchMenuItem); + .getActionView(searchMenuItem); searchViewAction.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { @@ -321,14 +321,14 @@ public boolean onQueryTextChange(String newText) { private boolean SmallWidgetSupported(DevicesInfo s) { if (s != null) { if (s.getSwitchTypeVal() == 0 && - (UsefulBits.isEmpty(s.getSwitchType()))) { + (UsefulBits.isEmpty(s.getSwitchType()))) { switch (s.getType()) { case DomoticzValues.Scene.Type.SCENE: case DomoticzValues.Scene.Type.GROUP: return true; } } else if (s.getSwitchTypeVal() == 0 && - (s.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY))) { + (s.getSwitchType().equals(DomoticzValues.Device.Type.Name.SECURITY))) { return false; //security panel is not supported for small widgets } else { switch (s.getSwitchTypeVal()) { diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java index d16fd3be5..2436f93c5 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetConfigurationActivity.java @@ -153,7 +153,7 @@ public void onItemClick(AdapterView parent, View view, int position, long id) final DevicesInfo mDeviceInfo = (DevicesInfo) adapter.getItem(position); if (mDeviceInfo.isProtected()) { PasswordDialog passwordDialog = new PasswordDialog( - WidgetConfigurationActivity.this, domoticz); + WidgetConfigurationActivity.this, domoticz); passwordDialog.show(); passwordDialog.onDismissListener(new PasswordDialog.DismissListener() { @Override @@ -200,15 +200,15 @@ public void onError(Exception error) { private void showSelectorDialog(final DevicesInfo selector, final String pass) { final ArrayList levelNames = selector.getLevelNames(); new MaterialDialog.Builder(this) - .title(R.string.selector_value) - .items(levelNames) - .itemsCallback(new MaterialDialog.ListCallback() { - @Override - public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - getBackground(selector, pass, String.valueOf(text)); - } - }) - .show(); + .title(R.string.selector_value) + .items(levelNames) + .itemsCallback(new MaterialDialog.ListCallback() { + @Override + public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + getBackground(selector, pass, String.valueOf(text)); + } + }) + .show(); } private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { @@ -257,17 +257,17 @@ private int getWidgetLayout(String background, DevicesInfo mSelectedSwitch) { private void getBackground(final DevicesInfo mSelectedSwitch, final String password, final String value) { new MaterialDialog.Builder(this) - .title(this.getString(R.string.widget_background)) - .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) - .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { - @Override - public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { - showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); - return true; - } - }) - .positiveText(R.string.ok) - .show(); + .title(this.getString(R.string.widget_background)) + .items(new String[]{this.getString(R.string.widget_dark), this.getString(R.string.widget_light), this.getString(R.string.widget_transparent_dark), this.getString(R.string.widget_transparent_light)}) + .itemsCallbackSingleChoice(-1, new MaterialDialog.ListCallbackSingleChoice() { + @Override + public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) { + showAppWidget(mSelectedSwitch, password, value, getWidgetLayout(String.valueOf(text), mSelectedSwitch)); + return true; + } + }) + .positiveText(R.string.ok) + .show(); } private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String value, int layoutId) { @@ -277,7 +277,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String int idx = mSelectedSwitch.getIdx(); if (extras != null) { mAppWidgetId = extras.getInt(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (UsefulBits.isEmpty(mSelectedSwitch.getType())) { Log.i(TAG, "Widget without a type saved"); mSharedPrefs.setWidgetIDX(mAppWidgetId, idx, false, password, value, layoutId); @@ -291,7 +291,7 @@ private void showAppWidget(DevicesInfo mSelectedSwitch, String password, String } } Intent startService = new Intent(WidgetConfigurationActivity.this, - WidgetProviderLarge.UpdateWidgetService.class); + WidgetProviderLarge.UpdateWidgetService.class); startService.putExtra(EXTRA_APPWIDGET_ID, mAppWidgetId); startService.setAction("FROM CONFIGURATION ACTIVITY"); startService(startService); @@ -318,7 +318,7 @@ public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_search, menu); MenuItem searchMenuItem = menu.findItem(R.id.search); searchViewAction = (SearchView) MenuItemCompat - .getActionView(searchMenuItem); + .getActionView(searchMenuItem); searchViewAction.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { @@ -338,7 +338,7 @@ private int withButtons(DevicesInfo s) { int withButton = 0; if (s != null) { if (s.getSwitchTypeVal() == 0 && - (UsefulBits.isEmpty(s.getSwitchType()))) { + (UsefulBits.isEmpty(s.getSwitchType()))) { switch (s.getType()) { case DomoticzValues.Scene.Type.SCENE: withButton = BUTTON_TOGGLE; diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java index 6326cd65b..2737d6646 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetIntentService.java @@ -116,8 +116,8 @@ private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) { return true; if (mExtendedStatusInfo.getSwitchTypeVal() == 0 && - (mExtendedStatusInfo.getSwitchType() == null || - UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { + (mExtendedStatusInfo.getSwitchType() == null || + UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { switch (mExtendedStatusInfo.getType()) { case DomoticzValues.Scene.Type.GROUP: return true; @@ -147,8 +147,8 @@ private boolean isOnOffSwitch(DevicesInfo mExtendedStatusInfo) { private boolean isPushOnSwitch(DevicesInfo mExtendedStatusInfo) { if (mExtendedStatusInfo.getSwitchTypeVal() == 0 && - (mExtendedStatusInfo.getSwitchType() == null || - UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { + (mExtendedStatusInfo.getSwitchType() == null || + UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { switch (mExtendedStatusInfo.getType()) { case DomoticzValues.Scene.Type.SCENE: return true; @@ -167,8 +167,8 @@ private boolean isPushOnSwitch(DevicesInfo mExtendedStatusInfo) { private boolean isPushOffSwitch(DevicesInfo mExtendedStatusInfo) { if (mExtendedStatusInfo.getSwitchTypeVal() == 0 && - (mExtendedStatusInfo.getSwitchType() == null || - UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { + (mExtendedStatusInfo.getSwitchType() == null || + UsefulBits.isEmpty(mExtendedStatusInfo.getSwitchType()))) { return false; } else switch (mExtendedStatusInfo.getSwitchTypeVal()) { @@ -343,7 +343,7 @@ public void onSwitchClick(final DevicesInfo clickedSwitch, boolean checked, Domo int jsonValue = 0; if (clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDS || - clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { + clickedSwitch.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDPERCENTAGE) { if (checked) jsonAction = DomoticzValues.Device.Switch.Action.OFF; else { jsonAction = DomoticzValues.Device.Switch.Action.ON; diff --git a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java index 289bda314..e133ae580 100644 --- a/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java +++ b/app/src/main/java/nl/hnogames/domoticz/Widgets/WidgetProviderLarge.java @@ -75,7 +75,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, packageName = context.getPackageName(); ComponentName thisWidget = new ComponentName(context, - WidgetProviderLarge.class); + WidgetProviderLarge.class); int[] allWidgetIds = appWidgetManager.getAppWidgetIds(thisWidget); if (allWidgetIds != null) { @@ -107,10 +107,10 @@ public int onStartCommand(Intent intent, int flags, int startId) { try { AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this - .getApplicationContext()); + .getApplicationContext()); int incomingAppWidgetId = intent.getIntExtra(EXTRA_APPWIDGET_ID, - INVALID_APPWIDGET_ID); + INVALID_APPWIDGET_ID); if (incomingAppWidgetId != INVALID_APPWIDGET_ID) { updateAppWidget(appWidgetManager, incomingAppWidgetId); } @@ -142,11 +142,11 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, views.setImageViewResource(R.id.rowIcon, R.drawable.mic); views.setTextViewText(R.id.on_button, "GO"); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); appWidgetManager.updateAppWidget(appWidgetId, views); } else if (idx == iQRCodeAction) { @@ -155,11 +155,11 @@ public void updateAppWidget(final AppWidgetManager appWidgetManager, views.setImageViewResource(R.id.rowIcon, R.drawable.qrcode); views.setTextViewText(R.id.on_button, "GO"); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); appWidgetManager.updateAppWidget(appWidgetId, views); } else { @@ -184,7 +184,7 @@ public void onReceiveDevice(DevicesInfo s) { if (s.getCounterToday() != null && s.getCounterToday().length() > 0) text += " Today: " + s.getCounterToday(); if (s.getCounter() != null && s.getCounter().length() > 0 && - !s.getCounter().equals(s.getData())) + !s.getCounter().equals(s.getData())) text += " Total: " + s.getCounter(); views.setTextViewText(R.id.desc, text); @@ -201,46 +201,46 @@ else if (s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.PUSH_OFF_BUTTO } views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), - !s.getStatusBoolean(), - true)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), + !s.getStatusBoolean(), + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); } else if (withButtons == BUTTON_2 && s.getStatus() != null) { views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), true, - false)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), true, + false)); views.setViewVisibility(R.id.on_button, View.VISIBLE); views.setOnClickPendingIntent(R.id.off_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), false, - false)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), false, + false)); views.setViewVisibility(R.id.off_button, View.VISIBLE); } else if (withButtons == BUTTON_3 && s.getStatus() != null) { views.setOnClickPendingIntent(R.id.switch_button_up, buildBlindPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), - s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.ON : DomoticzValues.Device.Blind.Action.OFF)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), + s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.ON : DomoticzValues.Device.Blind.Action.OFF)); views.setViewVisibility(R.id.switch_button_up, View.VISIBLE); views.setOnClickPendingIntent(R.id.switch_button_stop, buildBlindPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), DomoticzValues.Device.Blind.Action.STOP)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), DomoticzValues.Device.Blind.Action.STOP)); views.setViewVisibility(R.id.switch_button_stop, View.VISIBLE); views.setOnClickPendingIntent(R.id.switch_button_down, buildBlindPendingIntent( - UpdateWidgetService.this, - appWidgetId, - s.getIdx(), - s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.OFF : DomoticzValues.Device.Blind.Action.ON)); + UpdateWidgetService.this, + appWidgetId, + s.getIdx(), + s.getSwitchTypeVal() == DomoticzValues.Device.Type.Value.BLINDINVERTED ? DomoticzValues.Device.Blind.Action.OFF : DomoticzValues.Device.Blind.Action.ON)); views.setViewVisibility(R.id.switch_button_down, View.VISIBLE); } else { views.setViewVisibility(R.id.on_button, View.GONE); @@ -277,11 +277,11 @@ public void onReceiveScene(SceneInfo s) { views.setTextViewText(R.id.on_button, getApplicationContext().getString(R.string.button_state_on)); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - !s.getStatusInBoolean(), - true)); + UpdateWidgetService.this, + appWidgetId, + idx, + !s.getStatusInBoolean(), + true)); views.setViewVisibility(R.id.on_button, View.VISIBLE); } else { @@ -290,18 +290,18 @@ public void onReceiveScene(SceneInfo s) { views.setTextViewText(R.id.off_button, getApplicationContext().getString(R.string.button_state_off)); views.setTextViewText(R.id.on_button, getApplicationContext().getString(R.string.button_state_on)); views.setOnClickPendingIntent(R.id.on_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - true, - false)); + UpdateWidgetService.this, + appWidgetId, + idx, + true, + false)); views.setViewVisibility(R.id.on_button, View.VISIBLE); views.setOnClickPendingIntent(R.id.off_button, buildButtonPendingIntent( - UpdateWidgetService.this, - appWidgetId, - idx, - false, - false)); + UpdateWidgetService.this, + appWidgetId, + idx, + false, + false)); views.setViewVisibility(R.id.off_button, View.VISIBLE); } @@ -381,7 +381,7 @@ private int withButtons(DevicesInfo s) { int withButton = 0; if (s != null) { if (s.getSwitchTypeVal() == 0 && - (UsefulBits.isEmpty(s.getSwitchType()))) { + (UsefulBits.isEmpty(s.getSwitchType()))) { switch (s.getType()) { case DomoticzValues.Scene.Type.SCENE: withButton = BUTTON_1; diff --git a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java index c574545f7..8a2979f8d 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatAssistActivity.java @@ -42,13 +42,13 @@ public void onProvideAssistContent(AssistContent outContent) { super.onProvideAssistContent(outContent); try { outContent.setStructuredData( - new JSONObject() - .put("@type", "SoftwareApplication") - .put("author", "Domoticz") - .put("name", "Domoticz") - .put("id", "http://www.domoticz.com") - .put("description", "Domoticz is a very light weight home automation system that lets you monitor and configure miscellaneous devices, including lights, switches, various sensors/meters like temperature, rainfall, wind, ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and many more." - ).toString() + new JSONObject() + .put("@type", "SoftwareApplication") + .put("author", "Domoticz") + .put("name", "Domoticz") + .put("id", "http://www.domoticz.com") + .put("description", "Domoticz is a very light weight home automation system that lets you monitor and configure miscellaneous devices, including lights, switches, various sensors/meters like temperature, rainfall, wind, ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and many more." + ).toString() ); } catch (JSONException e) { e.printStackTrace(); diff --git a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java index c7e36ad4f..f867b0394 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/AppCompatPermissionsActivity.java @@ -56,7 +56,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.READ_PHONE_STATE")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_phone), permissionName); + this.getString(R.string.permission_desc_phone), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -64,7 +64,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.READ_EXTERNAL_STORAGE") || builder.toString().contains("android.permission.WRITE_EXTERNAL_STORAGE")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_storage), permissionName); + this.getString(R.string.permission_desc_storage), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -72,7 +72,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.CAMERA")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_camera), permissionName); + this.getString(R.string.permission_desc_camera), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -80,7 +80,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.RECORD_AUDIO")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_audio), permissionName); + this.getString(R.string.permission_desc_audio), permissionName); if (!alert.isShowing()) { alert.show(); } @@ -88,7 +88,7 @@ public void onPermissionDeclined(@NonNull String[] permissionName) { if (builder.toString().contains("android.permission.USE_FINGERPRINT")) { AlertDialog alert = PermissionsUtil.getAlertDialog(this, permissionHelper, this.getString(R.string.permission_title), - this.getString(R.string.permission_desc_finger), permissionName); + this.getString(R.string.permission_desc_finger), permissionName); if (!alert.isShowing()) { alert.show(); } diff --git a/app/src/main/java/nl/hnogames/domoticz/app/AppController.java b/app/src/main/java/nl/hnogames/domoticz/app/AppController.java index bc95ba745..d65d2967f 100755 --- a/app/src/main/java/nl/hnogames/domoticz/app/AppController.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/AppController.java @@ -76,7 +76,7 @@ public RequestQueue getRequestQueue() { HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); HttpsURLConnection.setDefaultHostnameVerifier( - mtm.wrapHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier())); + mtm.wrapHostnameVerifier(HttpsURLConnection.getDefaultHostnameVerifier())); } catch (KeyManagementException e) { e.printStackTrace(); } catch (NoSuchAlgorithmException e) { @@ -103,8 +103,8 @@ public void addToRequestQueue(Request req) { req.setTag(TAG); RetryPolicy retryPolicy = new DefaultRetryPolicy(socketTimeout, - DefaultRetryPolicy.DEFAULT_MAX_RETRIES, - DefaultRetryPolicy.DEFAULT_BACKOFF_MULT); + DefaultRetryPolicy.DEFAULT_MAX_RETRIES, + DefaultRetryPolicy.DEFAULT_BACKOFF_MULT); req.setRetryPolicy(retryPolicy); getRequestQueue().add(req); diff --git a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java index 9d78f72e4..a175337ee 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzCardFragment.java @@ -128,7 +128,7 @@ public void onAttachFragment(Fragment fragment) { listener = (DomoticzFragmentListener) fragment; } catch (ClassCastException e) { throw new ClassCastException( - fragment.toString() + " must implement DomoticzFragmentListener"); + fragment.toString() + " must implement DomoticzFragmentListener"); } } @@ -136,8 +136,10 @@ public void onAttachFragment(Fragment fragment) { * Checks for a active connection */ public void checkConnection() { - List fragments = getFragmentManager().getFragments(); - onAttachFragment(fragments.get(0) != null ? fragments.get(0) : fragments.get(1)); + if(listener == null) { + List fragments = getFragmentManager().getFragments(); + onAttachFragment(fragments.get(0) != null ? fragments.get(0) : fragments.get(1)); + } mPhoneConnectionUtil = new PhoneConnectionUtil(getContext()); if (mPhoneConnectionUtil.isNetworkAvailable()) { @@ -220,7 +222,7 @@ public void addDebugText(String text) { debugText.setText(temp); } } else throw new RuntimeException( - "Layout should have a TextView defined with the ID \"debugText\""); + "Layout should have a TextView defined with the ID \"debugText\""); } } @@ -232,7 +234,7 @@ private void setErrorLayoutMessage(String message) { TextView errorTextMessage = (TextView) root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } } @@ -252,7 +254,7 @@ private void setMessage(String message) { TextView errorTextMessage = (TextView) root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } private void hideRecyclerView() { diff --git a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java index 504dfaf3f..5fbe30981 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzDashboardFragment.java @@ -94,9 +94,9 @@ public void setTheme() { ((ImageView) root.findViewById(R.id.errorImage)).setImageDrawable(ContextCompat.getDrawable(getContext(), R.drawable.sad_smiley_dark)); mSwipeRefreshLayout.setColorSchemeResources( - R.color.secondary, - R.color.secondary_dark, - R.color.background_dark); + R.color.secondary, + R.color.secondary_dark, + R.color.background_dark); } } @@ -215,14 +215,13 @@ public void onActivityCreated(Bundle savedInstanceState) { * @param fragment fragment to cast the DomoticzFragmentListener to */ public void onAttachFragment(Fragment fragment) { - fragmentName = fragment.toString(); try { listener = (DomoticzFragmentListener) fragment; } catch (ClassCastException e) { throw new ClassCastException( - fragment.toString() + " must implement DomoticzFragmentListener"); + fragment.toString() + " must implement DomoticzFragmentListener"); } } @@ -240,9 +239,10 @@ public void showSpinner(boolean show) { * Checks for a active connection */ public void checkConnection() { - List fragments = getFragmentManager().getFragments(); - onAttachFragment(fragments.get(0) != null ? fragments.get(0) : fragments.get(1)); - + if(listener == null) { + List fragments = getFragmentManager().getFragments(); + onAttachFragment(fragments.get(0) != null ? fragments.get(0) : fragments.get(1)); + } mPhoneConnectionUtil = new PhoneConnectionUtil(getContext()); if (mPhoneConnectionUtil.isNetworkAvailable()) { addDebugText("Connection OK"); @@ -251,7 +251,6 @@ public void checkConnection() { listener.onConnectionFailed(); setErrorMessage(getString(R.string.error_notConnected)); } - ; } /** @@ -336,7 +335,7 @@ public void addDebugText(String text) { debugText.setText(temp); } } else throw new RuntimeException( - "Layout should have a TextView defined with the ID \"debugText\""); + "Layout should have a TextView defined with the ID \"debugText\""); } } } @@ -350,7 +349,7 @@ private void setErrorLayoutMessage(String message) { TextView errorTextMessage = (TextView) root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } public void setMessage(String message) { @@ -369,14 +368,14 @@ public void setMessage(String message) { TextView errorTextMessage = (TextView) root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } private void hideListView() { if (gridView != null) { gridView.setVisibility(View.GONE); } else throw new RuntimeException( - "Layout should have a ListView defined with the ID of listView"); + "Layout should have a ListView defined with the ID of listView"); } private void showDebugLayout() { diff --git a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java index 031534ce0..100edd05c 100644 --- a/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java +++ b/app/src/main/java/nl/hnogames/domoticz/app/DomoticzRecyclerFragment.java @@ -61,7 +61,6 @@ public class DomoticzRecyclerFragment extends Fragment { public RecyclerView gridView; - public SwipeRefreshLayout mSwipeRefreshLayout; public CoordinatorLayout coordinatorLayout; public Domoticz mDomoticz; @@ -74,8 +73,7 @@ public class DomoticzRecyclerFragment extends Fragment { private ViewGroup root; private String sort = ""; - public DomoticzRecyclerFragment() { - } + public DomoticzRecyclerFragment() {} public void setTheme() { if (mSharedPrefs == null) @@ -92,9 +90,9 @@ public void setTheme() { ((ImageView) root.findViewById(R.id.errorImage)).setImageDrawable(getResources().getDrawable(R.drawable.sad_smiley_dark)); mSwipeRefreshLayout.setColorSchemeResources( - R.color.secondary, - R.color.secondary_dark, - R.color.background_dark); + R.color.secondary, + R.color.secondary_dark, + R.color.background_dark); } } @@ -117,29 +115,25 @@ public void sortFragment(String sort) { } public void initViews(View root) { - - gridView = (RecyclerView) root.findViewById(R.id.my_recycler_view); + gridView = root.findViewById(R.id.my_recycler_view); if (mSharedPrefs == null) mSharedPrefs = new SharedPrefUtil(getContext()); - setGridViewLayout(); - coordinatorLayout = (CoordinatorLayout) root.findViewById(R.id.coordinatorLayout); - mSwipeRefreshLayout = (SwipeRefreshLayout) root.findViewById(R.id.swipe_refresh_layout); + coordinatorLayout = root.findViewById(R.id.coordinatorLayout); + mSwipeRefreshLayout = root.findViewById(R.id.swipe_refresh_layout); } public void setGridViewLayout() { try { boolean isTablet = false; - float screenWidth = 0; boolean isPortrait = false; if (getActivity().getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) isPortrait = true; if (getActivity() instanceof MainActivity) { isTablet = ! - ((MainActivity) getActivity()).onPhone; + ((MainActivity) getActivity()).onPhone; } - gridView.setHasFixedSize(true); if (isTablet) { @@ -192,14 +186,13 @@ public void onActivityCreated(Bundle savedInstanceState) { * @param fragment fragment to cast the DomoticzFragmentListener to */ public void onAttachFragment(Fragment fragment) { - fragmentName = fragment.toString(); try { listener = (DomoticzFragmentListener) fragment; } catch (ClassCastException e) { throw new ClassCastException( - fragment.toString() + " must implement DomoticzFragmentListener"); + fragment.toString() + " must implement DomoticzFragmentListener"); } } @@ -217,9 +210,11 @@ public void showSpinner(boolean show) { * Checks for a active connection */ public void checkConnection() { - List fragments = getFragmentManager().getFragments(); - onAttachFragment(fragments.get(0) != null ? fragments.get(0) : fragments.get(1)); - + if(listener==null) { + //Get listener + List fragments = getFragmentManager().getFragments(); + onAttachFragment(fragments.get(0) != null ? fragments.get(0) : fragments.get(1)); + } mPhoneConnectionUtil = new PhoneConnectionUtil(getContext()); if (mPhoneConnectionUtil.isNetworkAvailable()) { addDebugText("Connection OK"); @@ -303,7 +298,7 @@ public void addDebugText(String text) { debugText.setText(temp); } } else throw new RuntimeException( - "Layout should have a TextView defined with the ID \"debugText\""); + "Layout should have a TextView defined with the ID \"debugText\""); } } } @@ -311,49 +306,49 @@ public void addDebugText(String text) { private void setErrorLayoutMessage(String message) { hideListView(); - RelativeLayout errorLayout = (RelativeLayout) root.findViewById(R.id.errorLayout); + RelativeLayout errorLayout = root.findViewById(R.id.errorLayout); if (errorLayout != null) { errorLayout.setVisibility(View.VISIBLE); - TextView errorTextMessage = (TextView) root.findViewById(R.id.errorTextMessage); + TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } public void setMessage(String message) { - RelativeLayout errorLayout = (RelativeLayout) root.findViewById(R.id.errorLayout); + RelativeLayout errorLayout = root.findViewById(R.id.errorLayout); if (errorLayout != null) { errorLayout.setVisibility(View.VISIBLE); - ImageView errorImage = (ImageView) root.findViewById(R.id.errorImage); + ImageView errorImage = root.findViewById(R.id.errorImage); errorImage.setImageResource(R.drawable.empty); errorImage.setAlpha(0.5f); errorImage.setVisibility(View.VISIBLE); - TextView errorTextWrong = (TextView) root.findViewById(R.id.errorTextWrong); + TextView errorTextWrong = root.findViewById(R.id.errorTextWrong); errorTextWrong.setVisibility(View.GONE); - TextView errorTextMessage = (TextView) root.findViewById(R.id.errorTextMessage); + TextView errorTextMessage = root.findViewById(R.id.errorTextMessage); errorTextMessage.setText(message); } else throw new RuntimeException( - "Layout should have a RelativeLayout defined with the ID of errorLayout"); + "Layout should have a RelativeLayout defined with the ID of errorLayout"); } private void hideListView() { if (gridView != null) { gridView.setVisibility(View.GONE); } else throw new RuntimeException( - "Layout should have a ListView defined with the ID of listView"); + "Layout should have a ListView defined with the ID of listView"); } private void showDebugLayout() { try { if (root != null) { - LinearLayout debugLayout = (LinearLayout) root.findViewById(R.id.debugLayout); + LinearLayout debugLayout = root.findViewById(R.id.debugLayout); if (debugLayout != null) { debugLayout.setVisibility(View.VISIBLE); - debugText = (TextView) root.findViewById(R.id.debugText); + debugText = root.findViewById(R.id.debugText); if (debugText != null) { debugText.setMovementMethod(new ScrollingMovementMethod()); } diff --git a/app/src/main/res/drawable-hdpi/baseline_dashboard_black_18.png b/app/src/main/res/drawable-hdpi/baseline_dashboard_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..82619cccdabd010b8edccdeed46486f4e96b6193 GIT binary patch literal 153 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0dj!xq}=@ZL%gq6MahvtuN)TaS__WAbAW|Th6=)ZOr>mdKI;Vst0D&tl A!vFvP literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_dashboard_black_24.png b/app/src/main/res/drawable-hdpi/baseline_dashboard_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..a1476f6d94ef3f146c653a32f2f1799400ff3f39 GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBf;?RuLn;{GPCdxUpuoc{yLNGD z@mn^bMG+tPKJmzOrNuBPXlbhKc{gv3kK)U6L8lY%m0AKW_Xj@bSKRhy literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_dashboard_black_48.png b/app/src/main/res/drawable-hdpi/baseline_dashboard_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..ad14dfeb9fcb3669d59c0077ab851f2cc95eff6b GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xf3?%cF6JSP_>in3t;1quf*(q0Nw{LUhBzDt;wRc z12`F_Y({6Gll0mwdPxTil1g4G$$Lqyk_<=@lg{fe+D74kLd+)Ca<@I_+E(L&M$9(S zGPcE9sdYsgql~rOZI30i`4od5s; literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_dvr_black_24.png b/app/src/main/res/drawable-hdpi/baseline_dvr_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..e636c40b1b9409765962bb009374e1fba9c4b4e1 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8lc$SgNCo5Dsf}z64m@rD&AA<} z{yq}ARlTEnarNe-GOliBg|GJU=iRB}k=E+Z6mVc;mWt^}XcwF*_ok%5z;mJl+vG2P z0v=pVjdync)p}90`Q6+9QB@NflbXez_nhMYbUx!>O+Z2Z2|*|JvRg`zopr0FpIF>Hq)$ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_dvr_black_36.png b/app/src/main/res/drawable-hdpi/baseline_dvr_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..5dd9ce4e9ce1fa5e38630ce5cbe545f75852f848 GIT binary patch literal 286 zcmV+(0pb3MP)41u(5_*-wm^aGDwC=%UHjVaEP-eD4Pg^T2^~Xiq7nR6
    ~8`I6dUL&(4T{9%z5XrT??0JIKQ`hPD zwj6K&r1>ff(+?lwOiXCaJKIo@qWHAw!39}?b4xV7l^l7IWL35&tj&CSqLx7M(f;(E zb0;P*Hd@rho~62q^THihUPq;6ktTwI8FNyV|AapKu-($`9ar{+l_51|)AfO_WbkzL Kb6Mw<&;$UVDN)J* literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_highlight_black_24.png b/app/src/main/res/drawable-hdpi/baseline_highlight_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..bd256390da832aab8136d8b04f44361a09bfa3bf GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8LpB2O2`kP61P7Z}+NF-WvM{LT;< ztI(~;(U9=QC~?;j{sZeacDFR-8A^IGasFU3*!tJLW2>z^gTCFdGXjU&Sj}&-pfMr#C;f7P@ta&z!td$;Fo`b|qV3n%jI+aTjN&{wd1E zHrjqm{`9emDb)wRsCRyr*0W%fd9YK=%k)Q@_QD~xDOxoPFXwXgs+$z#hsfzoKj8AX Q3Fuk|Pgg&ebxsLQ0EzufDF6Tf literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_highlight_black_36.png b/app/src/main/res/drawable-hdpi/baseline_highlight_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..792947410c6d9bed34fd703cd940671b503b401f GIT binary patch literal 272 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL0wmRZ7KH(+>z*!-Ar*{o&oi0k^5V7XFd;Z+qiHaqwAf9Uu6=OV literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_highlight_black_48.png b/app/src/main/res/drawable-hdpi/baseline_highlight_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..881d6b0dd2f28b7b91e8cb6ae7535d31955b2989 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXoKNz{u$7;uuoF`1T4T8&jZ2>%(AE zqa|luSOnfGGDUeZ+;L?QGEfj;QMyJnmr^TRG>$O-aj$r#loBEHqmm@1Ee1{CvrTv~!&v$xP3m zUH7^qvh{R<(~39OCYf|v>{B*c!1?k=>4Pr2An6DH4ofadJk0g7RrJ=DW7@mIOrBe; zTu`vb*V8It!oMr5?ZOlJUML!>zn$x>^mfkY@|6xzXIX?iK<)q%+eFTZ9a&>~+~FLD zOp)7z3C2wAa|A7(^c+x3XW_F{E;teRFBPH^q`b~+rFnJWuHyM0t~vt4gu&C*&t;uc GLK6Ujn0*ug literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_opacity_black_18.png b/app/src/main/res/drawable-hdpi/baseline_opacity_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..9a7ba5624f0b829674327138cb0d8401203409fe GIT binary patch literal 295 zcmV+?0oeYDP)wyl4VG3VRP z3ha3S{CLfcW&d#O!?8aq>j^z&W>?V{Lg>#PRt$u;18t$NqL}J$lp)g=1}eqT_b6f% zs+!`!a4Z^yhEAnf(G{99<1#IwZ(Gu}@NP@qmN(&6LdmCaC9N)eS&(xigf(eP2EvJ) zGvUQ#&q7_!h4AEX;vR)dIWD!Z6o>JzrK-WAKoI2Kqp~yG6JchSG@C$z8LF9|L1V^j*KA@_gcsNnAc5rM8VKi} zTY}?v<@w)_>(-~w1$6o4hu$SJJ9b7YI1`>SGj__(Fl1<_>`VbbVW-TDGtyIbW(06< zD&^CC7;|jwE)^-JS6qgOV-YXzT4K0$!zmG`#7x~H$D_rUjApdZB+O(}dp2Y;S<}U* z$69t7s%IHYuuNq4glZv!J1qCI`#`ml!2ruZb}LjH8MLvqWw$}KltJiQqIz!>TA(T# zg$h(zqfmw_rVh^3#CYVvp&UaQlqoT#RA#0k#YTs@H#4V0poB-ZCnJA6kkH5tZ~Pxb wzV~COVGu%9M7+z48NwJ!7>aYil0KbDwB_GO482|tP07*qoM6N<$f|87r9{>OV literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_opacity_black_36.png b/app/src/main/res/drawable-hdpi/baseline_opacity_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..99c86b0495ea6ea33aa6c13978e530ea800878a3 GIT binary patch literal 496 zcmVC!&?9MzcaAU0N(Guyxmb!622HQilmzi8G4G9%8^s#v?)bSn^NWUDSb|Hfr`si zroM;~=UbnXr@n~+(9e%PCrf4N1K$XqJ|{^HVw+UFD#Da!r+o9GoFX+$K5OCRI{36w z$OXXPtbe3P({Mtp`j|SUE@5=@T5ySmP!B7vaKM^dm>qy23+b zD!DV8CnAW=n%ONCNY(RVcGHNZ%%}?&LuQvksL@Q4xOy<#CPe1VU;tO6W;=(-x%rT* zaaD)sug{S%Z`BwmsuLZMJd zW*+nSgG?t$lIed|j&_nljyy>}M?Xm`N1mjgqo1Ueqn{+m`N~)QBzaC6&1p$gKS`Do zr8xlYiK!aQyKW?ulLR@PF%1#Cy%lp3bjEMAT9P2A7a5tQk|f9(NM=^aljL86 z1Ify!bpJmdMd{xcBgoFqbT_?GGC=fbbFtfZ6`?T-8jvQ)0m#E4-{o_v5l}(y`9|lE zb9p)9yS_mI0$J!AT#lXmT<|SSCV*N*JY$=%SD0&_jdzqlY@2851Tw|A<=I()P$|#b z`3;qjs?K|3=>sJZ8RdCgqZGf%Mj~?An0QETg2>HNW9qsIAEG|Vyd_KKv#zgJkh=QQX(){Zz0I)b&;PJ`B9t%K8`4p=Ko z!dXs&vItyo7IXoTk=7i?8ZAU#Ud^3)F+=6G%bss^;9I zAOSTbO)V#l1}GS)7SsnN<5Y6Sp=ffzm?#5KHkz0?=Q&MrpdmLzIajENBY7Cl2dkL( zj3+lvRc1Y(bNHLJfy(?6Wf{k{EMu-QjWoX3`&hXxNfzGg))|4g`3Wahi1*WMn U)}~Bh=>Px#07*qoM6N<$f`TF+LjV8( literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_view_carousel_black_18.png b/app/src/main/res/drawable-hdpi/baseline_view_carousel_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..9bc4a45ed588534080792890b9b93f8b3db04924 GIT binary patch literal 134 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&i1|)m0dqXT5ptDmgHaVq+j8N g%<+|dO@Ryy-5Po~B7fa`1T>hz)78&qol`;+03FvUSO5S3 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_view_carousel_black_24.png b/app/src/main/res/drawable-hdpi/baseline_view_carousel_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..9f88ea5ae79622b03ba8d845a9081c676feb7c12 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBJUv|;Ln;{GUTb7!FyL{y*mv#X zrpjBae5;mL%xCUkKQZA;;MVKytHTu*@a<-OWuO273*sF_%ebe!uTGRV`TnZF_|B9i ZtSJ_vt4~ME-vJuR;OXk;vd$@?2>_7AD%Ai0 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_view_carousel_black_36.png b/app/src/main/res/drawable-hdpi/baseline_view_carousel_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..1d0056c0c814a9b992df8819b1aea1562ccc6bd5 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL1|)l2v+e?^JWm(LkP61PH#YJfP~dSr*mH=Z z=fOn@-Px-57|a`5-g)jncKy?feJY+^ceZB~YVz>t6eVxE!Ljb^q< xFhP`_S~f`X&)s+~=GQyRFa9bv@|>jd_X*R6Yo+Lb)0*(z#yqLIl z44Ar=b!scVx7GJEccMJ^@^lo5tk99Q7RkLU)6&*f$B`nPDIB5xb+QF)gfK!w>|6sQ zA#BQ7Gm|yT832cwOCHL2OJ~-9dw{My!$dZevF`x%eI!0t)xLzPrG-6EGcfjQY@i1A zEG$)(Sqb4%+LaJi%A6^D4u3ZN3si#z*b^vA?C4!`5e6Cz4nRy@002M3#Uo4%`6vJY N002ovPDHLkV1h^ne=`68 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_24.png b/app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..0945adf69b06f3c9232f3630f7102ecd27436ae2 GIT binary patch literal 415 zcmV;Q0bu@#P)iIT!z<6JD$k#_5LN5{51j-L9pi9=a1r#guMwKqafYZ?RB_WY zDr#88j1kom`VJ;(M|qvJrs*m|-;J008J%U*8g^7ZLyf002ov JPDHLkV1kxisfhpp literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_36.png b/app/src/main/res/drawable-hdpi/baseline_wb_sunny_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..7631537909ed17a0c9cb31f2f4c3641f5de20dc0 GIT binary patch literal 540 zcmV+%0^|LOP)*h<2eBDg;S=lxS=F2k&u? z?cRHDG4%TZyt^Og-M#-Y*#vZy0e?=2D8v8QM8(Qpu`(94c%$qbEAvSULz)P}D|5Io z&ntq^G)yTU$YV=^XGD2ICTED28>X;fnmYvTDF&P($}6TVV^@f>fgue9;es4#N~}@k zfQTJdDUl|}C4vxPK}3`EZECdXA_>2VsgX;qYZ2i^g?D6#?^GBgyY!I}_Ng-_4iN*7 zz@I8&XcbSE=o-hm1bFd+Sonko8;GTwICE_syT*|sU)HfNiewNFCe*AT4pz{F2?Nk{ zkc66Tr`R?cN!ZDXMNYBEEw<+r+jEGG{V`^2kcv|*9I`<&$UANQ`~rjEOpfk)Z)~JeXmQB;m+WE+k2j8M{=>GYjbAiS|Sbo|~QGJY?rAEuaDv(!DJ{Gfmh1wIhvy-BW(XgS1|2BM`+ChPRn z;&WU$S6BB~$AB$<5Pmm{?36qUsQVAl6e2+g!!ia&ay#%qol6-)Mh9K!VA-f;3JeVp e2xJWe7zF@_YZnNL`CH=v0000u zn!N(0*{uu)4F<_G7_^Vo;z6s~he!4hriKl;aZ}Tc4b%{3kJlW9qK>Udv6VU$$}CCC z`E4T+NDx6I>bGHXFkk_Glx8!r0y)hn%@*ciKqf(yW<8UzVG^|{%>bDgl1TvdTR*Yb zl0b`=lZ*$F@w?^>V<*`h<02P0P7d1{=9=Uu8IQ!`cgR`I9m-H`Ea5Jz9g-~HkFg}v z5z)LsIrxldIwF+_#96@yl)HRjCEY*_b*TTeju^U_(}Yk4hB!?Zl7aGI7G1<58a)Ly zvKV<7MIOqdd5lJ!D<}&uBg_mMtb*#9i70nbmfk~zY_R4f-15D5y%1r>+{703mB5DEHV66E}ze;^X{ zz~Dp|u8IU*L5x)*L8}m?K;XAbl-mM79HLC6-YTboDF}19cl~38(R{V|Pdy5GSS)bY zAxxIQeVH)ljPG2}(8a_X+LpQLpC#N3~B-0TwF7u)1#LyABti^&@nrR_{j#*_q zLCYaXwZ|lF#@IrX!;Epq?-}Doj+4U>`g*~>OiS|Nk^S-;MGkw< q8C(Jn1`P&%+fZ=O=nAV*FbV*pw|QBAqy!280000)d}VNO x1?yt53pO+Ro;529O|k1|%Oc%$NbBf;?RuLn;{GPCdxUpuoc{yLNGD z@mn^bMG+tPKJmzOrNuBPXlbhKc{gv3kK)U6L8lY%m0AKW_Xj@bSKRhyI0(32tTXui zU0Pw)`4w^EJT7ehr*EA;*l^ruaSp4f(MpXDz7sj_DhH-5$YYP&{z>U!oFVdQ&MBb@0HsGc A0ssI2 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_dvr_black_36.png b/app/src/main/res/drawable-mdpi/baseline_dvr_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..e636c40b1b9409765962bb009374e1fba9c4b4e1 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8lc$SgNCo5Dsf}z64m@rD&AA<} z{yq}ARlTEnarNe-GOliBg|GJU=iRB}k=E+Z6mVc;mWt^}XcwF*_ok%5z;mJl+vG2P z0v=pVjdync)p}90`Q6+9QB@NflbXez_nhMYbUx!>O+Z2Z2|*|JvRg`zopr0FpIF>Hq)$ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_dvr_black_48.png b/app/src/main/res/drawable-mdpi/baseline_dvr_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..7bd6c78db710bf4dac3dec09690500beb9bd73c0 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0Dsh%#5Ar*{or!le}b`WsAFWMAV z^yAVz#iIF6Q7ViJa&P-7UUTx!D>4vWV4vyFdp_euZXFZh8;{^JQzmV2KXDpG16ggQFde7el-@*prc z;Rs9I)#Z;nj|3L{=`%?w;n9gu6lb$4OX|}ToFL3nziG4VnrSJ%Gl33d@O1TaS?83{ F1OTa~P2vCm literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_highlight_black_18.png b/app/src/main/res/drawable-mdpi/baseline_highlight_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..9ba7e562155141fdc75259340ce35602f28d7caf GIT binary patch literal 170 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|m3O!vMLn;`P75G&c6del~I0_qb z*cdgknFN{`160H#JGBnSw@v1e(YUpvQK??y$;4JCNi)L@i!~ml+&J-|KW`yZGqY64 zfs#<>!}TUN9K2mQUvzC?&oZ|w7FZy^ZV7Yw6pI6*mKU5SGC4D|Fhwq5Vz}bv{qJ?= RvSy&=44$rjF6*2UngCibH3R?v literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_highlight_black_24.png b/app/src/main/res/drawable-mdpi/baseline_highlight_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..e50ea75933faea0f1c50c999216cc0fbdd33644a GIT binary patch literal 158 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+iR8JSjkP60R34;&v94ps4PIly( z&bFY3ZC8|k0wldT1B8LpB2O2`kP61P7Z}+NF-WvM{LT;< ztI(~;(U9=QC~?;j{sZeacDFR-8A^IGasFU3*!tJLW2>z^gTCFdGXjU&Sj}&-pfMr#C;f7P@ta&z!td$;Fo`b|qV3n%jI+aTjN&{wd1E zHrjqm{`9emDb)wRsCRyr*0W%fd9YK=%k)Q@_QD~xDOxoPFXwXgs+$z#hsfzoKj8AX Q3Fuk|Pgg&ebxsLQ0EzufDF6Tf literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_highlight_black_48.png b/app/src/main/res/drawable-mdpi/baseline_highlight_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..e6dca4876ec956cf71341c7a37a1f9869872414c GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0DMV>B>Ar*{ouQIY7b`WrT*zWQq ztdU{L1ZLI-TQ9DxK!vNpp{<%;+&woJmZa`ud{Ez@7~*zMyzv$@ul8nbgN>IKELK&1 zb7sn{8-hl!hW`^7vLCfwy=(X1H|I;l*PL&a4HJFbJNvYm z*_BhjPjBRKQDE}E_@~L)=)C%zN%i-%ET8S={J+P3V%=ZqKS~K=jT|A0dl&>RORheg S!%+=%ErX}4pUXO@geCyzY*O$5 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_opacity_black_18.png b/app/src/main/res/drawable-mdpi/baseline_opacity_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..da6e462cedb54a6d65980a9838e32b930a4c9001 GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mCV9FzhEy=lJ;lhzlqk}AQQ6CZ zL*Rmy6T_C3A{?9?9tKg)LJLwwbQQE34smxJw|AS%9W(!bNvUau^^Mmis)|8jK55T1 zwN=oP BNnQW| literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_opacity_black_24.png b/app/src/main/res/drawable-mdpi/baseline_opacity_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..33b981dd4e103724bb6b03dcdb163c2954dfe180 GIT binary patch literal 267 zcmV+m0rdWfP)3~s6fp%w2n8TwFc?@AJAi-zM(2>GgBid85uu1s0RoT;P%1OyU(_3f@%n6_ zt_R@e@o)C*GryKfrDaY{l@Kb;`SP)F=3E$SnxSDVTv)W^Mi^^AIUoJzu;N}AsVmqt zoXTO%gYaexvOD2wDu)fv!Yx@_7+Np`C67WKSzUONd?-KUFW(L++i^La`_M7dwqpYWCk`z8b3X!*livIX R_`CoB002ovPDHLkV1nbHY?%N6 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_opacity_black_36.png b/app/src/main/res/drawable-mdpi/baseline_opacity_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..61e1486ab059a1ef7c624cfe783de5c20d8fbee5 GIT binary patch literal 350 zcmV-k0iphhP)D!Z6o>JzrK-WAKoI2Kqp~yG6JchSG@C$z8LF9|L1V^j*KA@_gcsNnAc5rM8VKi} zTY}?v<@w)_>(-~w1$6o4hu$SJJ9b7YI1`>SGj__(Fl1<_>`VbbVW-TDGtyIbW(06< zD&^CC7;|jwE)^-JS6qgOV-YXzT4K0$!zmG`#7x~H$D_rUjApdZB+O(}dp2Y;S<}U* z$69t7s%IHYuuNq4glZv!J1qCI`#`ml!2ruZb}LjH8MLvqWw$}KltJiQqIz!>TA(T# zg$h(zqfmw_rVh^3#CYVvp&UaQlqoT#RA#0k#YTs@H#4V0poB-ZCnJA6kkH5tZ~Pxb wzV~COVGu%9M7+z48NwJ!7>aYil0KbDwB_GO482|tP07*qoM6N<$f|87r9{>OV literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_opacity_black_48.png b/app/src/main/res/drawable-mdpi/baseline_opacity_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..f63a7047c5ad7f38dbd602a51467b283a2b46edc GIT binary patch literal 469 zcmV;`0V@89P)9xNXzs4%y%_slaCzV7Iq)(za;BNaM^mIoG396cfPqgH5-%10#rseZka%Az0%RmM zPadft;B|b7FkwpapCRC7e3>NxmMD8w5klgru!_Pe6)!46WF@9X6hK6&nOErJ>%>q* zjJlhO36iqjAkJUnG-T$D39MYpYKt9)*`XzKS6DcZwGO-dXP1u59$;vaZ?)2AADw;r zYP!fIMvmo8Czv>u`6Eoor6w_zluI`dllMe06_K47S_w7!fsM4hZDp`NDfo0z`(^%;OkfPCznL=SdazcY_UL)u@UkEI1xyhY&1}j00000 LNkvXXu0mjfKA_4s literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_18.png b/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..fb321448caae85a60ef47d1c797a9d222b7a58dd GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|S5FtmkP60RiOL5I0{@RU@;|uz zg5d~nz#E4X3O-*sE;KCJ&^W>I#jEyRj*Hn;8$=umnG~B1t_089#L3L;(RK7l!p@1T Z3_@zH&GKBEwgC-f@O1TaS?83{1OW4qDAE7` literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_24.png b/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..3f8280542c6029473ff3a8efb37a5c84e4770d6f GIT binary patch literal 99 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjTAnVBAr*|t5?>NT{;2a^zRz^1 xZDJPVt{Vj#60S4_a=YnDB(>f>!M2!zVc*-g!b@+?_6F)=@O1TaS?83{1OWb>9{vCT literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_36.png b/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..9f88ea5ae79622b03ba8d845a9081c676feb7c12 GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k1|%Oc%$NbBJUv|;Ln;{GUTb7!FyL{y*mv#X zrpjBae5;mL%xCUkKQZA;;MVKytHTu*@a<-OWuO273*sF_%ebe!uTGRV`TnZF_|B9i ZtSJ_vt4~ME-vJuR;OXk;vd$@?2>_7AD%Ai0 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_48.png b/app/src/main/res/drawable-mdpi/baseline_view_carousel_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..86e54e0c696fb8ee1af380c93940b8592862b46a GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDH3?y^UWFG-iYymzYu0R?HmZtAK52P4Ng8YIR z9G=}s19Id%T^vIy7?TyG4gUYHXJ9}2|L6bzpXJ#UThCv;!pPvbv#$7;T!lYKyQiz4 J%Q~loCID4qA^rdW literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_18.png b/app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..9a96baff8f937bebb653cab3141b3f504906e83c GIT binary patch literal 249 zcmVrD@1s=hj^4;Iu(>{KGq>Ir#rBCo)i2O*w5BOqYQUTq10u~wr)giDKb!YXmYd0n*_ z16)2WnIRg0nYlCvoEk!twStMcGy&GCNv1)J^NO`#ZE#*2jF1*Zmg#FRRywt{dTQLc zfRyQ~GEm^AwMwSKfgXvjO7yf=e*Oj4PW|Hzw@O#95QoHc00000NkvXXu0mjf4+3h0 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_24.png b/app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..747cb7da82df7fa0f5cb4039f6c409b1ac762447 GIT binary patch literal 252 zcmV@Jf5ROy^_+Y(54^?z0000iIT!z<6JD$k#_5LN5{51j-L9pi9=a1r#guMwKqafYZ?RB_WY zDr#88j1kom`VJ;(M|qvJrs*m|-;J008J%U*8g^7ZLyf002ov JPDHLkV1kxisfhpp literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_48.png b/app/src/main/res/drawable-mdpi/baseline_wb_sunny_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..5da77de52fe61c8d30b006dc88cf3ea81b150db1 GIT binary patch literal 396 zcmV;70dxL|P)Q2U-QLdvSd>cX0Xsd`~ue`CjCHKR)mu z7^T%J(8?$Vh7laf(W=Ek7{G^i4BUcTOs%(l|$M=THY`iB&={ z6~gNM=PNK!!3FaK@mvJWEU?J|`)o2#3t>DL#5@;NU?`J7p2Rc78S-kUOcBGAK(ers z&oSa*$K>-yU5Jl$^9DJH&pG5_DT*V+U`Iq_Wd|k1|%Oc%$NbBf;?RuLn;{GPCdxUpuoc{yLNGD z@mn^bMG+tPKJmzOrNuBPXlbhKc{gv3kK)U6L8lY%m0AKW_Xj@bSKRhy|k0wldT1B8K8lc$SgNCo5Dsf}z64m@rD&AA<} z{yq}ARlTEnarNe-GOliBg|GJU=iRB}k=E+Z6mVc;mWt^}XcwF*_ok%5z;mJl+vG2P z0v=pVjdync)p}90`Q6+9QB@NflbXez_nhMYbUx!>O+Z2Z2|*|JvRg`zopr0FpIF>Hq)$ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_dvr_black_24.png b/app/src/main/res/drawable-xhdpi/baseline_dvr_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..7bd6c78db710bf4dac3dec09690500beb9bd73c0 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0Dsh%#5Ar*{or!le}b`WsAFWMAV z^yAVz#iIF6Q7ViJa&P-7UUTx!D>4vWV4vyFdp_euZXFZh8;{^JQzmV2KXDpG16ggQFde7el-@*prc z;Rs9I)#Z;nj|3L{=`%?w;n9gu6lb$4OX|}ToFL3nziG4VnrSJ%Gl33d@O1TaS?83{ F1OTa~P2vCm literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_dvr_black_36.png b/app/src/main/res/drawable-xhdpi/baseline_dvr_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..e90df3db5fb8760895f13318fe299c1279206f96 GIT binary patch literal 260 zcmV+f0sH=mP)41u(5_*-wm^aGDwC=%UHjVaEP-eD4Pg^T2^~Xiq7nR6
      ~8`I6dUL&(4T{9%z5XrT??eesmE(rFyuf3DpG(|4A|S86l8PA8&ih?)QriR zkpgW-)>9}zMb;)1U`H-K6Cj{$KqEjv;ecAe-zK2t_w-9^|Nk!m0tyFgI|2j< zi2jg$3J_2@;6p&i1Vn$x-USFK9I)vK5FjA>L-r;>K;eM300D&qUIiRI0WYLLdyal` z_CVHED8MCI7lF<$x15p3O&Gv6dm9A#4jwt-Ktt|&fBb#RDXpC|>FN3XJrhP8z0`64 jlK=q%1PCxQGc&Vqk7asghZoPj00000NkvXXu0mjfLrH}B literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_highlight_black_18.png b/app/src/main/res/drawable-xhdpi/baseline_highlight_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..bd256390da832aab8136d8b04f44361a09bfa3bf GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8LpB2O2`kP61P7Z}+NF-WvM{LT;< ztI(~;(U9=QC~?;j{sZeacDFR-8A^IGasFU3*!tJLW2>z^gTCFdGXjU&Sj}&-pfMr#C;f7P@ta&z!td$;Fo`b|qV3n%jI+aTjN&{wd1E zHrjqm{`9emDb)wRsCRyr*0W%fd9YK=%k)Q@_QD~xDOxoPFXwXgs+$z#hsfzoKj8AX Q3Fuk|Pgg&ebxsLQ0EzufDF6Tf literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_highlight_black_24.png b/app/src/main/res/drawable-xhdpi/baseline_highlight_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..e6dca4876ec956cf71341c7a37a1f9869872414c GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA0wn)(8}b0DMV>B>Ar*{ouQIY7b`WrT*zWQq ztdU{L1ZLI-TQ9DxK!vNpp{<%;+&woJmZa`ud{Ez@7~*zMyzv$@ul8nbgN>IKELK&1 zb7sn{8-hl!hW`^7vLCfwy=(X1H|I;l*PL&a4HJFbJNvYm z*_BhjPjBRKQDE}E_@~L)=)C%zN%i-%ET8S={J+P3V%=ZqKS~K=jT|A0dl&>RORheg S!%+=%ErX}4pUXO@geCyzY*O$5 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_highlight_black_36.png b/app/src/main/res/drawable-xhdpi/baseline_highlight_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..881d6b0dd2f28b7b91e8cb6ae7535d31955b2989 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXoKNz{u$7;uuoF`1T4T8&jZ2>%(AE zqa|luSOnfGGDUeZ+;L?QGEfj;QMyJnmr^TRG>$O-aj$r#loBEHqmm@1Ee1{CvrTv~!&v$xP3m zUH7^qvh{R<(~39OCYf|v>{B*c!1?k=>4Pr2An6DH4ofadJk0g7RrJ=DW7@mIOrBe; zTu`vb*V8It!oMr5?ZOlJUML!>zn$x>^mfkY@|6xzXIX?iK<)q%+eFTZ9a&>~+~FLD zOp)7z3C2wAa|A7(^c+x3XW_F{E;teRFBPH^q`b~+rFnJWuHyM0t~vt4gu&C*&t;uc GLK6Ujn0*ug literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_highlight_black_48.png b/app/src/main/res/drawable-xhdpi/baseline_highlight_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..4814825998e855beccefa8dfb2578c043f575fe8 GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7z-Z*@;uuoF_~v{g+o1xH){p$G z3P~=D6JP9P`Zl4_iJ>tupevLABJYk2wQc_+3-*6zdfvW7qid1IruD1}42(aL895vn z!ZtI9spOpRKD?%(t8bFa)Dnq&^%snyZ5Nj*PT3;yjHPz!;%F|lupfWr94qgCpW&ua zkuYP1LBV}a%f;4-Gv)wUfvgb+wqt37b^6KKaM6FwOUsQP$bN zb_*4q1KpH&+*dZq3D~;u;+=9P^Zo0U?y!8HTcGG3dv2y~pvXz1k9KcwZscW95MbUY zKiAINn3YB4K1-o2(7OoG5YG7e#UE4gQyYKI^nUvOXFA8s(@X9D%Q`I!`StmCi_gw4 s&%SfcboWZEn>*oteRCW_Cx|skCHL#0td%*PEu0{(r>mdKI;Vst0GqjvT>t<8 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_opacity_black_18.png b/app/src/main/res/drawable-xhdpi/baseline_opacity_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..61e1486ab059a1ef7c624cfe783de5c20d8fbee5 GIT binary patch literal 350 zcmV-k0iphhP)D!Z6o>JzrK-WAKoI2Kqp~yG6JchSG@C$z8LF9|L1V^j*KA@_gcsNnAc5rM8VKi} zTY}?v<@w)_>(-~w1$6o4hu$SJJ9b7YI1`>SGj__(Fl1<_>`VbbVW-TDGtyIbW(06< zD&^CC7;|jwE)^-JS6qgOV-YXzT4K0$!zmG`#7x~H$D_rUjApdZB+O(}dp2Y;S<}U* z$69t7s%IHYuuNq4glZv!J1qCI`#`ml!2ruZb}LjH8MLvqWw$}KltJiQqIz!>TA(T# zg$h(zqfmw_rVh^3#CYVvp&UaQlqoT#RA#0k#YTs@H#4V0poB-ZCnJA6kkH5tZ~Pxb wzV~COVGu%9M7+z48NwJ!7>aYil0KbDwB_GO482|tP07*qoM6N<$f|87r9{>OV literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_opacity_black_24.png b/app/src/main/res/drawable-xhdpi/baseline_opacity_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..f63a7047c5ad7f38dbd602a51467b283a2b46edc GIT binary patch literal 469 zcmV;`0V@89P)9xNXzs4%y%_slaCzV7Iq)(za;BNaM^mIoG396cfPqgH5-%10#rseZka%Az0%RmM zPadft;B|b7FkwpapCRC7e3>NxmMD8w5klgru!_Pe6)!46WF@9X6hK6&nOErJ>%>q* zjJlhO36iqjAkJUnG-T$D39MYpYKt9)*`XzKS6DcZwGO-dXP1u59$;vaZ?)2AADw;r zYP!fIMvmo8Czv>u`6Eoor6w_zluI`dllMe06_K47S_w7!fsM4hZDp`NDfo0z`(^%;OkfPCznL=SdazcY_UL)u@UkEI1xyhY&1}j00000 LNkvXXu0mjfKA_4s literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_opacity_black_36.png b/app/src/main/res/drawable-xhdpi/baseline_opacity_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..47a505688fb7e2399c04c79e27e0963beeeffdce GIT binary patch literal 634 zcmV-=0)_pFP)wmsuLZMJd zW*+nSgG?t$lIed|j&_nljyy>}M?Xm`N1mjgqo1Ueqn{+m`N~)QBzaC6&1p$gKS`Do zr8xlYiK!aQyKW?ulLR@PF%1#Cy%lp3bjEMAT9P2A7a5tQk|f9(NM=^aljL86 z1Ify!bpJmdMd{xcBgoFqbT_?GGC=fbbFtfZ6`?T-8jvQ)0m#E4-{o_v5l}(y`9|lE zb9p)9yS_mI0$J!AT#lXmT<|SSCV*N*JY$=%SD0&_jdzqlY@2851Tw|A<=I()P$|#b z`3;qjs?K|3=>sJZ8RdCgqZGf%Mj~?An0QETg2>HNW9qsIAEG|Vyd_KKv#zgJkh=QQX(){Zz0I)b&;PJ`B9t%K8`4p=Ko z!dXs&vItyo7IXoTk=7i?8ZAU#Ud^3)F+=6G%bss^;9I zAOSTbO)V#l1}GS)7SsnN<5Y6Sp=ffzm?#5KHkz0?=Q&MrpdmLzIajENBY7Cl2dkL( zj3+lvRc1Y(bNHLJfy(?6Wf{k{EMu-QjWoX3`&hXxNfzGg))|4g`3Wahi1*WMn U)}~Bh=>Px#07*qoM6N<$f`TF+LjV8( literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_opacity_black_48.png b/app/src/main/res/drawable-xhdpi/baseline_opacity_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..3c85bbb125d49e46fed935a6259d1a6d12bd7f05 GIT binary patch literal 880 zcmV-$1CRWPP)yrlV9TZrVoy0Zj;Fm@%sbNU#5b5{Na2x+{+cR>Eknw@4_(7 zs}-_wPaAC-Vfay4rU_IKi$903sKPNvUx931i@%s~=!9o6j%MzW%}eoD5*|H>$V#tN z$gPjhdLr^Wky-DB3b}cxjj@%;{7F={idHa)zn!T3jp%H5vqC!VYuE1~I)5t`d$eaf zASc4&aZ$VaAhGxtaXF|x=dNsp2<+CbJw{yqRRWG_&$>wh#Ej9dJoTR|lWdZv1S&IGE1;+gSvxRSQ3S2%F%a- zgKcSfrEGad6s)L^qfA!>Xs-VCuwsF7>S{aKB%C(4l#krYw=(T=ejI4;f&jGb_`zzK}4 zbhW@rj16|Rz+jBEbhSWBjOB2(Kz1y6l|-=qK`RNC^}c^63uvA8U? z7JmfcaYYSo8izka1zZ$|Nk*^xwuHxZIhe%De-8hUZbZd164Hqse;s}Yors4ArKTmb zxsHQ=t}~mKq{j1-P>zoD_%xkqOeG4DmKX#Afj}S-_}P2fQ8CcD1E1{x0000|k1|%Oc%$NbBJUv|;Ln;{GUTb7!FyL{y*mv#X zrpjBae5;mL%xCUkKQZA;;MVKytHTu*@a<-OWuO273*sF_%ebe!uTGRV`TnZF_|B9i ZtSJ_vt4~ME-vJuR;OXk;vd$@?2>_7AD%Ai0 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_24.png b/app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..86e54e0c696fb8ee1af380c93940b8592862b46a GIT binary patch literal 118 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDH3?y^UWFG-iYymzYu0R?HmZtAK52P4Ng8YIR z9G=}s19Id%T^vIy7?TyG4gUYHXJ9}2|L6bzpXJ#UThCv;!pPvbv#$7;T!lYKyQiz4 J%Q~loCID4qA^rdW literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_36.png b/app/src/main/res/drawable-xhdpi/baseline_view_carousel_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..b0375366d22e9a6a89a5a9b09bf73fc284bbba87 GIT binary patch literal 124 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xf3?%cF6iIT!z<6JD$k#_5LN5{51j-L9pi9=a1r#guMwKqafYZ?RB_WY zDr#88j1kom`VJ;(M|qvJrs*m|-;J008J%U*8g^7ZLyf002ov JPDHLkV1kxisfhpp literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xhdpi/baseline_wb_sunny_black_24.png b/app/src/main/res/drawable-xhdpi/baseline_wb_sunny_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..5da77de52fe61c8d30b006dc88cf3ea81b150db1 GIT binary patch literal 396 zcmV;70dxL|P)Q2U-QLdvSd>cX0Xsd`~ue`CjCHKR)mu z7^T%J(8?$Vh7laf(W=Ek7{G^i4BUcTOs%(l|$M=THY`iB&={ z6~gNM=PNK!!3FaK@mvJWEU?J|`)o2#3t>DL#5@;NU?`J7p2Rc78S-kUOcBGAK(ers z&oSa*$K>-yU5Jl$^9DJH&pG5_DT*V+U`Iq_Wdu zn!N(0*{uu)4F<_G7_^Vo;z6s~he!4hriKl;aZ}Tc4b%{3kJlW9qK>Udv6VU$$}CCC z`E4T+NDx6I>bGHXFkk_Glx8!r0y)hn%@*ciKqf(yW<8UzVG^|{%>bDgl1TvdTR*Yb zl0b`=lZ*$F@w?^>V<*`h<02P0P7d1{=9=Uu8IQ!`cgR`I9m-H`Ea5Jz9g-~HkFg}v z5z)LsIrxldIwF+_#96@yl)HRjCEY*_b*TTeju^U_(}Yk4hB!?Zl7aGI7G1<58a)Ly zvKV<7MIOqdd5lJ!D<}&uBg_mMtb*#9i70nbmfk~zY_R4f-15D5y%1r>+{703mB5DEHV66E}ze;^X{ zz~Dp|u8IU*L5x)*L8}m?K;XAbl-mM79HLC6-YTboDF}19cl~38(R{V|Pdy5GSS)bY zAxxIQeVH)ljPG2}(8a_X+LpQLpC#N3~B-0TwF7u)1#LyABti^&@nrR_{j#*_q zLCYaXwZ|lF#@IrX!;Epq?-}Doj+4U>`g*~>OiS|Nk^S-;MGkw< q8C(Jn1`P&%+fZ=O=nAV*FbV*pw|QBAqy!2800000!|=`WH867z#K9#ND)FQiPi+>P>PU^AvPhu^MyogkVq-=J4F~^ zH`10b%tV_+z94PcM1&kdI^`oX?Tp`+14O_s1W{J-8Q&*6@XSoU_*IySQ9}IMO!Ld+ z5*l1X+G238^Hq4w6f~H^JD>3rjUCq7@|+21F@@LW#|N0xrtpX{gklEkIKf34+D578 z631D`OhPe%=LX03QMkuQg3*Tz9w9+;pGASYRxom=UP6QdM9j>KsuOIErT^K)O<*Do_&cT;2tqs|vi(7x=C! z@LgY^RaKxxU!YM{piy6-OjV#vU*JW&@5IHb0>$11;^jo literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_24.png b/app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..ad14dfeb9fcb3669d59c0077ab851f2cc95eff6b GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xf3?%cF6Bh)#+*@YF$K{tFgRJy)^>bP0 Hl+XkKS(`R` literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_48.png b/app/src/main/res/drawable-xxhdpi/baseline_dashboard_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..bb705f3bc4411c37aeb9ecf787ceb84948ea118e GIT binary patch literal 139 zcmeAS@N?(olHy`uVBq!ia0vp^6F``e8A#skDEJMe*aCb)T!AzYEKT2e9!N2k1o;Is zI6S+N2ILrfx;TbZFeWeHm07rl+f)%Q~loCIHw!Di{C& literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_dvr_black_18.png b/app/src/main/res/drawable-xxhdpi/baseline_dvr_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..5dd9ce4e9ce1fa5e38630ce5cbe545f75852f848 GIT binary patch literal 286 zcmV+(0pb3MP)41u(5_*-wm^aGDwC=%UHjVaEP-eD4Pg^T2^~Xiq7nR6
        ~8`I6dUL&(4T{9%z5XrT??pa6)fYFk}od#$}kR4|qr>j_Q>aIUFqSNDJWet!T5 z=fiNZgPEC`nVEgp<(NK2!`I`OEca8I(&wQ&FPSJKx)Ab$vSNX?3AoQc4$n|@Qt%O56CLALj_GQzw?8z zS`#MhURafc2@^IDCM+;)@tL&jRk}}Km@r{gCaf0#CQMl5FONH6!h}^x*sZW8CM^D! zNBdzn2oqN4gk6V)2@}?U{xj@Kn6O$Cb}3Aluqp|=hz}FiZ^gg3&&fI?wO~hWeJRl; ztHV4z>z&db!^3)%w#IX4))OmG-ZmeBe}w}-)p z*6;Z4)Dq0(*CcjWj6qV-C4k9NYSLppeO`m^!!g#+Z65xTU0Z)+c}f}#)Jvw$l|9!f zbyw1Qjp4EUdok9cd7VyW&aGniE--|wk(bWcG2K^y*(&t1>BpH`;K z3O76BTWAyhWzv~udEJYLj4OYvxqIZ{=6xG~JbF4G;>4foUz*!-Ar*{o&oi0k^5V7XFd;Z+qiHaqwAf9Uu6=OV literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_highlight_black_24.png b/app/src/main/res/drawable-xxhdpi/baseline_highlight_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..881d6b0dd2f28b7b91e8cb6ae7535d31955b2989 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXoKNz{u$7;uuoF`1T4T8&jZ2>%(AE zqa|luSOnfGGDUeZ+;L?QGEfj;QMyJnmr^TRG>$O-aj$r#loBEHqmm@1Ee1{CvrTv~!&v$xP3m zUH7^qvh{R<(~39OCYf|v>{B*c!1?k=>4Pr2An6DH4ofadJk0g7RrJ=DW7@mIOrBe; zTu`vb*V8It!oMr5?ZOlJUML!>zn$x>^mfkY@|6xzXIX?iK<)q%+eFTZ9a&>~+~FLD zOp)7z3C2wAa|A7(^c+x3XW_F{E;teRFBPH^q`b~+rFnJWuHyM0t~vt4gu&C*&t;uc GLK6Ujn0*ug literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_highlight_black_36.png b/app/src/main/res/drawable-xxhdpi/baseline_highlight_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..9a9c5e8031f0a442dd5196f8616dc25f73868f41 GIT binary patch literal 449 zcmeAS@N?(olHy`uVBq!ia0vp^IUvlz0wh)Q=esd5Fm`ylIEGX(zB%9M=A0V=U||tuYC5Q=a#Sb%oV~=Hx2?Cn&*iV4|D3C? zV&3!0dE4iPW;{KW$X9%0+aZ}}2JMz-5|iI)Y&ys#C$T)yw4=JqXG65h;f@o%83Mn= zbpzJQ{Kz)vP!yZuvL>Z*f^YZyvr%!u$C9tE_?ob7P&2It*&J3K39a!89}3uC!uxzft{nelAV>EDj-3drBi~ul0OACFo`V4$FOMKrM~V~YwY!Abs9gFy z;Y3%vOO>2Zo|bQ2lH&mMzu|=!H|KC!&?9MzcaAU0N(Guyxmb!622HQilmzi8G4G9%8^s#v?)bSn^NWUDSb|Hfr`si zroM;~=UbnXr@n~+(9e%PCrf4N1K$XqJ|{^HVw+UFD#Da!r+o9GoFX+$K5OCRI{36w z$OXXPtbe3P({Mtp`j|SUE@5=@T5ySmP!B7vaKM^dm>qy23+b zD!DV8CnAW=n%ONCNY(RVcGHNZ%%}?&LuQvksL@Q4xOy<#CPe1VU;tO6W;=(-x%rT* zaaD)sug{S%Z`BwmsuLZMJd zW*+nSgG?t$lIed|j&_nljyy>}M?Xm`N1mjgqo1Ueqn{+m`N~)QBzaC6&1p$gKS`Do zr8xlYiK!aQyKW?ulLR@PF%1#Cy%lp3bjEMAT9P2A7a5tQk|f9(NM=^aljL86 z1Ify!bpJmdMd{xcBgoFqbT_?GGC=fbbFtfZ6`?T-8jvQ)0m#E4-{o_v5l}(y`9|lE zb9p)9yS_mI0$J!AT#lXmT<|SSCV*N*JY$=%SD0&_jdzqlY@2851Tw|A<=I()P$|#b z`3;qjs?K|3=>sJZ8RdCgqZGf%Mj~?An0QETg2>HNW9qsIAEG|Vyd_KKv#zgJkh=QQX(){Zz0I)b&;PJ`B9t%K8`4p=Ko z!dXs&vItyo7IXoTk=7i?8ZAU#Ud^3)F+=6G%bss^;9I zAOSTbO)V#l1}GS)7SsnN<5Y6Sp=ffzm?#5KHkz0?=Q&MrpdmLzIajENBY7Cl2dkL( zj3+lvRc1Y(bNHLJfy(?6Wf{k{EMu-QjWoX3`&hXxNfzGg))|4g`3Wahi1*WMn U)}~Bh=>Px#07*qoM6N<$f`TF+LjV8( literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_opacity_black_36.png b/app/src/main/res/drawable-xxhdpi/baseline_opacity_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..2f9270c7c30b5a0b57c0c5f8d0c57eec7fa9bec1 GIT binary patch literal 930 zcmV;T16}-yP)Dc31&el!~z`zmL^0f|n zUK3|r%hnnZn7QIwp4RoX&Ad{>!*YPAODhOl+JuEaO_dGT2}Wa#NB$F#g^%( zc@wAVTeHGQc#0L44MTD0BQ6@3_9cvzXIXDa`wwTP7#H>+grqmwZ``w)Fi!ktTsNH% z(!Su7aaTH=7;ac~f>&@Mkuhuq4!mu=Qjr-~8XD97MqDGqnz6X^AZra9dm=2vfxwb; zyo5{N8r~x(c?41a8lJr-xHi+Yt1k;hD>b zh7yL&uOcS3Vf+(lc+;>sEn+GMhOb7;Zu1ot8QlZJJECQP;V-wCIf3ED&{96Idof}* z2Zkp_OFEa|iw6V4zeLLqf!&7?b1pFab+o)`xJfU?aNqbDv^*QweFZTm0>d9b%Y%k< zKrwr{=Fwv>Vm5dcwh=KCyb7Cum{wkewL(l`ufhr=<`=KRenHFwT=XXE5>W)r@+NF1 zqH1~*Rtr&|c@y?7!d7^ZwE}Tvya+3cxMw*N^Q^Nxg9EL+{LdlaU9QA5>k9ASNZXi( zwZ)mIITo|5V?2#RxnmZV3wa)#n@z&G7dWb(b(H5(kVHK!5lX76W>rB^FSV@BsEROB zC2JI6ltt<1JZn4;g1!)~w6gT&bM~LVziO7jyDW6@_bDSDh)|OAf>}d&8E?GHJdvo? z{Do&iWMTbXMXe_*VZ0O~88hzabaW=k3E{ct$;L2F-}2qA2E5Nb5cjNC_=6PWqCDluO-g>}749Q(adB~RadC0i0l7x2@MsfdJ^%m!07*qoM6N<$ Ef`9U~KL7v# literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_opacity_black_48.png b/app/src/main/res/drawable-xxhdpi/baseline_opacity_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..237e3644a5314674fcffa2c471855d678c249f1f GIT binary patch literal 1234 zcmV;@1TFiCP)Kjeiop=oG4fGEKH9@D3KH8UY-&bW|$=?mlNey zo(dLcWXn<|C(5Nf%P_i?s1@Ju_}s`-#WIY|>eS1LvY)4x6){obb+Wjf(R<9q_h=ReD&|CkA% zW~Q(8x!V+Yw~J*^HH+ZeO0-xOorrfoSuPbfB7~zXf%;O2R~uW#+(IaCT2}3^<@~3V z=?P^n%k%vA@MtQ__xnMFbeQEEe>S{1)HvgB@(C&5^4sh zegLMR!nkkN&}Tqrqrr8?eY@br&Bg%>qrr;CeK&_aMf@Hu{xK~42@hs4ets@Qiwle! zXTZ6&jR)TdEjBW4Tnpz8G(KjT94#iN)%a}AxyucQ{v1s{H>|uI=bkkj`W`g7+pzLk zocmJOIgr5_hLvC8-0y}%?}aA28dm;}bN$S}9~4>Hu(BVn8Sl6(jwXv5|8U(o(;3Fx zXfl^^r*jSFb5up9H>_;Hxe~*ni_xUmu(Bk;gt1;!Pd{qRTUoJUqHFxhrWPF9BVyKG5X^H8uaK&hr;j6WDSzs?F2H5-4zp z+CT@R#1ks>JcSxl@Qu1WpHYk=GxNWyJbyC-$}CKUnmnb1TF8A}p@DR?AEo*!9+XdL1BI=_RfC?YB=(AQg@0jx`err{zQ zoX2V7My4iOb8#>24)c7&vP5rb9&r+>7l)HaMl8UsG)=-dzpyU_WXx=w$d?nHrkR)6 zmJC~v)A@3O9$dHb1_v@NIbjy|;=yseax3Q*&Sqn#CI`*UrX0_myvMivO$lwZP{zM} w&%50(J-++3bCZmRBuSDaNs=T literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_18.png b/app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..1d0056c0c814a9b992df8819b1aea1562ccc6bd5 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^W+2SL1|)l2v+e?^JWm(LkP61PH#YJfP~dSr*mH=Z z=fOn@-Px-57|a`5-g)jncKy?feJY+^ceZB~YVz>t6eVxE!Ljb^q< xFhP`_S~f`X&)s+~=GQyRFa9bv@|>jd_X*R6@^aQE>l`LBcLyk#Yr&wp6c98iv5QGs lmhu&AFv%n=ke6Ux%)oF^SF|)jRbUFp9#2<4mvv4FO#rUGB_#j= literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_48.png b/app/src/main/res/drawable-xxhdpi/baseline_view_carousel_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..b4391354c7daefbb92e3464f7ec776e16efed7b4 GIT binary patch literal 135 zcmeAS@N?(olHy`uVBq!ia0vp^6F``e8A#skDEJMe*aCb)T!AzYEKT2e9!N2k1o;Is zI6S+N2IS~_x;TbZFeXd5C5YVk&)#f*IJD#c|Ns03iUQRVoV{ES$oqTJoEifzH%125 W!@|J*h<2eBDg;S=lxS=F2k&u? z?cRHDG4%TZyt^Og-M#-Y*#vZy0e?=2D8v8QM8(Qpu`(94c%$qbEAvSULz)P}D|5Io z&ntq^G)yTU$YV=^XGD2ICTED28>X;fnmYvTDF&P($}6TVV^@f>fgue9;es4#N~}@k zfQTJdDUl|}C4vxPK}3`EZECdXA_>2VsgX;qYZ2i^g?D6#?^GBgyY!I}_Ng-_4iN*7 zz@I8&XcbSE=o-hm1bFd+Sonko8;GTwICE_syT*|sU)HfNiewNFCe*AT4pz{F2?Nk{ zkc66Tr`R?cN!ZDXMNYBEEw<+r+jEGG{V`^2kcv|*9I`<&$UANQ`~rjEOpfk)Z)~JeXmQB;m+WE+k2j8M{=>GYjbAiS|Sbo|~QGJY?rAEuaDv(!DJ{Gfmh1wIhvy-BW(XgS1|2BM`+ChPRn z;&WU$S6BB~$AB$<5Pmm{?36qUsQVAl6e2+g!!ia&ay#%qol6-)Mh9K!VA-f;3JeVp e2xJWe7zF@_YZnNL`CH=v0000u zn!N(0*{uu)4F<_G7_^Vo;z6s~he!4hriKl;aZ}Tc4b%{3kJlW9qK>Udv6VU$$}CCC z`E4T+NDx6I>bGHXFkk_Glx8!r0y)hn%@*ciKqf(yW<8UzVG^|{%>bDgl1TvdTR*Yb zl0b`=lZ*$F@w?^>V<*`h<02P0P7d1{=9=Uu8IQ!`cgR`I9m-H`Ea5Jz9g-~HkFg}v z5z)LsIrxldIwF+_#96@yl)HRjCEY*_b*TTeju^U_(}Yk4hB!?Zl7aGI7G1<58a)Ly zvKV<7MIOqdd5lJ!D<}&uBg_mMtb*#9i70nbmfk~zY_R4f-15D5y%1r>+{703mB5DEHV66E}ze;^X{ zz~Dp|u8IU*L5x)*L8}m?K;XAbl-mM79HLC6-YTboDF}19cl~38(R{V|Pdy5GSS)bY zAxxIQeVH)ljPG2}(8a_X+LpQLpC#N3~B-0TwF7u)1#LyABti^&@nrR_{j#*_q zLCYaXwZ|lF#@IrX!;Epq?-}Doj+4U>`g*~>OiS|Nk^S-;MGkw< q8C(Jn1`P&%+fZ=O=nAV*FbV*pw|QBAqy!2800002fjZC9R8 z+pa~i1mQp|cO-%sG_7X-%d$c!k(5*^9iT%JG**ptj6cb$33^~ZFQF63%B zH`9s~xK?gq7`f^~5|8ai15)G~*pHGd!G%b~T||Nss{@ZB7WNPwD51LZDq?9b(}NPJ z2k#;l_c~p{e@R|LEbldvc<*$?!A`?-3utu$Yh?i*OYjlmXdjZmTZbbKceuaPu)-;< z!q@3|JmPrAqS`7%X{%7}Xf@a|L~K`{ z&pNZ4)nGSc_I%duTG*{*_O=@AEsXNqe34+^s=>a|g;l7*%5`BaYOoevSe+WIP8as8 z8thkH*e7bRPjz9Bs=*$O3LDAFtTQ`b4R$_eE3DD%bEhk8lkq zaWGr6fH-YyY05=X#ccbmvb6hVDH<)M21!{3)3De?^Nym11-NbjHRijpJ=$1)LCjIb z1Y9Jw?g^HWxB~m-56&o?5It z*k{!LUt*eTijAC0?uVE|({&WL?r^O+shTTj`B5S;+a^5tvBAo-vPmZ4TRol}OLi&0 zn3Epx*g~`T_{u`Ivt|7sUzm3sT~c=|iOq0<)ztehRK7m8`q>*Ssc`pzO%UVk=LHy2aQ8^_0vdZwv$t+`}^*BwK) zz=h}1ZC5^7`?MiO!SX%};jN3%+OK+r=dNglWm| z#wUB^1>gCU?P7lW#3!YCrpkut6LNR4TrhFjJxz{tf!sRRP5K^6zlBb!oo4WL+YoG_ z!(7r4JTcqCGedd8YhTR;=9){c9Qn0MjWy)-PpNLkSt_h1p8OdLMJ_1WF8CVc@cL`R zHxI_Q7nxs8WO{Xt`PBrbR~MLXX|rw#=g(Lya>31Z!OlqdD^LvJ(uxj+^vT8}>PEdj0sm-N*jJXW}L@R7u`Em*Q@- zCt$z)@@4m z_s>0^LmKzo9XcQ9k9Fp+)#;K zPB{o0Wh8f#KfxFzeJjUilY`qAQ@+|Gz6!i4F7p?~umy-XFoMx4cs>L&TsQxokrgQ7 c3PL49$~W28zAp6*17?2)Pgg&ebxsLQ0N=UZPXGV_ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_18.png b/app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..ad14dfeb9fcb3669d59c0077ab851f2cc95eff6b GIT binary patch literal 126 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xf3?%cF67rl+f)%Q~loCIHw!Di{C& literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_48.png b/app/src/main/res/drawable-xxxhdpi/baseline_dashboard_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..e2fc973b4577199ef4da32e94a2108e1ef7de58b GIT binary patch literal 141 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvS8AxUb{c{0QYymzYu0R?HmZtAK52P4Ng8YIR z9G=}s19D6~T^vIy7~fuMWMyy=U_SVM|4Vy|po4;EnhY2!t-R__XR$Ldcr0Lu*}@RS h-tg}?14Bc}WrpJEKeBc`w08%Y>gnp|vd$@?2>`4yDOvyk literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_18.png b/app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..e90df3db5fb8760895f13318fe299c1279206f96 GIT binary patch literal 260 zcmV+f0sH=mP)41u(5_*-wm^aGDwC=%UHjVaEP-eD4Pg^T2^~Xiq7nR6
          ~8`I6dUL&(4T{9%z5XrT??eesmE(rFyuf3DpG(|4A|S86l8PA8&ih?)QriR zkpgW-)>9}zMb;)1U`H-K6Cj{$KqEjv;ecAe-zK2t_w-9^|Nk!m0tyFgI|2j< zi2jg$3J_2@;6p&i1Vn$x-USFK9I)vK5FjA>L-r;>K;eM300D&qUIiRI0WYLLdyal` z_CVHED8MCI7lF<$x15p3O&Gv6dm9A#4jwt-Ktt|&fBb#RDXpC|>FN3XJrhP8z0`64 jlK=q%1PCxQGc&Vqk7asghZoPj00000NkvXXu0mjfLrH}B literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_36.png b/app/src/main/res/drawable-xxxhdpi/baseline_dvr_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..32b7bef9864c4f88870e5699a1172b789e376bb9 GIT binary patch literal 483 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q1xWh(YZ)^zFs|}+aSW+oe0z6mw}-)p z*6;Z4)Dq0(*CcjWj6qV-C4k9NYSLppeO`m^!!g#+Z65xTU0Z)+c}f}#)Jvw$l|9!f zbyw1Qjp4EUdok9cd7VyW&aGniE--|wk(bWcG2K^y*(&t1>BpH`;K z3O76BTWAyhWzv~udEJYLj4OYvxqIZ{=6xG~JbF4G;>4foUu^J4wY8j(%Bf z-ejs?to&DUGw1c$vn{8dojF(kve*7p=c?URTwT0Bb%S4B);Y6U)8=4YYNDO*^uJS> zb!`svJy~9I@k>nZOU5$O%f=_`&aM@cPuTv+UF~AH<;73TZ*ul|9$%~VfgyS(-*5F= z)^pME|9stZHNG(1p27EP&yDujYqQT^j_^Oo9^o$)9sOa?TJPlD-1D~I&3xl@@N=1B z?_Rx%dvQxQZfsk5V81-j*9;6R7!pLlj1X=ECNN_as{|XEag~XO5yWW7Vq{}vsF=^p zu;8n`{WrNad-wkbD_~e5wg6&E2=@hcu+S>j7px#H{1Ohy!tY8;A?gn3zlJdMSA%4M zKpz<56POteh^MIC`J4r|hT*_w7~?XGAq-Ocqk+-H?4evZH;BW)AQuW_guxggP{uo$ zns#of<{i(b5OK4hZw%;?i zU($V1@p;ce%+kyDovFTfBRcLXV+J3@OBkdFJRt!YQui0IFwAp)W9^$Vc`it)r>mdK II;Vst0B3Rsl>h($ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_18.png b/app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..881d6b0dd2f28b7b91e8cb6ae7535d31955b2989 GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY0wn)GsXoKNz{u$7;uuoF`1T4T8&jZ2>%(AE zqa|luSOnfGGDUeZ+;L?QGEfj;QMyJnmr^TRG>$O-aj$r#loBEHqmm@1Ee1{CvrTv~!&v$xP3m zUH7^qvh{R<(~39OCYf|v>{B*c!1?k=>4Pr2An6DH4ofadJk0g7RrJ=DW7@mIOrBe; zTu`vb*V8It!oMr5?ZOlJUML!>zn$x>^mfkY@|6xzXIX?iK<)q%+eFTZ9a&>~+~FLD zOp)7z3C2wAa|A7(^c+x3XW_F{E;teRFBPH^q`b~+rFnJWuHyM0t~vt4gu&C*&t;uc GLK6Ujn0*ug literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_24.png b/app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..4814825998e855beccefa8dfb2578c043f575fe8 GIT binary patch literal 363 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD0wg^q?%&M7z-Z*@;uuoF_~v{g+o1xH){p$G z3P~=D6JP9P`Zl4_iJ>tupevLABJYk2wQc_+3-*6zdfvW7qid1IruD1}42(aL895vn z!ZtI9spOpRKD?%(t8bFa)Dnq&^%snyZ5Nj*PT3;yjHPz!;%F|lupfWr94qgCpW&ua zkuYP1LBV}a%f;4-Gv)wUfvgb+wqt37b^6KKaM6FwOUsQP$bN zb_*4q1KpH&+*dZq3D~;u;+=9P^Zo0U?y!8HTcGG3dv2y~pvXz1k9KcwZscW95MbUY zKiAINn3YB4K1-o2(7OoG5YG7e#UE4gQyYKI^nUvOXFA8s(@X9D%Q`I!`StmCi_gw4 s&%SfcboWZEn>*oteRCW_Cx|skCHL#0td%*PEu0{(r>mdKI;Vst0GqjvT>t<8 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_36.png b/app/src/main/res/drawable-xxxhdpi/baseline_highlight_black_36.png new file mode 100644 index 0000000000000000000000000000000000000000..9f251dc35a61acfabc0f89e50ea2953b3639a834 GIT binary patch literal 454 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q1xWh(YZ)^zF!p-7IEGX(zPZ-O=Hw{S@{rM7 zaBo0@Bfm6Do&&##ND{Mj!U3l3#?GJLGtc?xsds7qv>-3drBi~ul0OACFo`V4$FOMKrM~V~YwY!Abs9gFy z;Y3%vOO>2Zo|bQ2lH&mMzu|=!H|K7uMlx2JzDW%T_gd`r)Bk_s4===(7+a4;}1GAJ-G zurM?*FbDt*WN=_$n6qQ~WoDbB$6_C=-}B@BAh*BpX8Au;2VVp6gtPnWVz$lQuP}o# z;LLr`fHUy|XBae|-Jks6@qM1|go2}g{<0kX^O^J2&+D<}bL;IK4eRY44gc3PCH<=d z;-4&E|FAm#2P=@~w7dSguIb;;-5f^mcv*5kiHEQy03pe7ryejd>Y8|z8iaV zp3T3Kd+*O`AnjdnWWuHy^=bzNn@?4K7H4ti(PlpzFU&J59uyAm4)X&8lXS4a7DwmsuLZMJd zW*+nSgG?t$lIed|j&_nljyy>}M?Xm`N1mjgqo1Ueqn{+m`N~)QBzaC6&1p$gKS`Do zr8xlYiK!aQyKW?ulLR@PF%1#Cy%lp3bjEMAT9P2A7a5tQk|f9(NM=^aljL86 z1Ify!bpJmdMd{xcBgoFqbT_?GGC=fbbFtfZ6`?T-8jvQ)0m#E4-{o_v5l}(y`9|lE zb9p)9yS_mI0$J!AT#lXmT<|SSCV*N*JY$=%SD0&_jdzqlY@2851Tw|A<=I()P$|#b z`3;qjs?K|3=>sJZ8RdCgqZGf%Mj~?An0QETg2>HNW9qsIAEG|Vyd_KKv#zgJkh=QQX(){Zz0I)b&;PJ`B9t%K8`4p=Ko z!dXs&vItyo7IXoTk=7i?8ZAU#Ud^3)F+=6G%bss^;9I zAOSTbO)V#l1}GS)7SsnN<5Y6Sp=ffzm?#5KHkz0?=Q&MrpdmLzIajENBY7Cl2dkL( zj3+lvRc1Y(bNHLJfy(?6Wf{k{EMu-QjWoX3`&hXxNfzGg))|4g`3Wahi1*WMn U)}~Bh=>Px#07*qoM6N<$f`TF+LjV8( literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_24.png b/app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_24.png new file mode 100644 index 0000000000000000000000000000000000000000..3c85bbb125d49e46fed935a6259d1a6d12bd7f05 GIT binary patch literal 880 zcmV-$1CRWPP)yrlV9TZrVoy0Zj;Fm@%sbNU#5b5{Na2x+{+cR>Eknw@4_(7 zs}-_wPaAC-Vfay4rU_IKi$903sKPNvUx931i@%s~=!9o6j%MzW%}eoD5*|H>$V#tN z$gPjhdLr^Wky-DB3b}cxjj@%;{7F={idHa)zn!T3jp%H5vqC!VYuE1~I)5t`d$eaf zASc4&aZ$VaAhGxtaXF|x=dNsp2<+CbJw{yqRRWG_&$>wh#Ej9dJoTR|lWdZv1S&IGE1;+gSvxRSQ3S2%F%a- zgKcSfrEGad6s)L^qfA!>Xs-VCuwsF7>S{aKB%C(4l#krYw=(T=ejI4;f&jGb_`zzK}4 zbhW@rj16|Rz+jBEbhSWBjOB2(Kz1y6l|-=qK`RNC^}c^63uvA8U? z7JmfcaYYSo8izka1zZ$|Nk*^xwuHxZIhe%De-8hUZbZd164Hqse;s}Yors4ArKTmb zxsHQ=t}~mKq{j1-P>zoD_%xkqOeG4DmKX#Afj}S-_}P2fQ8CcD1E1{x0000Kjeiop=oG4fGEKH9@D3KH8UY-&bW|$=?mlNey zo(dLcWXn<|C(5Nf%P_i?s1@Ju_}s`-#WIY|>eS1LvY)4x6){obb+Wjf(R<9q_h=ReD&|CkA% zW~Q(8x!V+Yw~J*^HH+ZeO0-xOorrfoSuPbfB7~zXf%;O2R~uW#+(IaCT2}3^<@~3V z=?P^n%k%vA@MtQ__xnMFbeQEEe>S{1)HvgB@(C&5^4sh zegLMR!nkkN&}Tqrqrr8?eY@br&Bg%>qrr;CeK&_aMf@Hu{xK~42@hs4ets@Qiwle! zXTZ6&jR)TdEjBW4Tnpz8G(KjT94#iN)%a}AxyucQ{v1s{H>|uI=bkkj`W`g7+pzLk zocmJOIgr5_hLvC8-0y}%?}aA28dm;}bN$S}9~4>Hu(BVn8Sl6(jwXv5|8U(o(;3Fx zXfl^^r*jSFb5up9H>_;Hxe~*ni_xUmu(Bk;gt1;!Pd{qRTUoJUqHFxhrWPF9BVyKG5X^H8uaK&hr;j6WDSzs?F2H5-4zp z+CT@R#1ks>JcSxl@Qu1WpHYk=GxNWyJbyC-$}CKUnmnb1TF8A}p@DR?AEo*!9+XdL1BI=_RfC?YB=(AQg@0jx`err{zQ zoX2V7My4iOb8#>24)c7&vP5rb9&r+>7l)HaMl8UsG)=-dzpyU_WXx=w$d?nHrkR)6 zmJC~v)A@3O9$dHb1_v@NIbjy|;=yseax3Q*&Sqn#CI`*UrX0_myvMivO$lwZP{zM} w&%50(J-++3bCZmRBuSDaNs=T literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_48.png b/app/src/main/res/drawable-xxxhdpi/baseline_opacity_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..7dcc2836e6c35d1111b77505b0186e29c0d61b79 GIT binary patch literal 1632 zcmb7_eLNEg7{@neMwc^1&E3|Tm*J#V44IcSW|{QEF`y$L(D4YdIPz)qqE z-e0A>F9QLoxG~Pj1pvTkBL3LPAAqYbFhJg+uhfrG&1tS#qLQbPZM)RBRk1I%CoKsk z{JrBy#5&DE>)Dox;C*pLH;FD!*OL8fkpI_gNPg2aTgpd%)kCGkyLVrbw2E3)Q1!d1 z8I{gM7r0 zW;l)RJTRNJdXqOtV}NMI1JM((jHgOddpXPaJtZAvpxj!Jkz^ZoqehJz1-G`;NR(LB zGSc|6`P|m?T;80r1b6ighq_4!mnuDgUC$1gO{tPMAXT`YQCqbe-TT}?rx=(O)luin z{M`f_Q!&J!NduA1?uVRcfpQFKDgJ&;7?wWAcP^4~>Y!I*Ku>SbP=y}Z6w5{^h)FX% zMJyIs7CEa0ONTh7D`OdC83AdoXy=>>3hYY+5uLss+YEh^uhkh0ue~)y)C1c8u3!63 z!`e6?>D;A?kZF|W-{m{UWO^m}#I!~yU&o=UKfQqSRJWRU{Jv|>+y1N1T^g*|`V(ulU! z?cErDT1qlRZ)3*l?s4ec)asP*vWK)PdC+!$=mAkmYdkD|LDsc?y#ZVGdF|?Swq=TZ zIry^#A`*Yxdi_=qa2*=fLaoG{b6gpJ;-Q^a+q%>*9e|wbkACnYrsZ~>Evqw-nh0Gn zc(CV#jz?1E%jj1`kVQlmVTFmBdK^YVa*c!+5LpMSEl0-B-z1=ejD$W2@~^qzJ*nFl zeeRYZ+`dL-fPV{Hj}DndQqLz79*O(eEEbg9{P0y*lmSY^){ZKMHnsdBjiF0iGWZMZS>*GXkl3a%Gx4+?PfY1as^KQMBoC2Tw}F630=PL-MJlQorR_e@KU$6?7%IDw6_(r z>^fY?skl!`c9k8X&d93bkLXV?_1cT!Ch6IfnE~et<>8T+f0h?^!(R+_lB>lwGFuqI z-V>)icq=}^_WH0_@*T0}V5&nq%X_)V&NGHdftT8{dKTq2QM;_8-^dF?#ibpKHZSUH z-g1sB&iL9}e}`5ci29k`i?bfMqIl@H+}CK+$83_VKWA_6#V>a;{swdzB^>Nc1yG^w z-1Cmt&OoLrn-Dx{=KUY*HHUv1e$7t>6hgyeW9CT=$Uc4&z}e_Ybt_mq=&@KQ+!pWA zj4hHK4;``lDarUcY-yH)5{bH zH4ykx!jW#ske>8wEVCa2p<_7{7IXVNQc!i+fL^{5tARfao7VqU zVQOUp_BLp@JnNEtu8P4Md;>gb;x0?cIY3`?nD)vSU+|&re+-xC255OlTo!aVq6?6s zXEI&ZaV^>rraxGHY$-jE@|ot1sBl{Jc^0?-$U{9vf>o9EB55K15Q!X@_$Y&EFHY=! zIW~Kg!r69MD=x*uaKC^YJ{s;AX>O8RMfxKGEN$$so%vj%|5RHMI(Zwp^923qsxS-Z zMJiH8E)T2>jD`x<#`gbo0`a=`n9<}&0pd|L#>SlB)D)SE>Dzn$Kd_bn9tBT%wY(m^ Q|K%SL-MsPlUBl`B0Ld2@{{R30 literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_view_carousel_black_18.png b/app/src/main/res/drawable-xxxhdpi/baseline_view_carousel_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..b0375366d22e9a6a89a5a9b09bf73fc284bbba87 GIT binary patch literal 124 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xf3?%cF6o#h5YULGY{91ie<}XOl)78&qol`;+07UC3?*IS* literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_18.png b/app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_18.png new file mode 100644 index 0000000000000000000000000000000000000000..36c6850217a95b692588408fee26eb27383099e6 GIT binary patch literal 656 zcmV;B0&o3^P)u zn!N(0*{uu)4F<_G7_^Vo;z6s~he!4hriKl;aZ}Tc4b%{3kJlW9qK>Udv6VU$$}CCC z`E4T+NDx6I>bGHXFkk_Glx8!r0y)hn%@*ciKqf(yW<8UzVG^|{%>bDgl1TvdTR*Yb zl0b`=lZ*$F@w?^>V<*`h<02P0P7d1{=9=Uu8IQ!`cgR`I9m-H`Ea5Jz9g-~HkFg}v z5z)LsIrxldIwF+_#96@yl)HRjCEY*_b*TTeju^U_(}Yk4hB!?Zl7aGI7G1<58a)Ly zvKV<7MIOqdd5lJ!D<}&uBg_mMtb*#9i70nbmfk~zY_R4f-15D5y%1r>+{703mB5DEHV66E}ze;^X{ zz~Dp|u8IU*L5x)*L8}m?K;XAbl-mM79HLC6-YTboDF}19cl~38(R{V|Pdy5GSS)bY zAxxIQeVH)ljPG2}(8a_X+LpQLpC#N3~B-0TwF7u)1#LyABti^&@nrR_{j#*_q zLCYaXwZ|lF#@IrX!;Epq?-}Doj+4U>`g*~>OiS|Nk^S-;MGkw< q8C(Jn1`P&%+fZ=O=nAV*FbV*pw|QBAqy!2800000!|=`WH867z#K9#ND)FQiPi+>P>PU^AvPhu^MyogkVq-=J4F~^ zH`10b%tV_+z94PcM1&kdI^`oX?Tp`+14O_s1W{J-8Q&*6@XSoU_*IySQ9}IMO!Ld+ z5*l1X+G238^Hq4w6f~H^JD>3rjUCq7@|+21F@@LW#|N0xrtpX{gklEkIKf34+D578 z631D`OhPe%=LX03QMkuQg3*Tz9w9+;pGASYRxom=UP6QdM9j>KsuOIErT^K)O<*Do_&cT;2tqs|vi(7x=C! z@LgY^RaKxxU!YM{piy6-OjV#vU*JW&@5IHb0>$11;^joJw?g^HWxB~m-56&o?5It z*k{!LUt*eTijAC0?uVE|({&WL?r^O+shTTj`B5S;+a^5tvBAo-vPmZ4TRol}OLi&0 zn3Epx*g~`T_{u`Ivt|7sUzm3sT~c=|iOq0<)ztehRK7m8`q>*Ssc`pzO%UVk=LHy2aQ8^_0vdZwv$t+`}^*BwK) zz=h}1ZC5^7`?MiO!SX%};jN3%+OK+r=dNglWm| z#wUB^1>gCU?P7lW#3!YCrpkut6LNR4TrhFjJxz{tf!sRRP5K^6zlBb!oo4WL+YoG_ z!(7r4JTcqCGedd8YhTR;=9){c9Qn0MjWy)-PpNLkSt_h1p8OdLMJ_1WF8CVc@cL`R zHxI_Q7nxs8WO{Xt`PBrbR~MLXX|rw#=g(Lya>31Z!OlqdD^LvJ(uxj+^vT8}>PEdj0sm-N*jJXW}L@R7u`Em*Q@- zCt$z)@@4m z_s>0^LmKzo9XcQ9k9Fp+)#;K zPB{o0Wh8f#KfxFzeJjUilY`qAQ@+|Gz6!i4F7p?~umy-XFoMx4cs>L&TsQxokrgQ7 c3PL49$~W28zAp6*17?2)Pgg&ebxsLQ0N=UZPXGV_ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_48.png b/app/src/main/res/drawable-xxxhdpi/baseline_wb_sunny_black_48.png new file mode 100644 index 0000000000000000000000000000000000000000..614beb3b70a5e7066a53dd00f06048977e739880 GIT binary patch literal 1602 zcmV-I2EF--P)G0000IFNklJa1PPP#I|I_b&hOl+JVDaU z?`MKpZhoT)l4KCX*95aDAc)ljZhl`AOmg#wNT7dymtY(fr-=^`vk6iq%rAUE6ICE( zB0>0{*$1R_{6ODA3t9i>51*i&DQF>0pkaQOAft5t@Ch=cbo_h4T|>8(AVU(s{{(r) zp^-H0D&}_yY|Za3va6WiT{Y?S`IGeEHdgaEyZC|}#|gN?adLdYP9A3sv*3JSw8j?I>Ce7 z5hB7kUM7Zl2J!>aiGIUCLSUN~9-x49vIQQbnZHqI6o-%sd5BQ}jyesjr+`$@4mQvL z0Clb=i&ViZS3{ki97U?+QF>D2OyUAkMK3Uk8fFO{NR{ni2{p<*#1j`%gG?kqJTYK0 zHAXKkAs%^&-qaA+a~$!^V_Z*-5a9#FL*FMtO|Sv+)D2*tQ4|nQEie@0G;;{?*h4g9 znuie2eF(!0MHDz3qr_=L6qqB9N$y3IcrONta|}`90pgfrC8Efc7$ZU(qR1Q(Op!*E zc_XHH7E$K27@~zdqRc$4^}m3t>q^Y915xNsjL?k&qR;{NHHS1ySl2Oz<_L z)UPo>3!>N-)H4uK>;Ni`l<5Dl5K-*Ha_?370GkoTZq^^*SwykV>JN}b6uVo0fUgk6 zeyKk|8=}}Y{Q*uOiant}Kmk!~hyDP0M6r4O0Zt-{J*hvyUPQ5b^#}L{QS3MR1AKre z_5=L^o|vTQ&T#FYt<=v(#8Wp? z6GV7V_os{Xa|6c^&pgfz)DXQnk9g#HdQoGH_38kJ(bz-LGjsE(QI-%ORW@J=HO$zm zA7eEZ-RM8atnT^MoP6R^F zFD`+C`9mjgbmbPF;~Y}DoZ~5Or3+yh=jL|_G|cZ3Orab^8Nyn!1V|AEWLd{h8Yldh7=x>WGnJF+nGZ7NYaDbSk2??;tO&dCm_#pa(ux~9%l`=(St5H%00jH1OE~v z$skA(2^8Vx_dbD}-&O)QzxN5;{KgVYar6I2f+jp5<>vpN1ZidSw -