Skip to content

Commit

Permalink
Progress in Appbar: add new styles and template
Browse files Browse the repository at this point in the history
[Issue] #1558
[Problem] Progress in AppBar needs implemented
[Solution]
 - added new template to UIComponents
 - added new styles

Signed-off-by: Tomasz Lukawski <t.lukawski@samsung.com>
  • Loading branch information
TomaszLukawskiSam committed Feb 1, 2021
1 parent 9dab648 commit 54be953
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 11 deletions.
10 changes: 8 additions & 2 deletions examples/mobile/UIComponents/components/progress/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,23 @@ <h1>Progress</h1>
<div class="ui-content">
<ul class="ui-listview ui-content-area">
<li class="ui-li-anchor">
<a href="progress-bar/progressbar.html">Progress bar</a>
<a href="progress-bar/progress-bar.html">Progress bar</a>
</li>
<li class="ui-li-anchor">
<a href="progress-bar-indeterminate/progress-bar-indeterminate.html">Progress bar Indeterminate</a>
</li>
<li class="ui-li-anchor">
<a href="progress-circle/progresscircle.html">Progress Circle</a>
<a href="progress-circle/progress-circle.html">Progress Circle</a>
</li>
<li class="ui-li-anchor">
<a href="progress-circle-indeterminate/progress-circle-indeterminate.html">Progress Circle Indeterminate</a>
</li>
<li class="ui-li-anchor">
<a href="progress-bar-appbar/progress-bar.html">Progress Bar AppBar</a>
</li>
<li class="ui-li-anchor">
<a href="progress-circle-appbar/progress-circle.html">Progress Circle AppBar</a>
</li>
</ul>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>

<head>
<meta content="width=device-width, user-scalable=no" name="viewport" />
<link href="../../../lib/tau/mobile/theme/default/tau.css" rel="stylesheet" />
<link href="../../../css/style.css" rel="stylesheet" />
<script data-build-remove="false" src="../../../lib/tau/mobile/js/tau.js"></script>
<title>Progress Bar</title>
</head>

<body>
<div class="ui-page" id="progress-bar-appbar-page">
<header>
<div class="ui-appbar-controls-container">
<div class="ui-appbar-left-icons-container">
<a href="#" class="ui-btn ui-btn-icon ui-btn-icon-back" data-style="flat" data-rel="back"></a>
</div>
<div class="ui-progress" data-type="bar" data-value="50" id="progress-bar-appbar"></div>
</div>
<h1>
Progress Bar in AppBar
</h1>
</header>
<div class="ui-content"></div>
<!-- /content -->
<script src="progress-bar.js"></script>
</div>
<!-- /page -->
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(function (tau) {
"use strict";
var page = document.getElementById("progress-bar-appbar-page"),
progressbar = document.getElementById("progress-bar-appbar"),
timer,

pageBeforeShowHandler = function () {
var progressbarWidget = new tau.widget.Progress(progressbar);

timer = setTimeout(function () {
progressbarWidget.value(100);
}, 3000);
},

pageBeforeHideHandler = function () {
clearTimeout(timer);
};

page.addEventListener("pagebeforeshow", pageBeforeShowHandler);
page.addEventListener("pagebeforehide", pageBeforeHideHandler);

}(window.tau));
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</head>

<body>
<div class="ui-page" id="progressbar-demo">
<div class="ui-page" id="progress-bar-page">
<header>
<div class="ui-appbar-left-icons-container">
<a href="#" class="ui-btn ui-btn-icon ui-btn-icon-back" data-style="flat" data-rel="back"></a>
Expand All @@ -21,12 +21,12 @@ <h1>
</header>
<div class="ui-content">
<div class="ui-progress-container">
<div class="ui-progress" data-type="bar" data-value="50" id="progressbar"></div>
<div class="ui-progress" data-type="bar" data-value="50" id="progress-bar"></div>
<span class="ui-progress-text">Text text text text...</span>
</div>
</div>
<!-- /content -->
<script src="progressbar.js"></script>
<script src="progress-bar.js"></script>
</div>
<!-- /page -->
</body>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function (tau) {
"use strict";
var page = document.getElementById("progressbar-demo"),
progressbar = document.getElementById("progressbar"),
var page = document.getElementById("progress-bar-page"),
progressbar = document.getElementById("progress-bar"),
timer,

pageBeforeShowHandler = function () {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>

<head>
<meta content="width=device-width, user-scalable=no" name="viewport" />
<link href="../../../lib/tau/mobile/theme/default/tau.css" rel="stylesheet" />
<link href="../../../css/style.css" rel="stylesheet" />
<script data-build-remove="false" src="../../../lib/tau/mobile/js/tau.js"></script>
<title>Progress Bar</title>
</head>

<body>
<div class="ui-page" id="progress-circle-appbar-page">
<header>
<div class="ui-appbar-controls-container">
<div class="ui-appbar-left-icons-container">
<a href="#" class="ui-btn ui-btn-icon ui-btn-icon-back" data-style="flat" data-rel="back"></a>
</div>
<div class="ui-progress" data-type="indeterminatecircle"></div>
</div>
<h1>
Progress Circle in AppBar
</h1>
</header>
<div class="ui-content"></div>
</div>
<!-- /page -->
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</head>

<body>
<div class="ui-page" id="progresscircle-demo">
<div class="ui-page" id="progress-circle-page">
<header>
<div class="ui-appbar-left-icons-container">
<a href="#" class="ui-btn ui-btn-icon ui-btn-icon-back" data-style="flat" data-rel="back"></a>
Expand Down Expand Up @@ -38,7 +38,7 @@ <h1>
+10%
</button>
</div>
<script src="progresscircle.js">
<script src="progress-circle.js">
</script>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* pageBeforeShowHandler - pagebeforeshow event handler
* pageHideHandler - pagehide event handler
*/
var page = document.getElementById("progresscircle-demo"),
var page = document.getElementById("progress-circle-page"),
progressBar = document.getElementById("circle"),
minusBtn = document.getElementById("minus"),
plusBtn = document.getElementById("plus"),
Expand Down
42 changes: 41 additions & 1 deletion src/css/profile/mobile/common/progress.less
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ tau-progress {
box-sizing: border-box;
margin: auto;
animation: rotating 2s linear infinite;

&::before {
content:"";
border-top-style: solid;
Expand Down Expand Up @@ -398,3 +398,43 @@ tau-progress {
padding-left: 56 * @px_base;
padding-right: 56 * @px_base;
}

/** Progress Bar / Circle in AppBar */
.ui-appbar {
.ui-progress-bar {
height: 3 * @px_base;
}
.ui-indeterminate-circle {
width: 24 * @px_base;
height: 24 * @px_base;
margin-right: 24 * @px_base;
margin-bottom: 16 * @px_base;
transition: margin-right 200ms ease-in;
}
.ui-indeterminate-circle-medium {
&::before, &::after {
width: (24/2 - 3) * @px_base;
height: (24/2 - 3) * @px_base;
}

&::before {
border-top-width: 3 * @px_base;
border-left-width: 3 * @px_base;
}

&::after {
border-right-width: 3 * @px_base;
border-bottom-width: 3 * @px_base;
}
}
&.ui-appbar-expanded {
.ui-indeterminate-circle {
margin-right: calc(~"50% - "24/2 * @px_base);
}
&.ui-appbar-dragging {
.ui-indeterminate-circle {
margin-right: 24 * @px_base;
}
}
}
}

0 comments on commit 54be953

Please sign in to comment.