Skip to content

Commit

Permalink
Update switch mode icon's position and size
Browse files Browse the repository at this point in the history
  • Loading branch information
rootasjey committed Apr 7, 2019
1 parent 83765d7 commit 647a68e
Show file tree
Hide file tree
Showing 6 changed files with 1,278 additions and 1,535 deletions.
3 changes: 3 additions & 0 deletions app/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,7 @@ settings.bindLockUIChanged(updateLockUIIcon);
function updateLockUIIcon(active) {
const lockUI = document.getElementById('lockUI');
lockUI.style.visibility = active ? 'visible' : 'hidden';

const lockUIImg = document.getElementById('lockUI-img');
lockUIImg.y = layout.getLockIconY();
}
33 changes: 18 additions & 15 deletions app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,17 @@ const { height, width } = device.screen;

const deviceType = width === 300 && height === 300 ? 'Versa' : 'Ionic';

/**
* Return horizontal icon position.
*/
/** Return horizontal icon position. */
export function getIconX() {
const hPos = {
Ionic: 290,
Versa: 250,
};

return hPos[deviceType];
}

/**
* Return vertical icon position.
*/
/** Return vertical icon position. */
export function getIconY({ metricNumber }) {
const vPos = {
Ionic: {
Expand All @@ -40,7 +36,7 @@ export function getIconY({ metricNumber }) {
4: 255,
},
};

return vPos[deviceType][metricNumber];
}

Expand All @@ -50,16 +46,23 @@ export function getIconY({ metricNumber }) {
*/
export function getModeIconY() {
const vPos = {
Ionic: 200,
Versa: 240,
Ionic: 190,
Versa: 230,
};

return vPos[deviceType];
}

/**
* Return vertical text position.
*/
export function getLockIconY() {
const vPos = {
Ionic: 130,
Versa: 170,
}

return vPos[deviceType];
}

/** Return vertical text position. */
export function getTextX({ icon } = {}) {
const hPos = {
true: {
Expand All @@ -71,6 +74,6 @@ export function getTextX({ icon } = {}) {
Versa: 290,
}
};

return hPos[icon][deviceType];
}
Binary file modified build/app.fba
Binary file not shown.
Loading

1 comment on commit 647a68e

@rootasjey
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solve #5

Please sign in to comment.