Android Open Source - sdl_tester_android Sdl Tester Image Resource

From Project

Back to project page sdl_tester_android.


The source code is released under:

Copyright (c) 2014, Ford Motor Company All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are m...

If you think the Android project sdl_tester_android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.livio.sdltester;
//from w  w w  . j  a  v a 2s. com
import android.content.res.Resources;

import com.smartdevicelink.proxy.rpc.enums.FileType;

public enum SdlTesterImageResource {
  IC_APP_ICON("App Icon", FileType.GRAPHIC_PNG, R.drawable.ic_launcher),
  IC_ADD("Add Item", FileType.GRAPHIC_PNG, R.drawable.add),
  IC_ADD_TO_FAVORITES("Add to Favorites", FileType.GRAPHIC_PNG, R.drawable.add_to_favorites),
  IC_ANCHOR("Anchor", FileType.GRAPHIC_PNG, R.drawable.anchor),
  IC_GAME_PAD("Game Pad", FileType.GRAPHIC_PNG, R.drawable.game_pad),
  IC_REMOVE_FROM_FAVORITES("Remove from Favorites", FileType.GRAPHIC_PNG, R.drawable.remove_from_favorites),
  IC_REMOVE("Remove Item", FileType.GRAPHIC_PNG, R.drawable.remove),
  IC_ROCKET("Rocket", FileType.GRAPHIC_PNG, R.drawable.rocket),
  IC_UNDO("Undo", FileType.GRAPHIC_PNG, R.drawable.undo),
  IC_ZOOM_IN("Zoom In", FileType.GRAPHIC_PNG, R.drawable.zoom_in),
  IC_ZOOM_OUT("Zoom Out", FileType.GRAPHIC_PNG, R.drawable.zoom_out),
  private String friendlyName;
  private int imageId;
  private FileType fileType;
  private SdlTesterImageResource(String friendlyName, FileType type, int imageId){
    this.friendlyName = friendlyName;
    this.imageId = imageId;
    this.fileType = type;
  public String toString(){
    return friendlyName;
  public int getImageId(){
    return imageId;
  public FileType getFileType() {
    return fileType;

  public Bitmap getBitmap(Resources res){
    Bitmap result = BitmapFactory.decodeResource(res, imageId);
    return result;
  public static Bitmap getBitmap(Resources res, SdlTesterImageResource image){
    int resId = image.getImageId();
    Bitmap result = BitmapFactory.decodeResource(res, resId);
    return result;


Java Source Code List