Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5cd2a9f
frontend: prepare for responsive font-size
thisconnect May 9, 2024
e2473d4
frontend: implement responsive font-size using 62.5% trick
Tomasvrba Oct 15, 2025
a32e6d1
frontend: set default font-size
thisconnect Oct 16, 2025
1d73146
frontend/android: capture textzoom and set custom base font size
thisconnect May 5, 2024
0fbf3c8
frontend: rename css variable small to smaller
thisconnect Nov 10, 2025
eae32bc
frontend: redefine size-small css variable
thisconnect Nov 10, 2025
b2ac525
frontend: limit maximum font-size
thisconnect Oct 23, 2025
b586565
frontend: limit bottom-menu size expansion in reponsive mode
thisconnect Oct 17, 2025
f1352c2
frontend: limit toggle layout in scaled up version
thisconnect Oct 17, 2025
a6f5b8f
frontend: improve responsive styling of buttons
thisconnect Oct 17, 2025
a3cf2ad
frontend: improve form elements in responsive mode
thisconnect Oct 17, 2025
43945fd
frontend: fix settings-item height in scaled up mode
thisconnect Oct 17, 2025
8a75069
frontend: improve account-summary in scaled up mode
thisconnect Oct 17, 2025
878b15f
frontend: make guide component responsive
thisconnect Oct 22, 2025
acec824
frontend: make marketplace related components responsive
thisconnect Nov 10, 2025
ee0b93c
frontend: make dialog related components responsive
thisconnect Nov 10, 2025
fcb9255
frontend: make settings related components responsive
thisconnect Nov 10, 2025
4e88c36
frontend: improve sidebar in responsive mode
thisconnect Nov 10, 2025
cf73627
test: unclear what to do with view css variable overwrites
thisconnect Nov 11, 2025
089668f
frontend: improve all-accounts overlay in responsive mode
thisconnect Nov 11, 2025
5729c43
frontend: make account-overview responsive
thisconnect Nov 11, 2025
9e72fbb
frontend: make recieve view responsive
thisconnect Nov 11, 2025
d4cacd4
frontend: improve send view in responsive mode
thisconnect Nov 12, 2025
b11545d
frontend: account-overview refactoring
thisconnect Nov 18, 2025
11beebe
frontend: cleanup and remove unused icons and css
thisconnect Nov 12, 2025
b8ca454
frontend: optimize setup workflow in responsive mode
thisconnect Nov 13, 2025
ef219a5
frontend: improve waitign view in responsive mode
thisconnect Nov 13, 2025
bf8c9ac
frontend: improve bitsurance in responsive mode
thisconnect Nov 13, 2025
b8904ed
frontend: make copy component responsive and simplify styles
thisconnect Nov 17, 2025
11016f5
frontend: make transaction-detail dialog reponsive
thisconnect Nov 17, 2025
c6bc661
frontend: refactore balance and amount-with-unit components
thisconnect Nov 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public void setDarkTheme(boolean isDark) {
}
}

private int currentZoom;

@SuppressLint("SetJavaScriptEnabled")
@Override
protected void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -173,7 +175,33 @@ protected void onCreate(Bundle savedInstanceState) {

// vw.setWebContentsDebuggingEnabled(true); // enable remote debugging in chrome://inspect/#devices

vw.setWebViewClient(new BitBoxWebViewClient(BASE_URL, getAssets(), getApplication()));
// Retrieve the current text zoom setting to adjust the base font size in the WebView.
currentZoom = vw.getSettings().getTextZoom();

vw.setWebViewClient(new BitBoxWebViewClient(BASE_URL, getAssets(), getApplication()) {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);

// Calculate the base font size for html as a percentage.
// This percentage dynamically adjusts to ensure 1rem = 10px, scaled according to the current zoom level.
double baseFontSizePercentage = 62.5 * ((double) currentZoom / 100.0);

// The default body font size in rem, which is independent of the zoom level.
// This size does not scale dynamically with zoom adjustments and is fixed at 1.6rem.
double defaultFontSizeREM = 1.6;

// Reset the WebView's text zoom to 100% to ensure that the scaling is controlled via CSS
// and not by the WebView's default scaling behavior.
view.getSettings().setTextZoom(100);

String cssSetup = "document.documentElement.style.fontSize='" + baseFontSizePercentage + "%';" +
"document.body.style.fontSize='" + defaultFontSizeREM + "rem';";

// Execute the CSS setup in the WebView.
view.evaluateJavascript(cssSetup, null);
}
});

ActivityResultLauncher<String> fileChooser = registerForActivityResult(new ActivityResultContracts.GetContent(), uri -> webChrome.onFilePickerResult(uri));
BitBoxWebChromeClient.CameraPermissionDelegate cameraPermissionDelegate = () -> ActivityCompat.requestPermissions(
Expand Down Expand Up @@ -253,7 +281,6 @@ public void noAuthConfigured() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_SECURE);
}
}));

}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.container {
--size-default: 14px;
align-items: center;
background-color: var(--background-secondary);
border: none;
Expand Down
23 changes: 16 additions & 7 deletions frontends/web/src/components/amount/amount-with-unit.module.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
.rates {
cursor: default;
line-height: 1;
margin: 0;
max-width: 100%;
white-space: nowrap;
}

.unit {
font-weight: 400;
flex-grow: 0;
flex-shrink: 0;
color: var(--color-secondary);
font-variant: normal;
position: relative;
cursor: default;
}

.availableFiatAmount {
align-items: baseline;
color: var(--color-default);
padding-right: var(--space-quarter) !important;
display: inline-flex;
flex-grow: 0; /* all-accounts */
justify-content: flex-end; /* all-accounts */
justify-content: flex-start; /* account/send */
gap: 0.4ch;
text-align: right;
}

.availableFiatAmount.textStart {
justify-content: flex-start; /* account/send */
}

.availableFiatAmount.textEnd {
justify-content: flex-end; /* all-accounts */
}

.rotatable {
cursor: default;
font-size: inherit;
Expand All @@ -43,9 +57,4 @@
.fiatRow {
bottom: 0;
}

.availableFiatAmount,
.availableFiatUnit {
line-height: 24px;
}
}
38 changes: 14 additions & 24 deletions frontends/web/src/components/amount/amount-with-unit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import style from './amount-with-unit.module.css';

type TAmountWithUnitProps = {
amount: TAmountWithConversions | undefined;
tableRow?: boolean;
enableRotateUnit?: boolean;
sign?: string;
alwaysShowAmounts?: boolean;
Expand All @@ -34,12 +33,11 @@ type TAmountWithUnitProps = {

export const AmountWithUnit = ({
amount,
tableRow,
enableRotateUnit: rotateUnit,
sign,
convertToFiat,
alwaysShowAmounts = false,
unitClassName = ''
unitClassName = '',
}: TAmountWithUnitProps) => {
const { rotateDefaultCurrency, defaultCurrency, rotateBtcUnit } = useContext(RatesContext);

Expand All @@ -64,35 +62,27 @@ export const AmountWithUnit = ({
}

const enableClick = rotateUnit && (convertToFiat || isBitcoinCoin(amount.unit));
const formattedAmount = !!displayedAmount ?
(
<Amount
alwaysShowAmounts={alwaysShowAmounts}
amount={displayedAmount}
unit={displayedUnit}
onMobileClick={enableClick ? onClick : undefined}
/>
) : '---';

const amountUnit = <AmountUnit unit={displayedUnit} rotateUnit={enableClick ? onClick : undefined} className={unitClassName}/>;

if (tableRow) {
return (
<tr className={style.fiatRow}>
<td className={style.availableFiatAmount}>{formattedAmount}</td>
<td>{amountUnit}</td>
</tr>
);
}
return (
<span className={`
${style.rates || ''}
${style.availableFiatAmount || ''}
${!displayedAmount && style.notAvailable || ''}
`.trim()}>
{!!displayedAmount ? sign : ''}
{formattedAmount}
{!!displayedAmount ? (
<Amount
alwaysShowAmounts={alwaysShowAmounts}
amount={displayedAmount}
unit={displayedUnit}
onMobileClick={enableClick ? onClick : undefined}
/>
) : '---'}
{' '}
{amountUnit}
<AmountUnit
unit={displayedUnit}
rotateUnit={enableClick ? onClick : undefined}
className={unitClassName}/>
</span>
);
};
Expand Down
9 changes: 9 additions & 0 deletions frontends/web/src/components/amount/amount.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
.amount {
align-items: baseline;
display: inline-flex;
display: flow-root; /* all-account */
flex-shrink: 1;
flex-basis: auto;
flex-grow: 0;
font-variant: tabular-nums;
max-width: 100%;
/* max-width: calc(100% - 2ch); */
overflow: hidden;
/* TODO: keep clip? */
/* overflow: clip; */
text-overflow: ellipsis;
}

Expand Down
11 changes: 6 additions & 5 deletions frontends/web/src/components/amount/conversion-amount.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@
.txPrefix,
.txUnit {
color: var(--color-secondary);
font-size: 14px;
line-height: 1.285714;
font-size: var(--size-small);
/* line-height: 1.285714; */
white-space: nowrap;
}

.txConversionAmount .txUnit {
font-size: 12px;
font-size: var(--size-smaller);
flex-shrink: 0;
max-width: 100%;
}

.txSmallInlineIcon img {
max-height: 15px;
max-width: 15px;
max-height: 1.5rem;
max-width: 1.5rem;
vertical-align: text-bottom;
}
.txConversionAmount .txSmallInlineIcon {
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/aopp/aopp.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
}
@media (min-width: 1200px) {
.message {
--size-default: 18px;
--size-default: 1.8rem;
}
}
6 changes: 3 additions & 3 deletions frontends/web/src/components/badge/badge.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
border-radius: var(--space-half);
border: 1px solid;
display: inline-block;
font-size: var(--size-small);
font-size: var(--size-smaller);
flex-shrink: 0;
line-height: 1;
padding: var(--space-eight) 10px;
Expand All @@ -19,7 +19,7 @@
}

.badgeIcon {
max-width: 10px;
max-width: 1rem;
}

.withChildren .badgeIcon {
Expand All @@ -28,7 +28,7 @@

@media (max-width: 382px) {
.badge {
font-size: 10px;
font-size: 1rem;
}
}

Expand Down
31 changes: 13 additions & 18 deletions frontends/web/src/components/balance/balance.module.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,28 @@
.balanceTable {
.balanceContainer {
margin-bottom: var(--space-half);
max-width: 100%;
/* min-height: var(--button-height); */
}

.balance {
align-items: flex-end;
border-collapse: collapse;
border-spacing: 0;
display: flex;
flex-direction: row;
position: relative;
}

.balanceTable tr {
display: inline-block;
vertical-align: bottom;
padding-right: var(--space-half);
}

.balanceTable td {
flex-wrap: wrap;
font-size: var(--size-large);
font-weight: 400;
line-height: 1.2;
padding: 0;
vertical-align: baseline;
gap: var(--space-half);
line-height: 0.8125;
position: relative;
}

.balanceTable td:last-child {
.unit {
font-size: var(--size-default);
}

.pendingBalance {
color: var(--color-secondary);
font-size: var(--size-small);
font-size: var(--size-smaller);
line-height: 1;
margin: 0;
padding-top: var(--space-half);
Expand Down
30 changes: 14 additions & 16 deletions frontends/web/src/components/balance/balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,20 @@ export const Balance = ({
}

return (
<header className={style.balance}>
<table className={style.balanceTable}>
<tbody data-testid="availableBalance">
<AmountWithUnit
amount={balance.available}
tableRow
enableRotateUnit={!noRotateFiat}
/>
<AmountWithUnit
amount={balance.available}
tableRow
enableRotateUnit={!noRotateFiat}
convertToFiat
/>
</tbody>
</table>
<header className={style.balanceContainer}>
<div className={style.balance} data-testid="availableBalance">
<AmountWithUnit
amount={balance.available}
enableRotateUnit={!noRotateFiat}
unitClassName={style.unit}
/>
<AmountWithUnit
amount={balance.available}
enableRotateUnit={!noRotateFiat}
unitClassName={style.unit}
convertToFiat
/>
</div>
{
balance.hasIncoming && (
<p className={style.pendingBalance}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
align-items: center;
color: var(--color-text);
display: flex;
font-size: 12px;
font-size: min(1.2rem, 20px);
flex-direction: column;
gap: 4px;
justify-content: center;
Expand Down
11 changes: 7 additions & 4 deletions frontends/web/src/components/copy/Copy.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,20 @@
cursor: pointer;
display: flex;
flex-direction: row;
height: 18px;
height: var(--size-default);
justify-content: center;
margin-top: var(--spacing-half);
min-width: 18px !important;
max-width: var(--size-default);
padding: 0;
position: absolute;
right: var(--spacing-default);
top: 10px;
transition: background-color ease 0.2s;
width: 18px;
will-change: background-color;
}

.button img {
width: 18px;
height: var(--size-default);
}

.button:focus {
Expand All @@ -36,6 +35,10 @@
}

.container {
align-items: flex-start;
display: flex;
flex-direction: row;
justify-content: flex-start;
position: relative;
}

Expand Down
1 change: 0 additions & 1 deletion frontends/web/src/components/copy/Copy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ export const CopyableInput = ({

return (
<div className={[
'flex flex-row flex-start flex-items-start',
style.container,
className ? className : ''
].join(' ')}>
Expand Down
Loading
Loading