Skip to content

Commit 38dcedd

Browse files
vanshikaaroramaskaravivek
authored andcommitted
resolved issue #2542 with position of map icon (#2601)
* resolved issue #2542 * removed commented code
1 parent d719a4a commit 38dcedd

File tree

4 files changed

+17
-66
lines changed

4 files changed

+17
-66
lines changed

app/src/main/java/fr/free/nrw/commons/upload/UploadActivity.java

+2-11
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
109109
@BindView(R.id.license_subtitle) TextView licenseSubtitle;
110110
@BindView(R.id.please_wait_text_view) TextView pleaseWaitTextView;
111111

112-
//Right Card
113-
@BindView(R.id.right_card) CardView rightCard;
114-
@BindView(R.id.right_card_expand_button) ImageView rightCardExpandButton;
112+
115113
@BindView(R.id.right_card_map_button) View rightCardMapButton;
116114

117115
// Category Search
@@ -325,7 +323,7 @@ public void setBottomCardVisibility(boolean visible) {
325323

326324
@Override
327325
public void setRightCardVisibility(boolean visible) {
328-
rightCard.setVisibility(visible ? View.VISIBLE : View.GONE);
326+
rightCardMapButton.setVisibility(visible ? View.VISIBLE : View.GONE);
329327
}
330328

331329
@Override
@@ -358,12 +356,6 @@ public void setBottomCardState(boolean state) {
358356
updateCardState(state, bottomCardExpandButton, rvDescriptions, previous, next, bottomCardAddDescription);
359357
}
360358

361-
@Override
362-
public void setRightCardState(boolean state) {
363-
rightCardExpandButton.animate().rotation(rightCardExpandButton.getRotation() + (state ? -180 : 180)).start();
364-
//Add all items in rightCard here
365-
rightCardMapButton.setVisibility(state ? View.VISIBLE : View.GONE);
366-
}
367359

368360
@Override
369361
public void setBackground(Uri mediaUri) {
@@ -530,7 +522,6 @@ private void addNewDescription() {
530522
}
531523

532524
private void configureRightCard() {
533-
rightCardExpandButton.setOnClickListener(v -> presenter.toggleRightCardState());
534525
rightCardMapButton.setOnClickListener(v -> presenter.openCoordinateMap());
535526
}
536527

app/src/main/java/fr/free/nrw/commons/upload/UploadPresenter.java

-9
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,6 @@ void toggleBottomCardState() {
262262
view.setBottomCardState(uploadModel.isBottomCardState());
263263
}
264264

265-
/**
266-
* Toggles the right card's state between open and closed.
267-
*/
268-
void toggleRightCardState() {
269-
uploadModel.setRightCardState(!uploadModel.isRightCardState());
270-
view.setRightCardState(uploadModel.isRightCardState());
271-
}
272-
273265
/**
274266
* Sets all the cards' states to closed.
275267
*/
@@ -280,7 +272,6 @@ void closeAllCards() {
280272
}
281273
if (uploadModel.isRightCardState()) {
282274
uploadModel.setRightCardState(false);
283-
view.setRightCardState(false);
284275
}
285276
if (uploadModel.isBottomCardState()) {
286277
uploadModel.setBottomCardState(false);

app/src/main/java/fr/free/nrw/commons/upload/UploadView.java

-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ public interface UploadView {
4242

4343
void setBottomCardState(boolean state);
4444

45-
void setRightCardState(boolean bottomCardState);
46-
4745
void setBackground(Uri mediaUri);
4846

4947
void setTopCardVisibility(boolean visible);

app/src/main/res/layout/activity_upload_bottom_card.xml

+15-44
Original file line numberDiff line numberDiff line change
@@ -66,50 +66,8 @@
6666
</RelativeLayout>
6767
</androidx.cardview.widget.CardView>
6868

69-
<androidx.cardview.widget.CardView
70-
android:id="@+id/right_card"
71-
android:layout_width="wrap_content"
72-
android:layout_height="wrap_content"
73-
android:layout_marginEnd="8dp"
74-
android:layout_marginRight="8dp"
75-
android:layout_marginBottom="8dp"
76-
app:layout_constraintBottom_toTopOf="@+id/bottom_card"
77-
app:layout_constraintEnd_toEndOf="parent"
78-
app:layout_constraintTop_toBottomOf="@+id/top_card"
79-
tools:ignore="UnusedAttribute"
80-
tools:showIn="@layout/activity_upload">
8169

82-
<LinearLayout
83-
android:id="@+id/right_card_content"
84-
android:layout_width="wrap_content"
85-
android:layout_height="wrap_content"
86-
android:layout_centerVertical="true"
87-
android:orientation="vertical">
88-
89-
<ImageButton
90-
android:id="@+id/right_card_expand_button"
91-
style="@style/Widget.AppCompat.Button.Borderless"
92-
android:layout_width="16dp"
93-
android:layout_height="16dp"
94-
android:layout_margin="8dp"
95-
android:rotation="90"
96-
app:srcCompat="@drawable/ic_expand_less_black_24dp" />
97-
98-
<ImageButton
99-
android:id="@+id/right_card_map_button"
100-
android:layout_width="wrap_content"
101-
android:layout_height="wrap_content"
102-
android:layout_marginLeft="8dp"
103-
android:layout_marginRight="8dp"
104-
android:layout_marginBottom="8dp"
105-
android:visibility="visible"
106-
app:srcCompat="@drawable/ic_map_white_24dp" />
107-
108-
</LinearLayout>
109-
</androidx.cardview.widget.CardView>
110-
111-
112-
<androidx.cardview.widget.CardView
70+
<androidx.support.v7.widget.CardView
11371
android:id="@+id/bottom_card"
11472
android:layout_width="match_parent"
11573
android:layout_height="wrap_content"
@@ -149,6 +107,19 @@
149107
app:layout_constraintTop_toBottomOf="@id/bottom_card_title"
150108
tools:text="1st image" />
151109

110+
<ImageButton
111+
android:id="@+id/right_card_map_button"
112+
android:layout_width="wrap_content"
113+
android:layout_height="wrap_content"
114+
android:layout_marginLeft="8dp"
115+
android:layout_marginEnd="16dp"
116+
android:layout_marginRight="16dp"
117+
android:visibility="visible"
118+
app:layout_constraintEnd_toStartOf="@+id/bottom_card_expand_button"
119+
app:layout_constraintLeft_toLeftOf="parent"
120+
app:layout_constraintTop_toTopOf="parent"
121+
app:srcCompat="@drawable/ic_map_white_24dp" />
122+
152123
<ImageButton
153124
android:id="@+id/bottom_card_expand_button"
154125
style="@style/Widget.AppCompat.Button.Borderless"
@@ -206,7 +177,7 @@
206177
app:layout_constraintStart_toStartOf="parent" />
207178

208179
</androidx.constraintlayout.widget.ConstraintLayout>
209-
</androidx.cardview.widget.CardView>
180+
</androidx.support.v7.widget.CardView>
210181
</androidx.constraintlayout.widget.ConstraintLayout>
211182

212183

0 commit comments

Comments
 (0)