From 4c935918d650d327b4ead5817273ea8ac2e343ba Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Mon, 25 Jan 2021 10:57:27 +0100 Subject: [PATCH 1/2] Add 'What's an instance' dialog in login instead of opening link --- app/src/main/java/com/h/pixeldroid/LoginActivity.kt | 10 +++++++--- .../pixeldroid/postCreation/carousel/ImageCarousel.kt | 6 ++++-- .../main/res/layout/whats_an_instance_explanation.xml | 8 ++++++++ app/src/main/res/values/strings.xml | 7 +++++++ 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 app/src/main/res/layout/whats_an_instance_explanation.xml diff --git a/app/src/main/java/com/h/pixeldroid/LoginActivity.kt b/app/src/main/java/com/h/pixeldroid/LoginActivity.kt index a9ac3f63..c81c8798 100644 --- a/app/src/main/java/com/h/pixeldroid/LoginActivity.kt +++ b/app/src/main/java/com/h/pixeldroid/LoginActivity.kt @@ -104,9 +104,13 @@ class LoginActivity : BaseActivity() { private fun whatsAnInstance() { - val i = Intent(Intent.ACTION_VIEW) - i.data = Uri.parse("https://pixelfed.org/join") - startActivity(i) + val builder = AlertDialog.Builder(this) + builder.apply { + setView(layoutInflater.inflate(R.layout.whats_an_instance_explanation, null)) + setPositiveButton(android.R.string.ok) { _, _ -> } + } + // Create the AlertDialog + builder.show() } private fun hideKeyboard() { diff --git a/app/src/main/java/com/h/pixeldroid/postCreation/carousel/ImageCarousel.kt b/app/src/main/java/com/h/pixeldroid/postCreation/carousel/ImageCarousel.kt index 6c7e51b2..d631a4bb 100644 --- a/app/src/main/java/com/h/pixeldroid/postCreation/carousel/ImageCarousel.kt +++ b/app/src/main/java/com/h/pixeldroid/postCreation/carousel/ImageCarousel.kt @@ -454,8 +454,10 @@ class ImageCarousel( dataItem?.apply { caption.apply { - binding.editMediaDescriptionLayout.visibility = INVISIBLE - tvCaption.visibility = VISIBLE + if(layoutCarousel){ + binding.editMediaDescriptionLayout.visibility = INVISIBLE + tvCaption.visibility = VISIBLE + } currentDescription = this } } diff --git a/app/src/main/res/layout/whats_an_instance_explanation.xml b/app/src/main/res/layout/whats_an_instance_explanation.xml new file mode 100644 index 00000000..7182825a --- /dev/null +++ b/app/src/main/res/layout/whats_an_instance_explanation.xml @@ -0,0 +1,8 @@ + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6fa92f97..18e36156 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -28,6 +28,13 @@ "What's an instance?" + "You might be confused by the text field asking for the domain of your 'instance'. + +Pixelfed is a federated platform, and part of the 'fediverse', which means it can talk to other platforms which speak the same language, like Mastodon (see https://joinmastodon.org). + +It also means you have to choose which server, or 'instance' of Pixelfed to use. If you don't know any, you can look here: https://pixelfed.org/join + +For more info about Pixelfed, you can check here: https://pixelfed.org" Domain of your instance Connect to Pixelfed You need to be online to be able to add the first account and use PixelDroid :( From c2e81378a3b6f898a24597f6be53c052c824a2c0 Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Mon, 25 Jan 2021 11:13:25 +0100 Subject: [PATCH 2/2] remove extraneous string --- app/src/main/res/values-zh-rCN/strings.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 866fffe5..5ba8e3af 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -101,7 +101,6 @@ 图像裁剪后无法恢复 好的 图像仍在处理中,请先等待完成! - 点击图片可编辑 帖文中的一张图片 添加照片 %1$s投票已经结束