Fix warnings, add german translation

This commit is contained in:
vanitasvitae 2017-09-15 01:30:36 +02:00
parent a0d7071861
commit bd921bfc1b
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
4 changed files with 73 additions and 19 deletions

View File

@ -112,7 +112,7 @@ public class MainActivity extends AppCompatActivity {
//App was launched via launcher icon //App was launched via launcher icon
//TODO: Remove later together with launcher intent filter //TODO: Remove later together with launcher intent filter
default: default:
Toast.makeText(this, R.string.prompt_share_image, Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.toast_prompt_share_image, Toast.LENGTH_LONG).show();
} }
} }
@ -139,9 +139,8 @@ public class MainActivity extends AppCompatActivity {
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
handleSentImageIntent(cachedIntent); handleSentImageIntent(cachedIntent);
} else { } else {
Toast.makeText(this, R.string.missing_permission, Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.toast_missing_permission, Toast.LENGTH_LONG).show();
} }
return;
} }
} }
} }
@ -173,7 +172,7 @@ public class MainActivity extends AppCompatActivity {
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.menu_force_sphere: case R.id.menu_force_sphere:
Toast.makeText(this, R.string.not_yet_implemented, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.toast_not_yet_implemented, Toast.LENGTH_SHORT).show();
return true; return true;
} }
@ -191,7 +190,7 @@ public class MainActivity extends AppCompatActivity {
Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM); Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
if (imageUri == null) { if (imageUri == null) {
Toast.makeText(this, R.string.file_not_found, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.toast_file_not_found, Toast.LENGTH_SHORT).show();
return; return;
} }
@ -227,9 +226,11 @@ public class MainActivity extends AppCompatActivity {
} }
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); Log.e(TAG, "File not found.", e);
Toast.makeText(this, R.string.toast_file_not_found, Toast.LENGTH_SHORT).show();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); Log.e(TAG, "IOException: ", e);
Toast.makeText(this, R.string.toast_io_error, Toast.LENGTH_SHORT).show();
} }
} }
@ -252,10 +253,10 @@ public class MainActivity extends AppCompatActivity {
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
Log.e(TAG, "File not found.", e); Log.e(TAG, "File not found.", e);
Toast.makeText(this, R.string.file_not_found, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.toast_file_not_found, Toast.LENGTH_SHORT).show();
} catch (IOException e) { } catch (IOException e) {
Log.e(TAG, "IOException: ", e); Log.e(TAG, "IOException: ", e);
Toast.makeText(this, R.string.ioerror, Toast.LENGTH_SHORT).show(); Toast.makeText(this, R.string.toast_io_error, Toast.LENGTH_SHORT).show();
} }
} }

View File

@ -10,8 +10,55 @@ import android.util.Log;
import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.opengles.GL10;
import static android.opengl.GLES20.*; import static android.opengl.GLES20.GL_COLOR_BUFFER_BIT;
import static android.opengl.GLUtils.getEGLErrorString; import static android.opengl.GLES20.GL_COMPILE_STATUS;
import static android.opengl.GLES20.GL_CULL_FACE;
import static android.opengl.GLES20.GL_CW;
import static android.opengl.GLES20.GL_DEPTH_BUFFER_BIT;
import static android.opengl.GLES20.GL_DEPTH_TEST;
import static android.opengl.GLES20.GL_FLOAT;
import static android.opengl.GLES20.GL_FRAGMENT_SHADER;
import static android.opengl.GLES20.GL_LINEAR;
import static android.opengl.GLES20.GL_LINK_STATUS;
import static android.opengl.GLES20.GL_NEAREST;
import static android.opengl.GLES20.GL_TEXTURE0;
import static android.opengl.GLES20.GL_TEXTURE_2D;
import static android.opengl.GLES20.GL_TEXTURE_MAG_FILTER;
import static android.opengl.GLES20.GL_TEXTURE_MIN_FILTER;
import static android.opengl.GLES20.GL_TRIANGLES;
import static android.opengl.GLES20.GL_TRUE;
import static android.opengl.GLES20.GL_UNSIGNED_SHORT;
import static android.opengl.GLES20.GL_VERTEX_SHADER;
import static android.opengl.GLES20.glActiveTexture;
import static android.opengl.GLES20.glAttachShader;
import static android.opengl.GLES20.glBindTexture;
import static android.opengl.GLES20.glClear;
import static android.opengl.GLES20.glClearColor;
import static android.opengl.GLES20.glCompileShader;
import static android.opengl.GLES20.glCreateProgram;
import static android.opengl.GLES20.glCreateShader;
import static android.opengl.GLES20.glDeleteProgram;
import static android.opengl.GLES20.glDeleteShader;
import static android.opengl.GLES20.glDisableVertexAttribArray;
import static android.opengl.GLES20.glDrawElements;
import static android.opengl.GLES20.glEnable;
import static android.opengl.GLES20.glEnableVertexAttribArray;
import static android.opengl.GLES20.glFrontFace;
import static android.opengl.GLES20.glGenTextures;
import static android.opengl.GLES20.glGetAttribLocation;
import static android.opengl.GLES20.glGetProgramInfoLog;
import static android.opengl.GLES20.glGetProgramiv;
import static android.opengl.GLES20.glGetShaderInfoLog;
import static android.opengl.GLES20.glGetShaderiv;
import static android.opengl.GLES20.glGetUniformLocation;
import static android.opengl.GLES20.glLinkProgram;
import static android.opengl.GLES20.glShaderSource;
import static android.opengl.GLES20.glTexParameteri;
import static android.opengl.GLES20.glUniform1i;
import static android.opengl.GLES20.glUniformMatrix4fv;
import static android.opengl.GLES20.glUseProgram;
import static android.opengl.GLES20.glVertexAttribPointer;
import static android.opengl.GLES20.glViewport;
public class Renderer implements GLSurfaceView.Renderer { public class Renderer implements GLSurfaceView.Renderer {

View File

@ -1,2 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources></resources> <resources>
<string name="menu_force_sphere">Erzwinge Kugelansicht</string>
<string name="toast_file_not_found">Datei nicht gefunden.</string>
<string name="toast_io_error">Ein Fehler ist aufgetreten: IO-Error.</string>
<string name="toast_missing_permission">Foto kann nicht angezeigt werden: Fehlende Berechtigung für externen Speicher.</string>
<string name="toast_not_yet_implemented">Noch nicht implementiert!</string>
<string name="toast_prompt_share_image">Teile ein Bild mit der App!</string>
</resources>

View File

@ -1,10 +1,9 @@
<resources> <resources>
<string name="app_name">Spherical</string> <string name="app_name" translatable="false">Spherical</string>
<string name="prompt_share_image">Share an image with the app!</string> <string name="toast_prompt_share_image">Share an image with the app!</string>
<string name="file_not_found">File not found.</string> <string name="toast_file_not_found">File not found.</string>
<string name="ioerror">An Error has occurred: IOError.</string> <string name="toast_io_error">An Error has occurred: IO-Error.</string>
<string name="wow">WOW! SUCH 3D!!!</string>
<string name="menu_force_sphere">Show as Sphere</string> <string name="menu_force_sphere">Show as Sphere</string>
<string name="not_yet_implemented">Not yet implemented!</string> <string name="toast_not_yet_implemented">Not yet implemented!</string>
<string name="missing_permission">Cannot display photo: Missing permissions to access external storage.</string> <string name="toast_missing_permission">Cannot display photo: Missing permissions to access external storage.</string>
</resources> </resources>