Merge branch 'login_dialog' into 'master'

Add 'What's an instance' dialog in login instead of opening link

Closes #253

See merge request pixeldroid/PixelDroid!296
This commit is contained in:
Matthieu 2021-01-25 10:52:41 +00:00
commit cb3b004583
5 changed files with 26 additions and 6 deletions

View File

@ -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() {

View File

@ -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
}
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/whats_an_instance_explanation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:autoLink="web"
android:padding="16dp"
android:text="@string/whats_an_instance_explanation" />

View File

@ -101,7 +101,6 @@
<string name="crop_result_error">图像裁剪后无法恢复</string>
<string name="busy_dialog_ok_button">好的</string>
<string name="busy_dialog_text">图像仍在处理中,请先等待完成!</string>
<string name="click_image_edit">点击图片可编辑</string>
<string name="post_image">帖文中的一张图片</string>
<string name="add_photo">添加照片</string>
<string name="poll_notification">%1$s投票已经结束</string>

View File

@ -28,6 +28,13 @@
<!-- Login page -->
<string name="whats_an_instance">"What's an instance?"</string>
<string name="whats_an_instance_explanation">"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"</string>
<string name="domain_of_your_instance">Domain of your instance</string>
<string name="connect_to_pixelfed">Connect to Pixelfed</string>
<string name="login_connection_required_once">You need to be online to be able to add the first account and use PixelDroid :(</string>