Class ImageViewController


  • public class ImageViewController
    extends java.lang.Object
    The ImageViewController class provides a utility method to set an ImageView's image based on the first character of a given name. If the first character is a letter between A and Z, the corresponding image in the drawables folder will be used. If the first character is a non-alphanumeric character or a number, a random image will be chosen from the drawables folder.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void setImage​(java.lang.String name, android.widget.ImageView imageView)
      Sets the image of an ImageView based on the first character of the given name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ImageViewController

        public ImageViewController()
    • Method Detail

      • setImage

        public static void setImage​(java.lang.String name,
                                    android.widget.ImageView imageView)
        Sets the image of an ImageView based on the first character of the given name.
        Parameters:
        name - The name to base the image on.
        imageView - The ImageView to set the image on.