mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 05:39:53 +01:00
Try to make links clickable.
This commit is contained in:
@@ -425,6 +425,9 @@
|
|||||||
android:label="@string/open_link_title"
|
android:label="@string/open_link_title"
|
||||||
android:windowSoftInputMode="stateHidden|adjustResize">
|
android:windowSoftInputMode="stateHidden|adjustResize">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="briar"/>
|
<data android:scheme="briar"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import javax.inject.Inject;
|
|||||||
import static android.app.AlarmManager.ELAPSED_REALTIME;
|
import static android.app.AlarmManager.ELAPSED_REALTIME;
|
||||||
import static android.content.ClipDescription.MIMETYPE_TEXT_PLAIN;
|
import static android.content.ClipDescription.MIMETYPE_TEXT_PLAIN;
|
||||||
import static android.content.Intent.ACTION_SEND;
|
import static android.content.Intent.ACTION_SEND;
|
||||||
|
import static android.content.Intent.ACTION_VIEW;
|
||||||
import static android.content.Intent.EXTRA_TEXT;
|
import static android.content.Intent.EXTRA_TEXT;
|
||||||
import static android.os.SystemClock.elapsedRealtime;
|
import static android.os.SystemClock.elapsedRealtime;
|
||||||
import static java.util.Objects.requireNonNull;
|
import static java.util.Objects.requireNonNull;
|
||||||
@@ -82,13 +83,18 @@ public class ContactLinkInputActivity extends BriarActivity
|
|||||||
addButton.setOnClickListener(v -> onAddButtonClicked());
|
addButton.setOnClickListener(v -> onAddButtonClicked());
|
||||||
|
|
||||||
Intent i = getIntent();
|
Intent i = getIntent();
|
||||||
if (i != null && ACTION_SEND.equals(i.getAction())) {
|
if (i != null) {
|
||||||
String text = i.getStringExtra(EXTRA_TEXT);
|
String action = i.getAction();
|
||||||
if (text != null) linkInput.setText(text);
|
if (ACTION_SEND.equals(action) || ACTION_VIEW.equals(action)) {
|
||||||
} else if (i != null && "addContact".equals(i.getAction())) {
|
String text = i.getStringExtra(EXTRA_TEXT);
|
||||||
removeFakeRequest(i.getStringExtra("name"),
|
if (text != null) linkInput.setText(text);
|
||||||
i.getLongExtra("timestamp", 0));
|
String uri = i.getDataString();
|
||||||
finish();
|
if (uri != null) linkInput.setText(uri);
|
||||||
|
} else if ("addContact".equals(action)) {
|
||||||
|
removeFakeRequest(i.getStringExtra("name"),
|
||||||
|
i.getLongExtra("timestamp", 0));
|
||||||
|
finish();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +188,8 @@ public class ContactLinkInputActivity extends BriarActivity
|
|||||||
PendingIntent pendingIntent = PendingIntent.getActivity(this, 42, i, 0);
|
PendingIntent pendingIntent = PendingIntent.getActivity(this, 42, i, 0);
|
||||||
alarmManager.set(ELAPSED_REALTIME, triggerAt, pendingIntent);
|
alarmManager.set(ELAPSED_REALTIME, triggerAt, pendingIntent);
|
||||||
|
|
||||||
Log.e("TEST", "Setting Alarm in " + MILLISECONDS.toSeconds(fromNow) + " seconds");
|
Log.e("TEST", "Setting Alarm in " + MILLISECONDS.toSeconds(fromNow) +
|
||||||
|
" seconds");
|
||||||
Log.e("TEST", "with contact: " + name);
|
Log.e("TEST", "with contact: " + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user