예제 #1
0
  public static TextContentView create(
      LayoutInflater inflater, ViewGroup parent, boolean encryptionPlaceholder) {
    TextContentView view =
        (TextContentView) inflater.inflate(R.layout.message_content_text, parent, false);
    view.mEncryptionPlaceholder = encryptionPlaceholder;

    return view;
  }
예제 #2
0
  /**
   * Return a new Message instance from the global pool. Allows us to avoid allocating new objects
   * in many cases. Inspired by {@link android.os.Message}.
   *
   * @param encryptionPlaceholder true if the whole message is encrypted and this is a placeholder.
   */
  public static TextContentView obtain(
      LayoutInflater inflater, ViewGroup parent, boolean encryptionPlaceholder) {
    synchronized (sPoolSync) {
      if (sPool != null) {
        TextContentView m = sPool;
        sPool = m.next;
        m.next = null;
        sPoolSize--;
        // m.mContext = context;
        m.mEncryptionPlaceholder = encryptionPlaceholder;
        return m;
      }
    }

    return create(inflater, parent, encryptionPlaceholder);
  }