Displays toast. Toast will be displayed for given amount of seconds.
493411
public void show (final Toast toast, float timeSec) {
		Table toastMainTable = toast.getMainTable();
		if (toastMainTable.getStage() != null) {
			remove(toast);
		}
		toasts.add(toast);

		toast.setToastManager(this);
		toast.fadeIn();
		toastMainTable.pack();
		root.addActor(toastMainTable);

		updateToastsPositions();

		if (timeSec > 0) {
			Timer.Task fadeOutTask = new Timer.Task() {
				@Override
				public void run () {
					toast.fadeOut();
					timersTasks.remove(toast);
				}
			};
			timersTasks.put(toast, fadeOutTask);
			Timer.schedule(fadeOutTask, timeSec);
		}
	}
50162
@OnClick(R.id.iv_fan_art) void onFanArtClicked() {
    Toast.makeText(this, tvShowSelected.getTitle(), Toast.LENGTH_LONG).show();
  }
839245
function (message, title, color) {
    /**
     * Container element for all of the messages created from init().
     */
    var tc = document.querySelector(".toast-container");
    if (!tc) {
        /**
         * If there's no container created from the init() function, throw an error.
         */
        throw new Error("toast-container is null.");
    }
    else {
        /**
         * Amount of time before each element is removed.
         */
        var timer_1 = 7;
        /**
         * Declare if the user's mouse is hovering over the message.
         */
        var isHovered_1 = false;
        /**
         * Create elements.
         */
        var toastEl_1 = document.createElement("div");
        var titleEl = document.createElement("h4");
        var messageEl = document.createElement("div");
        var loaderEl = document.createElement("div");
        var leftLoaderEl = document.createElement("div");
        var rightLoaderEl = document.createElement("div");
        var spinnerLoaderEl = document.createElement("div");
        /**
         * Fill contents.
         */
        titleEl.innerText = title;
        messageEl.innerText = message;
        /**
         * Add classes.
         */
        toastEl_1.classList.add("toast");
        toastEl_1.classList.add(color);
        titleEl.classList.add("toast-title");
        messageEl.classList.add("toast-message");
        loaderEl.classList.add("toast-loader");
        leftLoaderEl.classList.add("toast-loader-left");
        leftLoaderEl.classList.add(color);
        rightLoaderEl.classList.add("toast-loader-right");
        spinnerLoaderEl.classList.add("toast-loader-spinner");
        /**
         * Click (makes the message go away entirely).
         */
        toastEl_1.addEventListener("click", function (e) {
            e.currentTarget.classList.add("poof");
            setTimeout(function () {
                if (!tc) {
                    throw (Error("toast-container is null."));
                }
                else {
                    tc.removeChild(toastEl_1);
                    var index = messageQueue.indexOf(message);
                    messageQueue.splice(index, 1);
                }
            }, 200);
        });
        /**
         * MouseEnter (pauses the timer).
         */
        toastEl_1.addEventListener("mouseenter", function (e) {
            var children = e.currentTarget.children[2].children;
            for (var i = 0; i < children.length; i++) {
                children[i].style.animationPlayState = "paused";
            }
            isHovered_1 = true;
        });
        /**
         * MouseLeave (resumes the timer).
         */
        toastEl_1.addEventListener("mouseleave", function (e) {
            var children = e.currentTarget.children[2].children;
            for (var i = 0; i < children.length; i++) {
                children[i].style.animationPlayState = "running";
            }
            isHovered_1 = false;
        });
        /**
         * Append children.
         */
        loaderEl.appendChild(leftLoaderEl);
        loaderEl.appendChild(rightLoaderEl);
        loaderEl.appendChild(spinnerLoaderEl);
        toastEl_1.appendChild(titleEl);
        toastEl_1.appendChild(messageEl);
        toastEl_1.appendChild(loaderEl);
        tc.appendChild(toastEl_1);
        /**
         * Start timer.
         */
        var interval_1 = setInterval(function () {
            if (timer_1 <= 7) {
                toastEl_1.classList.add("active");
            }
            if (!isHovered_1 && timer_1 <= .800) {
                toastEl_1.classList.add("poof");
            }
            if (!isHovered_1) {
                timer_1 -= 0.100;
                if (timer_1 <= 0) {
                    clearInterval(interval_1);
                    if (toastEl_1 && toastEl_1.parentNode === tc) {
                        if (!tc) {
                            throw (Error("toast-container is null."));
                        }
                        else {
                            tc.removeChild(toastEl_1);
                            var index = messageQueue.indexOf(message);
                            messageQueue.splice(index, 1);
                        }
                    }
                }
            }
        }, 100);
    }
}
541768
def setShowMinutes(self, state=True):
        
        self._showMinutes = state
        if state:
            self._minuteCombo.show()
        else:
            self._minuteCombo.hide()
1344951
function Toast(beyond) {
        "use strict";
    
        var events = new Events({'bind': this});
    
        var MESSAGE_TYPE = Object.freeze({
            'GENERAL_MESSAGE': 1,
            'GENERAL_ERROR': 2,
            'CONNECTION_ERROR': 3,
            'WARNING': 4
        });
        Object.defineProperty(this, 'MESSAGE_TYPE', {
            'get': function () {
                return MESSAGE_TYPE;
            }
        });
    
        const DURATION_DEFAULT = 3000;
        var messages = new Messages();
    
        var autoincrement = 0;
    
        beyond.showMessage = function (specs, duration) {
    
            // Check parameters
            if (typeof specs === 'string') {
                specs = {
                    'text': specs,
                    'duration': duration
                }
            }
            if (typeof specs !== 'object') {
                throw new Error('Invalid parameters');
            }
            if (!specs.type) {
                specs.type = MESSAGE_TYPE.GENERAL_MESSAGE;
            }
            if (specs.retry && typeof specs.retry !== 'function') {
                throw new Error('Invalid parameters, retry must be a function');
            }
    
            var id = specs.id;
            if (!id) {
                autoincrement++;
                id = 'message-' + autoincrement;
            }
    
            if (specs.type === MESSAGE_TYPE.CONNECTION_ERROR) {
    
                if (!specs.retry) {
                    throw new Error('Invalid parameters, retry was expected');
                }
    
                messages.set({
                    'id': id,
                    'type': MESSAGE_TYPE.CONNECTION_ERROR,
                    'retry': specs.retry,
                    'duration': 0 // Infinity
                });
    
            }
            else if (specs.type === MESSAGE_TYPE.GENERAL_ERROR) {
    
                if (!specs.text) {
                    throw new Error('Invalid parameters, text was expected');
                }
    
                if (specs.retry) {
                    duration = 0; // Infinity
                }
                else if (typeof specs.duration === 'number') {
                    duration = specs.duration;
                }
                else {
                    duration = DURATION_DEFAULT;
                }
    
                messages.set({
                    'id': id,
                    'type': MESSAGE_TYPE.GENERAL_ERROR,
                    'text': specs.text,
                    'retry': specs.retry,
                    'duration': duration
                });
    
            }
            else if (specs.type === MESSAGE_TYPE.GENERAL_MESSAGE) {
    
                if (!specs.text) {
                    throw new Error('Invalid parameters, text was expected');
                }
    
                messages.set({
                    'id': id,
                    'type': MESSAGE_TYPE.GENERAL_MESSAGE,
                    'text': specs.text,
                    'close': !!specs.close,
                    'duration': (typeof specs.duration === 'number') ? specs.duration : DURATION_DEFAULT
                });
    
            }
            else if (specs.type === MESSAGE_TYPE.WARNING) {
    
                if (!specs.text) {
                    throw new Error('Invalid parameters, message was expected');
                }
    
                messages.set({
                    'id': id,
                    'type': MESSAGE_TYPE.WARNING,
                    'text': specs.text,
                    'close': !!specs.close,
                    'duration': (typeof specs.duration === 'number') ? specs.duration : DURATION_DEFAULT
                });
    
            }
            else {
                throw new Error('Invalid parameters, message type is invalid')
            }
    
            events.trigger('change');
            return id;
    
        };
    
        beyond.showConnectionError = function (callback) {
            return beyond.showMessage({
                'type': MESSAGE_TYPE.CONNECTION_ERROR,
                'retry': callback
            });
        };
        beyond.showWarning = function (text, duration) {
            return beyond.showMessage({
                'type': MESSAGE_TYPE.WARNING,
                'text': text,
                'duration': duration
            });
        };
    
        this.removeMessage = function (id) {
            messages.delete(id);
            events.trigger('change');
        };
    
        beyond.removeMessage = this.removeMessage;
    
        this.retry = function () {
    
            var message = this.message;
            if (!message) {
                console.error('Retry method was called, but there is no active message');
                return;
            }
    
            if (message.type === MESSAGE_TYPE.CONNECTION_ERROR) {
    
                var remove = [];
                for (var index in messages.keys) {
    
                    var id = messages.keys[index];
    
                    message = messages.get(id);
                    if (message.type === MESSAGE_TYPE.CONNECTION_ERROR) {
                        message.retry();
                        remove.push(id);
                    }
    
                }
    
                for (var index in remove) {
                    var id = remove[index];
                    messages.delete(id);
                }
    
            }
            else {
    
                if (typeof message.retry !== 'function') {
                    console.error('Message retry function not set');
                }
                else {
                    message.retry();
                }
    
                messages.delete(message);
    
            }
    
            setTimeout(function () {
                events.trigger('change');
            }, 500)
    
    
        };
    
        this.close = function () {
    
            var message = this.message;
            if (!message) {
                return;
            }
    
            if (message.type === MESSAGE_TYPE.CONNECTION_ERROR) {
                console.error('Connection error message type cannot be closed', message);
                return;
            }
    
            messages.delete(message);
            events.trigger('change');
    
        };
    
        Object.defineProperty(this, 'message', {
            'get': function () {
    
                if (messages.typeExists(MESSAGE_TYPE.CONNECTION_ERROR)) {
                    return {
                        'type': MESSAGE_TYPE.CONNECTION_ERROR
                    }
                }
    
                return messages.first;
            }
        });
    
    }
787056
def on_make_toast(self, ref):
        
        d = self.declaration
        self.toast = Toast(__id__=ref)
        self.init_widget()
190409
@Override
    public void onSelectionChanged(FloatingLabelItemChooser<Product> source, Product selectedItem) {
        Toast.makeText(getActivity(), source.getItemPrinter().print(selectedItem), Toast.LENGTH_SHORT).show();
    }
918607
public void show() {
        if (mListener == null) {
            throw new NullPointerException(
                    "Attempting to bind null listener to SlideDateTimePicker");
        }

        if (mInitialDate == null) {
            setInitialDate(new Date());
        }

        DateTimeDialogFragment dialogFragment =
                DateTimeDialogFragment.newInstance(
                        mListener,
                        mInitialDate,
                        mMinDate,
                        mMaxDate,
                        mIsClientSpecified24HourTime,
                        mIs24HourTime,
                        mTheme,
                        mIndicatorColor);

        dialogFragment.show(mFragmentManager,
                DateTimeDialogFragment.TAG_SLIDE_DATE_TIME_DIALOG_FRAGMENT);
    }
1043813
public void wait(double seconds) {
        String action = "Wait " + seconds + SECONDS;
        String expected = WAITED + seconds + SECONDS;
        try {
            Thread.sleep((long) (seconds * 1000));
        } catch (InterruptedException e) {
            log.warn(e);
            reporter.fail(action, expected, "Failed to wait " + seconds + SECONDS + ". " + e.getMessage());
            Thread.currentThread().interrupt();
            return;
        }
        reporter.pass(action, expected, WAITED + seconds + SECONDS);
    }
36970
public void longToast(final int strId) {
        if (act == null)
            return;

        act.runOnUiThread(new Runnable() {

            public void run() {
                Toast.makeText(act, strId, Toast.LENGTH_LONG).show();
            }
        });
    }
1331689
def seconds(self):
        
        seconds = self.elapsed().seconds
        if self.limit() and self.countdown():
            seconds = (self.limit() - self.elapsed().seconds)
        return (seconds % 3600) % 60
639222
function() {
          // Display the duration.
          duration.innerHTML = self.formatTime(Math.round(sound.duration()));

          // Start upating the progress of the track.
          requestAnimationFrame(self.step.bind(self));

          // Start the wave animation if we have already loaded
          wave.container.style.display = 'block';
          bar.style.display = 'none';
          pauseBtn.style.display = 'block';
        }
816571
public static void setResultDisplayDurationInMs(Intent intent, long duration) {
    intent.putExtra(Intents.Scan.RESULT_DISPLAY_DURATION_MS, duration);
  }
468431
function(toastElement) {
      // Hiding the element
      // toastElement.classList.remove("on");
      toastElement.className = toastElement.className.replace(" on", "");

      // Removing the element from DOM after transition end
      window.setTimeout(
        function() {
          // Remove the elemenf from the DOM
          toastElement.parentNode.removeChild(toastElement);

          // Calling the callback function
          this.options.callback.call(toastElement);

          // Repositioning the toasts again
          Toastify.reposition();
        }.bind(this),
        400
      ); // Binding `this` for function invocation
    }
1046168
protected final void doWait(double seconds)
    {
        try
        {
            long ms = (long)(seconds * 1000l);
            synchronized (this)
            {
                wait(ms);
            }
        }
        catch (InterruptedException ie)
        {
            log.debug("BackgroundProcess thread interuptted.");
        }
    }
953313
private void displayCrouton() {
    if (croutonQueue.isEmpty()) {
      return;
    }

    // First peek whether the Crouton has an activity.
    final Crouton currentCrouton = croutonQueue.peek();

    // If the activity is null we poll the Crouton off the queue.
    if (null == currentCrouton.getActivity()) {
      croutonQueue.poll();
    }

    if (!currentCrouton.isShowing()) {
      // Display the Crouton
      sendMessage(currentCrouton, Messages.ADD_CROUTON_TO_VIEW);
      if (null != currentCrouton.getLifecycleCallback()) {
        currentCrouton.getLifecycleCallback().onDisplayed();
      }
    } else {
      sendMessageDelayed(currentCrouton, Messages.DISPLAY_CROUTON, calculateCroutonDuration(currentCrouton));
    }
  }
1192254
def is_displayed(self):
        
        t = self.wait_timeout
        self.wait_timeout = 0
        try:
            self.reload()
            return any(e.is_displayed() for e in self)
        finally:
            self.wait_timeout = t