mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Merge pull request #4167 from deltachat/wch423/mark-external-links
Mark external links with a special character
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
* Allow to see inbox quota for all relays in connectivity screen
|
||||
* Truncate file names in the middle, not at the end; important information are more often at the end
|
||||
* Remove email address from user profile
|
||||
* Mark external links with " ↗" to make them clear
|
||||
* Make QR code larger on "Add Second Device" screen
|
||||
* Fix: Show dialog if pasted QR codes are invalid
|
||||
* Update to core 2.36.0
|
||||
|
||||
@@ -6,6 +6,10 @@ a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a[href^='http']::after {
|
||||
content: " ↗";
|
||||
}
|
||||
|
||||
h2, h3, h4 {
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.thoughtcrime.securesms.relay.RelayListActivity;
|
||||
import org.thoughtcrime.securesms.scribbles.ScribbleActivity;
|
||||
import org.thoughtcrime.securesms.util.IntentUtils;
|
||||
import org.thoughtcrime.securesms.util.Prefs;
|
||||
import org.thoughtcrime.securesms.util.TextUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
import org.thoughtcrime.securesms.util.views.ProgressDialog;
|
||||
@@ -345,6 +346,11 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||
|
||||
private void showOtherOptionsDialog() {
|
||||
View view = View.inflate(this, R.layout.signup_options_view, null);
|
||||
Button otherServerButton = view.findViewById(R.id.use_other_server);
|
||||
if (otherServerButton != null) {
|
||||
otherServerButton.setText(
|
||||
TextUtil.markAsExternal(getString(R.string.instant_onboarding_other_server)));
|
||||
}
|
||||
AlertDialog signUpDialog = new AlertDialog.Builder(this)
|
||||
.setView(view)
|
||||
.setTitle(R.string.instant_onboarding_show_more_instances)
|
||||
@@ -376,9 +382,11 @@ public class InstantOnboardingActivity extends BaseActionBarActivity implements
|
||||
signUpBtn.setText(R.string.instant_onboarding_create);
|
||||
privacyPolicyBtn.setTextColor(getResources().getColor(R.color.delta_accent));
|
||||
if (DEFAULT_CHATMAIL_HOST.equals(providerHost)) {
|
||||
privacyPolicyBtn.setText(getString(R.string.instant_onboarding_agree_default2, providerHost));
|
||||
privacyPolicyBtn.setText(TextUtil.markAsExternal(
|
||||
getString(R.string.instant_onboarding_agree_default2, providerHost)));
|
||||
} else {
|
||||
privacyPolicyBtn.setText(getString(R.string.instant_onboarding_agree_instance, providerHost));
|
||||
privacyPolicyBtn.setText(TextUtil.markAsExternal(
|
||||
getString(R.string.instant_onboarding_agree_instance, providerHost)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
||||
import org.thoughtcrime.securesms.util.TextUtil;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
import java.io.InputStream;
|
||||
@@ -51,6 +52,28 @@ public class LocalHelpActivity extends WebViewActivity
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
super.onPrepareOptionsMenu(menu);
|
||||
this.getMenuInflater().inflate(R.menu.local_help, menu);
|
||||
|
||||
// Append " ↗" to external link buttons
|
||||
MenuItem item = menu.findItem(R.id.learn_more);
|
||||
if (item != null) {
|
||||
item.setTitle(TextUtil.markAsExternal(getString(R.string.delta_chat_homepage)));
|
||||
}
|
||||
|
||||
item = menu.findItem(R.id.privacy_policy);
|
||||
if (item != null) {
|
||||
item.setTitle(TextUtil.markAsExternal(getString(R.string.privacy_policy)));
|
||||
}
|
||||
|
||||
item = menu.findItem(R.id.contribute);
|
||||
if (item != null) {
|
||||
item.setTitle(TextUtil.markAsExternal(getString(R.string.contribute)));
|
||||
}
|
||||
|
||||
item = menu.findItem(R.id.report_issue);
|
||||
if (item != null) {
|
||||
item.setTitle(TextUtil.markAsExternal(getString(R.string.global_menu_help_report_desktop)));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.text.BidiFormatter;
|
||||
|
||||
public class TextUtil {
|
||||
@NonNull
|
||||
public static String bidiAppend(String text, String suffix) {
|
||||
return BidiFormatter.getInstance().unicodeWrap(text) + suffix;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static String markAsExternal(String text) {
|
||||
return bidiAppend(text, " ↗");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user