Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .github/images/screen_editor.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/images/screen_logger.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/images/screen_preview.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ plugins {
}

android {
namespace = "com.flykespice.povray"
namespace = "com.flykespice.droidray"
compileSdk = 36

defaultConfig {
applicationId = "com.flykespice.povray"
applicationId = "com.flykespice.droidray"
minSdk = 21
targetSdk = 35
versionCode = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray
package com.flykespice.droidray

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.POVRay"
android:theme="@style/Theme.DroidRay"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.POVRay">
android:theme="@style/Theme.DroidRay">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/cpp/povray/vfe/android/jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

using namespace vfe;

#define JNI_POVRAY_METHOD(func) Java_com_flykespice_povray_POVRay_##func
#define JNI_POVRAY_METHOD(func) Java_com_flykespice_droidray_POVRay_##func

//#define DELETE_FILE unlink

Expand Down Expand Up @@ -122,7 +122,7 @@ extern "C" JNIEXPORT jint JNICALL JNI_POVRAY_METHOD(renderScene) (JNIEnv* env, j
if (imageBuffer == nullptr)
{
// Step 1: Find the Java class containing the static ByteBuffer
jclass myClass = env->FindClass("com/flykespice/povray/POVRay");
jclass myClass = env->FindClass("com/flykespice/droidray/POVRay");
if (myClass == nullptr)
{
throwRuntimeException(env, "POVRay class not found");
Expand Down Expand Up @@ -211,7 +211,7 @@ extern "C" JNIEXPORT jstring JNICALL JNI_POVRAY_METHOD(getErrorString) (JNIEnv*

extern "C" JNIEXPORT jobjectArray JNICALL JNI_POVRAY_METHOD(getMessages) (JNIEnv* env, jobject thisObject)
{
jclass msgClass = env->FindClass("com/flykespice/povray/POVRay$Message");
jclass msgClass = env->FindClass("com/flykespice/droidray/POVRay$Message");
if (!msgClass)
throwRuntimeException(env, "POVRay.Message class couldn't be found");

Expand Down
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray
package com.flykespice.droidray

/**
* This stores the application state for the duration of the process in a simple way
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray
package com.flykespice.droidray

import android.graphics.Bitmap
import android.net.Uri
Expand All @@ -8,8 +8,8 @@ import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.material3.Surface
import com.flykespice.povray.ui.POVRayApp
import com.flykespice.povray.ui.theme.POVRayTheme
import com.flykespice.droidray.ui.POVRayApp
import com.flykespice.droidray.ui.theme.DroidRayTheme
import java.io.File
import java.io.FileNotFoundException
import java.io.FileOutputStream
Expand Down Expand Up @@ -58,9 +58,9 @@ class MainActivity : ComponentActivity() {
includeDir.mkdirs()
copyAssetsToInternalStorage(includeDir)
}/* else {
Log.d("POVRay", "directory include contents =")
Log.d("DroidRay", "directory include contents =")
for (file in includeDir.list().toList()) {
Log.d("POVRay", "$file")
Log.d("DroidRay", "$file")
}
}*/

Expand All @@ -78,11 +78,11 @@ class MainActivity : ComponentActivity() {

enableEdgeToEdge()
setContent {
POVRayTheme {
DroidRayTheme {
Surface {
POVRayApp(
onSaveBitmap = { bitmap = it; launcherBitmapExporter.launch("render.png") },
onClickOpen = { launcherOpener.launch(arrayOf("application/octet-stream")) },
onClickOpen = { launcherOpener.launch(arrayOf("text/*", "application/*")) },
onClickSave = { launcherSaver.launch(AppState.lastOpenedName ?: "scene.pov")}
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.flykespice.povray;
package com.flykespice.droidray;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

public class POVRay {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray.ui
package com.flykespice.droidray.ui

import android.content.Context
import android.graphics.Bitmap
Expand Down Expand Up @@ -45,11 +45,11 @@ import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.tooling.preview.Preview
import androidx.core.graphics.createBitmap
import com.flykespice.povray.AppState
import com.flykespice.povray.POVRay
import com.flykespice.povray.R
import com.flykespice.povray.ui.dialog.RenderOptionsDialog
import com.flykespice.povray.ui.theme.POVRayTheme
import com.flykespice.droidray.AppState
import com.flykespice.droidray.POVRay
import com.flykespice.droidray.R
import com.flykespice.droidray.ui.dialog.RenderOptionsDialog
import com.flykespice.droidray.ui.theme.DroidRayTheme
import kotlinx.coroutines.delay
import java.nio.ByteOrder

Expand Down Expand Up @@ -316,7 +316,7 @@ private fun AppTopBar(
)
}
},
title = { Text("POVRay v3.7") }
title = { Text("DroidRay") }
)
}

Expand Down Expand Up @@ -366,7 +366,7 @@ private fun AppFloatingActionButton(rendering: Boolean, onClicked: () -> Unit) {
@Preview
@Composable
private fun PreviewApp() {
POVRayTheme {
DroidRayTheme {
Surface(Modifier.fillMaxSize()) {
POVRayApp(onSaveBitmap = {}, onClickOpen = {}, onClickSave = {})
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray.ui
package com.flykespice.droidray.ui

import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.horizontalScroll
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray.ui
package com.flykespice.droidray.ui

import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Column
Expand All @@ -25,8 +25,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp
import com.flykespice.povray.POVRay
import com.flykespice.povray.ui.theme.POVRayTheme
import com.flykespice.droidray.POVRay
import com.flykespice.droidray.ui.theme.DroidRayTheme


@OptIn(ExperimentalMaterial3Api::class)
Expand Down Expand Up @@ -93,7 +93,7 @@ private fun PreviewLogScreen() {
POVRay.Message(POVRay.Message.TYPE_INFO, "Rendering Done")
)

POVRayTheme {
DroidRayTheme {
Surface (Modifier.fillMaxSize()) {
LogScreen(log = sampleLog)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.flykespice.povray.ui
package com.flykespice.droidray.ui

import android.content.res.Configuration
import android.graphics.BitmapFactory
import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -21,8 +20,9 @@ import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.flykespice.povray.R
import com.flykespice.povray.ui.theme.POVRayTheme
import androidx.core.graphics.drawable.toBitmap
import com.flykespice.droidray.R
import com.flykespice.droidray.ui.theme.DroidRayTheme

@Composable
fun RenderPreviewScreen(
Expand Down Expand Up @@ -56,12 +56,11 @@ fun RenderPreviewScreen(
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
private fun PreviewRenderPreviewScreen() {
POVRayTheme {
DroidRayTheme {
Surface(Modifier.fillMaxSize()) {
val sampleBitmap = BitmapFactory.decodeResource(
LocalContext.current.resources,
R.drawable.render_example
).asImageBitmap()
val sampleBitmap = LocalContext.current.getDrawable(R.drawable.ic_launcher_background)!!
.toBitmap()
.asImageBitmap()

RenderPreviewScreen(previewBitmap = sampleBitmap, isRendering = false, onClickSave = {})
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray.ui.dialog
package com.flykespice.droidray.ui.dialog

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -30,7 +30,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.flykespice.povray.ui.theme.POVRayTheme
import com.flykespice.droidray.ui.theme.DroidRayTheme

@Composable
fun RenderOptionsDialog(
Expand Down Expand Up @@ -109,7 +109,7 @@ fun RenderOptionsDialog(
@Preview
@Composable
private fun PreviewRenderOptionsDialog() {
POVRayTheme {
DroidRayTheme {
Surface {
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
var dialogOpened by remember { mutableStateOf(true) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray.ui.theme
package com.flykespice.droidray.ui.theme

import androidx.compose.ui.graphics.Color

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.flykespice.povray.ui.theme
package com.flykespice.droidray.ui.theme

import android.app.Activity
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
Expand Down Expand Up @@ -34,7 +33,7 @@ private val LightColorScheme = lightColorScheme(
)

@Composable
fun POVRayTheme(
fun DroidRayTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray.ui.theme
package com.flykespice.droidray.ui.theme

import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.flykespice.povray.ui.viewmodel
package com.flykespice.droidray.ui.viewmodel

import android.app.Application
import android.content.Context
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.viewModelScope
import com.flykespice.povray.POVRay
import com.flykespice.droidray.POVRay
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.launch
Expand All @@ -31,7 +31,7 @@ class EditorViewModel(application: Application) : AndroidViewModel(application)

val error = POVRay.renderScene("${context.filesDir}/temp.pov", "+L${context.filesDir}/include +W320 +H240 -F")
if (error != POVRay.vfeNoError) {
TODO("Handle povray rendering error")
TODO("Handle DroidRay rendering error")
}

_enabled.value = true
Expand Down
Binary file removed app/src/main/res/drawable/render_example.png
Binary file not shown.
1 change: 1 addition & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
1 change: 1 addition & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
<monochrome android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">POV-Ray</string>
<string name="app_name">DroidRay</string>
</resources>
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="Theme.POVRay" parent="android:Theme.Material.Light.NoActionBar" />
<style name="Theme.DroidRay" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.flykespice.povray
package com.flykespice.droidray

import org.junit.Test

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ dependencyResolutionManagement {
}
}

rootProject.name = "POV-Ray"
rootProject.name = "DroidRay"
include(":app")
Loading