diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 3398b22..5edf6dd 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -11,7 +11,6 @@ diff --git a/app/src/main/java/com/mo_stepper/horizonta_stepper/MainActivity.kt b/app/src/main/java/com/mo_stepper/horizonta_stepper/MainActivity.kt index 2e4860b..76c5e73 100644 --- a/app/src/main/java/com/mo_stepper/horizonta_stepper/MainActivity.kt +++ b/app/src/main/java/com/mo_stepper/horizonta_stepper/MainActivity.kt @@ -7,6 +7,7 @@ import androidx.core.widget.doAfterTextChanged import com.mo_stepper.horizonta_stepper.databinding.ActivityMainBinding import com.mo_stepper.mohorizontalstepper.MoHorizontalStepper + class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 3e72c92..35d9e0b 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -6,6 +6,7 @@ android:layout_height="match_parent" tools:context=".MainActivity"> + - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/step_view_layout.xml b/app/src/main/res/layout/step_view_layout.xml deleted file mode 100644 index dcb23b9..0000000 --- a/app/src/main/res/layout/step_view_layout.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 0e63a02..faba818 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -9,9 +9,5 @@ - \ No newline at end of file diff --git a/mohorizontalstepper/build.gradle b/mohorizontalstepper/build.gradle index 7588722..d1b132f 100644 --- a/mohorizontalstepper/build.gradle +++ b/mohorizontalstepper/build.gradle @@ -4,7 +4,8 @@ plugins { id 'maven-publish' } group = 'Mohamed02Emad' -version = "1.0.3" +version = "1.0.4" + android { namespace 'com.mo_stepper.mohorizontalstepper' compileSdk 33 @@ -32,39 +33,29 @@ android { jvmTarget = '1.8' } -// productFlavors { -// flavor1 { -// applicationId 'com.mo_stepper.mohorizontalstepper' -// } -// publishing { -// singleVariant("release") { -// withSourcesJar() -// withJavadocJar() -// } -// } -// } - - dependencies { +} - implementation 'androidx.core:core-ktx:1.7.0' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'com.google.android.material:material:1.9.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' +dependencies { - } + implementation 'androidx.core:core-ktx:1.7.0' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.9.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.5' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' } - publishing { publications { release(MavenPublication) { groupId = 'com.github.Mohamed02Emad' artifactId = 'mo-horizontal-stepper' - version = '1.0.3' + version = '1.0.4' afterEvaluate { from components.release } } } -} \ No newline at end of file +} diff --git a/mohorizontalstepper/src/androidTest/java/com/mo_stepper/mohorizontalstepper/ExampleInstrumentedTest.kt b/mohorizontalstepper/src/androidTest/java/com/mo_stepper/mohorizontalstepper/ExampleInstrumentedTest.kt index 9244574..e69de29 100644 --- a/mohorizontalstepper/src/androidTest/java/com/mo_stepper/mohorizontalstepper/ExampleInstrumentedTest.kt +++ b/mohorizontalstepper/src/androidTest/java/com/mo_stepper/mohorizontalstepper/ExampleInstrumentedTest.kt @@ -1,24 +0,0 @@ -package com.mo_stepper.mohorizontalstepper - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("com.mo_stepper.mohorizontalstepper", appContext.packageName) - } -} \ No newline at end of file diff --git a/mohorizontalstepper/src/main/AndroidManifest.xml b/mohorizontalstepper/src/main/AndroidManifest.xml deleted file mode 100644 index e8ea398..0000000 --- a/mohorizontalstepper/src/main/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/java/com/mo_stepper/mohorizontalstepper/MainActivity.kt b/mohorizontalstepper/src/main/java/com/mo_stepper/mohorizontalstepper/MainActivity.kt deleted file mode 100644 index ca206f8..0000000 --- a/mohorizontalstepper/src/main/java/com/mo_stepper/mohorizontalstepper/MainActivity.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.mo_stepper.mohorizontalstepper - -import androidx.appcompat.app.AppCompatActivity -import android.os.Bundle - -class MainActivity : AppCompatActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_main) - } -} \ No newline at end of file diff --git a/mohorizontalstepper/src/main/java/com/mo_stepper/mohorizontalstepper/MoHorizontalStepper.kt b/mohorizontalstepper/src/main/java/com/mo_stepper/mohorizontalstepper/MoHorizontalStepper.kt index 10ba567..72b1ed7 100644 --- a/mohorizontalstepper/src/main/java/com/mo_stepper/mohorizontalstepper/MoHorizontalStepper.kt +++ b/mohorizontalstepper/src/main/java/com/mo_stepper/mohorizontalstepper/MoHorizontalStepper.kt @@ -2,6 +2,7 @@ package com.mo_stepper.mohorizontalstepper import android.content.Context import android.util.AttributeSet +import android.util.Log import android.view.LayoutInflater import android.view.Menu import android.view.View @@ -10,6 +11,7 @@ import android.widget.LinearLayout import android.widget.TextView import androidx.core.content.ContextCompat + class MoHorizontalStepper @JvmOverloads constructor( context: Context, attrs: AttributeSet? = null, @@ -91,16 +93,19 @@ class MoHorizontalStepper @JvmOverloads constructor( private fun initStepper() { for (i in 0 until numberOfSteps) { val stepView = createStepView(i + 1) - stepViews.add(stepView) + stepViews.add(stepView) + Log.d("mohamed", "initStepper: 2 ") addView(stepView) if (i != numberOfSteps - 1) { + Log.d("mohamed", "initStepper: 3 ") val space = createSpace() spaceViews.add(space) addView(space) } } + updateStepViews() } @@ -200,6 +205,15 @@ class MoHorizontalStepper @JvmOverloads constructor( fun isLastStep(): Boolean = currentStepIndex == stepViews.size - 1 + fun getFragmentByIndex(stepIndex: Int): Int? { + return try { + menu?.getItem(stepIndex)?.itemId + } catch (_: java.lang.Exception) { + null + } + } + + /* methods for shaping and coloring */ @@ -322,13 +336,6 @@ class MoHorizontalStepper @JvmOverloads constructor( initStepper() } - fun getFragmentByIndex(stepIndex: Int): Int? { - return try { - menu?.getItem(stepIndex)?.itemId - } catch (_: java.lang.Exception) { - null - } - } /* enum for modes diff --git a/mohorizontalstepper/src/main/res/drawable-v24/ic_launcher_foreground.xml b/mohorizontalstepper/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index 2b068d1..0000000 --- a/mohorizontalstepper/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/res/drawable/ic_launcher_background.xml b/mohorizontalstepper/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index 07d5da9..0000000 --- a/mohorizontalstepper/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mohorizontalstepper/src/main/res/layout/activity_main.xml b/mohorizontalstepper/src/main/res/layout/activity_main.xml deleted file mode 100644 index 17eab17..0000000 --- a/mohorizontalstepper/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/res/layout/space.xml b/mohorizontalstepper/src/main/res/layout/space.xml index fd198b9..bb8ba30 100644 --- a/mohorizontalstepper/src/main/res/layout/space.xml +++ b/mohorizontalstepper/src/main/res/layout/space.xml @@ -11,7 +11,7 @@ android:layout_width="match_parent" android:layout_height="1dp" android:layout_gravity="center_vertical" - android:background="@color/control_theme_color" + android:background="@color/stepper_black" android:alpha="0.3" /> diff --git a/mohorizontalstepper/src/main/res/layout/step_view_layout.xml b/mohorizontalstepper/src/main/res/layout/step_view_layout.xml index 48dc03e..dd0587d 100644 --- a/mohorizontalstepper/src/main/res/layout/step_view_layout.xml +++ b/mohorizontalstepper/src/main/res/layout/step_view_layout.xml @@ -9,7 +9,6 @@ android:layout_width="35dp" android:layout_height="35dp" android:layout_gravity="center" - android:background="@color/stepper_red" app:shapeAppearance="@style/roundedImageViewRounded" /> diff --git a/mohorizontalstepper/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/mohorizontalstepper/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index eca70cf..0000000 --- a/mohorizontalstepper/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/mohorizontalstepper/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml deleted file mode 100644 index eca70cf..0000000 --- a/mohorizontalstepper/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/mohorizontalstepper/src/main/res/mipmap-anydpi-v33/ic_launcher.xml deleted file mode 100644 index 6f3b755..0000000 --- a/mohorizontalstepper/src/main/res/mipmap-anydpi-v33/ic_launcher.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/res/mipmap-hdpi/ic_launcher.webp b/mohorizontalstepper/src/main/res/mipmap-hdpi/ic_launcher.webp deleted file mode 100644 index c209e78..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/mohorizontalstepper/src/main/res/mipmap-hdpi/ic_launcher_round.webp deleted file mode 100644 index b2dfe3d..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-mdpi/ic_launcher.webp b/mohorizontalstepper/src/main/res/mipmap-mdpi/ic_launcher.webp deleted file mode 100644 index 4f0f1d6..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/mohorizontalstepper/src/main/res/mipmap-mdpi/ic_launcher_round.webp deleted file mode 100644 index 62b611d..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-xhdpi/ic_launcher.webp b/mohorizontalstepper/src/main/res/mipmap-xhdpi/ic_launcher.webp deleted file mode 100644 index 948a307..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/mohorizontalstepper/src/main/res/mipmap-xhdpi/ic_launcher_round.webp deleted file mode 100644 index 1b9a695..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/mohorizontalstepper/src/main/res/mipmap-xxhdpi/ic_launcher.webp deleted file mode 100644 index 28d4b77..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/mohorizontalstepper/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp deleted file mode 100644 index 9287f50..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/mohorizontalstepper/src/main/res/mipmap-xxxhdpi/ic_launcher.webp deleted file mode 100644 index aa7d642..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/mohorizontalstepper/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp deleted file mode 100644 index 9126ae3..0000000 Binary files a/mohorizontalstepper/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ diff --git a/mohorizontalstepper/src/main/res/values-night/themes.xml b/mohorizontalstepper/src/main/res/values-night/themes.xml deleted file mode 100644 index 397b84e..0000000 --- a/mohorizontalstepper/src/main/res/values-night/themes.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/res/values/strings.xml b/mohorizontalstepper/src/main/res/values/strings.xml deleted file mode 100644 index 31d861c..0000000 --- a/mohorizontalstepper/src/main/res/values/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - MoHorizontalStepper - \ No newline at end of file diff --git a/mohorizontalstepper/src/main/res/values/themes.xml b/mohorizontalstepper/src/main/res/values/themes.xml index 70ea6b5..25036c1 100644 --- a/mohorizontalstepper/src/main/res/values/themes.xml +++ b/mohorizontalstepper/src/main/res/values/themes.xml @@ -1,16 +1,15 @@ - - \ No newline at end of file + + + diff --git a/mohorizontalstepper/src/test/java/com/mo_stepper/mohorizontalstepper/ExampleUnitTest.kt b/mohorizontalstepper/src/test/java/com/mo_stepper/mohorizontalstepper/ExampleUnitTest.kt index 0fb32c2..e69de29 100644 --- a/mohorizontalstepper/src/test/java/com/mo_stepper/mohorizontalstepper/ExampleUnitTest.kt +++ b/mohorizontalstepper/src/test/java/com/mo_stepper/mohorizontalstepper/ExampleUnitTest.kt @@ -1,17 +0,0 @@ -package com.mo_stepper.mohorizontalstepper - -import org.junit.Test - -import org.junit.Assert.* - -/** - * Example local unit test, which will execute on the development machine (host). - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -class ExampleUnitTest { - @Test - fun addition_isCorrect() { - assertEquals(4, 2 + 2) - } -} \ No newline at end of file