v0.8.8: bubble for Android 0.7.5 — the composer is always the small size; smoother scrolling past photos
Android: the composer used to shrink only with the keyboard up; now it is always that size (small text, tight padding, 60 dp buttons), and the keyboard only takes a line off the text box and the subtitle. Checked on the Rabbit with the dev app, at rest and typing. Desktop: the chat and Get info show a smaller copy of each still picture (720 px long edge, made once into <dataDir>/thumbs) instead of decoding a phone's 4000 px photo every time a row scrolls in. Full size, Save and Copy still use the original; GIFs and pictures already that small are served as they are. Pictures decode off the main thread.
This commit is contained in:
@@ -123,23 +123,16 @@ public final class ChatActivity extends BaseActivity {
|
||||
|
||||
/**
|
||||
* The R1 has 640 px of height and the keyboard takes about half: with a
|
||||
* photo attached, the full-size composer would push the text box under
|
||||
* it. So while it's up, the photos, text and padding all shrink and the
|
||||
* subtitle goes, leaving the text box and a few messages in view.
|
||||
* photo attached, the composer would push the text box under it. So
|
||||
* while it's up, the photos shrink, the text box gives up a line and the
|
||||
* subtitle goes, leaving the text box and a few messages in view. (The
|
||||
* composer itself is always the small size: see composer().)
|
||||
*/
|
||||
private void setCompact(boolean on) {
|
||||
compact = on;
|
||||
header.setPadding(Ui.dp(this, 24), Ui.dp(this, on ? 4 : 10), Ui.dp(this, 24), Ui.dp(this, on ? 4 : 10));
|
||||
subView.setVisibility(on || subView.getText().length() == 0 ? View.GONE : View.VISIBLE);
|
||||
composerBox.setPadding(Ui.dp(this, 12), Ui.dp(this, on ? 4 : 10), Ui.dp(this, 12), Ui.dp(this, on ? 4 : 10));
|
||||
input.setTextSize(TypedValue.COMPLEX_UNIT_SP, on ? Ui.T_SMALL : Ui.T_BODY);
|
||||
input.setPadding(Ui.dp(this, on ? 18 : 24), Ui.dp(this, on ? 8 : 14), Ui.dp(this, on ? 18 : 24), Ui.dp(this, on ? 8 : 14));
|
||||
input.setMaxLines(on ? 3 : 4);
|
||||
for (TextView b : new TextView[] {attach, send}) {
|
||||
b.setMinWidth(Ui.dp(this, on ? 60 : 80));
|
||||
b.setMinHeight(Ui.dp(this, on ? 56 : 80));
|
||||
b.setTextSize(TypedValue.COMPLEX_UNIT_SP, on ? 28 : 34);
|
||||
}
|
||||
for (int i = 0; i < tray.getChildCount(); i++) tray.getChildAt(i).setLayoutParams(thumbParams());
|
||||
if (on) list.post(this::showLatest);
|
||||
}
|
||||
@@ -165,7 +158,9 @@ public final class ChatActivity extends BaseActivity {
|
||||
LinearLayout box = composerBox = new LinearLayout(this);
|
||||
box.setOrientation(LinearLayout.VERTICAL);
|
||||
box.setBackgroundColor(Ui.PANEL);
|
||||
box.setPadding(Ui.dp(this, 12), Ui.dp(this, 10), Ui.dp(this, 12), Ui.dp(this, 10));
|
||||
// Always the compact size (it used to shrink only with the keyboard
|
||||
// up): the big one's padding was wasted on a 640 px screen.
|
||||
box.setPadding(Ui.dp(this, 12), Ui.dp(this, 4), Ui.dp(this, 12), Ui.dp(this, 4));
|
||||
|
||||
// From-number picker, only for a conversation with nothing in it yet.
|
||||
fromRow = new LinearLayout(this);
|
||||
@@ -189,15 +184,17 @@ public final class ChatActivity extends BaseActivity {
|
||||
row.setBaselineAligned(false);
|
||||
attach = Ui.headerButton(this, Glyph.Kind.ATTACH);
|
||||
attach.setOnTouchListener((v, e) -> attachTouch(e));
|
||||
compactButton(attach);
|
||||
input = new EditText(this);
|
||||
input.setHint("Message");
|
||||
input.setHintTextColor(Ui.MUTED);
|
||||
input.setTextColor(Ui.TEXT);
|
||||
input.setTextSize(TypedValue.COMPLEX_UNIT_SP, Ui.T_BODY);
|
||||
input.setTextSize(TypedValue.COMPLEX_UNIT_SP, Ui.T_SMALL);
|
||||
input.setMaxLines(4);
|
||||
input.setBackground(Ui.input(this, 36));
|
||||
input.setPadding(Ui.dp(this, 24), Ui.dp(this, 14), Ui.dp(this, 24), Ui.dp(this, 14));
|
||||
input.setPadding(Ui.dp(this, 18), Ui.dp(this, 8), Ui.dp(this, 18), Ui.dp(this, 8));
|
||||
send = Ui.headerButton(this, Glyph.Kind.SEND, Ui.ACCENT);
|
||||
compactButton(send);
|
||||
send.setOnClickListener(v -> submit());
|
||||
row.addView(attach);
|
||||
row.addView(input, new LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1));
|
||||
@@ -226,6 +223,12 @@ public final class ChatActivity extends BaseActivity {
|
||||
return box;
|
||||
}
|
||||
|
||||
private void compactButton(TextView b) {
|
||||
b.setMinWidth(Ui.dp(this, 60));
|
||||
b.setMinHeight(Ui.dp(this, 56));
|
||||
b.setTextSize(TypedValue.COMPLEX_UNIT_SP, 28);
|
||||
}
|
||||
|
||||
private android.content.SharedPreferences drafts() {
|
||||
return getSharedPreferences("drafts", MODE_PRIVATE);
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,8 +26,8 @@ import sys
|
||||
import zipfile
|
||||
from pathlib import Path
|
||||
|
||||
VERSION_NAME = "0.7.4"
|
||||
VERSION_CODE = 12
|
||||
VERSION_NAME = "0.7.5"
|
||||
VERSION_CODE = 13
|
||||
|
||||
PACKAGE = "me.teafry.voipmessages"
|
||||
DEV_PACKAGE = PACKAGE + ".dev"
|
||||
|
||||
Reference in New Issue
Block a user