resolved issue #2542 with position of map icon (#2601)

* resolved issue #2542

* removed commented code
This commit is contained in:
Vanshika Arora 2019-03-17 15:42:57 +05:30 committed by Vivek Maskara
parent d719a4a9d4
commit 38dceddbf5
4 changed files with 17 additions and 66 deletions

View file

@ -109,9 +109,7 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
@BindView(R.id.license_subtitle) TextView licenseSubtitle;
@BindView(R.id.please_wait_text_view) TextView pleaseWaitTextView;
//Right Card
@BindView(R.id.right_card) CardView rightCard;
@BindView(R.id.right_card_expand_button) ImageView rightCardExpandButton;
@BindView(R.id.right_card_map_button) View rightCardMapButton;
// Category Search
@ -325,7 +323,7 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
@Override
public void setRightCardVisibility(boolean visible) {
rightCard.setVisibility(visible ? View.VISIBLE : View.GONE);
rightCardMapButton.setVisibility(visible ? View.VISIBLE : View.GONE);
}
@Override
@ -358,12 +356,6 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
updateCardState(state, bottomCardExpandButton, rvDescriptions, previous, next, bottomCardAddDescription);
}
@Override
public void setRightCardState(boolean state) {
rightCardExpandButton.animate().rotation(rightCardExpandButton.getRotation() + (state ? -180 : 180)).start();
//Add all items in rightCard here
rightCardMapButton.setVisibility(state ? View.VISIBLE : View.GONE);
}
@Override
public void setBackground(Uri mediaUri) {
@ -530,7 +522,6 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
}
private void configureRightCard() {
rightCardExpandButton.setOnClickListener(v -> presenter.toggleRightCardState());
rightCardMapButton.setOnClickListener(v -> presenter.openCoordinateMap());
}

View file

@ -262,14 +262,6 @@ public class UploadPresenter {
view.setBottomCardState(uploadModel.isBottomCardState());
}
/**
* Toggles the right card's state between open and closed.
*/
void toggleRightCardState() {
uploadModel.setRightCardState(!uploadModel.isRightCardState());
view.setRightCardState(uploadModel.isRightCardState());
}
/**
* Sets all the cards' states to closed.
*/
@ -280,7 +272,6 @@ public class UploadPresenter {
}
if (uploadModel.isRightCardState()) {
uploadModel.setRightCardState(false);
view.setRightCardState(false);
}
if (uploadModel.isBottomCardState()) {
uploadModel.setBottomCardState(false);

View file

@ -42,8 +42,6 @@ public interface UploadView {
void setBottomCardState(boolean state);
void setRightCardState(boolean bottomCardState);
void setBackground(Uri mediaUri);
void setTopCardVisibility(boolean visible);

View file

@ -66,50 +66,8 @@
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/right_card"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/bottom_card"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/top_card"
tools:ignore="UnusedAttribute"
tools:showIn="@layout/activity_upload">
<LinearLayout
android:id="@+id/right_card_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical">
<ImageButton
android:id="@+id/right_card_expand_button"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_margin="8dp"
android:rotation="90"
app:srcCompat="@drawable/ic_expand_less_black_24dp" />
<ImageButton
android:id="@+id/right_card_map_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:visibility="visible"
app:srcCompat="@drawable/ic_map_white_24dp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
<androidx.support.v7.widget.CardView
android:id="@+id/bottom_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -149,6 +107,19 @@
app:layout_constraintTop_toBottomOf="@id/bottom_card_title"
tools:text="1st image" />
<ImageButton
android:id="@+id/right_card_map_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:visibility="visible"
app:layout_constraintEnd_toStartOf="@+id/bottom_card_expand_button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_map_white_24dp" />
<ImageButton
android:id="@+id/bottom_card_expand_button"
style="@style/Widget.AppCompat.Button.Borderless"
@ -206,7 +177,7 @@
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.support.v7.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>