package fr.ayoubdev.rnak.utils;

import android.view.View;

/**
 * Created by Adib on 24/01/2016.
 */
public class RNAKDrawable {
	public static <T extends View> int getDrawableID(T view, String filename) {
		String imageName = getFilenameWithoutExtension(filename);
		imageName.replace('-', '_');

		return view.getResources().getIdentifier(imageName, "drawable", view.getContext().getPackageName());
	}

	private static String getFilenameWithoutExtension(String filename) {
		int extensionIndex = filename.lastIndexOf('.');

		if(extensionIndex != -1)
			return filename.substring(0, extensionIndex);
		return filename;
	}
}

@@ -57,49 +57,8 @@
 w;%0A%0A
-/**%0A * Created by Adib on 24/01/2016.%0A */
 %0Apub

Remove comment