Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
fix a right padding for the only circles mode
Browse files Browse the repository at this point in the history
  • Loading branch information
shuhart committed May 5, 2018
1 parent ae4f554 commit 16eeee3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.2'


// NOTE: Do not place your application dependencies here; they belong
Expand All @@ -15,7 +15,7 @@ buildscript {
}

allprojects {
ext.supportVersion = "27.1.0"
ext.supportVersion = "27.1.1"
repositories {
google()
jcenter()
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Oct 30 10:19:46 EET 2017
#Sat May 05 13:59:10 MSK 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
5 changes: 3 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:$supportVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation project(':stepview')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
22 changes: 14 additions & 8 deletions sample/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#25448a"
android:gravity="center"
android:orientation="vertical"
tools:context=".MainActivity">

<com.shuhart.stepview.StepView
android:id="@+id/step_view"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="16dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:sv_animationType="All"
app:sv_stepPadding="12dp"
app:sv_steps="@array/steps"
app:sv_stepsNumber="4"
app:sv_typeface="@font/iran_sans_mobile" />

<Button
android:id="@+id/next"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="@string/btn_next" />
android:text="@string/btn_next"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/step_view" />

<Button
android:id="@+id/back"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:text="@string/btn_back" />
android:text="@string/btn_back"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/next" />

</LinearLayout>
</android.support.constraint.ConstraintLayout>
2 changes: 1 addition & 1 deletion stepview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ext {
siteUrl = 'https://github.com/shuhart/StepView'
gitUrl = 'https://github.com/shuhart/StepView.git'

libraryVersion = '1.2.6'
libraryVersion = '1.2.7'

developerId = 'shuhart'
developerName = 'Redrick Shuhart'
Expand Down
2 changes: 1 addition & 1 deletion stepview/src/main/java/com/shuhart/stepview/StepView.java
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ private int[] getCirclePositionsWithoutText() {
if (result.length == 1) {
return result;
}
result[result.length - 1] = getMeasuredWidth() - getPaddingRight();
result[result.length - 1] = getMeasuredWidth() - getPaddingRight() - selectedCircleRadius;
float spaceLeft = result[result.length - 1] - result[0];
int margin = (int) (spaceLeft / (result.length - 1));
for (int i = 1; i < result.length - 1; i++) {
Expand Down

0 comments on commit 16eeee3

Please sign in to comment.