diff options
author | Sapier <sapier AT gmx dot net> | 2015-12-18 20:05:13 +0100 |
---|---|---|
committer | Sapier <sapier AT gmx dot net> | 2015-12-23 21:01:35 +0100 |
commit | 9c9b02ca8ad2753ad9c2e10e5b40e23029739634 (patch) | |
tree | 1e6a70aeca747d790502f1c02bd27acd6a8e6cc4 /build/android/src | |
parent | 98d16e0d9a945f5f48462c05f26ae4bde2db5731 (diff) | |
download | minetest-9c9b02ca8ad2753ad9c2e10e5b40e23029739634.tar.gz minetest-9c9b02ca8ad2753ad9c2e10e5b40e23029739634.tar.bz2 minetest-9c9b02ca8ad2753ad9c2e10e5b40e23029739634.zip |
Android: shorten initial progress bar text way more simple
Diffstat (limited to 'build/android/src')
-rw-r--r-- | build/android/src/net/minetest/minetest/MinetestAssetCopy.java | 44 |
1 files changed, 2 insertions, 42 deletions
diff --git a/build/android/src/net/minetest/minetest/MinetestAssetCopy.java b/build/android/src/net/minetest/minetest/MinetestAssetCopy.java index 5776e77b5..eb92acb63 100644 --- a/build/android/src/net/minetest/minetest/MinetestAssetCopy.java +++ b/build/android/src/net/minetest/minetest/MinetestAssetCopy.java @@ -254,54 +254,14 @@ public class MinetestAssetCopy extends Activity boolean shortened = false; String todisplay = m_tocopy.get(progress[0]); m_ProgressBar.setProgress(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) { - 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); - } + m_Filename.setText(todisplay); } else { 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 + " ..."); - } + m_Filename.setText(full_text); } } |