1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-30 08:11:17 +00:00

Added copy button to device IDs (fixes #559).

This commit is contained in:
Felix Ableitner 2016-02-09 23:01:39 +01:00
parent af5ba5c0d9
commit f299ca2d1e
8 changed files with 6 additions and 2 deletions

View file

@ -3,8 +3,10 @@ package com.nutomic.syncthingandroid.fragments;
import android.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.SwitchCompat;
import android.text.Editable;
@ -378,6 +380,8 @@ public class DeviceFragment extends Fragment implements
private void prepareEditMode() {
getActivity().getWindow().setSoftInputMode(SOFT_INPUT_STATE_ALWAYS_HIDDEN);
Drawable dr = ContextCompat.getDrawable(getActivity(), R.drawable.ic_content_copy_black_24dp);
mIdView.setCompoundDrawablesWithIntrinsicBounds(null, null, dr, null);
mIdView.setEnabled(false);
mQrButton.setVisibility(GONE);

View file

@ -154,7 +154,6 @@ public class DrawerFragment extends Fragment implements RestApi.OnReceiveSystemI
return;
mDeviceId.setText(info.myID);
mDeviceId.setVisibility(View.VISIBLE);
mDeviceId.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

View file

@ -61,7 +61,8 @@
android:layout_height="wrap_content"
android:fontFamily="monospace"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:visibility="invisible" />
android:drawableRight="@drawable/ic_content_copy_black_24dp"
android:drawableEnd="@drawable/ic_content_copy_black_24dp" />
</LinearLayout>
<View