Sha256: ab9dc7fa9ceee60765ce6ee89b3efaabdf88e477d65bee02da3d62d31758b7dc

Contents?: true

Size: 449 Bytes

Versions: 29

Compression:

Stored size: 449 Bytes

Contents

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

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

  def toast_result(result, success, failure, duration=5000)
    toast(result ? success : failure, duration)
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
ruboto-1.0.3 assets/src/ruboto/util/toast.rb
ruboto-1.0.2 assets/src/ruboto/util/toast.rb
ruboto-1.0.1 assets/src/ruboto/util/toast.rb
ruboto-1.0.0 assets/src/ruboto/util/toast.rb
ruboto-0.16.0 assets/src/ruboto/util/toast.rb
ruboto-0.15.0 assets/src/ruboto/util/toast.rb
ruboto-0.14.0 assets/src/ruboto/util/toast.rb
ruboto-0.13.0 assets/src/ruboto/util/toast.rb
ruboto-0.12.0 assets/src/ruboto/util/toast.rb
ruboto-0.13.0.rc.0 assets/src/ruboto/util/toast.rb
ruboto-0.12.0.rc.0 assets/src/ruboto/util/toast.rb
ruboto-0.11.0 assets/src/ruboto/util/toast.rb
ruboto-0.11.0.rc.1 assets/src/ruboto/util/toast.rb
ruboto-0.11.0.rc.0 assets/src/ruboto/util/toast.rb
ruboto-0.10.2 assets/src/ruboto/util/toast.rb
ruboto-0.10.2.rc.0 assets/src/ruboto/util/toast.rb
ruboto-0.10.1 assets/src/ruboto/util/toast.rb
ruboto-0.10.0 assets/src/ruboto/util/toast.rb
ruboto-0.10.0.rc.1 assets/src/ruboto/util/toast.rb
ruboto-0.10.0.rc.0 assets/src/ruboto/util/toast.rb