Skip to content
Merged

Dev #321

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e106815
switch log level to all again
Hiebeler Apr 10, 2025
b982d4a
Migrate to FileKit 0.10.0 version and implement common download feature.
terrakok Apr 11, 2025
83444ab
Fix navigation problems when user is changed
terrakok Apr 13, 2025
c47ec11
Fix android app icon customization.
terrakok Apr 13, 2025
a12e04a
Simplify user switch logic.
terrakok Apr 15, 2025
ba41453
Fix double app icons in open redirects
terrakok Apr 15, 2025
a69f3da
Merge pull request #301 from terrakok/dev
Hiebeler Apr 15, 2025
1aadff7
New Crowdin translations by GitHub Action
crowdin-bot Apr 15, 2025
96a8308
Migrate to ComposeMediaPlayer
terrakok Apr 18, 2025
dcfe1f1
Refactor: File management and cache handling
terrakok Apr 18, 2025
49281b9
Save images in to the gallery and show snack message
terrakok Apr 18, 2025
099a9be
Clear backstack states when switching users.
terrakok Apr 18, 2025
6da09f4
Fix navigation after post creation.
terrakok Apr 18, 2025
1e6d3c9
Merge pull request #304 from terrakok/dev
Hiebeler Apr 25, 2025
dd3c4e5
Merge pull request #302 from daniebeler/l10n_crowdin_translations
Hiebeler Apr 25, 2025
e8bbf87
New Crowdin translations by GitHub Action
crowdin-bot Apr 25, 2025
0987936
Merge pull request #305 from daniebeler/l10n_crowdin_translations
Hiebeler Apr 25, 2025
7ef309b
Update dependencies
terrakok Apr 25, 2025
6e0e9df
Hide volume toggle to videos with no audio tracks
terrakok Apr 25, 2025
73970da
Remove unused Compose Dev Maven repository
terrakok Apr 25, 2025
ddf95df
Update deps to the latest stable versions.
terrakok May 6, 2025
387aa7f
Fix typo in en-rUS strings.xml
cpbaumer May 6, 2025
7efd988
Merge pull request #310 from cpbaumer/dev
Hiebeler May 13, 2025
3483be0
Merge pull request #306 from terrakok/dev
Hiebeler May 13, 2025
ebcf289
Treat all media types except video as image
terrakok May 16, 2025
e084d3b
Update various library versions.
terrakok May 16, 2025
6806ad8
Update KSP and AGP versions, disable obfuscation in release builds
terrakok May 16, 2025
7572474
Merge pull request #316 from terrakok/dev
Hiebeler May 16, 2025
50a6783
#309 Bug fix: Fix opening compose window from sharing an image
Hiebeler Jun 4, 2025
0cb22d1
#303 Fix bug when clicking on notification post
Hiebeler Jun 4, 2025
7b0db3a
Remove icon change two icons description
Hiebeler Jun 4, 2025
8dfe163
Increase version number
daniebeler Jun 8, 2025
db44765
Add app store badge for github readme
daniebeler Jun 8, 2025
a6c96c6
Update README.md
daniebeler Jun 8, 2025
520744b
Update README.md
daniebeler Jun 8, 2025
a45ed88
Update crowdin.yml
Hiebeler Jun 8, 2025
cc6777c
Adapt log level, Add patch notes
daniebeler Jun 8, 2025
3597c6d
Merge branch 'main' into dev
daniebeler Jun 8, 2025
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
6 changes: 5 additions & 1 deletion .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ on:
push:
branches: [ dev ]
workflow_dispatch:


permissions:
contents: write
pull-requests: write

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
Pixelix is an Android client for [Pixelfed](https://pixelfed.org/), the federated image-sharing social network.
It's designed to provide a seamless and high-performance user experience. With Pixelix, you can easily browse, post, and interact with your Pixelfed network on the go.


<a href="https://apps.apple.com/app/pixelix-a-pixelfed-client/id6743839819"><img alt="Get it on Google Play" src="https://github.com/ghostbyte-dev/pixelix/blob/db447657e1abd8ec90bbd1e1ca9edac4bb930878/appstorebadgewhite.svg" height="42" align="middle"></a>
<a href="https://play.google.com/store/apps/details?id=com.daniebeler.pfpixelix"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" height="60" align="middle"></a>

<a href="https://f-droid.org/packages/com.daniebeler.pfpixelix"><img alt="Get it on F-Droid" src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" height="60" align="middle"></a>
<a href="https://github.com/ImranR98/Obtainium/releases"><img alt="Get it on Obtainium banner" src="https://github.com/user-attachments/assets/58fd5f7e-8136-4e92-a462-c7977e119602" height="40" align="middle"/></a>
<a href="https://play.google.com/store/apps/details?id=com.daniebeler.pfpixelix"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png" height="60" align="middle"></a>
<a href="https://apt.izzysoft.de/fdroid/index/apk/com.daniebeler.pfpixelix"><img src="https://gitlab.com/IzzyOnDroid/repo/-/raw/master/assets/IzzyOnDroid.png" alt="Get it from IzzyOnDroid" height="60" align="middle"></a>

## Please donate
Expand Down
26 changes: 15 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import com.google.devtools.ksp.gradle.KspAATask
import org.jetbrains.compose.desktop.application.dsl.TargetFormat.*

plugins {
Expand Down Expand Up @@ -93,6 +94,9 @@ kotlin {

//image crop
implementation(libs.krop)

//video player
implementation(libs.composemediaplayer)
}

androidMain.dependencies {
Expand All @@ -111,12 +115,8 @@ kotlin {
implementation(libs.material)

//media
implementation(libs.androidx.media3.exoplayer)
implementation(libs.androidx.media3.exoplayer.dash)
implementation(libs.androidx.media3.ui)
implementation(libs.android.image.cropper)
implementation(libs.coil.video)
implementation(libs.coil.gif)
implementation(libs.coil.video)

// widget
implementation(libs.androidx.glance.appwidget)
Expand All @@ -133,11 +133,7 @@ kotlin {
implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutines.swing)
implementation(libs.ktor.client.okhttp)
implementation(libs.appdirs)
implementation(libs.slf4j.simple)
implementation(libs.vlcj)
implementation(libs.jna)
implementation(libs.jna.platform)
}
}

Expand All @@ -154,8 +150,8 @@ android {
applicationId = "com.daniebeler.pfpixelix"
minSdk = 26
targetSdk = 35
versionCode = 31
versionName = "4.1.0"
versionCode = 32
versionName = "4.1.1"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down Expand Up @@ -183,6 +179,9 @@ android {
isDebuggable = false
isProfileable = false
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}
packaging.resources {
Expand Down Expand Up @@ -243,3 +242,8 @@ compose.desktop {
}
}
}

tasks.configureEach {
if (this is KspAATask && name != "kspCommonMainKotlinMetadata")
dependsOn("kspCommonMainKotlinMetadata")
}
3 changes: 2 additions & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
-dontobfuscate
27 changes: 16 additions & 11 deletions app/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<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" />
Expand All @@ -64,20 +69,10 @@
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="video/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />

<data
android:host="callback"
android:scheme="pixelix-android-auth" />
</intent-filter>
</activity>

<activity-alias
android:name=".AppActivity"
android:name=".Icon02"
android:exported="true"
android:enabled="true"
android:icon="@mipmap/ic_launcher_02"
Expand Down Expand Up @@ -315,6 +310,16 @@
android:authorities="${applicationId}.androidx-startup"
tools:node="remove">
</provider>
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.example.android.appwidget.fileprovider"
Expand Down
34 changes: 17 additions & 17 deletions app/src/androidMain/kotlin/com/daniebeler/pfpixelix/AppActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,44 @@ import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.window.DialogWindowProvider
import androidx.core.content.FileProvider
import io.github.vinceglb.filekit.FileKit
import io.github.vinceglb.filekit.dialogs.init
import java.io.File
import java.io.FileOutputStream
import java.io.InputStream
import java.lang.ref.WeakReference

class AppActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
FileKit.init(this)
MyApplication.currentActivity = WeakReference(this)
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
App(MyApplication.appComponent) { finish() }
}
if (savedInstanceState == null) {
handleNewIntent(intent)
handleNewIntent(intent, this)
}
}

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
handleNewIntent(intent)
handleNewIntent(intent, this)
}

private fun handleNewIntent(intent: Intent) {
private fun handleNewIntent(intent: Intent, appActivity: AppActivity) {
when (intent.action) {
Intent.ACTION_VIEW -> {
intent.dataString?.let { onExternalUrl(it) }
}
Intent.ACTION_SEND, Intent.ACTION_SEND_MULTIPLE -> {
val imageUris = handleSharePhotoIntent(intent, contentResolver, cacheDir)
val imageUris = handleSharePhotoIntent(intent, contentResolver, cacheDir, appActivity)
if (imageUris.isNotEmpty()) {
imageUris.forEach { uri ->
try {
Expand Down Expand Up @@ -85,15 +81,19 @@ actual fun EdgeToEdgeDialogProperties(
decorFitsSystemWindows = false
)

private fun saveUriToCache(uri: Uri, contentResolver: ContentResolver, cacheDir: File): Uri? {
private fun saveUriToCache(uri: Uri, contentResolver: ContentResolver, cacheDir: File, appActivity: AppActivity): Uri? {
try {
val inputStream: InputStream? = contentResolver.openInputStream(uri)
inputStream?.use { input ->
val file = File(cacheDir, "shared_image_${System.currentTimeMillis()}.jpg")
FileOutputStream(file).use { output ->
input.copyTo(output)
}
return Uri.fromFile(file) // Return the new cached URI
return FileProvider.getUriForFile(
appActivity,
"${appActivity.packageName}.provider",
file
)
}
} catch (e: Exception) {
e.printStackTrace()
Expand All @@ -102,7 +102,7 @@ private fun saveUriToCache(uri: Uri, contentResolver: ContentResolver, cacheDir:
}

private fun handleSharePhotoIntent(
intent: Intent, contentResolver: ContentResolver, cacheDir: File
intent: Intent, contentResolver: ContentResolver, cacheDir: File, appActivity: AppActivity
): List<Uri> {
val action = intent.action
val type = intent.type
Expand All @@ -122,7 +122,7 @@ private fun handleSharePhotoIntent(
) as? Uri
}
singleUri?.let { uri ->
val cachedUri = saveUriToCache(uri, contentResolver, cacheDir)
val cachedUri = saveUriToCache(uri, contentResolver, cacheDir, appActivity)
imageUris =
cachedUri?.let { listOf(it) } ?: emptyList() // Wrap single image in a list
}
Expand All @@ -141,7 +141,7 @@ private fun handleSharePhotoIntent(
}
imageUris = receivedUris?.mapNotNull {
saveUriToCache(
it, contentResolver, cacheDir
it, contentResolver, cacheDir, appActivity
)
} ?: emptyList()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.daniebeler.pfpixelix

import android.app.Activity
import android.app.Application
import android.content.Context
import androidx.activity.ComponentActivity
Expand All @@ -11,7 +10,6 @@ import androidx.work.WorkerParameters
import coil3.SingletonImageLoader
import com.daniebeler.pfpixelix.di.AppComponent
import com.daniebeler.pfpixelix.di.create
import com.daniebeler.pfpixelix.domain.service.file.AndroidFileService
import com.daniebeler.pfpixelix.domain.service.icon.AndroidAppIconManager
import com.daniebeler.pfpixelix.utils.configureLogger
import com.daniebeler.pfpixelix.widget.notifications.work_manager.LatestImageTask
Expand All @@ -28,7 +26,6 @@ class MyApplication : Application(), Configuration.Provider {
override fun onCreate() {
appComponent = AppComponent.create(
this,
AndroidFileService(this),
AndroidAppIconManager(this)
)
SingletonImageLoader.setSafe {
Expand Down
Loading