Skip to content

Commit bfc62bb

Browse files
authored
Merge pull request #650 from domoticz/feature/subscriptions
Feature/subscriptions
2 parents 304f3be + 608efd6 commit bfc62bb

File tree

538 files changed

+1305
-955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

538 files changed

+1305
-955
lines changed

app/build.gradle

+11-8
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ android {
111111
resValue "string", "analiticsapikey", "$System.env.GOOGLE_ANALITICS_ID"
112112
resValue "string", "google_maps_key", "$System.env.GOOGLEAPIKEY"
113113
resValue "string", "revenuecat_apikey", "$System.env.REVENUECATKEY"
114-
resValue "string", "app_name_domoticz", 'Domoticz Lite'
115-
buildConfigField "boolean", "LITE_VERSION", "true"
114+
resValue "string", "app_name_domoticz", 'Domoticz'
115+
buildConfigField "boolean", "NEW_VERSION", "true"
116116
buildConfigField "boolean", "PAID_OOTT", "false"
117117
dimension "tier"
118118
}
@@ -130,8 +130,8 @@ android {
130130

131131
resValue "string", "analiticsapikey", "$System.env.GOOGLE_ANALITICS_ID"
132132
resValue "string", "google_maps_key", "$System.env.GOOGLEAPIKEY"
133-
resValue "string", "app_name_domoticz", 'Domoticz'
134-
buildConfigField "boolean", "LITE_VERSION", "false"
133+
resValue "string", "app_name_domoticz", 'Domoticz Premium'
134+
buildConfigField "boolean", "NEW_VERSION", "false"
135135
buildConfigField "boolean", "PAID_OOTT", "false"
136136
dimension "tier"
137137
}
@@ -151,7 +151,7 @@ android {
151151
resValue "string", "google_maps_key", "$System.env.GOOGLEAPIKEY"
152152

153153
resValue "string", "app_name_domoticz", 'OOTT'
154-
buildConfigField "boolean", "LITE_VERSION", "false"
154+
buildConfigField "boolean", "NEW_VERSION", "false"
155155
buildConfigField "boolean", "PAID_OOTT", "true"
156156
dimension "tier"
157157
}
@@ -187,12 +187,12 @@ dependencies {
187187
implementation "androidx.work:work-runtime:2.8.0-alpha02"
188188
implementation 'androidx.preference:preference:1.2.0'
189189
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
190-
implementation 'androidx.appcompat:appcompat:1.4.1'
190+
implementation 'androidx.appcompat:appcompat:1.4.2'
191191
implementation 'androidx.legacy:legacy-support-v13:1.0.0'
192192
implementation 'androidx.recyclerview:recyclerview:1.2.1'
193193
implementation 'androidx.cardview:cardview:1.0.0'
194194
implementation 'androidx.biometric:biometric:1.1.0'
195-
implementation 'com.google.android.material:material:1.6.0'
195+
implementation 'com.google.android.material:material:1.6.1'
196196
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
197197
implementation 'androidx.annotation:annotation:1.3.0'
198198
implementation 'org.reactivestreams:reactive-streams:1.0.3'
@@ -209,7 +209,7 @@ dependencies {
209209
implementation 'com.google.android.ads.consent:consent-library:1.0.8'
210210
implementation "com.google.android.gms:play-services-analytics:17.0.1"
211211
implementation "com.google.android.gms:play-services-wearable:17.1.0"
212-
implementation "com.google.android.gms:play-services-maps:17.0.1"
212+
implementation "com.google.android.gms:play-services-maps:18.0.2"
213213
implementation "com.google.android.gms:play-services-gcm:17.0.0"
214214
implementation "com.google.android.gms:play-services-location:18.0.0"
215215
implementation "com.google.android.gms:play-services-places:17.0.0"
@@ -243,12 +243,15 @@ dependencies {
243243
implementation 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
244244
implementation 'com.alexvasilkov:gesture-views:2.6.0'
245245

246+
implementation 'com.github.rubengees:easy-header-footer-adapter:3.0.0@aar'
247+
246248
implementation("com.mikepenz:materialdrawer:6.1.3@aar") {
247249
transitive = true
248250
}
249251

250252
implementation 'com.github.stfalcon:chatkit:0.3.3'
251253
implementation 'com.github.matthiasrobbers:shortbread:1.1.0'
254+
implementation 'androidx.core:core:1.6.0'
252255
annotationProcessor 'com.github.matthiasrobbers:shortbread-compiler:1.1.0'
253256
implementation ('com.adevinta.android:leku:9.1.4') {
254257
exclude group: 'com.google.android.gms'

app/src/main/java/nl/hnogames/domoticz/MainActivity.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import android.view.View;
3737
import android.view.WindowManager;
3838
import android.widget.FrameLayout;
39-
import android.widget.TextView;
4039
import android.widget.Toast;
4140

4241
import com.afollestad.materialdialogs.MaterialDialog;
@@ -108,7 +107,6 @@
108107
import nl.hnogames.domoticz.utils.SharedPrefUtil;
109108
import nl.hnogames.domoticz.utils.TalkBackUtil;
110109
import nl.hnogames.domoticz.utils.UsefulBits;
111-
import nl.hnogames.domoticz.utils.ViewUtils;
112110
import nl.hnogames.domoticz.utils.WidgetUtils;
113111
import nl.hnogames.domoticz.welcome.WelcomeViewActivity;
114112
import nl.hnogames.domoticzapi.Containers.ConfigInfo;
@@ -180,9 +178,7 @@ protected void onCreate(Bundle savedInstanceState) {
180178
mSharedPrefs = new SharedPrefUtil(this);
181179
permissionHelper = PermissionHelper.getInstance(this);
182180

183-
UsefulBits.checkAPK(this, mSharedPrefs);
184-
185-
if (Build.VERSION.SDK_INT < 21 && (BuildConfig.LITE_VERSION || !mSharedPrefs.isAPKValidated())) {
181+
if (Build.VERSION.SDK_INT < 21 && (!AppController.IsPremiumEnabled || !mSharedPrefs.isAPKValidated())) {
186182
setContentView(R.layout.activity_newmain_free);
187183
MobileAds.initialize(this, this.getString(R.string.ADMOB_APP_KEY));
188184
AdRequest adRequest = new AdRequest.Builder()
@@ -236,6 +232,11 @@ protected void onCreate(Bundle savedInstanceState) {
236232
new GeoUtils(this, this).AddGeofences();
237233
resetWorkerThreads();
238234
initScreen();
235+
236+
if(mSharedPrefs.showOldVersionDialog()) {
237+
UsefulBits.ShowOldVersionDialog(this);
238+
mSharedPrefs.OldVersionDialogShown();
239+
}
239240
}
240241
}
241242

@@ -840,7 +841,7 @@ public void drawNavigationMenu(final ConfigInfo mConfig) {
840841
.withOnlyMainProfileImageVisible(true)
841842
.withOnAccountHeaderListener((view, profile, current) -> {
842843
if (!current) {
843-
if (BuildConfig.LITE_VERSION || !mSharedPrefs.isAPKValidated()) {
844+
if (!AppController.IsPremiumEnabled || !mSharedPrefs.isAPKValidated()) {
844845
if (frameLayout != null) {
845846
Snackbar.make(frameLayout, getString(R.string.category_account) + " " + getString(R.string.premium_feature), Snackbar.LENGTH_LONG)
846847
.setAction(R.string.upgrade, view1 -> UsefulBits.openPremiumAppStore(MainActivity.this))
@@ -891,7 +892,7 @@ public void onCancel() {
891892
for (UserInfo user : config.getUsers()) {
892893
if (!allUsers.contains(user.getUsername())) {
893894
ProfileDrawerItem profile = new ProfileDrawerItem().withName(user.getRightsValue(this)
894-
).withEmail(user.getUsername())
895+
).withEmail(user.getUsername())
895896
.withIcon(R.drawable.users)
896897
.withEnabled(user.isEnabled());
897898
allUsers.add(user.getUsername());

app/src/main/java/nl/hnogames/domoticz/adapters/DashboardAdapter.java

+14-14
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@ public DataObjectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
215215

216216
// Check if we're running on Android 5.0 or higher
217217
if (Build.VERSION.SDK_INT >= 21) {
218-
row = LayoutInflater.from(parent.getContext())
219-
.inflate(R.layout.dashboard_row, parent, false);
218+
row = LayoutInflater.from(parent.getContext())
219+
.inflate(R.layout.dashboard_row, parent, false);
220220
} else {
221-
row = LayoutInflater.from(parent.getContext())
222-
.inflate(R.layout.dashboard_row_noads, parent, false);
221+
row = LayoutInflater.from(parent.getContext())
222+
.inflate(R.layout.dashboard_row_noads, parent, false);
223223
}
224224
return new DataObjectHolder(row);
225225
}
@@ -319,8 +319,8 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
319319
}
320320
break;
321321
default:
322-
setButtons(holder, Buttons.SWITCH);
323-
setOnOffSwitchRowData(mDeviceInfo, holder);
322+
setButtons(holder, Buttons.SWITCH);
323+
setOnOffSwitchRowData(mDeviceInfo, holder);
324324
break;
325325
}
326326
break;
@@ -352,11 +352,11 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
352352
case DomoticzValues.Device.Type.Value.DIMMER:
353353
if (mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.RGB) ||
354354
mDeviceInfo.getSubType().startsWith(DomoticzValues.Device.SubType.Name.WW)) {
355-
setButtons(holder, Buttons.DIMMER_RGB);
356-
setDimmerRowData(mDeviceInfo, holder, true);
355+
setButtons(holder, Buttons.DIMMER_RGB);
356+
setDimmerRowData(mDeviceInfo, holder, true);
357357
} else {
358-
setButtons(holder, Buttons.DIMMER);
359-
setDimmerRowData(mDeviceInfo, holder, false);
358+
setButtons(holder, Buttons.DIMMER);
359+
setDimmerRowData(mDeviceInfo, holder, false);
360360
}
361361
break;
362362

@@ -375,8 +375,8 @@ private void setSwitchRowData(DevicesInfo mDeviceInfo,
375375
break;
376376

377377
case DomoticzValues.Device.Type.Value.SELECTOR:
378-
setButtons(holder, Buttons.SELECTOR);
379-
setSelectorRowData(mDeviceInfo, holder);
378+
setButtons(holder, Buttons.SELECTOR);
379+
setSelectorRowData(mDeviceInfo, holder);
380380
break;
381381

382382
case DomoticzValues.Device.Type.Value.BLINDS:
@@ -1835,8 +1835,8 @@ public void setButtons(DataObjectHolder holder, int button) {
18351835
holder.switch_name.setVisibility(View.VISIBLE);
18361836

18371837
holder.infoIcon.setVisibility(View.GONE);
1838-
ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) holder.iconRow.getLayoutParams();
1839-
p.topMargin = 20;
1838+
ViewGroup.MarginLayoutParams p = (ViewGroup.MarginLayoutParams) holder.iconRow.getLayoutParams();
1839+
p.topMargin = 20;
18401840

18411841
holder.switch_battery_level.setVisibility(View.VISIBLE);
18421842
switch (button) {

0 commit comments

Comments
 (0)