aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2015-01-06 16:01:49 +0100
committersapier <Sapier at GMX dot net>2015-01-06 16:13:39 +0100
commit083d19b3fc8f60468e124c801296c13b66c41abc (patch)
treec1e2a9fd7e54dad102da6a8aada8d3b1a476fbbd /build
parentef0a4e361440430e9512c7adc278c36956275a5c (diff)
downloadminetest-083d19b3fc8f60468e124c801296c13b66c41abc.tar.gz
minetest-083d19b3fc8f60468e124c801296c13b66c41abc.tar.bz2
minetest-083d19b3fc8f60468e124c801296c13b66c41abc.zip
Fixes for android
Copy only minetest_game to apk by default Don't copy .git and .svn folders to apk Fix bouncing asset copy scrollbar due to long filepaths Reenable font scaling to fix broken menu on high dpi screens Implement minetest loglevel to android loglevel mapping Disable touch digging while moving around
Diffstat (limited to 'build')
-rw-r--r--build/android/Makefile14
-rw-r--r--build/android/src/org/minetest/minetest/MinetestAssetCopy.java56
2 files changed, 66 insertions, 4 deletions
diff --git a/build/android/Makefile b/build/android/Makefile
index a8a0a6016..d770462e1 100644
--- a/build/android/Makefile
+++ b/build/android/Makefile
@@ -20,6 +20,8 @@ PATHCFGFILE = path.cfg
ROOT = $(shell pwd)
+GAMES_TO_COPY = minetest_game
+
################################################################################
# Android Version code
# Increase for each build!
@@ -631,15 +633,23 @@ assets : $(ASSETS_TIMESTAMP)
cp -r ${ROOT}/../../client ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../doc ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../fonts ${ROOT}/assets/Minetest; \
- cp -r ${ROOT}/../../games ${ROOT}/assets/Minetest; \
+ mkdir ${ROOT}/assets/Minetest/games; \
+ for game in ${GAMES_TO_COPY}; \
+ do \
+ cp -r ${ROOT}/../../games/$$game ${ROOT}/assets/Minetest/games/; \
+ done; \
cp -r ${ROOT}/../../mods ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../po ${ROOT}/assets/Minetest; \
cp -r ${ROOT}/../../textures ${ROOT}/assets/Minetest; \
mkdir -p ${ROOT}/assets/Minetest/media; \
cp -r ${IRRLICHT_DIR}/media/Shaders ${ROOT}/assets/Minetest/media; \
- cd ${ROOT}/assets; \
+ cd ${ROOT}/assets || exit 1; \
find . -name "timestamp" -exec rm {} \; ; \
find . -name "*.blend" -exec rm {} \; ; \
+ find . -name "*~" -exec rm {} \; ; \
+ find . -type d -path "*.git" -exec rm -rf {} \; ; \
+ find . -type d -path "*.svn" -exec rm -rf {} \; ; \
+ find . -type f -path "*.gitignore" -exec rm -rf {} \; ; \
ls -R | grep ":$$" | sed -e 's/:$$//' -e 's/\.//' -e 's/^\///' > "index.txt"; \
find Minetest >"filelist.txt"; \
cp ${ROOT}/${ASSETS_TIMESTAMP} ${ROOT}/${ASSETS_TIMESTAMP}.old; \
diff --git a/build/android/src/org/minetest/minetest/MinetestAssetCopy.java b/build/android/src/org/minetest/minetest/MinetestAssetCopy.java
index f6b2e8013..62f61ad62 100644
--- a/build/android/src/org/minetest/minetest/MinetestAssetCopy.java
+++ b/build/android/src/org/minetest/minetest/MinetestAssetCopy.java
@@ -9,6 +9,7 @@ import java.io.InputStreamReader;
import java.io.OutputStream;
import java.util.Vector;
import java.util.Iterator;
+import java.lang.Object;
import android.app.Activity;
import android.content.res.AssetFileDescriptor;
@@ -20,6 +21,9 @@ import android.util.Log;
import android.view.Display;
import android.widget.ProgressBar;
import android.widget.TextView;
+import android.graphics.Rect;
+import android.graphics.Paint;
+import android.text.TextPaint;
public class MinetestAssetCopy extends Activity
{
@@ -244,14 +248,62 @@ public class MinetestAssetCopy extends Activity
*/
protected void onProgressUpdate(Integer... progress)
{
+
if (m_copy_started)
{
+ boolean shortened = false;
+ String todisplay = m_tocopy.get(progress[0]);
m_ProgressBar.setProgress(progress[0]);
- m_Filename.setText(m_tocopy.get(progress[0]));
+
+ // make sure our text doesn't exceed our layout width
+ Rect bounds = new Rect();
+ Paint textPaint = m_Filename.getPaint();
+ textPaint.getTextBounds(todisplay, 0, todisplay.length(), bounds);
+
+ while (bounds.width() > getResources().getDisplayMetrics().widthPixels * 0.7) {
+ Log.e("MinetestAssetCopy", todisplay + ": " +
+ bounds.width() + " > " + (getResources().getDisplayMetrics().widthPixels * 0.7));
+ if (todisplay.length() < 2) {
+ break;
+ }
+ todisplay = todisplay.substring(1);
+ textPaint.getTextBounds(todisplay, 0, todisplay.length(), bounds);
+ shortened = true;
+ }
+
+ if (! shortened) {
+ m_Filename.setText(todisplay);
+ }
+ else {
+ m_Filename.setText(".." + todisplay);
+ }
}
else
{
- m_Filename.setText("scanning " + m_Foldername + " ...");
+ boolean shortened = false;
+ String todisplay = m_Foldername;
+ String full_text = "scanning " + todisplay + " ...";
+ // make sure our text doesn't exceed our layout width
+ Rect bounds = new Rect();
+ Paint textPaint = m_Filename.getPaint();
+ textPaint.getTextBounds(full_text, 0, full_text.length(), bounds);
+
+ while (bounds.width() > getResources().getDisplayMetrics().widthPixels * 0.7) {
+ if (todisplay.length() < 2) {
+ break;
+ }
+ todisplay = todisplay.substring(1);
+ full_text = "scanning " + todisplay + " ...";
+ textPaint.getTextBounds(full_text, 0, full_text.length(), bounds);
+ shortened = true;
+ }
+
+ if (! shortened) {
+ m_Filename.setText(full_text);
+ }
+ else {
+ m_Filename.setText("scanning .." + todisplay + " ...");
+ }
}
}