java类android.text.method.LinkMovementMethod的实例源码

AboutActivity.java 文件源码 项目:smart-asset-iot-android-demo 阅读 33 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.NoActionBar);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    ButterKnife.bind(this);

    toolbar.setTitleTextColor(ContextCompat.getColor(this, R.color.white));
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_return);
    toolbar.setNavigationOnClickListener(v -> onBackPressed());
    title.setMovementMethod(LinkMovementMethod.getInstance());
}
ActivityTabs.java 文件源码 项目:LibVNCAndroid 阅读 30 收藏 0 点赞 0 评论 0
/**
 * @brief Shows the dialog to indicate about info
 * @return The new dialog
 * @details Shows the dialog to indicate about info
 */
private Dialog createAboutDialog()
 {
    //necesario para poder clicar en los links
    final TextView message = new TextView(this);
    final SpannableString s = 
               new SpannableString(this.getText(R.string.about_message));
  Linkify.addLinks(s, Linkify.WEB_URLS);
  message.setText(s);
  message.setMovementMethod(LinkMovementMethod.getInstance());

  return new AlertDialog.Builder(this)
  .setTitle(R.string.about_title)
  .setView(message)
  .setPositiveButton(R.string.about_ok,
   new DialogInterface.OnClickListener() {

    @Override
    public void onClick(DialogInterface dialog, int which) {
     // Auto-generated method stub

    }
   }
    )
  .show();
 }
AboutActivity.java 文件源码 项目:SERC-ENERYGY-METERING-MOBILE-APP 阅读 40 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);


    // about_page_textview has links specified by putting <a> tags in the string
    // resource.  By default these links will appear but not
    // respond to user input.  To make them active, you need to
    // call setMovementMethod() on the TextView object.
    TextView aboutPageText = (TextView) findViewById(R.id.about_page_textview);
    aboutPageText.setMovementMethod(LinkMovementMethod.getInstance());

    // This makes the image clickable
    ImageView img = (ImageView)findViewById(R.id.about_page_image);
    img.setOnClickListener(new View.OnClickListener(){
        public void onClick(View v){
            Intent intent = new Intent();
            intent.setAction(Intent.ACTION_VIEW);
            intent.addCategory(Intent.CATEGORY_BROWSABLE);
            intent.setData(Uri.parse("http://serc.strathmore.edu/"));
            startActivity(intent);
        }
    });
}
BookContentTextView.java 文件源码 项目:GitHub 阅读 35 收藏 0 点赞 0 评论 0
public void setText(String text) {
    int startIndex = 0;
    while (true) {

        int start = text.indexOf("《");
        int end = text.indexOf("》");
        if (start < 0 || end < 0) {
            append(text.substring(startIndex));
            break;
        }

        append(text.substring(startIndex, start));

        SpannableString spanableInfo = new SpannableString(text.substring(start, end + 1));
        spanableInfo.setSpan(new Clickable(spanableInfo.toString()), 0, end + 1 - start, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        append(spanableInfo);
        //setMovementMethod()该方法必须调用,否则点击事件不响应
        setMovementMethod(LinkMovementMethod.getInstance());
        text = text.substring(end + 1);

        LogUtils.e(spanableInfo.toString());
    }
}
MessageDialog.java 文件源码 项目:GitHub 阅读 67 收藏 0 点赞 0 评论 0
@SuppressLint("InflateParams")
@Override
public AlertDialog onCreateDialog(Bundle savedInstanceState) {
    View dialogView = LayoutInflater.from(getActivity())
            .inflate(R.layout.dialog_message, null);

    TextView messageView = (TextView) dialogView.findViewById(R.id.message);
    messageView.setMovementMethod(LinkMovementMethod.getInstance());
    messageView.setText(Html.fromHtml(getArguments().getString(ARG_MESSAGE)));

    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AppTheme_AlertDialog);
    builder.setTitle(getArguments().getString(ARG_TITLE))
            .setIcon(getArguments().getInt(ARG_ICON))
            .setView(dialogView)
            .setPositiveButton(R.string.OK, new OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            });

    return builder.create();
}
NestAdapter.java 文件源码 项目:GitHub 阅读 22 收藏 0 点赞 0 评论 0
@Override
protected void convert(BaseViewHolder helper, Status item) {
    helper.addOnClickListener(R.id.tweetText);
    switch (helper.getLayoutPosition()%
            3){
        case 0:
            helper.setImageResource(R.id.img,R.mipmap.animation_img1);
            break;
        case 1:
            helper.setImageResource(R.id.img,R.mipmap.animation_img2);
            break;
        case 2:
            helper.setImageResource(R.id.img,R.mipmap.animation_img3);
            break;
    }
    helper.setText(R.id.tweetName,"Hoteis in Rio de Janeiro");
    String msg="\"He was one of Australia's most of distinguished artistes, renowned for his portraits\"";
    ( (TextView)helper.getView(R.id.tweetText)).setText(SpannableStringUtils.getBuilder(msg).append("landscapes and nedes").setClickSpan(clickableSpan).create());
    ( (TextView)helper.getView(R.id.tweetText)).setMovementMethod(LinkMovementMethod.getInstance());
}
BottomSheetMessage.java 文件源码 项目:anitrend-app 阅读 21 收藏 0 点赞 0 评论 0
@Override
public void onStart() {
    super.onStart();
    mState.setOnClickListener(this);

    if(negative == 0)
        mNegative.setVisibility(View.GONE);
    else {
        mNegative.setOnClickListener(this);
        mNegative.setText(negative);
    }

    if(positive == 0)
        mPositive.setVisibility(View.GONE);
    else {
        mPositive.setOnClickListener(this);
        mPositive.setText(positive);
    }

    mTitle.setText(title);
    mText.setMovementMethod(LinkMovementMethod.getInstance());
    mText.setText(Html.fromHtml(getString(text)));
    if(bottomSheetBehavior.getState() != BottomSheetBehavior.STATE_EXPANDED)
        bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
}
SadTabViewFactory.java 文件源码 项目:chromium-for-android-56-debug-video 阅读 17 收藏 0 点赞 0 评论 0
/**
 * @param context Context of the resulting Sad Tab view.
 * @param suggestionAction Action to be executed when user clicks "try these suggestions".
 * @param reloadButtonAction Action to be executed when Reload button is pressed.
 *                           (e.g., refreshing the page)
 * @return A "Sad Tab" view instance which is used in place of a crashed renderer.
 */
public static View createSadTabView(
        Context context, final OnClickListener suggestionAction,
        OnClickListener reloadButtonAction) {
    // Inflate Sad tab and initialize.
    LayoutInflater inflater = (LayoutInflater) context.getSystemService(
            Context.LAYOUT_INFLATER_SERVICE);
    View sadTabView = inflater.inflate(R.layout.sad_tab, null);

    TextView messageText = (TextView) sadTabView.findViewById(R.id.sad_tab_message);
    messageText.setText(getHelpMessage(context, suggestionAction));
    messageText.setMovementMethod(LinkMovementMethod.getInstance());

    Button reloadButton = (Button) sadTabView.findViewById(R.id.sad_tab_reload_button);
    reloadButton.setOnClickListener(reloadButtonAction);

    return sadTabView;
}
ShareActivity.java 文件源码 项目:ultrasonic 阅读 34 收藏 0 点赞 0 评论 0
private void displayShareInfo(final Share share)
{
    final TextView textView = new TextView(this);
    textView.setPadding(5, 5, 5, 5);

    final Spannable message = new SpannableString("Owner: " + share.getUsername() +
            "\nComments: " + ((share.getDescription() == null) ? "" : share.getDescription()) +
            "\nURL: " + share.getUrl() +
            "\nEntry Count: " + share.getEntries().size() +
            "\nVisit Count: " + share.getVisitCount() +
            ((share.getCreated() == null) ? "" : ("\nCreation Date: " + share.getCreated().replace('T', ' '))) +
            ((share.getLastVisited() == null) ? "" : ("\nLast Visited Date: " + share.getLastVisited().replace('T', ' '))) +
            ((share.getExpires() == null) ? "" : ("\nExpiration Date: " + share.getExpires().replace('T', ' '))));

    Linkify.addLinks(message, Linkify.WEB_URLS);
    textView.setText(message);
    textView.setMovementMethod(LinkMovementMethod.getInstance());

    new AlertDialog.Builder(this).setTitle("Share Details").setCancelable(true).setIcon(android.R.drawable.ic_dialog_info).setView(textView).show();
}
MainActivity.java 文件源码 项目:IntroApp 阅读 15 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    findViewById(R.id.btn_play_again).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            PrefManager prefManager = new PrefManager(getApplicationContext());

            prefManager.setFirstTimeLaunch(true);

            startActivity(new Intent(MainActivity.this, WelcomeActivity.class));
            finish();
        }
    });

    TextView textView =(TextView)findViewById(R.id.textView);
    textView.setClickable(true);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    String text = "<a href='https://github.com/Kvaibhav01/IntroApp'> Star or Fork this project on GitHub </a>";
    textView.setText(Html.fromHtml(text));
}
AboutUsActivity.java 文件源码 项目:Password-Storage 阅读 31 收藏 0 点赞 0 评论 0
private void onClickURL(){
    MovementMethod contributors_descMovementMethod = contributors_desc.getMovementMethod();
    if ((contributors_descMovementMethod == null) || !(contributors_descMovementMethod instanceof LinkMovementMethod)) {
        if (contributors_desc.getLinksClickable()) {
            contributors_desc.setMovementMethod(LinkMovementMethod.getInstance());
        }
    }
    MovementMethod app_report_issues_descMovementMethod = app_report_issues_desc.getMovementMethod();
    if ((app_report_issues_descMovementMethod == null) || !(app_report_issues_descMovementMethod instanceof LinkMovementMethod)) {
        if (app_report_issues_desc.getLinksClickable()) {
            app_report_issues_desc.setMovementMethod(LinkMovementMethod.getInstance());
        }
    }
    MovementMethod app_license_info_descMovementMethod = app_license_info_desc.getMovementMethod();
    if ((app_license_info_descMovementMethod == null) || !(app_license_info_descMovementMethod instanceof LinkMovementMethod)) {
        if (app_license_info_desc.getLinksClickable()) {
            app_license_info_desc.setMovementMethod(LinkMovementMethod.getInstance());
        }
    }
}
VideoPreviewFragment.java 文件源码 项目:Phoenix-for-VK 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void displayVideoInfo(Video video) {
    if(nonNull(mRootView)){
        mRootView.findViewById(R.id.content).setVisibility(View.VISIBLE);
        mRootView.findViewById(R.id.loading_root).setVisibility(View.GONE);
    }

    safelySetText(mTitleText, video.getTitle());

    if(nonNull(mSubtitleText)){
        Spannable subtitle = OwnerLinkSpanFactory.withSpans(video.getDescription(), true, false, ownerLinkAdapter);

        mSubtitleText.setText(subtitle, TextView.BufferType.SPANNABLE);
        mSubtitleText.setMovementMethod(LinkMovementMethod.getInstance());
    }

    String imageUrl = video.getMaxResolutionPhoto();

    if (nonEmpty(imageUrl) && nonNull(mPreviewImage)) {
        PicassoInstance.with()
                .load(imageUrl)
                .into(mPreviewImage);
    }
}
AboutDialogFragment.java 文件源码 项目:dynamic-toasts 阅读 23 收藏 0 点赞 0 评论 0
@Override
protected @NonNull DynamicDialog onCustomiseDialog(@NonNull DynamicDialog alertDialog,
                                                   @Nullable Bundle savedInstanceState) {
    View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_about,
            new LinearLayout(getContext()), false);
    TextView message = view.findViewById(R.id.dialog_about_text);

    message.setText(Html.fromHtml(getString(R.string.about_content)
            .replace("\n", "<br/>")));
    message.setTextSize(TypedValue.COMPLEX_UNIT_SP, TEXT_SIZE);
    message.setLineSpacing(0f, 1.2f);
    message.setMovementMethod(LinkMovementMethod.getInstance());
    message.setLinkTextColor(ContextCompat.getColor(getContext(), R.color.colorPrimary));

    alertDialog.setView(view);
    return alertDialog;
}
PoemActivity.java 文件源码 项目:Sprog-App 阅读 26 收藏 0 点赞 0 评论 0
public void displayPost(CharSequence title, CharSequence author, CharSequence content,
                        String link) {
    View v = LayoutInflater.from(this).inflate(R.layout.post_row, mainlist, false);
    ((TextView) v.findViewById(R.id.title))
            .setText(title);
    ((TextView) v.findViewById(R.id.author)).setText(author);
    if (content != null || link != null) {
        ((TextView) v.findViewById(R.id.content))
                .setMovementMethod(LinkMovementMethod.getInstance());
        v.findViewById(R.id.content).setVisibility(View.VISIBLE);
        if (content != null) {
            ((TextView) v.findViewById(R.id.content)).setText(content);
        } else if (link != null) {
            ((TextView) v.findViewById(R.id.content))
                    .setText(Util.linkToSpan(link));
        }
    }
    mainlist.addView(v);
}
Utilities.java 文件源码 项目:FlickLauncher 阅读 22 收藏 0 点赞 0 评论 0
public static void upgradeToPROAlertDialog(Context context)
{
    AlertDialog builder =
            new AlertDialog.Builder(context, R.style.AlertDialogCustom).setTitle(context.getResources().getString(R.string.app_name))
                    .setCancelable(false)
                    .setIcon(R.mipmap.ic_launcher_home)
                    .setMessage(R.string.license_dialog_message_pro)
                    .setPositiveButton(context.getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int id) {
                            dialog.dismiss();
                        }
                    }).create();
    builder.show();
    ((TextView)builder.findViewById(android.R.id.message)).setMovementMethod(LinkMovementMethod.getInstance());
    ((TextView)builder.findViewById(android.R.id.message)).setGravity(Gravity.CENTER_VERTICAL);
    builder.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
}
VerifyIdentityActivity.java 文件源码 项目:PeSanKita-android 阅读 31 收藏 0 点赞 0 评论 0
private void setFingerprintViews(Fingerprint fingerprint) {
  String digits   = fingerprint.getDisplayableFingerprint().getDisplayText();
  int    partSize = digits.length() / codes.length;

  for (int i=0;i<codes.length;i++) {
    codes[i].setText(digits.substring(i * partSize, (i * partSize) + partSize));
  }

  byte[] qrCodeData   = fingerprint.getScannableFingerprint().getSerialized();
  String qrCodeString = new String(qrCodeData, Charset.forName("ISO-8859-1"));
  Bitmap qrCodeBitmap = QrCode.create(qrCodeString);

  qrCode.setImageBitmap(qrCodeBitmap);
  description.setText(Html.fromHtml(String.format(getActivity().getString(R.string.verify_display_fragment__if_you_wish_to_verify_the_security_of_your_end_to_end_encryption_with_s), recipient.toShortString())));
  description.setMovementMethod(LinkMovementMethod.getInstance());
}
AboutTheApp.java 文件源码 项目:JavaIsFun 阅读 21 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about_the_app);
    setTitle("Sobre o aplicativo");
    TextView link = (TextView) findViewById(R.id.linkGithub);
    String linkText = "<a href='https://github.com/jvbeltra/JavaIsFun'>Repositório Github</a>";
    link.setText(Html.fromHtml(linkText));
    link.setMovementMethod(LinkMovementMethod.getInstance());
    TextView link2 = (TextView) findViewById(R.id.linkSiteIF);
    String linkText2 = "<a href='http://ibirama.ifc.edu.br/'>IFC - Ibirama</a>";
    link2.setText(Html.fromHtml(linkText2));
    link2.setMovementMethod(LinkMovementMethod.getInstance());


}
CommentAdapter.java 文件源码 项目:anitrend-app 阅读 27 收藏 0 点赞 0 评论 0
ViewHolder(View view) {
    super(view);
    mLikesViewer = view.findViewById(R.id.likes_viewer);
    mPostContainer = view.findViewById(R.id.post_extra_holder);
    mFlipper = (ViewFlipper) view.findViewById(R.id.mFlipper);
    mAvatar = (ImageView) view.findViewById(R.id.post_avatar);
    mPostExtra = (ImageView) view.findViewById(R.id.post_extra_img);
    mTime = (TextView) view.findViewById(R.id.post_time);
    mUsername = (TextView) view.findViewById(R.id.post_user_name);
    mContent = (TextView) view.findViewById(R.id.post_text);
    mLike = (TextView) view.findViewById(R.id.post_like);
    mReply = (TextView) view.findViewById(R.id.post_reply);
    mEdit = (TextView) view.findViewById(R.id.post_edit);
    mDelete = (TextView) view.findViewById(R.id.post_delete);
    mGallery = (TextView) view.findViewById(R.id.post_extra_img_gallery) ;
    mContent.setMovementMethod(LinkMovementMethod.getInstance());
    mContent.setFocusable(false);
    mLikesViewer.setOnClickListener(this);
    mFlipper.setOnClickListener(this);
    mReply.setOnClickListener(this);
    mEdit.setOnClickListener(this);
    mDelete.setOnClickListener(this);
    mAvatar.setOnClickListener(this);
    mPostExtra.setOnClickListener(this);
    mGallery.setOnClickListener(this);
}
AppUtils.java 文件源码 项目:Ghost-Android 阅读 29 收藏 0 点赞 0 评论 0
public static void setHtmlWithLinkClickHandler(TextView tv, String html,
                                        Action1<String> linkClickHandler) {
    CharSequence sequence = Html.fromHtml(html);
    SpannableStringBuilder strBuilder = new SpannableStringBuilder(sequence);
    URLSpan[] urls = strBuilder.getSpans(0, sequence.length(), URLSpan.class);
    for (URLSpan span : urls) {
        int start = strBuilder.getSpanStart(span);
        int end = strBuilder.getSpanEnd(span);
        int flags = strBuilder.getSpanFlags(span);
        ClickableSpan clickable = new ClickableSpan() {
            public void onClick(View view) {
                linkClickHandler.call(span.getURL());
            }
        };
        strBuilder.setSpan(clickable, start, end, flags);
        strBuilder.removeSpan(span);
    }
    tv.setText(strBuilder);
    tv.setMovementMethod(LinkMovementMethod.getInstance());
}
AboutActivity.java 文件源码 项目:homebank_android 阅读 22 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);


    TextView t2 = (TextView) findViewById(R.id.hb);
    t2.setMovementMethod(LinkMovementMethod.getInstance());

    TextView t1 = (TextView) findViewById(R.id.help);
    t1.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setData(Uri.parse("market://details?id=" + getApplicationContext().getPackageName()));
            startActivity(intent);
        }
    });
    t1.setMovementMethod(LinkMovementMethod.getInstance());
}
CheckDozeActivity.java 文件源码 项目:MiPushFramework 阅读 22 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (PushServiceAccessibility.isInDozeWhiteList(this)) {
        nextPage();
        finish();
        return;
    }
    SetupWizardLayout layout = new SetupWizardLayout(this);
    layout.getNavigationBar()
            .setNavigationBarListener(this);
    TextView textView = new TextView(this);
    textView.setText(Html.fromHtml(getString(R.string.wizard_descr_doze_whitelist)));
    int padding = (int) getResources().getDimension(R.dimen.suw_glif_margin_sides);
    textView.setPadding(padding, padding, padding, padding);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    layout.addView(textView);
    layout.setHeaderText(R.string.wizard_title_doze_whitelist);
    setContentView(layout);
}
FinishWizardActivity.java 文件源码 项目:MiPushFramework 阅读 21 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    WizardSPUtils.setShouldShowWizard(false, this);
    SetupWizardLayout layout = new SetupWizardLayout(this);
    layout.getNavigationBar()
            .setNavigationBarListener(this);
    layout.getNavigationBar().getBackButton().setVisibility(View.GONE);
    TextView textView = new TextView(this);
    textView.setText(Html.fromHtml(getString(R.string.wizard_descr_finish)));
    int padding = (int) getResources().getDimension(R.dimen.suw_glif_margin_sides);
    textView.setPadding(padding, padding, padding, padding);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    layout.addView(textView);
    layout.setHeaderText(R.string.app_name);
    setContentView(layout);
}
WelcomeActivity.java 文件源码 项目:MiPushFramework 阅读 34 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!WizardSPUtils.shouldShowWizard(this)) {
        startActivity (new Intent(this,
                MainActivity.class));
        finish();
        return;
    }
    SetupWizardLayout layout = new SetupWizardLayout(this);
    layout.getNavigationBar()
            .setNavigationBarListener(this);
    TextView textView = new TextView(this);
    textView.setText(Html.fromHtml(getString(R.string.wizard_descr)));
    int padding = (int) getResources().getDimension(R.dimen.suw_glif_margin_sides);
    textView.setPadding(padding, padding, padding, padding);
    textView.setMovementMethod(LinkMovementMethod.getInstance());
    layout.addView(textView);
    layout.setHeaderText(R.string.app_name);
    setContentView(layout);
}
ChatRoomMsgViewHolderBaseText.java 文件源码 项目:decoy 阅读 22 收藏 0 点赞 0 评论 0
@Override
protected void bindContentView() {
    layoutDirection();

    TextView bodyTextView = findViewById(R.id.nim_message_item_text_body);
    bodyTextView.setTextColor(isReceivedMessage() ? Color.BLACK : Color.WHITE);
    bodyTextView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            onItemClick();
        }
    });
    MoonUtil.identifyFaceExpression(NimUIKit.getContext(), bodyTextView, getDisplayText(), ImageSpan.ALIGN_BOTTOM);
    bodyTextView.setMovementMethod(LinkMovementMethod.getInstance());
    bodyTextView.setOnLongClickListener(longClickListener);
}
TweetQueueAdapter.java 文件源码 项目:OSchina_resources_android 阅读 24 收藏 0 点赞 0 评论 0
@SuppressWarnings("unused")
public void bind(int position, TweetPublishModel model, RequestManager loader) {
    itemView.setTag(model);

    Context context = itemView.getContext();

    Spannable spannable = TweetParser.getInstance().parse(context, model.getContent());
    mTitle.setText(spannable);
    mTitle.setMovementMethod(LinkMovementMethod.getInstance());
    mTitle.setFocusable(false);
    mTitle.setDispatchToParent(true);
    mTitle.setLongClickable(false);

    mLog.setText(String.format("Error:%s.",
            model.getErrorString() == null ? "null" : model.getErrorString()));
    mDate.setText(FORMAT.format(new Date(model.getDate())));
}
InfoFragment.java 文件源码 项目:puremadrid 阅读 25 收藏 0 点赞 0 评论 0
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);

    // Set the text view as the activity layout
    View view = inflater.inflate(R.layout.fragment_info, container, false);
    this.view = view;

    //Set actions for buttons
    Button button_calaire = view.findViewById(R.id.link_calaire);
    Button button_rateus = view.findViewById(R.id.link_google_play);
    Button button_facebook = view.findViewById(R.id.link_facebook);

    button_calaire.setOnClickListener(this);
    button_rateus.setOnClickListener(this);
    button_facebook.setOnClickListener(this);

    TextView textAppDdisenada = view.findViewById(R.id.text_app_disenada);
    textAppDdisenada.setMovementMethod(LinkMovementMethod.getInstance());

    return view;
}
AboutUtils.java 文件源码 项目:iosched-reader 阅读 32 收藏 0 点赞 0 评论 0
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    int padding = getResources().getDimensionPixelSize(R.dimen.content_padding_dialog);

    TextView eulaTextView = new TextView(getActivity());
    eulaTextView.setText(Html.fromHtml(getString(R.string.eula_legal_text)));
    eulaTextView.setMovementMethod(LinkMovementMethod.getInstance());
    eulaTextView.setPadding(padding, padding, padding, padding);

    return new AlertDialog.Builder(getActivity())
            .setTitle(R.string.about_eula)
            .setView(eulaTextView)
            .setPositiveButton(R.string.ok,
                    new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int whichButton) {
                            dialog.dismiss();
                        }
                    }
            )
            .create();
}
WebRtcCallScreen.java 文件源码 项目:Cable-Android 阅读 25 收藏 0 点赞 0 评论 0
public void setUntrustedIdentity(Recipient personInfo, IdentityKey untrustedIdentity) {
  String          name            = recipient.toShortString();
  String          introduction    = String.format(getContext().getString(R.string.WebRtcCallScreen_new_safety_numbers), name, name);
  SpannableString spannableString = new SpannableString(introduction + " " + getContext().getString(R.string.WebRtcCallScreen_you_may_wish_to_verify_this_contact));

  spannableString.setSpan(new VerifySpan(getContext(), personInfo.getRecipientId(), untrustedIdentity),
                          introduction.length()+1, spannableString.length(),
                          Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

  setPersonInfo(personInfo);

  this.incomingCallOverlay.setActiveCall();
  this.status.setText(R.string.WebRtcCallScreen_new_safety_number_title);
  this.untrustedIdentityContainer.setVisibility(View.VISIBLE);
  this.untrustedIdentityExplanation.setText(spannableString);
  this.untrustedIdentityExplanation.setMovementMethod(LinkMovementMethod.getInstance());

  this.endCallButton.setVisibility(View.INVISIBLE);
}
MainActivity.java 文件源码 项目:AndroidIRCLogViewer 阅读 13 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    mTextMessage = (TextView) findViewById(R.id.message);
    mTextMessage.setLinksClickable(true);
    mTextMessage.setMovementMethod(LinkMovementMethod.getInstance());
    BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
    navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);

    final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
    baseUrl = preferences.getString("base_url", null);
    nickname = preferences.getString("nickname", null);

    loadLog();
}
AboutActivity.java 文件源码 项目:Show_Chat 阅读 37 收藏 0 点赞 0 评论 0
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_about);
    ButterKnife.bind(this);
    setupToolbar();

    MovementMethod movementMethod = LinkMovementMethod.getInstance();

    versionTextView.setText(getVersionName());
    appInfoTextView.setText(StringUtils.fromHtml(getString(R.string.about_app_info)));
    appInfoTextView.setMovementMethod(movementMethod);
    librariesTextView.setText(StringUtils.fromHtml(getString(R.string.about_libraries_text)));
    librariesTextView.setMovementMethod(movementMethod);
    licenseTextView.setText(StringUtils.fromHtml(getString(R.string.about_license_text)));
    licenseTextView.setMovementMethod(movementMethod);
}


问题


面经


文章

微信
公众号

扫码关注公众号