mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Add new contact us flow.
This commit is contained in:
committed by
Greyson Parrelli
parent
f1f505d41c
commit
f9de131017
@@ -1,10 +1,14 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.LabeledIntent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,4 +19,21 @@ public class IntentUtils {
|
||||
return resolveInfoList != null && resolveInfoList.size() > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* From: <a href="https://stackoverflow.com/a/12328282">https://stackoverflow.com/a/12328282</a>
|
||||
*/
|
||||
public static @Nullable LabeledIntent getLabelintent(@NonNull Context context, @NonNull Intent origIntent, int name, int drawable) {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
ComponentName launchName = origIntent.resolveActivity(pm);
|
||||
|
||||
if (launchName != null) {
|
||||
Intent resolved = new Intent();
|
||||
resolved.setComponent(launchName);
|
||||
resolved.setData(origIntent.getData());
|
||||
|
||||
return new LabeledIntent(resolved, context.getPackageName(), name, drawable);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
package org.thoughtcrime.securesms.util;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.AbsoluteSizeSpan;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.text.style.RelativeSizeSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.text.style.URLSpan;
|
||||
|
||||
import androidx.annotation.DrawableRes;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class SpanUtil {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user