Browse Source

Fix warnings, add german translation

feature_fragments
vanitasvitae 5 years ago
parent
commit
bd921bfc1b
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
  1. 19
      app/src/main/java/de/trac/spherical/MainActivity.java
  2. 51
      app/src/main/java/de/trac/spherical/rendering/Renderer.java
  3. 9
      app/src/main/res/values-de/strings.xml
  4. 13
      app/src/main/res/values/strings.xml

19
app/src/main/java/de/trac/spherical/MainActivity.java

@ -112,7 +112,7 @@ public class MainActivity extends AppCompatActivity {
//App was launched via launcher icon
//TODO: Remove later together with launcher intent filter
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) {
handleSentImageIntent(cachedIntent);
} 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) {
switch (item.getItemId()) {
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;
}
@ -191,7 +190,7 @@ public class MainActivity extends AppCompatActivity {
Uri imageUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
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;
}
@ -227,9 +226,11 @@ public class MainActivity extends AppCompatActivity {
}
} 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) {
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) {
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) {
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();
}
}

51
app/src/main/java/de/trac/spherical/rendering/Renderer.java

@ -10,8 +10,55 @@ import android.util.Log;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import static android.opengl.GLES20.*;
import static android.opengl.GLUtils.getEGLErrorString;
import static android.opengl.GLES20.GL_COLOR_BUFFER_BIT;
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 {

9
app/src/main/res/values-de/strings.xml

@ -1,2 +1,9 @@
<?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>

13
app/src/main/res/values/strings.xml

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

Loading…
Cancel
Save