Skip to content

Commit

Permalink
resolved issue commons-app#2542
Browse files Browse the repository at this point in the history
  • Loading branch information
vanshikaarora committed Mar 15, 2019
1 parent 44c18ac commit f56a092
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 50 deletions.
14 changes: 3 additions & 11 deletions app/src/main/java/fr/free/nrw/commons/upload/UploadActivity.java
Expand Up @@ -109,9 +109,8 @@ 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_expand_button) ImageView rightCardExpandButton;
@BindView(R.id.right_card_map_button) View rightCardMapButton;

// Category Search
Expand Down Expand Up @@ -325,7 +324,7 @@ public void setBottomCardVisibility(boolean visible) {

@Override
public void setRightCardVisibility(boolean visible) {
rightCard.setVisibility(visible ? View.VISIBLE : View.GONE);
rightCardMapButton.setVisibility(visible ? View.VISIBLE : View.GONE);
}

@Override
Expand Down Expand Up @@ -358,12 +357,6 @@ public void setBottomCardState(boolean state) {
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) {
Expand Down Expand Up @@ -530,7 +523,6 @@ private void addNewDescription() {
}

private void configureRightCard() {
rightCardExpandButton.setOnClickListener(v -> presenter.toggleRightCardState());
rightCardMapButton.setOnClickListener(v -> presenter.openCoordinateMap());
}

Expand Down
Expand Up @@ -266,14 +266,6 @@ void toggleBottomCardState() {
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.
*/
Expand All @@ -284,7 +276,6 @@ void closeAllCards() {
}
if (uploadModel.isRightCardState()) {
uploadModel.setRightCardState(false);
view.setRightCardState(false);
}
if (uploadModel.isBottomCardState()) {
uploadModel.setBottomCardState(false);
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/fr/free/nrw/commons/upload/UploadView.java
Expand Up @@ -42,8 +42,6 @@ public interface UploadView {

void setBottomCardState(boolean state);

void setRightCardState(boolean bottomCardState);

void setBackground(Uri mediaUri);

void setTopCardVisibility(boolean visible);
Expand Down
41 changes: 13 additions & 28 deletions app/src/main/res/layout/activity_upload_bottom_card.xml
Expand Up @@ -79,36 +79,8 @@
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>
</android.support.v7.widget.CardView>


<android.support.v7.widget.CardView
android:id="@+id/bottom_card"
android:layout_width="match_parent"
Expand Down Expand Up @@ -149,6 +121,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"
Expand Down

0 comments on commit f56a092

Please sign in to comment.