mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-09 03:54:17 +08:00
Tweak button ordering on the file received dialog
This commit is contained in:
@@ -119,25 +119,7 @@ public class TermuxFileReceiverActivity extends Activity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void promptNameAndSave(final InputStream in, final String attachmentFileName) {
|
void promptNameAndSave(final InputStream in, final String attachmentFileName) {
|
||||||
DialogUtils.textInput(this, R.string.file_received_title, attachmentFileName
|
DialogUtils.textInput(this, R.string.file_received_title, attachmentFileName, R.string.file_received_edit_button, new DialogUtils.TextSetListener() {
|
||||||
, android.R.string.ok, new DialogUtils.TextSetListener() {
|
|
||||||
@Override
|
|
||||||
public void onTextSet(final String text) {
|
|
||||||
if (saveStreamWithName(in, text) == null) return;
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}, R.string.file_received_open_folder_button, new DialogUtils.TextSetListener() {
|
|
||||||
@Override
|
|
||||||
public void onTextSet(String text) {
|
|
||||||
if (saveStreamWithName(in, text) == null) return;
|
|
||||||
|
|
||||||
Intent executeIntent = new Intent(TermuxService.ACTION_EXECUTE);
|
|
||||||
executeIntent.putExtra(TermuxService.EXTRA_CURRENT_WORKING_DIRECTORY, TERMUX_RECEIVEDIR);
|
|
||||||
executeIntent.setClass(TermuxFileReceiverActivity.this, TermuxService.class);
|
|
||||||
startService(executeIntent);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
}, R.string.file_received_edit_button, new DialogUtils.TextSetListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextSet(String text) {
|
public void onTextSet(String text) {
|
||||||
File outFile = saveStreamWithName(in, text);
|
File outFile = saveStreamWithName(in, text);
|
||||||
@@ -161,6 +143,24 @@ public class TermuxFileReceiverActivity extends Activity {
|
|||||||
startService(executeIntent);
|
startService(executeIntent);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
R.string.file_received_open_folder_button, new DialogUtils.TextSetListener() {
|
||||||
|
@Override
|
||||||
|
public void onTextSet(String text) {
|
||||||
|
if (saveStreamWithName(in, text) == null) return;
|
||||||
|
|
||||||
|
Intent executeIntent = new Intent(TermuxService.ACTION_EXECUTE);
|
||||||
|
executeIntent.putExtra(TermuxService.EXTRA_CURRENT_WORKING_DIRECTORY, TERMUX_RECEIVEDIR);
|
||||||
|
executeIntent.setClass(TermuxFileReceiverActivity.this, TermuxService.class);
|
||||||
|
startService(executeIntent);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
android.R.string.cancel, new DialogUtils.TextSetListener() {
|
||||||
|
@Override
|
||||||
|
public void onTextSet(final String text) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}, new DialogInterface.OnDismissListener() {
|
}, new DialogInterface.OnDismissListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(DialogInterface dialog) {
|
public void onDismiss(DialogInterface dialog) {
|
||||||
|
Reference in New Issue
Block a user