Home | History | Annotate | Download | only in text
      1 package com.android.mail.text;
      2 
      3 import android.text.TextPaint;
      4 import android.text.style.ClickableSpan;
      5 import android.view.View;
      6 
      7 import com.android.mail.browse.ConversationViewHeader.ConversationViewHeaderCallbacks;
      8 
      9 /**
     10  * A custom span that enables the labels to be clickable in the conversation
     11  * header while still allowing the subject to be selectable.
     12  */
     13 public class ChangeLabelsSpan extends ClickableSpan {
     14 
     15     private final ConversationViewHeaderCallbacks mCallbacks;
     16 
     17     public ChangeLabelsSpan(ConversationViewHeaderCallbacks callbacks) {
     18         mCallbacks = callbacks;
     19     }
     20 
     21     @Override
     22     public void onClick(View widget) {
     23         if (mCallbacks != null) {
     24             mCallbacks.onFoldersClicked();
     25         }
     26     }
     27 
     28     @Override
     29     public void updateDrawState(TextPaint ds) {
     30         // DO NOTHING
     31     }
     32 }
     33