From 691ca26daa004b8a8bd78618642696c84c18d368 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Mon, 8 Feb 2016 22:59:40 +0100 Subject: [PATCH] Added share device ID button to drawer, always show scrollbar. --- .../fragments/DrawerFragment.java | 19 +++++++++--------- .../res/drawable-hdpi/ic_share_black_24dp.png | Bin 0 -> 543 bytes .../res/drawable-mdpi/ic_share_black_24dp.png | Bin 0 -> 377 bytes .../drawable-xhdpi/ic_share_black_24dp.png | Bin 0 -> 684 bytes .../drawable-xxhdpi/ic_share_black_24dp.png | Bin 0 -> 989 bytes .../drawable-xxxhdpi/ic_share_black_24dp.png | Bin 0 -> 1266 bytes src/main/res/layout/fragment_drawer.xml | 13 ++++++++++-- 7 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 src/main/res/drawable-hdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-mdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-xhdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-xxhdpi/ic_share_black_24dp.png create mode 100644 src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png 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 0000000000000000000000000000000000000000..9079041a69f207492a70dc5c1a1598bacfc310eb GIT binary patch literal 543 zcmV+)0^t3LP)ulTvu`Z;7;G#-Fu%ReT z+pMgyir55dTsWOflNM$suKKOc`998X&gDJt84he@5|1dkuZV`%8tFk-JPyZnRejtk zWD{YIn2mfoW7cRoP}$*K{SoDKpc4a`lj%Um1~T7w8u{3ef=ABv<=X1WKx1ZH10DHr z6JEnt8e(#kD51bElv>IPWWe-h&H8sun$}T9%YFNc-6&Jxza~9)Ykx@@v z3fjvy+>*t%x8`+{+_k46rWZ?IXvH~?d}LAmn6GL+$5ls9ki~)8LVQdVlpW5Ga*_6p zzS_8!Z^=PF6rI{tJL;+_O}~@QsP1fts#`K8W716{)@>)X+Cm`zHB71mC;7{q55sx( zWtCu-O*L!7n19Y~_kv5i=%quZm2@@CN2MCi{EwS)J+Kj>-L^fmzSm~&A03}8J7Y{P zG9vGScgaBi9AH6Ksqa~v~W2px*{sPgtTppxwm`eZv002ovPDHLkV1mV6?@<5% literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1a2b2abf3f38eaf21a47b40ed7de5cd0aadb0864 GIT binary patch literal 377 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1rX+877l!}s{b%+Ad7K3vkw8&y zVGw3ym^BBap1s7=*OmPN6Njj&z=8hCCkzaXT%InDAr`0iUbgi<6ez;>A%5S4=9ia* z>Z7EjnraxYt94JXi<4J#lBtqiWDpy*NKt9Y#y7q~(r4^dUzV=ie5d%`Q_DNgEzdt( zpRD&`-lnw)3v%P-Cowwsx(0cvJeCq-bWl9kbvW57Ax`TY`(k^)wD7RM*EX2W{jzD6 z>U+K?Q+c*rXi-?Fyno}2idE`EBlZHsmFyX9vS-BtI!UX|@HcV_-3q0zFAYK~z}7 z?U&DM6G0TmKiQ4gR;e^LYcy6Qspz3et(tn!i}-`~fAHkNKTPy4B2*DUp$LYSZGy!{ zLZND!-2|!>v^8zIUY2!d-Nj^QqzZkfeeVtLJHwm#zVE_;?YAYQDW5Jm+hCx(>2q3)@EsZJx0zGY^v7k9hv@gIAP;E$oGG{Z@)7?_lzh@9`Ktk_SE8 z<^fGLT$GM@xy}6{yBGki&^2AM@d5NeN5(_@bcqo@(~$?TIM310bs4U($GU%<#{qDt zkrN;+>MmRAl*4A7;?JWpAn&IyJA7^Fa!b+*(iyGd?&C+qT-*S&V6 zSK(!|h(;C-&=_NiEiCogG{p?(Jg>nV4Isxw44}o*?^M{oHXUb%VlNE S6cW<_0000@Z3N>d$}!P)47q z*(f!X?OFRBH0lfF&c{P0kWJ`)r=pH>( z=iukn1IR`%cXRR#@=Z37nQk8C7?&}IMa^0Qb?}_)ihbQixe#ZNZJF}J!Ar$PvCkM@ zs_9c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P zPRp`ak-|)pGX(%(lQ>l+&M*Jv7FFv)ZcFV=F!0`}S~WFf9zccCIeh?`%0%k}NL40U zA3&lq(fR;Zx$QW1LA({!dB8DIiAbFQx8(N`A1f}qZ=v^yY1Bd8?g3xw-VcbCXO2VC zd@P^7DgS1TF<5f2zQBZ&yGEw`9Tytupp_65%PQ;m^5x5y cFJHF$2R{-Ko`X>XzW@LL07*qoM6N<$f~RLj2mk;8 literal 0 HcmV?d00001 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"> + +