misc: added some documentation for functions

This commit is contained in:
rafal1137 2020-05-17 19:19:56 +02:00
parent 0648e500be
commit cf37c16557
2 changed files with 27 additions and 0 deletions

View File

@ -30,10 +30,17 @@ public class ETLActivity extends SDLActivity implements JoyStickListener {
static volatile boolean UiMenu = false;
ImageButton btn;
/**
* Get an uiMenu boolean variable
* @return UiMenu
*/
public static boolean getUiMenu() {
return UiMenu;
}
/**
* RunUI Function
*/
public void runUI() {
// Use runThread() instead ?
@ -256,10 +263,20 @@ public class ETLActivity extends SDLActivity implements JoyStickListener {
});
}
/**
* Convert pixel metrics to dp
* @param px value of px to be converted
* @return dp
*/
public static int pxToDp(int px) {
return (int) (px / Resources.getSystem().getDisplayMetrics().density);
}
/**
* Get an image stored from Asset Dir of an App
* @param strName name of the image to get
* @return "resized" image
*/
private Bitmap getBitmapFromAsset(String strName) {
AssetManager assetManager = getAssets();
InputStream istr = null;

View File

@ -26,6 +26,11 @@ import cz.msebera.android.httpclient.Header;
public class ETLMain extends Activity {
/**
* Get an splash screen image from Asset Dir of an App
* @param strName name of the splash screen image
* @return image
*/
private Drawable getSplashScreenFromAsset(String strName) {
AssetManager assetManager = getAssets();
InputStream istr = null;
@ -41,6 +46,11 @@ public class ETLMain extends Activity {
return etl_drawable;
}
/**
* Convert pixel metrics to dp
* @param px value of px to be converted
* @return dp
*/
public static int pxToDp(int px) {
return (int) (px / Resources.getSystem().getDisplayMetrics().density);
}