Skip to content

Commit

Permalink
Returned спизженный ControlКнопка
Browse files Browse the repository at this point in the history
  • Loading branch information
MaXFeeD committed Jun 27, 2021
1 parent dcba50f commit a8c6b7b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
1 change: 1 addition & 0 deletions dev/.includes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions dev/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
66 changes: 66 additions & 0 deletions dev/visual/control.js
Original file line number Diff line number Diff line change
@@ -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;
};

0 comments on commit a8c6b7b

Please sign in to comment.