mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Arrance list row layout
This commit is contained in:
parent
bdc96993aa
commit
7b05f1fe7e
3 changed files with 20 additions and 57 deletions
|
|
@ -2,6 +2,7 @@ package fr.free.nrw.commons.nearby;
|
|||
|
||||
import android.os.CountDownTimer;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.transition.TransitionManager;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -29,21 +30,14 @@ class PlaceRenderer extends Renderer<Place> {
|
|||
@BindView(R.id.distance) TextView distance;
|
||||
@BindView(R.id.icon) ImageView icon;
|
||||
@BindView(R.id.buttonLayout) LinearLayout buttonLayout;
|
||||
private Animation animationUp;
|
||||
private Animation animationDown;
|
||||
|
||||
private View view;
|
||||
private final int COUNTDOWN_RUNNING_TIME = 500;
|
||||
private static ArrayList<LinearLayout> openedItems;
|
||||
|
||||
|
||||
//private final PlaceClickedListener listener;
|
||||
|
||||
PlaceRenderer(){
|
||||
//@NonNull PlaceClickedListener listener) {
|
||||
Log.d("nesli","renderer created");
|
||||
openedItems = new ArrayList<>();
|
||||
//this.listener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -55,8 +49,6 @@ class PlaceRenderer extends Renderer<Place> {
|
|||
@Override
|
||||
protected void setUpView(View view) {
|
||||
ButterKnife.bind(this, view);
|
||||
animationUp = AnimationUtils.loadAnimation(getContext(),R.anim.slide_up);
|
||||
animationDown = AnimationUtils.loadAnimation(getContext(),R.anim.slide_down);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -66,6 +58,8 @@ class PlaceRenderer extends Renderer<Place> {
|
|||
@Override
|
||||
public void onClick(View view) {
|
||||
Log.d("Renderer", "clicked");
|
||||
TransitionManager.beginDelayedTransition(buttonLayout);
|
||||
|
||||
if(buttonLayout.isShown()){
|
||||
closeLayout(buttonLayout);
|
||||
}else {
|
||||
|
|
@ -89,28 +83,10 @@ class PlaceRenderer extends Renderer<Place> {
|
|||
}
|
||||
|
||||
private void closeLayout(LinearLayout buttonLayout){
|
||||
//openedItems.remove(buttonLayout);
|
||||
/*buttonLayout.startAnimation(animationUp);
|
||||
CountDownTimer countDownTimerStatic = new CountDownTimer(COUNTDOWN_RUNNING_TIME, 16) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
buttonLayout.setVisibility(View.GONE);
|
||||
//buttonLayout.setVisibility(View.GONE);
|
||||
}
|
||||
};
|
||||
countDownTimerStatic.start();*/
|
||||
buttonLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void openLayout(LinearLayout buttonLayout){
|
||||
/*buttonLayout.setVisibility(View.VISIBLE);
|
||||
ViewCompat.setElevation( view, 10);
|
||||
buttonLayout.startAnimation(animationDown);
|
||||
//openedItems.add(buttonLayout);*/
|
||||
buttonLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,25 +76,5 @@
|
|||
tools:text="@string/placeholder_place_description"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/buttonLayout"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
android:layout_below="@+id/icon"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="72dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
|
||||
<include layout="@layout/nearby_row_button" />
|
||||
</LinearLayout>
|
||||
<include layout="@layout/nearby_row_button" />
|
||||
</RelativeLayout>
|
||||
|
|
@ -1,9 +1,13 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/buttonLayout"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="horizontal"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
android:visibility="gone"
|
||||
android:layout_below="@+id/icon"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/directionsButton"
|
||||
|
|
@ -18,13 +22,14 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_directions_black_24dp" />
|
||||
app:srcCompat="@drawable/ic_photo_camera_white_24dp"
|
||||
android:tint="@color/primaryDarkColor"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="DIRECTIONS"
|
||||
android:text="CAMERA"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
|
|
@ -40,13 +45,14 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_wikidata_logo_24dp" />
|
||||
app:srcCompat="@drawable/ic_photo_white_24dp"
|
||||
android:tint="@color/primaryDarkColor"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="WIKIDATA"
|
||||
android:text="GALLERY"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -63,17 +69,18 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_wikipedia_logo_24dp"
|
||||
app:srcCompat="@drawable/ic_directions_black_24dp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:text="WIKIPEDIA"
|
||||
android:text="DIRECTIONS"
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/overflowButton"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -86,7 +93,7 @@
|
|||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_gravity="center_horizontal"
|
||||
app:srcCompat="@drawable/ic_overflow"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue