if (mIsLandscape == true) {
if (!mButtonVisible) {
w1 = bw - bw/2;
bw /= 2;
}
if (bw > bh*2) bw = bh*2;
h1 = dh;
w2 = bw;
}
else {
// screen adjust for dual display
if (dh >= screen_h * 4 / 3) {
h1 = (dh - screen_h * 4 / 3) / 2;
bh = dh - screen_h - h1;
} else if (!mButtonVisible) {
h1 = bh - bh/2;
bh /= 2;
}
if (bh > bw*2) bh = bw*2;
w1 = dw;
h2 = bh;
}
if (getResources().getBoolean(R.bool.use_launcher)) {
gCurrentDirectoryPath = Environment.getExternalStorageDirectory() + "/ons";
// load config file
File configFile = new File(gCurrentDirectoryPath, "config.txt");
if (configFile.exists()) {
BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream(configFile)));
String line;
while ((line = reader.readLine()) != null) {
String[] cfgDat = line.split(":");
if ("launch_dir".equals(cfgDat[0]) && cfgDat[1] != null && cfgDat[1].length() > 0) {
File file = new File(cfgDat[1]);
if (file.exists()) gCurrentDirectoryPath = cfgDat[1];
}
}
} catch (FileNotFoundException e) {
showErrorDialog(e.getMessage());
} catch (IOException e) {
showErrorDialog(e.getMessage());
} finally {
if (reader != null) {
try {
reader.close();
} catch (IOException e) {
showErrorDialog(e.getMessage());
}
}
}
}
runLauncher();
}