Skip to content

resolved issue #2542 with position of map icon #2601

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

Merged
merged 3 commits into from
Mar 17, 2019
Merged
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
13 changes: 2 additions & 11 deletions app/src/main/java/fr/free/nrw/commons/upload/UploadActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -325,7 +323,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 +356,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 +522,6 @@ private void addNewDescription() {
}

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

Expand Down
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
59 changes: 15 additions & 44 deletions app/src/main/res/layout/activity_upload_bottom_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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>


Expand Down