[android] Removed 'remove local edits' button.

This commit is contained in:
Dmitry Yunitsky 2016-04-28 18:09:34 +03:00 committed by Alex Zolotarev
parent ce1065d0f2
commit dc5d996c14
2 changed files with 1 additions and 34 deletions

View file

@ -59,16 +59,6 @@
</LinearLayout>
<ImageView
android:id="@+id/more"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="?selectableItemBackgroundBorderless"
android:padding="@dimen/margin_half"
android:scaleType="center"
android:src="@drawable/abc_ic_menu_moreoverflow_mtrl_alpha"
android:tint="?iconTint"/>
</LinearLayout>
</android.support.v7.widget.CardView>

View file

@ -3,8 +3,6 @@ package com.mapswithme.maps.editor;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.format.DateUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@ -12,13 +10,11 @@ import android.widget.TextView;
import java.util.Locale;
import com.mapswithme.maps.R;
import com.mapswithme.util.BottomSheetHelper;
import com.mapswithme.util.UiUtils;
public class ProfileFragment extends AuthFragment implements View.OnClickListener
{
private TextView mEditsLocal;
private View mEditsMore;
private TextView mEditsSent;
private TextView mEditsSentDate;
private View mLogout;
@ -42,14 +38,11 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene
final View localEdits = editsBlock.findViewById(R.id.local_edits);
((ImageView) localEdits.findViewById(R.id.image)).setImageResource(R.drawable.ic_device);
mEditsLocal = (TextView) localEdits.findViewById(R.id.title);
mEditsMore = localEdits.findViewById(R.id.more);
mEditsMore.setOnClickListener(this);
UiUtils.hide(localEdits.findViewById(R.id.subtitle), localEdits.findViewById(R.id.more));
UiUtils.hide(localEdits.findViewById(R.id.subtitle));
final View sentEdits = editsBlock.findViewById(R.id.sent_edits);
((ImageView) sentEdits.findViewById(R.id.image)).setImageResource(R.drawable.ic_upload);
mEditsSent = (TextView) sentEdits.findViewById(R.id.title);
mEditsSentDate = (TextView) sentEdits.findViewById(R.id.subtitle);
UiUtils.hide(sentEdits.findViewById(R.id.more));
mAuthBlock = view.findViewById(R.id.block_auth);
((TextView) mAuthBlock.findViewById(R.id.first_osm_edit)).setText(R.string.login_and_edit_map_motivation_message);
}
@ -73,8 +66,6 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene
UiUtils.hide(mEditsSentDate);
else
UiUtils.setTextAndShow(mEditsSentDate, "Upload date : " + DateUtils.formatDateTime(getActivity(), stats[2] * 1000, 0));
UiUtils.showIf(stats[1] != stats[0], mEditsMore);
}
@Override
@ -86,20 +77,6 @@ public class ProfileFragment extends AuthFragment implements View.OnClickListene
OsmOAuth.clearAuthorization();
refreshViews();
break;
case R.id.more:
BottomSheetHelper.create(getActivity())
.sheet(Menu.NONE, R.drawable.ic_delete, R.string.delete)
.listener(new MenuItem.OnMenuItemClickListener()
{
@Override
public boolean onMenuItemClick(MenuItem menuItem)
{
Editor.nativeClearLocalEdits();
refreshViews();
return false;
}
}).tint().show();
break;
}
}
}