diff --git a/apps/app/ui-tests-app/css/elevation.css b/apps/app/ui-tests-app/css/elevation.css new file mode 100644 index 000000000..5ebb8a2ab --- /dev/null +++ b/apps/app/ui-tests-app/css/elevation.css @@ -0,0 +1,43 @@ +Label, Button { + text-align: center; + padding: 10; + margin: 16; + background-color: #bbb; +} + +.elevation-0 { + android-elevation: 0; +} + +.elevation-2 { + android-elevation: 2; +} + +.elevation-4 { + android-elevation: 4; +} + +.elevation-4:highlighted { + android-elevation: 2; +} + +.elevation-8 { + android-elevation: 8; +} + +.elevation-10 { + android-elevation: 10; +} + +.pressed-z-10 { + android-dynamic-elevation-offset: 10; +} + +.round { + color: #fff; + background-color: #ff1744; + border-radius: 50%; /* TODO kills elevation */ + width: 80; + height: 80; + android-elevation: 8; +} \ No newline at end of file diff --git a/apps/app/ui-tests-app/css/elevation.ts b/apps/app/ui-tests-app/css/elevation.ts new file mode 100644 index 000000000..dd7e54701 --- /dev/null +++ b/apps/app/ui-tests-app/css/elevation.ts @@ -0,0 +1,20 @@ +import { Button } from "tns-core-modules/ui/button/button"; +import { EventData } from "tns-core-modules/ui/page/page"; + +const states = [ + { class: "", text: "default elevation" }, + { class: "elevation-10", text: "elevetion 10" }, + { class: "elevation-10 pressed-z-10", text: "elevetion 10 pressed-z 10" }, + { class: "elevation-0", text: "elevetion 0" }, +] +let currentState = 0; + +export function buttonTap(args: EventData) { + let btn: Button = args.object as Button; + currentState++; + if (currentState >= states.length) { + currentState = 0; + } + btn.className = states[currentState].class; + btn.text = states[currentState].text; +} \ No newline at end of file diff --git a/apps/app/ui-tests-app/css/elevation.xml b/apps/app/ui-tests-app/css/elevation.xml new file mode 100644 index 000000000..37a492e92 --- /dev/null +++ b/apps/app/ui-tests-app/css/elevation.xml @@ -0,0 +1,25 @@ + + + +