Browse Source

ui changes made

new_design
Mohan Shiwakoti 1 year ago
parent
commit
30656e39f6
  1. 24
      app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeFragmentV3.kt
  2. 12
      app/src/main/res/anim/rotate_180_animation_anticlockwise.xml
  3. 12
      app/src/main/res/anim/rotate_180_animation_clockwise.xml
  4. 12
      app/src/main/res/layout/fragment_home_new.xml

24
app/src/main/java/com/remit/jmecustomer/features/homeV3/view/HomeFragmentV3.kt

@ -16,6 +16,7 @@ import android.view.*
import android.view.GestureDetector.SimpleOnGestureListener
import android.view.ViewTreeObserver.OnGlobalLayoutListener
import android.view.animation.AccelerateDecelerateInterpolator
import android.view.animation.AnimationUtils
import android.view.animation.Interpolator
import android.view.inputmethod.EditorInfo
import android.widget.*
@ -70,6 +71,7 @@ class HomeFragmentV3 : BaseFragment(), View.OnClickListener,
OnEditorActionListener, ExchangeRateContractInterfacee,
SendTypeAdapter.OnPaymentModeSelectionListener,
UserProfilePresenterInterface.UserProfileContractInterface {
private var switchTrip: Boolean = false
private var scrollPosition: Int = 0
private var _binding: FragmentHomeNewBinding? = null
private val binding get() = _binding!!
@ -248,6 +250,9 @@ class HomeFragmentV3 : BaseFragment(), View.OnClickListener,
R.id.notificationViewContainer -> {
handleNotificationOnClick()
}
R.id.rel_switch -> {
switchAmountAnimation()
}
}
}
@ -402,6 +407,7 @@ class HomeFragmentV3 : BaseFragment(), View.OnClickListener,
recepientFlagImageView?.setOnClickListener(this)
binding.agreeButton.setOnClickListener(this)
binding.linUploadSlip.setOnClickListener(this)
binding.relSwitch.setOnClickListener(this)
}
override fun onEditorAction(v: TextView, actionId: Int, event: KeyEvent?): Boolean {
@ -619,4 +625,22 @@ class HomeFragmentV3 : BaseFragment(), View.OnClickListener,
spannableString.setSpan(colorSpan, startIndex, endIndex, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
return spannableString
}
fun switchAmountAnimation(){
if (!switchTrip) {
val switchAnimation = AnimationUtils.loadAnimation(
context,
R.anim.rotate_180_animation_clockwise
)
switchTrip = true
binding.imgSwitch.startAnimation(switchAnimation)
} else {
val switchAnimation = AnimationUtils.loadAnimation(
context,
R.anim.rotate_180_animation_anticlockwise
)
switchTrip = false
binding.imgSwitch.startAnimation(switchAnimation)
}
}
}

12
app/src/main/res/anim/rotate_180_animation_anticlockwise.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:fillEnabled="true">
<rotate
android:pivotX = "50%"
android:pivotY = "50%"
android:fromDegrees = "180"
android:toDegrees = "0"
android:duration = "500"/>
</set>

12
app/src/main/res/anim/rotate_180_animation_clockwise.xml

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:fillAfter="true"
android:fillEnabled="true">
<rotate
android:pivotX = "50%"
android:pivotY = "50%"
android:fromDegrees = "0"
android:toDegrees = "180"
android:duration = "500"/>
</set>

12
app/src/main/res/layout/fragment_home_new.xml

@ -264,6 +264,7 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<RelativeLayout
android:id="@+id/rel_switch"
android:layout_marginTop="@dimen/_10sdp"
android:layout_marginLeft="@dimen/_20sdp"
app:layout_constraintTop_toTopOf="parent"
@ -273,11 +274,12 @@
android:layout_width="@dimen/_25sdp"
android:layout_height="@dimen/_25sdp">
<ImageView
android:layout_centerInParent="true"
android:src="@drawable/ic_change_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:id="@+id/img_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@drawable/ic_change_field" />
</RelativeLayout>

Loading…
Cancel
Save