Skip to content

Commit 254ab8e

Browse files
author
Mark Heinis
committed
Use a different library for the intro/settings slider
Use a different library for the intro/settings slider
1 parent dcaead9 commit 254ab8e

File tree

70 files changed

+56
-5102
lines changed

Some content is hidden

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

70 files changed

+56
-5102
lines changed

Diff for: app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ dependencies {
218218
implementation 'com.github.zagum:SpeechRecognitionView:1.0.2'
219219
implementation 'com.afollestad:digitus:0.3.0'
220220
implementation "com.github.skydoves:colorpickerview:2.0.1"
221+
implementation 'com.github.paolorotolo:appintro:v5.1.0'
221222

222223
implementation project(':libs:MemorizingTrustManager')
223-
implementation project(path: ':materialIntro_library')
224224
implementation project(path: ':SeekArc_library')
225225
implementation project(path: ':domoticzapi')
226226
implementation project(path: ':materialList')

Diff for: app/src/debug/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@
410410
<activity
411411
android:name=".Welcome.WelcomeViewActivity"
412412
android:configChanges="orientation|screenSize"
413-
android:label="@string/welcome_title_activity_welcome"
414-
android:theme="@style/AppThemeIntro"/>
413+
android:label="@string/welcome_title_activity_welcome"/>
415414

416415
<meta-data
417416
android:name="com.google.android.gms.ads.APPLICATION_ID"

Diff for: app/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,7 @@
410410
<activity
411411
android:name=".Welcome.WelcomeViewActivity"
412412
android:configChanges="orientation|screenSize"
413-
android:label="@string/welcome_title_activity_welcome"
414-
android:theme="@style/AppThemeIntro"/>
413+
android:label="@string/welcome_title_activity_welcome"/>
415414

416415
<meta-data
417416
android:name="com.google.android.geo.API_KEY"

Diff for: app/src/main/java/nl/hnogames/domoticz/Fragments/MainPager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void initViews() {
136136
if (mSharedPrefs.darkThemeEnabled()) {
137137
bottomNavigation.setBackgroundColor(getResources().getColor(R.color.background_dark));
138138
bottomNavigation.setItemIconTintList(ContextCompat.getColorStateList(bottomNavigation.getContext(), R.color.material_grey_500_));
139-
bottomNavigation.setItemTextColor(ContextCompat.getColorStateList(bottomNavigation.getContext(), R.color.white_alpha));
139+
bottomNavigation.setItemTextColor(ContextCompat.getColorStateList(bottomNavigation.getContext(), R.color.white));
140140
}
141141
adapterViewPager = new MainPagerAdapter(((AppCompatActivity) context), 3);
142142
vpPager.setAdapter(adapterViewPager);

Diff for: app/src/main/java/nl/hnogames/domoticz/Fragments/TemperatureMainPager.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ private void initViews() {
136136
if (mSharedPrefs.darkThemeEnabled()) {
137137
bottomNavigation.setBackgroundColor(getResources().getColor(R.color.background_dark));
138138
bottomNavigation.setItemIconTintList(ContextCompat.getColorStateList(bottomNavigation.getContext(), R.color.material_grey_500_));
139-
bottomNavigation.setItemTextColor(ContextCompat.getColorStateList(bottomNavigation.getContext(), R.color.white_alpha));
139+
bottomNavigation.setItemTextColor(ContextCompat.getColorStateList(bottomNavigation.getContext(), R.color.white));
140140
}
141141
adapterViewPager = new MainPagerAdapter(((AppCompatActivity) context), 2);
142142
vpPager.setAdapter(adapterViewPager);

Diff for: app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomePage4.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
5656
Bundle savedInstanceState) {
5757
View v = inflater.inflate(R.layout.fragment_welcome4, container, false);
5858

59-
please_wait_layout = (LinearLayout) v.findViewById(R.id.layout_please_wait);
60-
result_layout = (LinearLayout) v.findViewById(R.id.layout_result);
61-
result = (TextView) v.findViewById(R.id.result);
59+
please_wait_layout = v.findViewById(R.id.layout_please_wait);
60+
result_layout = v.findViewById(R.id.layout_result);
61+
result = v.findViewById(R.id.result);
6262

6363
return v;
6464
}

Diff for: app/src/main/java/nl/hnogames/domoticz/Welcome/WelcomeViewActivity.java

+35-54
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
import android.content.Intent;
2626
import android.os.Bundle;
2727

28-
import com.heinrichreimersoftware.materialintro.app.IntroActivity;
29-
import com.heinrichreimersoftware.materialintro.slide.FragmentSlide;
30-
import com.heinrichreimersoftware.materialintro.slide.SimpleSlide;
28+
import com.github.paolorotolo.appintro.AppIntro2;
29+
import com.github.paolorotolo.appintro.AppIntroFragment;
30+
import com.github.paolorotolo.appintro.model.SliderPage;
3131

32-
import androidx.viewpager.widget.ViewPager;
32+
import androidx.annotation.Nullable;
33+
import androidx.fragment.app.Fragment;
3334
import nl.hnogames.domoticz.R;
3435
import nl.hnogames.domoticz.Utils.SharedPrefUtil;
3536
import nl.hnogames.domoticz.Utils.UsefulBits;
3637

37-
public class WelcomeViewActivity extends IntroActivity {
38-
38+
public class WelcomeViewActivity extends AppIntro2 {
3939
private static final int WELCOME_WIZARD = 1;
4040
private int p = 0;
4141

@@ -45,66 +45,47 @@ protected void onCreate(Bundle savedInstanceState) {
4545
if (!UsefulBits.isEmpty(mSharedPrefs.getDisplayLanguage()))
4646
UsefulBits.setDisplayLanguage(this, mSharedPrefs.getDisplayLanguage());
4747

48-
setFullscreen(true);
4948
super.onCreate(savedInstanceState);
50-
51-
setFinishEnabled(false);
52-
setSkipEnabled(false);
49+
skipButtonEnabled = false;
5350
UsefulBits.checkAPK(this, new SharedPrefUtil(this));
5451

55-
addSlide(new SimpleSlide.Builder()
56-
.image(R.mipmap.ic_launcher)
57-
.title(R.string.app_name_domoticz)
58-
.description(R.string.welcome_info_domoticz)
59-
.background(R.color.black)
60-
.build());
61-
62-
addSlide(new FragmentSlide.Builder()
63-
.background(R.color.welcome2_background)
64-
.fragment(WelcomePage2.newInstance())
65-
.build());
66-
67-
addSlide(new FragmentSlide.Builder()
68-
.background(!mSharedPrefs.darkThemeEnabled() ? R.color.welcome4_background : R.color.primary_dark)
69-
.fragment(WelcomePage3.newInstance(WELCOME_WIZARD))
70-
.build());
71-
72-
addSlide(new FragmentSlide.Builder()
73-
.background(!mSharedPrefs.darkThemeEnabled() ? R.color.welcome4_background : R.color.primary_dark)
74-
.fragment(WelcomePage4.newInstance())
75-
.build());
76-
77-
addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
78-
@Override
79-
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
80-
}
81-
82-
@Override
83-
public void onPageSelected(int position) {
84-
p = position;
85-
if (position == 3) {
86-
setFinishEnabled(true);
87-
} else {
88-
setFinishEnabled(false);
89-
}
90-
}
91-
92-
@Override
93-
public void onPageScrollStateChanged(int state) {
94-
}
95-
});
52+
SliderPage sliderPage = new SliderPage();
53+
sliderPage.setTitle(getString(R.string.app_name_domoticz));
54+
sliderPage.setDescription(getString(R.string.welcome_info_domoticz));
55+
sliderPage.setImageDrawable(R.mipmap.ic_launcher);
56+
sliderPage.setBgColor(R.color.black);
57+
addSlide(AppIntroFragment.newInstance(sliderPage));
58+
59+
addSlide(WelcomePage2.newInstance());
60+
addSlide(WelcomePage3.newInstance(WELCOME_WIZARD));
61+
addSlide(WelcomePage4.newInstance());
9662
}
9763

9864
@Override
9965
public void onBackPressed() {
10066
if (p > 0) {
101-
previousSlide();
102-
disableFinishButton(false);
67+
setProgressButtonEnabled(false);
10368
} else {
10469
finishWithResult(false);
10570
}
10671
}
10772

73+
@Override
74+
public void onDonePressed(Fragment currentFragment) {
75+
super.onDonePressed(currentFragment);
76+
finishWithResult(true);
77+
}
78+
79+
@Override
80+
public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
81+
super.onSlideChanged(oldFragment, newFragment);
82+
if (newFragment instanceof WelcomePage4) {
83+
setProgressButtonEnabled(false);
84+
} else {
85+
setProgressButtonEnabled(true);
86+
}
87+
}
88+
10889
public void finishWithResult(boolean success) {
10990
Bundle conData = new Bundle();
11091
conData.putBoolean("RESULT", success);
@@ -115,7 +96,7 @@ public void finishWithResult(boolean success) {
11596
}
11697

11798
public void disableFinishButton(boolean disable) {
118-
setFinishEnabled(!disable);
99+
setProgressButtonEnabled(!disable);
119100
}
120101

121102
private void endWelcomeWizard() {

Diff for: app/src/main/res/layout/fragment_welcome2.xml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
android:paddingLeft="@dimen/activity_horizontal_margin"
2727
android:paddingTop="@dimen/welcome_top_margin"
2828
android:paddingRight="@dimen/activity_horizontal_margin"
29+
android:background="@color/white"
2930
android:paddingBottom="@dimen/activity_vertical_margin">
3031

3132
<LinearLayout

Diff for: app/src/main/res/layout/fragment_welcome3.xml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
android:paddingLeft="@dimen/activity_horizontal_margin"
2727
android:paddingTop="@dimen/welcome_top_margin"
2828
android:paddingRight="@dimen/activity_horizontal_margin"
29+
android:background="@color/white"
2930
android:paddingBottom="@dimen/activity_vertical_margin"
3031
android:windowSoftInputMode="adjustPan">
3132

Diff for: app/src/main/res/layout/fragment_welcome4.xml

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2424
android:id="@+id/root4"
2525
android:layout_width="fill_parent"
26+
android:background="@color/white"
2627
android:layout_height="fill_parent"
2728
android:layout_marginTop="50dp"
2829
android:paddingLeft="@dimen/activity_horizontal_margin"

Diff for: app/src/main/res/values/styles.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
~ regarding copyright ownership. The ASF licenses this file
88
~ to you under the Apache License, Version 2.0 (the
99
~ "License"); you may not use this file except in compliance
10-
~ with the License. You may obtain a copy of the License at
10+
~ with the License. You may obtain a copy of the License atWelcomeViewActivity
1111
~
1212
~ http://www.apache.org/licenses/LICENSE-2.0
1313
~
@@ -20,7 +20,7 @@
2020
-->
2121
<resources>
2222
<!-- Base application theme. -->
23-
<style name="AppThemeIntro" parent="Theme.MaterialComponents.Light.NoActionBar">
23+
<style name="AppThemeIntro" parent="Theme.MaterialComponents.Light.NoActionBar.Bridge">
2424
<item name="windowActionBar">false</item>
2525
<item name="windowNoTitle">true</item>
2626
</style>

Diff for: app/version.properties

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Mon Jan 14 13:53:53 CET 2019
2-
VERSION_BUILD=5379
3-
VERSION_PATCH=63
4-
VERSION_CODE=379
1+
#Mon Jan 14 17:11:09 CET 2019
2+
VERSION_BUILD=5404
3+
VERSION_PATCH=66
4+
VERSION_CODE=382

Diff for: domoticzapi/version.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Mon Jan 14 13:53:53 CET 2019
1+
#Mon Jan 14 17:10:29 CET 2019
22
VERSION_BUILD=3675
3-
VERSION_PATCH=189
4-
VERSION_CODE=189
3+
VERSION_PATCH=191
4+
VERSION_CODE=191

Diff for: materialIntro_library/.gitignore

-1
This file was deleted.

Diff for: materialIntro_library/build.gradle

-37
This file was deleted.

Diff for: materialIntro_library/proguard-rules.pro

-17
This file was deleted.

Diff for: materialIntro_library/src/main/AndroidManifest.xml

-1
This file was deleted.

Diff for: materialIntro_library/src/main/java/com/heinrichreimersoftware/materialintro/app/ButtonCtaFragment.java

-19
This file was deleted.

0 commit comments

Comments
 (0)