2016-02-25 22:53:33 +01:00
|
|
|
package com.simplemobiletools.gallery;
|
|
|
|
|
2016-02-29 22:51:28 +01:00
|
|
|
import android.content.Context;
|
2016-06-09 00:13:30 +02:00
|
|
|
import android.content.res.Resources;
|
2016-02-29 22:51:28 +01:00
|
|
|
import android.widget.Toast;
|
|
|
|
|
2016-03-07 21:41:55 +01:00
|
|
|
public class Utils {
|
2016-02-25 22:53:33 +01:00
|
|
|
public static String getFilename(final String path) {
|
|
|
|
return path.substring(path.lastIndexOf("/") + 1);
|
|
|
|
}
|
2016-02-29 22:51:28 +01:00
|
|
|
|
|
|
|
public static void showToast(Context context, int resId) {
|
|
|
|
Toast.makeText(context, context.getResources().getString(resId), Toast.LENGTH_SHORT).show();
|
|
|
|
}
|
2016-06-09 00:13:30 +02:00
|
|
|
|
|
|
|
public static int getNavBarHeight(Resources res) {
|
|
|
|
int id = res.getIdentifier("navigation_bar_height", "dimen", "android");
|
|
|
|
if (id > 0) {
|
|
|
|
return res.getDimensionPixelSize(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2016-02-25 22:53:33 +01:00
|
|
|
}
|