Compare commits

..
6 Commits
Author SHA1 Message Date
Codex 650431e3d1 Compact action buttons across pages
Gitea Smoke / smoke (push) Successful in 2s
Gitea Android APK / build (push) Failing after 1m1s
2026-07-15 15:15:09 +00:00
Codex 412c69cc36 Replace native dialogs with app sheets
Gitea Smoke / smoke (push) Successful in 0s
Gitea Android APK / build (push) Has been cancelled
2026-07-15 15:03:56 +00:00
Codex 813a74f3ef Simplify server page actions
Gitea Smoke / smoke (push) Successful in 2s
Gitea Android APK / build (push) Failing after 1m2s
2026-07-15 14:40:01 +00:00
Codex 0d32e6105a Move secondary navigation into header menu
Gitea Smoke / smoke (push) Successful in 2s
Gitea Android APK / build (push) Failing after 1m33s
2026-07-15 10:37:22 +00:00
Codex 0cf8de3dda Fix Gitea release asset uploads
Gitea Smoke / smoke (push) Successful in 0s
Gitea Android APK / build (push) Successful in 12m1s
2026-07-15 08:36:33 +00:00
Codex 4f1b24c1c3 Bound Gitea release mirror retries
Gitea Android APK / build (push) Failing after 2s
Gitea Smoke / smoke (push) Successful in 0s
2026-07-15 08:28:54 +00:00
2 changed files with 226 additions and 47 deletions
+4 -4
View File
@@ -55,12 +55,12 @@ jobs:
mkdir -p release
ATTEMPT=1
while [ "${ATTEMPT}" -le 30 ]; do
while [ "${ATTEMPT}" -le 6 ]; do
if curl -fsSL "${GITHUB_APK_URL}" -o release/tmux-android.apk; then
break
fi
rm -f release/tmux-android.apk
echo "Waiting for GitHub release ${TAG} (${ATTEMPT}/30)..."
echo "Waiting for GitHub release ${TAG} (${ATTEMPT}/6)..."
sleep 10
ATTEMPT=$((ATTEMPT + 1))
done
@@ -95,7 +95,7 @@ jobs:
"${API_ROOT}/releases/tags/${TAG}" \
-o /tmp/gitea-release.json
fi
RELEASE_ID="$(sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p' /tmp/gitea-release.json | head -1)"
RELEASE_ID="$(sed -n 's/^{"id":\([0-9][0-9]*\),.*/\1/p' /tmp/gitea-release.json | head -1)"
if [ -z "${RELEASE_ID}" ]; then
echo "Cannot resolve Gitea release id for ${TAG}." >&2
exit 1
@@ -248,7 +248,7 @@ jobs:
"${API_ROOT}/releases/tags/${TAG}" \
-o /tmp/gitea-release.json
fi
RELEASE_ID="$(sed -n 's/.*"id":\([0-9][0-9]*\).*/\1/p' /tmp/gitea-release.json | head -1)"
RELEASE_ID="$(sed -n 's/^{"id":\([0-9][0-9]*\),.*/\1/p' /tmp/gitea-release.json | head -1)"
if [ -z "${RELEASE_ID}" ]; then
echo "Cannot resolve Gitea release id." >&2
cat /tmp/gitea-release.json >&2
@@ -2,11 +2,11 @@ package com.neatstudio.tmuxandroid;
import android.Manifest;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
@@ -293,17 +293,11 @@ public final class MainActivity extends Activity {
ScrollView scroll = new ScrollView(this);
LinearLayout content = pageContent();
List<String> serverUrls = savedServerUrls();
content.addView(createPageHeader(
serverUrls.size() + " nodes",
"Servers",
" Add",
view -> promptCustomServer()
));
content.addView(createServerPageHeader(serverUrls.size() + " nodes"));
for (String url : serverUrls) {
content.addView(serverProfileCard(url), spacedHeight(72, 0, 12));
}
content.addView(createServerUtilityRow());
scroll.addView(content);
root.addView(scroll, new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
@@ -523,14 +517,46 @@ public final class MainActivity extends Activity {
return header;
}
private View createServerUtilityRow() {
LinearLayout row = new LinearLayout(this);
row.setOrientation(LinearLayout.HORIZONTAL);
row.setPadding(0, dp(4), 0, 0);
row.addView(compactButton("Probe all", view -> probeServerProfiles()));
row.addView(compactButton("Update", view -> renderUpdateScreen()));
row.addView(compactButton("More", view -> showMainNavigation()));
return row;
private View createServerPageHeader(String eyebrow) {
LinearLayout header = new LinearLayout(this);
header.setOrientation(LinearLayout.HORIZONTAL);
header.setGravity(Gravity.BOTTOM);
header.setPadding(dp(2), dp(6), dp(2), dp(18));
LinearLayout titleBlock = new LinearLayout(this);
titleBlock.setOrientation(LinearLayout.VERTICAL);
TextView eyebrowView = new TextView(this);
eyebrowView.setText(eyebrow.toUpperCase(java.util.Locale.ROOT));
eyebrowView.setTextColor(COLOR_TEXT_MUTED);
eyebrowView.setTextSize(10);
eyebrowView.setTypeface(Typeface.MONOSPACE);
TextView title = new TextView(this);
title.setText("Servers");
title.setTextColor(COLOR_TEXT);
title.setTextSize(25);
title.setTypeface(Typeface.DEFAULT_BOLD);
title.setIncludeFontPadding(false);
titleBlock.addView(eyebrowView);
titleBlock.addView(title);
header.addView(titleBlock, new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1));
addHeaderTool(header, "", "Refresh servers", view -> probeServerProfiles());
addHeaderTool(header, "", "Add server", view -> promptCustomServer());
addHeaderTool(header, "", "More navigation", view -> showMainNavigation());
return header;
}
private void addHeaderTool(
LinearLayout header,
String label,
String description,
View.OnClickListener action
) {
Button button = terminalToolButton(label, action);
button.setContentDescription(description);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(dp(38), dp(38));
params.leftMargin = dp(4);
header.addView(button, params);
}
private View createSessionPageHeader() {
@@ -728,7 +754,7 @@ public final class MainActivity extends Activity {
}
private void confirmRemoveSavedServer(String url) {
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Remove server")
.setMessage("Remove " + url + " from this device?")
.setNegativeButton("Cancel", null)
@@ -763,7 +789,7 @@ public final class MainActivity extends Activity {
private void showMainNavigation() {
String[] items = {"Projects", "Tools", "Update", "About"};
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("tmuxctl")
.setItems(items, (dialog, which) -> {
if (which == 0) {
@@ -1027,11 +1053,15 @@ public final class MainActivity extends Activity {
LinearLayout actions = new LinearLayout(this);
actions.setOrientation(LinearLayout.HORIZONTAL);
actions.setGravity(Gravity.END | Gravity.CENTER_VERTICAL);
Button copy = compactButton("Copy commands", view -> copyText("Server install", SERVER_INSTALL_COMMANDS));
actions.addView(copy, new LinearLayout.LayoutParams(0, dp(40), 1));
actions.addView(copy, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, dp(32)));
Button add = compactButton("Add server", view -> promptCustomServer());
LinearLayout.LayoutParams addParams = new LinearLayout.LayoutParams(0, dp(40), 1);
addParams.leftMargin = dp(7);
LinearLayout.LayoutParams addParams = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
dp(32)
);
addParams.leftMargin = dp(5);
actions.addView(add, addParams);
panel.addView(actions, spacedMatchWrap(10, 0));
@@ -1294,28 +1324,40 @@ public final class MainActivity extends Activity {
}
private LinearLayout actionPanel(Button... buttons) {
final int columns = 3;
LinearLayout panel = new LinearLayout(this);
panel.setOrientation(LinearLayout.VERTICAL);
panel.setPadding(dp(6), dp(6), dp(6), dp(1));
panel.setPadding(dp(4), dp(4), dp(4), 0);
panel.setBackground(panelBackground());
LinearLayout row = null;
for (int index = 0; index < buttons.length; index++) {
if (index % 2 == 0) {
if (index % columns == 0) {
row = new LinearLayout(this);
row.setOrientation(LinearLayout.HORIZONTAL);
panel.addView(row, matchWrap());
}
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, dp(38), 1);
params.leftMargin = dp(3);
params.rightMargin = dp(3);
params.bottomMargin = dp(6);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(0, dp(32), 1);
params.leftMargin = dp(2);
params.rightMargin = dp(2);
params.bottomMargin = dp(4);
buttons[index].setTextSize(9);
buttons[index].setPadding(dp(4), 0, dp(4), 0);
row.addView(buttons[index], params);
}
int remainder = buttons.length % columns;
if (row != null && remainder != 0) {
for (int index = remainder; index < columns; index++) {
LinearLayout.LayoutParams spacerParams = new LinearLayout.LayoutParams(0, dp(32), 1);
spacerParams.leftMargin = dp(2);
spacerParams.rightMargin = dp(2);
row.addView(new View(this), spacerParams);
}
}
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
);
params.bottomMargin = dp(8);
params.bottomMargin = dp(6);
panel.setLayoutParams(params);
return panel;
}
@@ -1829,7 +1871,7 @@ public final class MainActivity extends Activity {
}
private void confirmKill(String sessionName) {
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Kill session")
.setMessage("Kill tmux session \"" + sessionName + "\"?")
.setNegativeButton("Cancel", null)
@@ -3025,7 +3067,7 @@ public final class MainActivity extends Activity {
EditText project = formField(form, "Project", "");
EditText agent = formField(form, "Agent/session name", "");
EditText kill = formField(form, "Kill too: true or false", "false");
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Remove kanban session")
.setView(form)
.setNegativeButton("Cancel", null)
@@ -3345,7 +3387,7 @@ public final class MainActivity extends Activity {
EditText body = formField(form, "Message", "");
body.setMinLines(3);
body.setSingleLine(false);
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Send group message")
.setView(form)
.setNegativeButton("Cancel", null)
@@ -3366,7 +3408,7 @@ public final class MainActivity extends Activity {
LinearLayout form = formRoot();
EditText project = formField(form, "Project", "");
EditText message = formField(form, "Message ID", "");
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Scan group message")
.setView(form)
.setNegativeButton("Cancel", null)
@@ -3391,7 +3433,7 @@ public final class MainActivity extends Activity {
EditText body = formField(form, "Body", "");
body.setMinLines(2);
body.setSingleLine(false);
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Post hook event")
.setView(form)
.setNegativeButton("Cancel", null)
@@ -3410,7 +3452,7 @@ public final class MainActivity extends Activity {
LinearLayout form = formRoot();
EditText session = formField(form, "Session optional", "");
EditText url = formField(form, "Image URL", "");
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Upload image URL")
.setView(form)
.setNegativeButton("Cancel", null)
@@ -3427,7 +3469,7 @@ public final class MainActivity extends Activity {
EditText session = new EditText(this);
session.setSingleLine(true);
session.setHint("session optional");
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Upload image file")
.setView(session)
.setNegativeButton("Cancel", null)
@@ -3453,7 +3495,7 @@ public final class MainActivity extends Activity {
LinearLayout form = formRoot();
EditText path = formField(form, "Path", "");
EditText basePath = formField(form, "Base path optional", "");
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Image preview info")
.setView(form)
.setNegativeButton("Cancel", null)
@@ -3470,7 +3512,7 @@ public final class MainActivity extends Activity {
LinearLayout form = formRoot();
EditText path = formField(form, "Path", "");
EditText basePath = formField(form, "Base path optional", "");
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Open image preview")
.setView(form)
.setNegativeButton("Cancel", null)
@@ -3505,7 +3547,7 @@ public final class MainActivity extends Activity {
text.append('\n');
text.append(permissionSummary());
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Permissions / update")
.setMessage(text.toString())
.setNegativeButton("Close", null)
@@ -3543,7 +3585,7 @@ public final class MainActivity extends Activity {
"Preview manual: " + BuildConfig.DEFAULT_PREVIEW_UPDATE_URL,
"Custom URL"
};
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Update source")
.setItems(items, (dialog, which) -> {
if (which == 0) {
@@ -3678,7 +3720,7 @@ public final class MainActivity extends Activity {
image.setImageBitmap(bitmap);
image.setAdjustViewBounds(true);
image.setPadding(dp(8), dp(8), dp(8), dp(8));
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle("Image preview")
.setView(image)
.setPositiveButton("Close", null)
@@ -3716,7 +3758,7 @@ public final class MainActivity extends Activity {
input.setHint(hint);
input.setText(value);
input.setSelectAllOnFocus(true);
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle(title)
.setView(input)
.setNegativeButton("Cancel", null)
@@ -3774,7 +3816,7 @@ public final class MainActivity extends Activity {
ScrollView scroll = new ScrollView(this);
TextView content = new TextView(this);
content.setText(text == null || text.isEmpty() ? "(empty)" : text);
content.setTextColor(Color.rgb(20, 24, 30));
content.setTextColor(COLOR_TEXT);
content.setTextSize(12);
content.setTypeface(Typeface.MONOSPACE);
content.setTextIsSelectable(true);
@@ -3783,13 +3825,150 @@ public final class MainActivity extends Activity {
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
));
new AlertDialog.Builder(this)
new AppDialogBuilder()
.setTitle(title)
.setView(scroll)
.setPositiveButton("Close", null)
.show();
}
private final class AppDialogBuilder {
private String title = "";
private String message;
private View content;
private String[] items;
private DialogInterface.OnClickListener itemAction;
private String negativeLabel;
private DialogInterface.OnClickListener negativeAction;
private String neutralLabel;
private DialogInterface.OnClickListener neutralAction;
private String positiveLabel;
private DialogInterface.OnClickListener positiveAction;
AppDialogBuilder setTitle(String value) {
title = value;
return this;
}
AppDialogBuilder setMessage(String value) {
message = value;
return this;
}
AppDialogBuilder setView(View value) {
content = value;
return this;
}
AppDialogBuilder setItems(String[] values, DialogInterface.OnClickListener action) {
items = values;
itemAction = action;
return this;
}
AppDialogBuilder setNegativeButton(String label, DialogInterface.OnClickListener action) {
negativeLabel = label;
negativeAction = action;
return this;
}
AppDialogBuilder setNeutralButton(String label, DialogInterface.OnClickListener action) {
neutralLabel = label;
neutralAction = action;
return this;
}
AppDialogBuilder setPositiveButton(String label, DialogInterface.OnClickListener action) {
positiveLabel = label;
positiveAction = action;
return this;
}
Dialog show() {
Dialog dialog = new Dialog(MainActivity.this);
LinearLayout sheet = bottomSheetContent(dialog, title, dialogSubtitle());
if (message != null) {
TextView body = bodyText(message);
body.setTextSize(12);
body.setTextIsSelectable(true);
body.setPadding(dp(2), dp(4), dp(2), dp(8));
sheet.addView(body, matchWrap());
}
if (content != null) {
LinearLayout.LayoutParams contentParams = matchWrap();
contentParams.bottomMargin = dp(10);
sheet.addView(content, contentParams);
}
if (items != null) {
for (int index = 0; index < items.length; index++) {
final int selected = index;
Button choice = toolbarButton(items[index], view -> {
dialog.dismiss();
if (itemAction != null) {
itemAction.onClick(dialog, selected);
}
});
choice.setGravity(Gravity.START | Gravity.CENTER_VERTICAL);
choice.setTextSize(11);
LinearLayout.LayoutParams choiceParams = matchWrap();
choiceParams.height = dp(42);
choiceParams.bottomMargin = dp(6);
sheet.addView(choice, choiceParams);
}
}
addDialogActions(dialog, sheet);
showBottomSheet(dialog, sheet, null);
return dialog;
}
private String dialogSubtitle() {
if (items != null) {
return "Choose an option";
}
if (content != null) {
return "Complete the fields below";
}
return "Confirm this action";
}
private void addDialogActions(Dialog dialog, LinearLayout sheet) {
if (negativeLabel == null && neutralLabel == null && positiveLabel == null) {
return;
}
LinearLayout actions = new LinearLayout(MainActivity.this);
actions.setOrientation(LinearLayout.HORIZONTAL);
actions.setGravity(Gravity.END | Gravity.CENTER_VERTICAL);
addDialogAction(actions, dialog, neutralLabel, neutralAction, DialogInterface.BUTTON_NEUTRAL, false);
addDialogAction(actions, dialog, negativeLabel, negativeAction, DialogInterface.BUTTON_NEGATIVE, false);
addDialogAction(actions, dialog, positiveLabel, positiveAction, DialogInterface.BUTTON_POSITIVE,
"Remove".equals(positiveLabel) || "Kill".equals(positiveLabel) || "Delete".equals(positiveLabel));
sheet.addView(actions, spacedMatchWrap(4, 0));
}
private void addDialogAction(
LinearLayout actions,
Dialog dialog,
String label,
DialogInterface.OnClickListener action,
int which,
boolean danger
) {
if (label == null) {
return;
}
Button button = compactButton(label, view -> {
dialog.dismiss();
if (action != null) {
action.onClick(dialog, which);
}
});
if (danger) {
button.setTextColor(COLOR_DANGER);
}
actions.addView(button);
}
}
private LinearLayout formRoot() {
LinearLayout form = new LinearLayout(this);
form.setOrientation(LinearLayout.VERTICAL);