mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-26 22:31:16 +00:00
Added share device ID button to drawer, always show scrollbar.
This commit is contained in:
parent
776a746740
commit
691ca26daa
7 changed files with 20 additions and 12 deletions
|
@ -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))));
|
||||
|
|
BIN
src/main/res/drawable-hdpi/ic_share_black_24dp.png
Normal file
BIN
src/main/res/drawable-hdpi/ic_share_black_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 543 B |
BIN
src/main/res/drawable-mdpi/ic_share_black_24dp.png
Normal file
BIN
src/main/res/drawable-mdpi/ic_share_black_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 377 B |
BIN
src/main/res/drawable-xhdpi/ic_share_black_24dp.png
Normal file
BIN
src/main/res/drawable-xhdpi/ic_share_black_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 684 B |
BIN
src/main/res/drawable-xxhdpi/ic_share_black_24dp.png
Normal file
BIN
src/main/res/drawable-xxhdpi/ic_share_black_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 989 B |
BIN
src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png
Normal file
BIN
src/main/res/drawable-xxxhdpi/ic_share_black_24dp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
|
@ -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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
@ -38,7 +39,6 @@
|
|||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/deviceIdContainer"
|
||||
style="@style/Widget.Syncthing.TextView.Label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -207,6 +207,15 @@
|
|||
android:drawableStart="@drawable/ic_web_black_24dp"
|
||||
android:text="@string/web_gui_title" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawerActionShareId"
|
||||
style="@style/Widget.Syncthing.TextView.Label"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:drawableLeft="@drawable/ic_share_black_24dp"
|
||||
android:drawableStart="@drawable/ic_share_black_24dp"
|
||||
android:text="@string/share_device_id" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/drawerActionDonate"
|
||||
style="@style/Widget.Syncthing.TextView.Label"
|
||||
|
|
Loading…
Reference in a new issue