From ccadaac718bdd911df088b58dba7bb9c4cbf7069 Mon Sep 17 00:00:00 2001
From: Matthieu <24-artectrex@users.noreply.shinice.net>
Date: Wed, 19 May 2021 11:05:44 +0200
Subject: [PATCH] Catch filenotfoundexception, add build variant for debug
---
.gitignore | 1 +
app/build.gradle | 22 ++++--
.../drawable-v24/ic_launcher_foreground.xml | 38 ++++++++++
.../res/drawable/ic_launcher_background.xml | 74 +++++++++++++++++++
.../res/mipmap-anydpi-v26/ic_launcher.xml | 5 ++
.../mipmap-anydpi-v26/ic_launcher_round.xml | 5 ++
app/src/main/AndroidManifest.xml | 2 +-
.../app/postCreation/PostCreationActivity.kt | 12 ++-
app/src/main/res/values/strings.xml | 29 +++++++-
app/src/main/res/xml/root_preferences.xml | 2 +-
10 files changed, 181 insertions(+), 9 deletions(-)
create mode 100644 app/src/debug/res/drawable-v24/ic_launcher_foreground.xml
create mode 100644 app/src/debug/res/drawable/ic_launcher_background.xml
create mode 100644 app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
create mode 100644 app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
diff --git a/.gitignore b/.gitignore
index d879603d..1d76c5b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,5 +14,6 @@
.cxx
.idea
app/release
+app/debug
app/lint
lint
diff --git a/app/build.gradle b/app/build.gradle
index 705a0e0a..e045470c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -36,6 +36,7 @@ android {
sourceSets {
main.java.srcDirs += 'src/main/java'
test.java.srcDirs += 'src/test/java'
+ staging.res.srcDirs += 'src/debug/res'
androidTest.java.srcDirs += 'src/androidTest/java'
}
testBuildType "staging"
@@ -44,7 +45,8 @@ android {
buildTypes {
debug {
-
+ applicationIdSuffix '.debug'
+ versionNameSuffix "-debug"
}
staging {
initWith debug
@@ -74,6 +76,7 @@ android {
proguardFiles 'proguard-rules.pro'
}
}
+
testOptions {
animationsDisabled true
@@ -86,14 +89,23 @@ android {
apply plugin: 'kotlin-kapt'
}
+afterEvaluate {
+ /**
+ * Make a string with the application_id (available in xml etc)
+ */
+ android.applicationVariants.all { variant ->
+ variant.resValue 'string', 'application_id', variant.applicationId
+ }
+}
+
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
/**
* AndroidX dependencies:
*/
- implementation 'androidx.appcompat:appcompat:1.2.0'
- implementation 'androidx.core:core-ktx:1.3.2'
+ implementation 'androidx.appcompat:appcompat:1.3.0'
+ implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
@@ -111,7 +123,7 @@ dependencies {
implementation "androidx.annotation:annotation:1.2.0"
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation "androidx.activity:activity-ktx:1.2.3"
- implementation 'androidx.fragment:fragment-ktx:1.3.3'
+ implementation 'androidx.fragment:fragment-ktx:1.3.4'
// Use the most recent version of CameraX
def cameraX_version = '1.0.0'
@@ -191,7 +203,7 @@ dependencies {
// debugImplementation required vs testImplementation: https://issuetracker.google.com/issues/128612536
//noinspection FragmentGradleConfiguration
- stagingImplementation("androidx.fragment:fragment-testing:1.3.3") {
+ stagingImplementation("androidx.fragment:fragment-testing:1.3.4") {
exclude group:'androidx.test', module:'monitor'
}
diff --git a/app/src/debug/res/drawable-v24/ic_launcher_foreground.xml b/app/src/debug/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..b382f73c
--- /dev/null
+++ b/app/src/debug/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/debug/res/drawable/ic_launcher_background.xml b/app/src/debug/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..ca3826a4
--- /dev/null
+++ b/app/src/debug/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..bbd3e021
--- /dev/null
+++ b/app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..bbd3e021
--- /dev/null
+++ b/app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b848a8d5..ff17319e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -127,7 +127,7 @@
}
+ }.show()
+ return
+ }
val imagePart = ProgressRequestBody(imageInputStream, data.size)
val requestBody = MultipartBody.Builder()
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ebd8f06c..f77e9206 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1,7 +1,12 @@
+
PixelDroid
+
+
My Profile
+
+
Settings
"Invalid domain"
"Could not register the application with this server"
@@ -14,16 +19,35 @@
"OK, continue anyway"
"Cancel logging in"
Settings
-
+
+
Application Theme
+
+
Theme
+
+
Default (Follows system)
+
+
Light
+
+
Dark
+
+
%1$s followed you
+
+
%1$s mentioned you
+
+
%1$s shared your post
+
+
%1$s liked your post
+
+
"%1$s's poll has ended"
@@ -201,4 +225,7 @@ For more info about Pixelfed, you can check here: https://pixelfed.org"
Image showing a red panda, Pixelfed\'s mascot, using a phone
Could not delete the post, error %1$d
Could not delete the post, check your connection?
+
+
+ File %1$s was not found
\ No newline at end of file
diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml
index 2ffb30f9..298a62a6 100644
--- a/app/src/main/res/xml/root_preferences.xml
+++ b/app/src/main/res/xml/root_preferences.xml
@@ -26,7 +26,7 @@
android:summary="@string/about_pixeldroid"
app:icon="@drawable/info_black_24dp">