Skip to content

Commit

Permalink
new theme package
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Aug 3, 2024
1 parent d18936f commit e430b0c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</intent-filter>
</activity>
<activity
android:name=".Simulator"
android:name=".themes.Simulator"
android:exported="false"
android:process=":simulator"
android:taskAffinity=""
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/cpp/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ extern "C" void simulator_start(JNIEnv* env, jobject thiz, jobject bitmap, jint
extern "C" void simulator_stop(JNIEnv* env);
extern "C" void simulator_key(jint key);

extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_Simulator_key(JNIEnv* env, jobject thiz, jint key) {
extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_themes_Simulator_key(JNIEnv* env, jobject thiz, jint key) {
simulator_key(key);
}

extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_Simulator_stop(JNIEnv* env, jobject thiz) {
extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_themes_Simulator_stop(JNIEnv* env, jobject thiz) {
simulator_stop(env);
}

extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_Simulator_start(JNIEnv* env, jobject thiz, jobject bitmap, jint w, jint h) {
extern "C" JNIEXPORT void JNICALL Java_org_andbootmgr_app_themes_Simulator_start(JNIEnv* env, jobject thiz, jobject bitmap, jint w, jint h) {
simulator_start(env, thiz, bitmap, w, h);
}
1 change: 1 addition & 0 deletions app/src/main/java/org/andbootmgr/app/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import com.topjohnwu.superuser.Shell.FLAG_REDIRECT_STDERR
import com.topjohnwu.superuser.io.SuFile
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import org.andbootmgr.app.themes.Themes
import org.andbootmgr.app.util.AbmTheme
import org.andbootmgr.app.util.ConfigFile
import org.andbootmgr.app.util.SDUtils
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.andbootmgr.app
package org.andbootmgr.app.themes

import android.graphics.Bitmap
import android.graphics.Canvas
Expand All @@ -19,6 +19,7 @@ import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import com.topjohnwu.superuser.Shell
import com.topjohnwu.superuser.io.SuRandomAccessFile
import org.andbootmgr.app.join
import java.io.File
import kotlin.math.min
import kotlin.system.exitProcess
Expand Down Expand Up @@ -92,12 +93,14 @@ class Simulator : AppCompatActivity() {
}
}

@Suppress("unused") // jni
private fun blockCount(): Long {
return Shell.cmd("blockdev --getsz ${f.absolutePath}").exec().out.join("\n").toLong().also {
Log.i("Simulator", "block count: $it")
}
}

@Suppress("unused") // jni
private fun readBlocks(offset: Long, count: Int): ByteArray {
Log.i("Simulator", "read $count bytes at $offset")
val fo = SuRandomAccessFile.open(f, "r")
Expand All @@ -108,11 +111,13 @@ class Simulator : AppCompatActivity() {
return b
}

@Suppress("unused") // jni
private fun redraw() {
Log.i("Simulator", "redrawing")
v.invalidate()
}

@Suppress("unused") // jni
private fun screenPrint(str: String) {
handler.post {
Toast.makeText(this, str.trim(), Toast.LENGTH_SHORT).show()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.andbootmgr.app
package org.andbootmgr.app.themes

import android.content.Intent
import android.widget.Toast
Expand Down Expand Up @@ -30,10 +30,7 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
import androidx.compose.ui.draw.drawWithCache
import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.geometry.Size
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.res.stringResource
Expand All @@ -43,6 +40,11 @@ import androidx.navigation.compose.rememberNavController
import com.github.skydoves.colorpicker.compose.BrightnessSlider
import com.github.skydoves.colorpicker.compose.HsvColorPicker
import com.github.skydoves.colorpicker.compose.rememberColorPickerController
import org.andbootmgr.app.ActionAbortedCleanlyError
import org.andbootmgr.app.ActionAbortedError
import org.andbootmgr.app.AppContent
import org.andbootmgr.app.MainActivityState
import org.andbootmgr.app.R
import org.andbootmgr.app.util.ConfigFile
import java.io.File

Expand Down

0 comments on commit e430b0c

Please sign in to comment.