Sha256: ecdd7098c2b7db153e7dacdbc47e9250d6a0f9f380341f73ccdafabd01f823b1

Contents?: true

Size: 509 Bytes

Versions: 1

Compression:

Stored size: 509 Bytes

Contents

#######################################################
#
# ruboto/util/toast.rb
#
# Utility methods for doing a toast.
#
#######################################################

Java::android.content.Context.class_eval do
  def toast(text, duration=android.widget.Toast::LENGTH_SHORT)
    Java::android.widget.Toast.makeText(self, text, duration).show
  end

  def toast_result(result, success, failure, duration=android.widget.Toast::LENGTH_SHORT)
    toast(result ? success : failure, duration)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruboto-1.1.0 assets/src/ruboto/util/toast.rb