Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- slide_in_down.xml
- <?xml version="1.0" encoding="utf-8"?>
- <set xmlns:android="http://schemas.android.com/apk/res/android"
- android:fillAfter="true" >
- <translate
- android:duration="400"
- android:fromYDelta="-100%"
- android:interpolator="@android:anim/linear_interpolator"
- android:toYDelta="0%" />
- <alpha
- android:duration="400"
- android:fromAlpha="0.0"
- android:interpolator="@android:anim/accelerate_interpolator"
- android:toAlpha="1.0" />
- </set>
- slide_out_right.xml
- <?xml version="1.0" encoding="utf-8"?>
- <set xmlns:android="http://schemas.android.com/apk/res/android"
- android:fillAfter="true" >
- <translate
- android:duration="400"
- android:fromYDelta="-100%"
- android:interpolator="@android:anim/linear_interpolator"
- android:toYDelta="0%" />
- <alpha
- android:duration="400"
- android:fromAlpha="0.0"
- android:interpolator="@android:anim/accelerate_interpolator"
- android:toAlpha="1.0" />
- </set>
- delivery_card_info_item.xml
- <?xml version="1.0" encoding="utf-8"?>
- <FrameLayout 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:id="@+id/rootView"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:background="@color/color_foreground_inverse">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/delivery_card_item"
- android:layout_gravity="top"
- android:background="?attr/selectableItemBackground"
- android:orientation="horizontal"
- android:paddingLeft="@dimen/padding_medium">
- <ImageView
- android:id="@+id/icon"
- android:layout_width="56dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:paddingRight="36dp"
- android:src="@drawable/ic_account_box_black_24dp_vector"/>
- <FrameLayout
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:minHeight="?attr/listPreferredItemHeight">
- <RelativeLayout
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="left|center">
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/title"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/arrests_delivery_card_info"
- android:layout_alignParentLeft="true"
- android:layout_toLeftOf="@+id/icon_arrow_hidden"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Body2"/>
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/description"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Body0"
- android:visibility="gone"
- android:layout_alignParentLeft="true"
- android:layout_toLeftOf="@+id/icon_arrow_hidden"
- android:layout_below="@+id/title"
- tools:text="Hello"/>
- <ImageView
- android:id="@+id/icon_arrow_hidden"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="invisible"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:paddingRight="@dimen/padding_medium"
- android:src="@drawable/ic_thin_arrow_down_grey_vector"/>
- </RelativeLayout>
- <View
- android:id="@+id/divider"
- android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_gravity="bottom"
- android:visibility="visible"
- android:background="?attr/dividerHorizontal"/>
- </FrameLayout>
- </LinearLayout>
- <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:id="@+id/delivery_card_constraint_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <android.support.constraint.Guideline
- android:id="@+id/guideline_vertical"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- app:layout_constraintGuide_begin="@dimen/margin_medium"
- tools:layout_editor_absoluteX="16dp"
- tools:layout_editor_absoluteY="0dp" />
- <android.support.constraint.Guideline
- android:id="@+id/guideline_horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- app:layout_constraintGuide_begin="@dimen/margin_medium"
- tools:layout_editor_absoluteX="0dp"
- tools:layout_editor_absoluteY="16dp" />
- <View
- android:id="@+id/delivery_card_first_line_view"
- android:layout_width="1dp"
- android:layout_height="0dp"
- android:layout_marginBottom="@dimen/margin_xsmall"
- android:layout_marginLeft="@dimen/margin_medium_small"
- android:layout_marginTop="@dimen/margin_large"
- android:background="@color/icon_mask_color_default"
- app:layout_constraintBottom_toBottomOf="@+id/delivery_card_inproduction_status_text_view"
- app:layout_constraintTop_toTopOf="@+id/delivery_card_inproduction_status_text_view"
- android:layout_marginStart="@dimen/margin_medium_small"
- app:layout_constraintLeft_toLeftOf="@+id/guideline_vertical"/>
- <View
- android:id="@+id/delivery_card_second_line_view"
- android:layout_width="1dp"
- android:layout_height="0dp"
- android:layout_marginBottom="@dimen/margin_xsmall"
- android:layout_marginLeft="@dimen/margin_medium_small"
- android:layout_marginTop="@dimen/margin_large"
- android:background="@color/icon_mask_color_default"
- app:layout_constraintBottom_toBottomOf="@+id/delivery_card_delivering_status_text_view"
- app:layout_constraintTop_toTopOf="@+id/delivery_card_delivering_status_text_view"
- android:layout_marginStart="@dimen/margin_medium_small"
- app:layout_constraintLeft_toLeftOf="@+id/guideline_vertical"/>
- <ImageView
- android:id="@+id/delivery_card_inproduction_status_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:background="@drawable/delivery_card_timeline_1_vector"
- app:layout_constraintLeft_toLeftOf="@+id/guideline_vertical"
- app:layout_constraintTop_toTopOf="@+id/guideline_horizontal" />
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/delivery_card_inproduction_title_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_large"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Title"
- app:layout_constraintLeft_toRightOf="@+id/delivery_card_inproduction_status_text_view"
- app:layout_constraintTop_toTopOf="@+id/guideline_horizontal"
- tools:text="Карта изготавливается"
- android:layout_marginStart="@dimen/margin_large"/>
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/delivery_card_inproduction_body_text_view"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_large"
- android:layout_marginRight="@dimen/margin_medium"
- android:layout_marginTop="@dimen/margin_small"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Body2"
- app:layout_constraintLeft_toRightOf="@+id/delivery_card_inproduction_status_text_view"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_inproduction_title_text_view"
- tools:text="Заберите карту тут и тут inproduction и еще текст какой-то"
- android:layout_marginStart="@dimen/margin_large"
- android:layout_marginEnd="@dimen/margin_medium"/>
- <ImageView
- android:id="@+id/delivery_card_delivering_status_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/margin_xxmedium_large"
- android:background="@drawable/delivery_card_timeline_2_vector"
- app:layout_constraintLeft_toLeftOf="@+id/guideline_vertical"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_inproduction_body_text_view" />
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/delivery_card_delivering_title_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_large"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Title"
- app:layout_constraintLeft_toRightOf="@+id/delivery_card_delivering_status_text_view"
- app:layout_constraintTop_toTopOf="@+id/delivery_card_delivering_status_text_view"
- tools:text="Доставка к месту выдачи"
- android:layout_marginStart="@dimen/margin_large"/>
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/delivery_card_delivering_body_text_view"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_large"
- android:layout_marginRight="@dimen/margin_medium"
- android:layout_marginTop="@dimen/margin_small"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Body2"
- app:layout_constraintLeft_toRightOf="@+id/delivery_card_delivering_status_text_view"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_delivering_title_text_view"
- tools:text="Заберите карту тут и тут delivering"
- android:layout_marginStart="@dimen/margin_large"
- android:layout_marginEnd="@dimen/margin_medium"/>
- <ImageView
- android:id="@+id/delivery_card_ready_status_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/margin_xxmedium_large"
- android:background="@drawable/delivery_card_timeline_3_vector"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_delivering_body_text_view"
- app:layout_constraintLeft_toLeftOf="@+id/guideline_vertical"/>
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/delivery_card_ready_title_text_view"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_large"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Title"
- app:layout_constraintLeft_toRightOf="@+id/delivery_card_ready_status_text_view"
- app:layout_constraintTop_toTopOf="@+id/delivery_card_ready_status_text_view"
- tools:text="Kарта готова к выдаче"
- android:layout_marginStart="@dimen/margin_large"/>
- <ru.sberbank.mobile.core.view.RoboTextView
- android:id="@+id/delivery_card_ready_body_text_view"
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_large"
- android:layout_marginRight="@dimen/margin_medium"
- android:layout_marginTop="@dimen/margin_small"
- android:textAppearance="@style/TextAppearance.Material.Sbrf.Body2"
- app:layout_constraintLeft_toRightOf="@+id/delivery_card_ready_status_text_view"
- app:layout_constraintRight_toRightOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_ready_title_text_view"
- tools:text="Заберите карту тут и тут ready"
- android:layout_marginStart="@dimen/margin_large"
- android:layout_marginEnd="@dimen/margin_medium"/>
- <Button
- android:id="@+id/delivery_card_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/margin_28dp"
- android:layout_marginTop="@dimen/margin_small"
- app:layout_constraintLeft_toRightOf="@+id/delivery_card_ready_status_text_view"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_ready_body_text_view"
- tools:text="Позвонить в банк" />
- <View
- android:id="@+id/delivery_card_divider"
- android:layout_width="0dp"
- android:layout_height="1dp"
- android:layout_marginTop="@dimen/margin_medium"
- android:background="?attr/dividerHorizontal"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_map_image_view"
- tools:visibility="visible" />
- <ru.yandex.yandexmapkit.MapView android:id="@+id/delivery_card_map"
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="275dp"
- android:layout_height="110dp"
- android:layout_marginTop="@dimen/margin_small"
- android:apiKey="xXsTsEf15yGGSdErpi~zWYa3OoMy38GjREwgJZdyoyVBA3rjAkQptHMquCWWGgricRvfsu5MU-gGHdQxL5xKZLjafDVBKY~mo-aVkzaUSFg="
- android:tag="static"
- app:layout_constraintLeft_toLeftOf="@+id/delivery_card_ready_body_text_view"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_button" />
- <ImageView
- android:id="@+id/delivery_card_map_image_view"
- android:layout_width="275dp"
- android:layout_height="110dp"
- android:layout_marginTop="@dimen/margin_small"
- app:layout_constraintLeft_toLeftOf="@+id/delivery_card_ready_body_text_view"
- app:layout_constraintTop_toBottomOf="@+id/delivery_card_button"/>
- </android.support.constraint.ConstraintLayout>
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:id="@+id/clicking_view"
- android:layout_gravity="top"
- android:orientation="horizontal"
- android:baselineAligned="true"
- android:paddingLeft="@dimen/padding_medium">
- <FrameLayout
- android:layout_width="0dp"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:layout_weight="1"
- android:minHeight="?attr/listPreferredItemHeight"
- android:layout_marginBottom="@dimen/margin_1dp">
- <ImageView
- android:id="@+id/icon_arrow"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="right|center_vertical"
- android:layout_alignParentRight="true"
- android:layout_centerVertical="true"
- android:paddingRight="@dimen/padding_medium"
- android:src="@drawable/ic_thin_arrow_down_grey_vector"/>
- </FrameLayout>
- </LinearLayout>
- </FrameLayout>
- private void setArrests() {
- // if (mProductBean instanceof CardBean && ((CardBean) mProductBean).isArrested()) {
- // mConstraintLayout.setVisibility(View.GONE);
- // mDeliveryCardShowView.setVisibility(View.VISIBLE);
- // mClickingView.setVisibility(View.VISIBLE);
- mConstraintLayout.setVisibility(View.GONE);
- setUpArrestsAnimation();
- }
- private void setUpArrestsAnimation() {
- mClickingView.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if (mConstraintLayout.getVisibility() == View.GONE) {
- Animation fadeOut = AnimationUtils.loadAnimation(mContext, R.anim.fade_out);
- fadeOut.setDuration(400);
- fadeOut.setFillAfter(true);
- fadeOut.setFillEnabled(true);
- mDeliveryCardShowView.startAnimation(fadeOut);
- Animation otherAnimation = AnimationUtils.loadAnimation(mContext, R.anim.slide_in_down);
- otherAnimation.setAnimationListener(new Animation.AnimationListener() {
- @Override
- public void onAnimationStart(Animation animation) {
- mConstraintLayout.setVisibility(View.VISIBLE);
- }
- @Override
- public void onAnimationEnd(Animation animation) {
- }
- @Override
- public void onAnimationRepeat(Animation animation) {
- }
- });
- mConstraintLayout.startAnimation(otherAnimation);
- } else {
- Animation animationFadeIn = AnimationUtils.loadAnimation(mContext, R.anim.fade_in);
- animationFadeIn.setDuration(800);
- animationFadeIn.setFillAfter(true);
- animationFadeIn.setFillEnabled(true);
- mDeliveryCardShowView.startAnimation(animationFadeIn);
- Animation otherAnimation = AnimationUtils.loadAnimation(mContext, R.anim.slide_out_up);
- otherAnimation.setAnimationListener(new Animation.AnimationListener() {
- @Override
- public void onAnimationStart(Animation animation) {
- }
- @Override
- public void onAnimationEnd(Animation animation) {
- mConstraintLayout.setVisibility(View.GONE);
- }
- @Override
- public void onAnimationRepeat(Animation animation) {
- }
- });
- mConstraintLayout.startAnimation(otherAnimation);
- }
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement