Skip to content

Commit c847fbf

Browse files
authored
Fix for Android Studio 2.3.x freeze when in Layout Preview. (#215)
Fixes Android Studio 2.3.x freeze when in Layout Preview. Update plugin versions and build tools to the newest ones. Library version update to 4.3.1
1 parent c63fd62 commit c847fbf

27 files changed

+77
-32
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
8+
## [4.3.1]
9+
### Fixed
10+
- Android Studio 2.3.x freeze introduced with version 4.1.0 of the library when using tabs
11+
712
## [4.3.0]
813
### Added
914
- A way to set bottom navigation button colors programmatically via:
@@ -40,6 +45,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4045
- **Breaking change:** Changed `setNextButtonLabel` methods in `StepViewModel.Builder` to `setEndButtonLabel` so that it works for both Next and Complete buttons (issue #107)
4146
- **Breaking change:** Split `content` stepper feedback type into `content_progress` and `content_fade`.
4247

48+
[4.3.1]: https://github.com/stepstone-tech/android-material-stepper/compare/v4.3.0...v4.3.1
4349
[4.3.0]: https://github.com/stepstone-tech/android-material-stepper/compare/v4.2.0...v4.3.0
4450
[4.2.0]: https://github.com/stepstone-tech/android-material-stepper/compare/v4.1.0...v4.2.0
4551
[4.1.0]: https://github.com/stepstone-tech/android-material-stepper/compare/v4.0.0...v4.1.0

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Moreover, you can find there other examples, e.g. how to persist state on rotati
6666

6767
### Download (from JCenter)
6868
```groovy
69-
compile 'com.stepstone.stepper:material-stepper:4.3.0'
69+
compile 'com.stepstone.stepper:material-stepper:4.3.1'
7070
```
7171

7272
*Note:* This library adds a transitive dependency to AppCompat `25.4.0`

build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
2-
ext.gradleAndroidVersion = '3.0.0-beta6'
3-
ext.kotlinVersion = '1.1.3-2'
2+
ext.gradleAndroidVersion = '3.0.0-beta7'
3+
ext.kotlinVersion = '1.1.4-3'
44
ext.bintrayVersion = '1.7.3'
55
ext.mavenGradlePluginVersion = '2.0'
66

@@ -30,7 +30,7 @@ configure(allprojects) {
3030
androidMinSdkVersion = 14
3131
androidTargetSdkVersion = 25
3232
androidCompileSdkVersion = 25
33-
androidBuildToolsVersion = '25.0.2'
33+
androidBuildToolsVersion = '26.0.2'
3434
androidSupportLibraryVersion = '25.4.0'
3535

3636
junitVersion = '4.12'

circle.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ machine:
99
dependencies:
1010
pre:
1111
- wget "https://services.gradle.org/distributions/gradle-4.1-bin.zip"; unzip gradle-4.1-bin.zip
12-
- if [ ! -e /usr/local/android-sdk-linux/build-tools/25.0.2 ]; then echo y | android update sdk --all --no-ui --filter "build-tools-25.0.2"; fi;
12+
- if [ ! -e /usr/local/android-sdk-linux/build-tools/26.0.2 ]; then echo y | android update sdk --all --no-ui --filter "build-tools-26.0.2"; fi;
1313
- if [ ! -e /usr/local/android-sdk-linux/platforms/android-25 ]; then echo y | android update sdk --all --no-ui --filter "android-25"; fi;
1414
- if ! $(grep -q "Revision=47.0.0" /usr/local/android-sdk-linux/extras/android/m2repository/source.properties); then echo y | android update sdk --all --no-ui --filter "extra-android-m2repository"; fi;
1515
- echo y | android update sdk --no-ui --all --filter tool,extra-google-google_play_services
1616
- printf 'bintray.user=dummy_user\nbintray.apikey=dummy_api_key\nsdk.dir=/usr/local/android-sdk-linux' > local.properties
1717

1818
cache_directories:
19-
- /usr/local/android-sdk-linux/build-tools/25.0.2
19+
- /usr/local/android-sdk-linux/build-tools/26.0.2
2020
- /usr/local/android-sdk-linux/platforms/android-25
2121
- /usr/local/android-sdk-linux/extras/android/m2repository
2222

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
POM_GROUP_ID=com.stepstone.stepper
2121
POM_ARTIFACT_ID=material-stepper
2222
POM_TEST_ARTIFACT_ID=espresso-material-stepper
23-
POM_VERSION=4.3.0
23+
POM_VERSION=4.3.1
2424

2525
#Needed so that Robolectric is working: https://github.com/robolectric/robolectric/issues/3169
2626
android.enableAapt2=false

material-stepper/src/main/java/com/stepstone/stepper/internal/type/TabsStepperType.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package com.stepstone.stepper.internal.type;
1818

19-
import android.content.Context;
2019
import android.support.annotation.NonNull;
2120
import android.support.annotation.RestrictTo;
2221
import android.util.SparseArray;
@@ -53,10 +52,10 @@ public TabsStepperType(StepperLayout stepperLayout) {
5352
mTabsContainer.setListener(stepperLayout);
5453

5554
if (stepperLayout.isInEditMode()) {
56-
Context context = stepperLayout.getContext();
55+
//noinspection ConstantConditions
5756
mTabsContainer.setSteps(Arrays.asList(
58-
new StepViewModel.Builder(context).setTitle("Step 1").create(),
59-
new StepViewModel.Builder(context).setTitle("Step 2").setSubtitle("Optional").create())
57+
new StepViewModel.Builder(null).setTitle("Step 1").create(),
58+
new StepViewModel.Builder(null).setTitle("Step 2").setSubtitle("Optional").create())
6059
);
6160
mTabsContainer.updateSteps(0, new SparseArray<VerificationError>(), false);
6261
mTabsContainer.setVisibility(View.VISIBLE);

material-stepper/src/main/res/layout/ms_step_tab.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
android:orientation="vertical"
55
tools:layout_height="wrap_content"
66
tools:layout_width="wrap_content"
7-
tools:parentTag="com.stepstone.stepper.internal.widget.StepTab"
7+
tools:parentTag="android.widget.RelativeLayout"
88
tools:theme="@style/MSDefaultStepperLayoutTheme">
99

1010
<FrameLayout
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
7-
app:ms_stepperType="dots" />
8+
app:ms_stepperType="dots"
9+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_showBackButtonOnFirstStep="true"
8-
app:ms_stepperType="dots"/>
9+
app:ms_stepperType="dots"
10+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
android:id="@+id/stepperLayout"
45
android:layout_width="match_parent"
5-
android:layout_height="match_parent" />
6+
android:layout_height="match_parent"
7+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
7-
app:ms_stepperType="dots"/>
8+
app:ms_stepperType="dots"
9+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
7-
app:ms_stepperType="none"/>
8+
app:ms_stepperType="none"
9+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
7-
app:ms_stepperType="progress_bar" />
8+
app:ms_stepperType="progress_bar"
9+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
7-
app:ms_stepperType="tabs" />
8+
app:ms_stepperType="tabs"
9+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_stepperType="tabs"
8-
app:ms_showErrorState="true" />
9+
app:ms_showErrorState="true"
10+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_stepperType="tabs"
8-
app:ms_tabNavigationEnabled="false" />
9+
app:ms_tabNavigationEnabled="false"
10+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_stepperType="tabs"
89
app:ms_showErrorStateEnabled="true"
9-
app:ms_errorColor="@color/colorButton"/>
10+
app:ms_errorColor="@color/colorButton"
11+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_stepperType="tabs"
8-
app:ms_showErrorStateEnabled="true" />
9+
app:ms_showErrorStateEnabled="true"
10+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_stepperType="tabs"
89
app:ms_showErrorStateEnabled="true"
9-
app:ms_showErrorMessageEnabled="true"/>
10+
app:ms_showErrorMessageEnabled="true"
11+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_showBottomNavigation="false"
8-
app:ms_stepperType="tabs" />
9+
app:ms_stepperType="tabs"
10+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_stepperType="tabs"
89
app:ms_showErrorState="true"
9-
app:ms_showErrorStateOnBack="true"/>
10+
app:ms_showErrorStateOnBack="true"
11+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_stepperType="dots"
8-
app:ms_showErrorState="true" />
9+
app:ms_showErrorState="true"
10+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
78
app:ms_showBackButtonOnFirstStep="true"
8-
app:ms_stepperType="dots"/>
9+
app:ms_stepperType="dots"
10+
tools:theme="@style/AppTheme" />

sample/src/main/res/layout/activity_stepper_feedback.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
@@ -12,4 +13,5 @@
1213
app:ms_stepperFeedbackType="tabs|content_progress|content_fade|disabled_bottom_navigation|disabled_content_interaction"
1314
app:ms_stepperFeedback_contentFadeAlpha="0.3"
1415
app:ms_stepperFeedback_contentOverlayBackground="@color/custom_overlay_background"
15-
app:ms_stepperType="tabs" />
16+
app:ms_stepperType="tabs"
17+
tools:theme="@style/AppTheme" />

sample/src/main/res/layout/activity_styled_dots.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
@@ -10,4 +11,5 @@
1011
app:ms_backButtonColor="@color/ms_custom_button_text_color"
1112
app:ms_nextButtonColor="@color/ms_custom_button_text_color"
1213
app:ms_completeButtonColor="@color/ms_custom_button_text_color"
13-
app:ms_bottomNavigationBackground="?attr/colorAccent" />
14+
app:ms_bottomNavigationBackground="?attr/colorAccent"
15+
tools:theme="@style/AppTheme" />

sample/src/main/res/layout/activity_styled_progress_bar.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
45
android:id="@+id/stepperLayout"
56
android:layout_width="match_parent"
67
android:layout_height="match_parent"
@@ -15,4 +16,5 @@
1516
app:ms_nextButtonText="GO"
1617
app:ms_completeButtonText="FINISH"
1718
app:ms_completeButtonBackground="@drawable/ms_button_background"
18-
app:ms_stepperLayoutTheme="@style/StepperLayoutThemeWithCenteredCompleteButton"/>
19+
app:ms_stepperLayoutTheme="@style/StepperLayoutThemeWithCenteredCompleteButton"
20+
tools:theme="@style/AppTheme" />
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<com.stepstone.stepper.StepperLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
android:id="@+id/stepperLayout"
45
android:layout_width="match_parent"
5-
android:layout_height="match_parent" />
6+
android:layout_height="match_parent"
7+
tools:theme="@style/AppTheme" />

0 commit comments

Comments
 (0)