diff --git a/dev/.includes b/dev/.includes index ac409de..c486029 100755 --- a/dev/.includes +++ b/dev/.includes @@ -42,6 +42,7 @@ visual/fragments/shared.js visual/fragments/sidebar.js visual/fragments/logotype.js visual/fragments/overlay.js +visual/control.js visual/sidebar.js visual/explorer.js visual/project.js diff --git a/dev/header.js b/dev/header.js index c29391d..5afdcca 100755 --- a/dev/header.js +++ b/dev/header.js @@ -44,9 +44,6 @@ let maximumAllowedBounds = 128; let importAutoselect = false; let safetyProcesses = true; let transitionSideDividers = 8; -let debugAttachBackground = false; -let debugAttachControlTools = true; -let debugIgnoreLockedBackground = true; // Currently build information const REVISION = "testing-beta-preview-0.3.5-27.06.2021-14"; diff --git a/dev/visual/control.js b/dev/visual/control.js new file mode 100755 index 0000000..73ed41a --- /dev/null +++ b/dev/visual/control.js @@ -0,0 +1,66 @@ +const ControlButton = function() { + UniqueWindow.apply(this, arguments); + this.resetContent(); + this.setBackground("popupButton"); + + let actor = new FadeActor(); + actor.setInterpolator(new AccelerateDecelerateInterpolator()); + actor.setDuration(400); + this.setEnterActor(actor); + + actor = new SlideActor(Interface.Gravity.LEFT); + actor.setInterpolator(new AccelerateInterpolator()); + actor.setDuration(400); + this.setExitActor(actor); +}; + +ControlButton.prototype = new UniqueWindow; +ControlButton.prototype.TYPE = "ControlButton"; + +ControlButton.prototype.unclose = true; + +ControlButton.prototype.resetContent = function() { + let scope = this, + views = this.views = new Object(); + let content = new android.widget.FrameLayout(context); + this.setContent(content); + + views.layout = new android.widget.LinearLayout(context); + views.layout.setOrientation(Interface.Orientate.VERTICAL); + views.layout.setOnClickListener(function(view) { + scope.isCloseableOutside() && scope.hide(); + scope.__click && scope.__click(); + }); + let params = android.widget.FrameLayout.LayoutParams(Interface.Display.WRAP, Interface.Display.WRAP); + params.setMargins(Interface.getY(20), Interface.getY(20), 0, 0); + content.addView(views.layout, params); + + views.button = new android.widget.ImageView(context); + views.button.setPadding(Interface.getY(15), Interface.getY(15), Interface.getY(15), Interface.getY(15)); + params = android.widget.LinearLayout.LayoutParams(Interface.getY(100), Interface.getY(100)); + views.layout.addView(views.button, params); +}; + +ControlButton.prototype.setBackground = function(src) { + this.views && this.views.layout && + this.views.layout.setBackgroundDrawable(ImageFactory.getDrawable(src)); +}; + +ControlButton.prototype.setIcon = function(src) { + this.views && this.views.button && + this.views.button.setImageDrawable(ImageFactory.getDrawable(src)); +}; + +ControlButton.prototype.setOnClickListener = function(listener) { + this.__click = function() { + tryout(listener); + }; +}; + +ControlButton.prototype.isCloseableOutside = function() { + return this.unclose; +}; + +ControlButton.prototype.setCloseableOutside = function(state) { + this.unclose = !!state; +};