fix: move card favourite star to bottom-right so it no longer overlaps the overflow button (v0.3.3.4)
build / Assemble debug APK (push) Failing after 9s

This commit is contained in:
Incido Developer committed 2026-08-17 12:59:10 +12:00
1 parent 5b82d2a9fe
commit 089926377c
44 files changed
+5490 -140

No files matched your search

+70
View File
@@ -4,7 +4,26 @@
<!--
Incido is privacy-first and offline-only. We intentionally do NOT
declare the android.permission.INTERNET permission. (N2)
v0.3.1.0: added CAMERA permission for the in-editor camera
capture button. Still no INTERNET, still no third-party tracking,
still no analytics — photos stay on-device in the ObjectBox
database and are never uploaded anywhere.
-->
<uses-permission android:name="android.permission.CAMERA" />
<!-- v0.3.2.0: biometric (fingerprint / face) unlock for the
app-lock PIN alternative. USE_BIOMETRIC is the modern
permission; USE_FINGERPRINT is the pre-Android-10 alias and
is declared so older devices don't fail manifest checks. -->
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.fingerprint"
android:required="false" />
<application
android:name="org.incido.compose.IncidoApplication"
@@ -27,8 +46,59 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!--
v0.3.1.0: accept "Share With" content from other apps.
v0.3.1.1: broadened to all mime types so Incido appears in
the share menu for PDFs, audio, video, archives, etc. —
not just images and text. The specific mime entries are
kept as documentation; Android's matcher actually picks
the */* catch-all for everything we don't otherwise list.
-->
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND_MULTIPLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
<!--
v0.3.1.0: FileProvider that exposes the camera outbox (a
temporary subdirectory of cacheDir). The camera app is
handed a content:// URI pointing here, writes the JPEG,
and we then read the bytes into the ObjectBox attachment
store and delete the temp file.
-->
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>
</application>
</manifest>
@@ -1,22 +1,142 @@
package org.incido.app
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.fragment.app.FragmentActivity
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import org.incido.compose.IncidoApp
import org.incido.compose.share.SharedIntentBuffer
import org.incido.compose.ui.editor.SharedImage
/**
* The single Activity hosting the Compose UI. All real work — navigation,
* ViewModels, data — lives in the `:composeApp` module so it stays
* portable when iOS / Desktop ports happen.
*
* v0.3.1.0 — also handles `ACTION_SEND` and `ACTION_SEND_MULTIPLE`
* intents (the "Share With" entry point from other apps). Inbound
* content is copied into memory here, parked in [SharedIntentBuffer],
* and picked up once by the Compose tree on first composition.
*
* v0.3.2.0 — this Activity must be a [androidx.fragment.app.FragmentActivity]
* (not just `ComponentActivity`) because the biometric prompt needs
* a Fragment-based host. ComponentActivity already extends from
* FragmentActivity via androidx.activity:activity-compose, so the cast
* inside `PinEntryScreen` succeeds. The [onStop] hook records the
* background timestamp so the SecurityManager can re-lock on resume
* if the timeout has elapsed.
*/
class MainActivity : ComponentActivity() {
class MainActivity : FragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
handleShareIntent(intent)
setContent {
IncidoApp()
val app = application as org.incido.compose.IncidoApplication
// v0.3.1.0: hand the NoteRepository through to the Compose
// tree so the editor's full-screen image viewer can fetch
// attachment bytes on demand.
// v0.3.2.0: pass the SecurityManager + SettingsRepository
// through too so the auth gate and theme integration have
// direct access (without round-tripping through LocalContext).
IncidoApp(
repository = app.container.noteRepository,
securityManager = app.container.securityManager,
settingsRepository = app.container.settingsRepository,
)
}
}
override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
setIntent(intent)
handleShareIntent(intent)
}
/**
* v0.3.2.0: when the Activity is no longer visible, tell the
* SecurityManager so it can record the background timestamp.
* `onAppForegrounded()` (called from the root Compose tree on
* `ON_RESUME`) decides whether to re-lock based on the elapsed
* time vs the configured auto-lock timeout.
*/
override fun onStop() {
super.onStop()
val app = application as? org.incido.compose.IncidoApplication
app?.container?.securityManager?.onAppBackgrounded()
}
/**
* Decode any ACTION_SEND / ACTION_SEND_MULTIPLE payload into a
* [SharedIntentBuffer.Payload] and stash it. Safe to call multiple
* times — repeated identical intents just overwrite the same payload.
*/
private fun handleShareIntent(intent: Intent?) {
if (intent == null) return
val action = intent.action
val type = intent.type
if (action != Intent.ACTION_SEND && action != Intent.ACTION_SEND_MULTIPLE) return
// v0.3.1.1: stash text + uri list SYNCHRONOUSLY so the Compose
// tree (LaunchedEffect(Unit) reads the buffer once on first
// composition) sees the payload even though `lifecycleScope.launch`
// would otherwise run the image-byte I/O asynchronously and miss
// the first composition. We push an initial payload with no
// images; the async block then re-`put`s with images appended.
val text: String? = intent.getStringExtra(Intent.EXTRA_TEXT)
val uris: List<Uri> = when (action) {
Intent.ACTION_SEND -> listOfNotNull(
@Suppress("DEPRECATION")
intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM),
)
Intent.ACTION_SEND_MULTIPLE -> @Suppress("DEPRECATION")
intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM).orEmpty()
else -> emptyList()
}
SharedIntentBuffer.put(
SharedIntentBuffer.Payload(text = text, images = emptyList())
)
if (uris.isNotEmpty()) {
lifecycleScope.launch {
val images: List<SharedImage> = withContext(Dispatchers.IO) {
uris.mapNotNull { uri ->
val bytes = runCatching {
contentResolver.openInputStream(uri)?.use { it.readBytes() }
}.getOrNull() ?: return@mapNotNull null
val mime = contentResolver.getType(uri) ?: type ?: "application/octet-stream"
val displayName = queryDisplayName(uri) ?: "Shared_${System.currentTimeMillis()}"
SharedImage(bytes = bytes, mimeType = mime, displayName = displayName)
}
}
// Merge with whatever the buffer currently holds (keep its
// text — a second share-into on the same activity instance
// shouldn't clobber text-only payloads).
val current = SharedIntentBuffer.consume() ?: SharedIntentBuffer.Payload(null, emptyList())
SharedIntentBuffer.put(current.copy(images = images))
}
}
}
private fun queryDisplayName(uri: Uri): String? {
return runCatching {
contentResolver.query(
uri,
arrayOf(android.provider.OpenableColumns.DISPLAY_NAME),
null, null, null,
)?.use { cursor ->
if (cursor.moveToFirst()) {
val idx = cursor.getColumnIndex(android.provider.OpenableColumns.DISPLAY_NAME)
if (idx >= 0) cursor.getString(idx) else null
} else null
}
}.getOrNull()
}
}
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
v0.3.1.0 — FileProvider paths.
The camera intent writes the captured JPEG to a temporary location
in our cache directory. We read the bytes out of that temp file
immediately and persist them inside the ObjectBox database; the
temp file is deleted once the bytes are in the DB. So this only
needs to expose the cache outbox — never any persistent storage.
v0.3.1.3 — added `open_outbox`. When the user taps a non-image
attachment thumbnail in the editor, we write its bytes to
cacheDir/open_outbox/ and hand a content:// URI to an
ACTION_VIEW intent so the system default app (PDF viewer, music
player, etc.) can open it. `open_outbox/` must be exposed here
or FileProvider.getUriForFile throws IllegalArgumentException.
-->
<paths>
<cache-path
name="camera_outbox"
path="camera_outbox/" />
<cache-path
name="open_outbox"
path="open_outbox/" />
</paths>