Skip to content

Commit edcc49f

Browse files
committed
Updated documentation
1 parent 1eb366c commit edcc49f

File tree

6 files changed

+48
-12
lines changed

6 files changed

+48
-12
lines changed

app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88
compileSdkVersion 28
99
defaultConfig {
1010
applicationId 'com.devmike.pagestepindicator'
11-
minSdkVersion 17
11+
minSdkVersion 14
1212
targetSdkVersion 28
1313
versionCode 1
1414
versionName "1.0"
@@ -42,6 +42,8 @@ dependencies {
4242
implementation 'com.android.support:appcompat-v7:28.0.0'
4343
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
4444
testImplementation 'junit:junit:4.12'
45+
androidTestImplementation 'com.android.support.test:rules:1.0.2'
4546
androidTestImplementation 'com.android.support.test:runner:1.0.2'
4647
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
48+
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
4749
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package devmike.jade.com.pagestepindicator
2+
3+
import android.support.test.espresso.Espresso.onView
4+
import android.support.test.espresso.ViewAction
5+
import android.support.test.espresso.action.GeneralLocation
6+
import android.support.test.espresso.action.GeneralSwipeAction
7+
import android.support.test.espresso.action.Press
8+
import android.support.test.espresso.action.Swipe
9+
import android.support.test.espresso.action.ViewActions.swipeLeft
10+
import android.support.test.espresso.assertion.ViewAssertions.matches
11+
import android.support.test.espresso.contrib.ViewPagerActions
12+
import android.support.test.espresso.matcher.ViewMatchers.isDisplayed
13+
import android.support.test.espresso.matcher.ViewMatchers.withId
14+
import android.support.test.filters.LargeTest
15+
import android.support.test.filters.SmallTest
16+
import android.support.test.rule.ActivityTestRule
17+
import android.support.test.runner.AndroidJUnit4
18+
import org.junit.Rule
19+
import org.junit.Test
20+
import org.junit.runner.RunWith
21+
22+
/**
23+
* Hide the PageStepIndicator to allow this test to run
24+
*/
25+
@RunWith(AndroidJUnit4::class)
26+
@SmallTest
27+
class MainActivityTest {
28+
29+
30+
@get:Rule
31+
val mainActivityTest = ActivityTestRule(MainActivity::class.java)
32+
33+
@Test
34+
fun testSwipe(){
35+
onView(withId(R.id.vp)).check(matches(isDisplayed())).perform(ViewPagerActions.scrollRight()).perform(ViewPagerActions.scrollLeft())
36+
}
37+
38+
39+
}

app/src/main/res/layout/activity_main.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
xmlns:app="http://schemas.android.com/apk/res-auto"
77
android:layout_width="match_parent"
88
android:padding="15dp"
9+
android:id="@+id/parent"
910
android:layout_height="match_parent"
1011
tools:context=".MainActivity">
1112

1213
<devmike.jade.com.PageStepIndicator
14+
android:visibility="gone"
1315
app:pgTitles="@array/titles"
1416
app:pgTitleTextSize="15sp"
1517
app:pgStrokeAlpha="255"
16-
app:pgLineHeight="10dp"
18+
app:pgLineHeight="2dp"
1719
app:pgRadius="15dp"
1820
app:pgCurrentStepColor="@android:color/holo_red_dark"
1921
app:pgTextColor="@android:color/white"

dependecy.gradle

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ ext{
1414
//Gradle plugin
1515
appCompat : 'com.android.support:appcompat-v7:28.0.0',
1616
junit : 'junit:junit:4.12',
17-
robolectric : 'org.robolectric:robolectric:3.2.2',
18-
mockito : 'org.mockito:mockito-core:2.2.0',
19-
supportDesign : 'com.android.support:design:28.0.0',
20-
supportAnnotation : 'com.android.support:support-annotations:28.0.0'
17+
supportDesign : 'com.android.support:design:28.0.0'
2118
]
2219
}

pagestepindicator/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ group='com.github.devmike01'
77

88
android {
99
compileSdkVersion 28
10-
buildToolsVersion '28.0.3'
1110
defaultConfig {
12-
minSdkVersion 17
11+
minSdkVersion 14
1312
targetSdkVersion 28
1413
versionCode 1
1514
versionName "1.0"
@@ -33,10 +32,7 @@ dependencies {
3332

3433
implementation dependency.appCompat
3534
implementation dependency.junit
36-
//implementation dependency.robolectric
37-
implementation dependency.mockito
3835
implementation dependency.supportDesign
39-
implementation dependency.supportAnnotation
4036

4137
/*Properties props = new Properties()
4238
//InputStream inputStream = this.getClass().getResourceAsStream("local.properties")

pagestepindicator/src/main/java/devmike/jade/com/PageStepIndicator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private void initAttributes(Context context, AttributeSet attributeSet) {
198198
}
199199
}
200200

201-
public void addOnTabSelectedListener(TabLayout.OnTabSelectedListener onTabSelectedListener){
201+
private void addOnTabSelectedListener(TabLayout.OnTabSelectedListener onTabSelectedListener){
202202
this.onTabSelectedListener =onTabSelectedListener;
203203
}
204204

0 commit comments

Comments
 (0)