mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
* resolved issue #2542 * removed commented code
This commit is contained in:
parent
d719a4a9d4
commit
38dceddbf5
4 changed files with 17 additions and 66 deletions
|
|
@ -109,9 +109,7 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
|
||||||
@BindView(R.id.license_subtitle) TextView licenseSubtitle;
|
@BindView(R.id.license_subtitle) TextView licenseSubtitle;
|
||||||
@BindView(R.id.please_wait_text_view) TextView pleaseWaitTextView;
|
@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;
|
@BindView(R.id.right_card_map_button) View rightCardMapButton;
|
||||||
|
|
||||||
// Category Search
|
// Category Search
|
||||||
|
|
@ -325,7 +323,7 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRightCardVisibility(boolean visible) {
|
public void setRightCardVisibility(boolean visible) {
|
||||||
rightCard.setVisibility(visible ? View.VISIBLE : View.GONE);
|
rightCardMapButton.setVisibility(visible ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -358,12 +356,6 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
|
||||||
updateCardState(state, bottomCardExpandButton, rvDescriptions, previous, next, bottomCardAddDescription);
|
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
|
@Override
|
||||||
public void setBackground(Uri mediaUri) {
|
public void setBackground(Uri mediaUri) {
|
||||||
|
|
@ -530,7 +522,6 @@ public class UploadActivity extends BaseActivity implements UploadView, SimilarI
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureRightCard() {
|
private void configureRightCard() {
|
||||||
rightCardExpandButton.setOnClickListener(v -> presenter.toggleRightCardState());
|
|
||||||
rightCardMapButton.setOnClickListener(v -> presenter.openCoordinateMap());
|
rightCardMapButton.setOnClickListener(v -> presenter.openCoordinateMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -262,14 +262,6 @@ public class UploadPresenter {
|
||||||
view.setBottomCardState(uploadModel.isBottomCardState());
|
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.
|
* Sets all the cards' states to closed.
|
||||||
*/
|
*/
|
||||||
|
|
@ -280,7 +272,6 @@ public class UploadPresenter {
|
||||||
}
|
}
|
||||||
if (uploadModel.isRightCardState()) {
|
if (uploadModel.isRightCardState()) {
|
||||||
uploadModel.setRightCardState(false);
|
uploadModel.setRightCardState(false);
|
||||||
view.setRightCardState(false);
|
|
||||||
}
|
}
|
||||||
if (uploadModel.isBottomCardState()) {
|
if (uploadModel.isBottomCardState()) {
|
||||||
uploadModel.setBottomCardState(false);
|
uploadModel.setBottomCardState(false);
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,6 @@ public interface UploadView {
|
||||||
|
|
||||||
void setBottomCardState(boolean state);
|
void setBottomCardState(boolean state);
|
||||||
|
|
||||||
void setRightCardState(boolean bottomCardState);
|
|
||||||
|
|
||||||
void setBackground(Uri mediaUri);
|
void setBackground(Uri mediaUri);
|
||||||
|
|
||||||
void setTopCardVisibility(boolean visible);
|
void setTopCardVisibility(boolean visible);
|
||||||
|
|
|
||||||
|
|
@ -66,50 +66,8 @@
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</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
|
<androidx.support.v7.widget.CardView
|
||||||
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
|
|
||||||
android:id="@+id/bottom_card"
|
android:id="@+id/bottom_card"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
@ -149,6 +107,19 @@
|
||||||
app:layout_constraintTop_toBottomOf="@id/bottom_card_title"
|
app:layout_constraintTop_toBottomOf="@id/bottom_card_title"
|
||||||
tools:text="1st image" />
|
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
|
<ImageButton
|
||||||
android:id="@+id/bottom_card_expand_button"
|
android:id="@+id/bottom_card_expand_button"
|
||||||
style="@style/Widget.AppCompat.Button.Borderless"
|
style="@style/Widget.AppCompat.Button.Borderless"
|
||||||
|
|
@ -206,7 +177,7 @@
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.support.v7.widget.CardView>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue