Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HacktoberFest] Provided rtl support #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class FragmentA : Fragment() {
PushDownAnim.setPushDownAnimTo(nextToB).setScale(PushDownAnim.MODE_STATIC_DP,5F).setOnClickListener {
view.findNavController().navigate(R.id.fragmentAtoB)
activity?.findViewById<Stepper>(R.id.Stepper)?.forward()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.forward()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.forward()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ class FragmentB : Fragment() {
PushDownAnim.setPushDownAnimTo(nextToC).setScale(PushDownAnim.MODE_STATIC_DP,5F).setOnClickListener {
view.findNavController().navigate(R.id.fragmentBtoC)
activity?.findViewById<Stepper>(R.id.Stepper)?.forward()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.forward()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.forward()
}

PushDownAnim.setPushDownAnimTo(backArrow).setScale(PushDownAnim.MODE_STATIC_DP,5F).setOnClickListener {
view.findNavController().popBackStack()
activity?.findViewById<Stepper>(R.id.Stepper)?.back()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.back()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.back()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ class FragmentC : Fragment() {
PushDownAnim.setPushDownAnimTo(nextToD).setScale(PushDownAnim.MODE_STATIC_DP,5F).setOnClickListener {
view.findNavController().navigate(R.id.fragmentCtoD)
activity?.findViewById<Stepper>(R.id.Stepper)?.forward()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.forward()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.forward()
}

PushDownAnim.setPushDownAnimTo(backArrow).setScale(PushDownAnim.MODE_STATIC_DP,5F).setOnClickListener {
view.findNavController().popBackStack()
activity?.findViewById<Stepper>(R.id.Stepper)?.back()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.back()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.back()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ class FragmentD : Fragment() {
PushDownAnim.setPushDownAnimTo(nextToE).setScale(PushDownAnim.MODE_STATIC_DP,5F).setOnClickListener {
view.findNavController().navigate(R.id.fragmentDtoE)
activity?.findViewById<Stepper>(R.id.Stepper)?.forward()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.forward()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.forward()
}
PushDownAnim.setPushDownAnimTo(backArrow).setScale(PushDownAnim.MODE_STATIC_DP,5F).setOnClickListener {
view.findNavController().popBackStack()
activity?.findViewById<Stepper>(R.id.Stepper)?.back()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.back()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.back()
}
}
}
17 changes: 16 additions & 1 deletion app/src/main/java/com/tayfuncesur/stepperdemo/frags/FragmentE.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import com.tayfuncesur.stepper.Stepper
import com.tayfuncesur.stepperdemo.R
import com.thekhaeng.pushdownanim.PushDownAnim
import kotlinx.android.synthetic.main.fragment_e.*
import kotlinx.android.synthetic.main.fragment_e.backArrow

class FragmentE : Fragment() {

Expand All @@ -29,6 +28,16 @@ class FragmentE : Fragment() {
activity?.findViewById<View>(R.id.StepperView)?.background =
ContextCompat.getDrawable(context!!, R.drawable.success_gradient)
}

activity?.findViewById<Stepper>(R.id.StepperRtl)?.progress(3)?.addOnCompleteListener {
activity?.findViewById<View>(R.id.StepperViewRtl)?.background =
ContextCompat.getDrawable(context!!, R.drawable.success_gradient)
}

activity?.findViewById<Stepper>(R.id.StepperAuto)?.progress(3)?.addOnCompleteListener {
activity?.findViewById<View>(R.id.StepperViewAuto)?.background =
ContextCompat.getDrawable(context!!, R.drawable.success_gradient)
}
}


Expand All @@ -37,9 +46,15 @@ class FragmentE : Fragment() {
view.findNavController().popBackStack()
activity?.findViewById<Stepper>(R.id.Stepper)?.stop()
activity?.findViewById<Stepper>(R.id.Stepper)?.back()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.stop()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.back()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.stop()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.back()
}
PushDownAnim.setPushDownAnimTo(progressStop).setScale(PushDownAnim.MODE_STATIC_DP, 5F).setOnClickListener {
activity?.findViewById<Stepper>(R.id.Stepper)?.stop()
activity?.findViewById<Stepper>(R.id.StepperRtl)?.stop()
activity?.findViewById<Stepper>(R.id.StepperAuto)?.stop()
}
}
}
59 changes: 46 additions & 13 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
<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"
tools:context=".MainActivity">

<com.tayfuncesur.stepper.Stepper
android:layout_width="wrap_content"
android:id="@+id/Stepper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:id="@+id/Stepper"
>
app:layout_constraintTop_toTopOf="parent">

<View android:layout_width="wrap_content"
android:layout_height="10dp"
android:id="@+id/StepperView"
android:background="@drawable/gradient"/>
<View
android:id="@+id/StepperView"
android:layout_width="wrap_content"
android:layout_height="10dp"
android:background="@drawable/gradient" />

</com.tayfuncesur.stepper.Stepper>

<com.tayfuncesur.stepper.Stepper
android:id="@+id/StepperRtl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:useRTL="FORCE"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/Stepper">

<View
android:id="@+id/StepperViewRtl"
android:layout_width="wrap_content"
android:layout_height="10dp"
android:background="@drawable/gradient" />
</com.tayfuncesur.stepper.Stepper>

<com.tayfuncesur.stepper.Stepper
android:id="@+id/StepperAuto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:useRTL="AUTO"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/StepperRtl">

<View
android:id="@+id/StepperViewAuto"
android:layout_width="wrap_content"
android:layout_height="10dp"
android:background="@drawable/gradient" />
</com.tayfuncesur.stepper.Stepper>

<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="0dp"
app:defaultNavHost="true"
app:navGraph="@navigation/navigation_graph"/>
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/StepperAuto"
app:navGraph="@navigation/navigation_graph" />

</android.support.constraint.ConstraintLayout>
Loading