diff --git a/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java b/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java index b991002c..a61dbd90 100644 --- a/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java +++ b/src/main/java/com/nutomic/syncthingandroid/fragments/DrawerFragment.java @@ -30,15 +30,10 @@ public class DrawerFragment extends Fragment implements RestApi.OnReceiveSystemI RestApi.OnReceiveConnectionsListener, View.OnClickListener { private TextView mDeviceId; - private TextView mCpuUsage; - private TextView mRamUsage; - private TextView mDownload; - private TextView mUpload; - private TextView mAnnounceServer; private TextView mExitButton; @@ -95,10 +90,10 @@ public class DrawerFragment extends Fragment implements RestApi.OnReceiveSystemI mAnnounceServer = (TextView) view.findViewById(R.id.announce_server); mExitButton = (TextView) view.findViewById(R.id.drawerActionExit); - view.findViewById(R.id.deviceIdContainer) - .setOnClickListener(this); view.findViewById(R.id.drawerActionWebGui) .setOnClickListener(this); + view.findViewById(R.id.drawerActionShareId) + .setOnClickListener(this); view.findViewById(R.id.drawerActionDonate) .setOnClickListener(this); view.findViewById(R.id.drawerActionRestart) @@ -190,13 +185,17 @@ public class DrawerFragment extends Fragment implements RestApi.OnReceiveSystemI @Override public void onClick(View v) { switch (v.getId()) { - case R.id.deviceIdContainer: - RestApi.shareDeviceId(getActivity(), mDeviceId.getText().toString()); - break; case R.id.drawerActionWebGui: startActivity(new Intent(mActivity, WebGuiActivity.class)); mActivity.closeDrawer(); break; + case R.id.drawerActionShareId: + Intent i = new Intent(android.content.Intent.ACTION_SEND); + i.setType("text/plain"); + i.putExtra(android.content.Intent.EXTRA_TEXT, mDeviceId.getText()); + startActivity(Intent.createChooser(i, "Share device ID with")); + mActivity.closeDrawer(); + break; case R.id.drawerActionDonate: startActivity(new Intent(ACTION_VIEW, Uri.parse( getString(R.string.donate_url)))); diff --git a/src/main/res/drawable-hdpi/ic_share_black_24dp.png b/src/main/res/drawable-hdpi/ic_share_black_24dp.png new file mode 100644 index 00000000..9079041a Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_share_black_24dp.png differ diff --git a/src/main/res/drawable-mdpi/ic_share_black_24dp.png b/src/main/res/drawable-mdpi/ic_share_black_24dp.png new file mode 100644 index 00000000..1a2b2abf Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_share_black_24dp.png differ diff --git a/src/main/res/drawable-xhdpi/ic_share_black_24dp.png b/src/main/res/drawable-xhdpi/ic_share_black_24dp.png new file mode 100644 index 00000000..3b63ed34 Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_share_black_24dp.png differ diff --git a/src/main/res/drawable-xxhdpi/ic_share_black_24dp.png b/src/main/res/drawable-xxhdpi/ic_share_black_24dp.png new file mode 100644 index 00000000..ab7c509c Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_share_black_24dp.png differ diff --git a/src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png b/src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png new file mode 100644 index 00000000..0d2410c1 Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png differ diff --git a/src/main/res/layout/fragment_drawer.xml b/src/main/res/layout/fragment_drawer.xml index 862f8b42..7cc19d80 100644 --- a/src/main/res/layout/fragment_drawer.xml +++ b/src/main/res/layout/fragment_drawer.xml @@ -30,7 +30,8 @@ android:layout_height="match_parent" android:layout_above="@+id/bottomActions" android:layout_alignParentTop="true" - android:fillViewport="true"> + android:fillViewport="true" + android:fadeScrollbars="false"> + +