diff --git a/.idea/icon.png b/.idea/icon.png index 3132225d..cc0448e5 100644 Binary files a/.idea/icon.png and b/.idea/icon.png differ diff --git a/README.md b/README.md index 62c5e1de..2b208a7c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ [![Translate - with Weblate](https://img.shields.io/badge/translate%20with-Weblate-green.svg?style=flat)](https://weblate.tusky.app/) [![OpenCollective](https://opencollective.com/tusky/backers/badge.svg)](https://opencollective.com/tusky/) [![Build Status](https://app.bitrise.io/app/a3e773c3c57a894c/status.svg?token=qLu_Ti4Gp2LWcYT4eo2INQ&branch=develop)](https://app.bitrise.io/app/a3e773c3c57a894c) # Tusky +[Prima versione debug Busky](https://zerbino.esiliati.org/#JERqHadYT8Ry7od9HgydmA,YHQI3znBO_gp-wt1qwg2dg,Tusky_23.0_113_642643c9_blue_debug.apk) + Tusky is a beautiful Android client for [Mastodon](https://github.com/mastodon/mastodon). Mastodon is an ActivityPub federated social network. That means no single entity controls the whole network, rather, like e-mail, volunteers and organisations operate their own independent servers, users from which can all interact with each other seamlessly. diff --git a/app/src/blue/res/mipmap-hdpi/ic_launcher.png b/app/src/blue/res/mipmap-hdpi/ic_launcher.png index 023b25f7..2e2dadaa 100644 Binary files a/app/src/blue/res/mipmap-hdpi/ic_launcher.png and b/app/src/blue/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/blue/res/mipmap-mdpi/ic_launcher.png b/app/src/blue/res/mipmap-mdpi/ic_launcher.png index 3463d7bb..9c252840 100644 Binary files a/app/src/blue/res/mipmap-mdpi/ic_launcher.png and b/app/src/blue/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/blue/res/mipmap-xhdpi/ic_launcher.png b/app/src/blue/res/mipmap-xhdpi/ic_launcher.png index 3694d986..50e25863 100644 Binary files a/app/src/blue/res/mipmap-xhdpi/ic_launcher.png and b/app/src/blue/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/blue/res/mipmap-xxhdpi/ic_launcher.png b/app/src/blue/res/mipmap-xxhdpi/ic_launcher.png index 2ef6e08a..4ff08fc9 100644 Binary files a/app/src/blue/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/blue/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/blue/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/blue/res/mipmap-xxxhdpi/ic_launcher.png index 88795199..4fb5b99c 100644 Binary files a/app/src/blue/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/blue/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/ic_launcher-web.png b/app/src/main/ic_launcher-web.png index 3132225d..cc0448e5 100644 Binary files a/app/src/main/ic_launcher-web.png and b/app/src/main/ic_launcher-web.png differ diff --git a/app/src/main/java/com/keylesspalace/tusky/db/DraftsAlert.kt b/app/src/main/java/com/keylesspalace/tusky/db/DraftsAlert.kt index 9d11f47d..a5b78b50 100644 --- a/app/src/main/java/com/keylesspalace/tusky/db/DraftsAlert.kt +++ b/app/src/main/java/com/keylesspalace/tusky/db/DraftsAlert.kt @@ -1,99 +1,99 @@ -/* Copyright 2023 Andi McClure - * - * This file is a part of Tusky. - * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. - * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. - * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ - -package com.keylesspalace.tusky.db - -import android.content.Context -import android.content.DialogInterface -import android.util.Log -import androidx.appcompat.app.AlertDialog -import androidx.lifecycle.LifecycleCoroutineScope -import androidx.lifecycle.LifecycleOwner -import androidx.lifecycle.lifecycleScope -import com.keylesspalace.tusky.R -import com.keylesspalace.tusky.components.drafts.DraftsActivity -import kotlinx.coroutines.launch -import javax.inject.Inject -import javax.inject.Singleton - -/** - * This class manages an alert popup when a post has failed and been saved to drafts. - * It must be separately registered in each lifetime in which it is to appear, - * and it only appears if the post failure belongs to the current user. - */ - -private const val TAG = "DraftsAlert" - -@Singleton -class DraftsAlert @Inject constructor(db: AppDatabase) { - // For tracking when a media upload fails in the service - private val draftDao: DraftDao = db.draftDao() - - @Inject - lateinit var accountManager: AccountManager - - fun observeInContext(context: T, showAlert: Boolean) where T : Context, T : LifecycleOwner { - accountManager.activeAccount?.let { activeAccount -> - val coroutineScope = context.lifecycleScope - - // Assume a single MainActivity, AccountActivity or DraftsActivity never sees more then one user id in its lifetime. - val activeAccountId = activeAccount.id - - // This LiveData will be automatically disposed when the activity is destroyed. - val draftsNeedUserAlert = draftDao.draftsNeedUserAlert(activeAccountId) - - // observe ensures that this gets called at the most appropriate moment wrt the context lifecycle— - // at init, at next onResume, or immediately if the context is resumed already. - if (showAlert) { - draftsNeedUserAlert.observe(context) { count -> - Log.d(TAG, "User id $activeAccountId changed: Notification-worthy draft count $count") - if (count > 0) { - AlertDialog.Builder(context) - .setTitle(R.string.action_post_failed) - .setMessage( - context.resources.getQuantityString(R.plurals.action_post_failed_detail, count) - ) - .setPositiveButton(R.string.action_post_failed_show_drafts) { _: DialogInterface?, _: Int -> - clearDraftsAlert(coroutineScope, activeAccountId) // User looked at drafts - - val intent = DraftsActivity.newIntent(context) - context.startActivity(intent) - } - .setNegativeButton(R.string.action_post_failed_do_nothing) { _: DialogInterface?, _: Int -> - clearDraftsAlert(coroutineScope, activeAccountId) // User doesn't care - } - .show() - } - } - } else { - draftsNeedUserAlert.observe(context) { - Log.d(TAG, "User id $activeAccountId: Clean out notification-worthy drafts") - clearDraftsAlert(coroutineScope, activeAccountId) - } - } - } ?: run { - Log.w(TAG, "Attempted to observe drafts, but there is no active account") - } - } - - /** - * Clear drafts alert for specified user - */ - private fun clearDraftsAlert(coroutineScope: LifecycleCoroutineScope, id: Long) { - coroutineScope.launch { - draftDao.draftsClearNeedUserAlert(id) - } - } -} +/* Copyright 2023 Andi McClure + * + * This file is a part of Tusky. + * + * This program is free software; you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation; either version 3 of the + * License, or (at your option) any later version. + * + * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with Tusky; if not, + * see . */ + +package com.keylesspalace.tusky.db + +import android.content.Context +import android.content.DialogInterface +import android.util.Log +import androidx.appcompat.app.AlertDialog +import androidx.lifecycle.LifecycleCoroutineScope +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.lifecycleScope +import com.keylesspalace.tusky.R +import com.keylesspalace.tusky.components.drafts.DraftsActivity +import kotlinx.coroutines.launch +import javax.inject.Inject +import javax.inject.Singleton + +/** + * This class manages an alert popup when a post has failed and been saved to drafts. + * It must be separately registered in each lifetime in which it is to appear, + * and it only appears if the post failure belongs to the current user. + */ + +private const val TAG = "DraftsAlert" + +@Singleton +class DraftsAlert @Inject constructor(db: AppDatabase) { + // For tracking when a media upload fails in the service + private val draftDao: DraftDao = db.draftDao() + + @Inject + lateinit var accountManager: AccountManager + + fun observeInContext(context: T, showAlert: Boolean) where T : Context, T : LifecycleOwner { + accountManager.activeAccount?.let { activeAccount -> + val coroutineScope = context.lifecycleScope + + // Assume a single MainActivity, AccountActivity or DraftsActivity never sees more then one user id in its lifetime. + val activeAccountId = activeAccount.id + + // This LiveData will be automatically disposed when the activity is destroyed. + val draftsNeedUserAlert = draftDao.draftsNeedUserAlert(activeAccountId) + + // observe ensures that this gets called at the most appropriate moment wrt the context lifecycle— + // at init, at next onResume, or immediately if the context is resumed already. + if (showAlert) { + draftsNeedUserAlert.observe(context) { count -> + Log.d(TAG, "User id $activeAccountId changed: Notification-worthy draft count $count") + if (count > 0) { + AlertDialog.Builder(context) + .setTitle(R.string.action_post_failed) + .setMessage( + context.resources.getQuantityString(R.plurals.action_post_failed_detail, count) + ) + .setPositiveButton(R.string.action_post_failed_show_drafts) { _: DialogInterface?, _: Int -> + clearDraftsAlert(coroutineScope, activeAccountId) // User looked at drafts + + val intent = DraftsActivity.newIntent(context) + context.startActivity(intent) + } + .setNegativeButton(R.string.action_post_failed_do_nothing) { _: DialogInterface?, _: Int -> + clearDraftsAlert(coroutineScope, activeAccountId) // User doesn't care + } + .show() + } + } + } else { + draftsNeedUserAlert.observe(context) { + Log.d(TAG, "User id $activeAccountId: Clean out notification-worthy drafts") + clearDraftsAlert(coroutineScope, activeAccountId) + } + } + } ?: run { + Log.w(TAG, "Attempted to observe drafts, but there is no active account") + } + } + + /** + * Clear drafts alert for specified user + */ + private fun clearDraftsAlert(coroutineScope: LifecycleCoroutineScope, id: Long) { + coroutineScope.launch { + draftDao.draftsClearNeedUserAlert(id) + } + } +} diff --git a/app/src/main/res/drawable/ic_bot_24dp.xml b/app/src/main/res/drawable/ic_bot_24dp.xml index abb3efb4..26d4c9e0 100644 --- a/app/src/main/res/drawable/ic_bot_24dp.xml +++ b/app/src/main/res/drawable/ic_bot_24dp.xml @@ -1,8 +1,8 @@ - - - + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_person_remove_24dp.xml b/app/src/main/res/drawable/ic_person_remove_24dp.xml index 10332c28..9da6463c 100644 --- a/app/src/main/res/drawable/ic_person_remove_24dp.xml +++ b/app/src/main/res/drawable/ic_person_remove_24dp.xml @@ -1,8 +1,8 @@ - - - + + + \ No newline at end of file diff --git a/app/src/main/res/layout/exo_player_control_view.xml b/app/src/main/res/layout/exo_player_control_view.xml index b304d900..7fe37e9d 100644 --- a/app/src/main/res/layout/exo_player_control_view.xml +++ b/app/src/main/res/layout/exo_player_control_view.xml @@ -1,159 +1,159 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/plurals.xml b/app/src/main/res/values/plurals.xml index c025d78a..43d56fc7 100644 --- a/app/src/main/res/values/plurals.xml +++ b/app/src/main/res/values/plurals.xml @@ -1,6 +1,6 @@ - - - @string/action_post_failed_detail - @string/action_post_failed_detail_plural - + + + @string/action_post_failed_detail + @string/action_post_failed_detail_plural + \ No newline at end of file diff --git a/assets/fdroid_badge.png b/assets/fdroid_badge.png index 23af0e40..021fa39e 100644 Binary files a/assets/fdroid_badge.png and b/assets/fdroid_badge.png differ diff --git a/assets/tusky_banner.xcf b/assets/tusky_banner.xcf index 55551d1f..0257356c 100644 Binary files a/assets/tusky_banner.xcf and b/assets/tusky_banner.xcf differ diff --git a/fastlane/metadata/android/en-US/images/featureGraphic.png b/fastlane/metadata/android/en-US/images/featureGraphic.png index a8256b18..2d13a898 100644 Binary files a/fastlane/metadata/android/en-US/images/featureGraphic.png and b/fastlane/metadata/android/en-US/images/featureGraphic.png differ diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png index 88795199..4fb5b99c 100644 Binary files a/fastlane/metadata/android/en-US/images/icon.png and b/fastlane/metadata/android/en-US/images/icon.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/00_login.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/00_login.png index 22074d15..128f0ec5 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/00_login.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/00_login.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/01_timeline.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/01_timeline.png index 88d9e74d..5c5eba7b 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/01_timeline.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/01_timeline.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/02_compose.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/02_compose.png index 2a098a12..2cfd3bdb 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/02_compose.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/02_compose.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/03_profile.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/03_profile.png index d40864c7..b6d76064 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/03_profile.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/03_profile.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/04_favourites.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/04_favourites.png index 78dee66d..a6e262e0 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/04_favourites.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/04_favourites.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/05_reply.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/05_reply.png index a8c76356..0efd4ba0 100644 Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/05_reply.png and b/fastlane/metadata/android/en-US/images/phoneScreenshots/05_reply.png differ