public AlbumView(Context context) {
      super(context);

      imageView = new BackupImageView(context);
      addView(
          imageView,
          LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));

      LinearLayout linearLayout = new LinearLayout(context);
      linearLayout.setOrientation(LinearLayout.HORIZONTAL);
      linearLayout.setBackgroundColor(0x7f000000);
      addView(
          linearLayout,
          LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 28, Gravity.LEFT | Gravity.BOTTOM));

      nameTextView = new TextView(context);
      nameTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13);
      nameTextView.setTextColor(0xffffffff);
      nameTextView.setSingleLine(true);
      nameTextView.setEllipsize(TextUtils.TruncateAt.END);
      nameTextView.setMaxLines(1);
      nameTextView.setGravity(Gravity.CENTER_VERTICAL);
      linearLayout.addView(
          nameTextView, LayoutHelper.createLinear(0, LayoutHelper.MATCH_PARENT, 1.0f, 8, 0, 0, 0));

      countTextView = new TextView(context);
      countTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13);
      countTextView.setTextColor(0xffaaaaaa);
      countTextView.setSingleLine(true);
      countTextView.setEllipsize(TextUtils.TruncateAt.END);
      countTextView.setMaxLines(1);
      countTextView.setGravity(Gravity.CENTER_VERTICAL);
      linearLayout.addView(
          countTextView,
          LayoutHelper.createLinear(
              LayoutHelper.WRAP_CONTENT, LayoutHelper.MATCH_PARENT, 4, 0, 4, 0));

      selector = new View(context);
      selector.setBackgroundResource(R.drawable.list_selector);
      addView(
          selector, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
    }
  @Override
  public View createView(Context context) {
    actionBar.setBackButtonImage(R.drawable.ic_ab_back);
    actionBar.setAllowOverlayTitle(true);
    actionBar.setTitle(LocaleController.getString("EncryptionKey", R.string.EncryptionKey));

    actionBar.setActionBarMenuOnItemClick(
        new ActionBar.ActionBarMenuOnItemClick() {
          @Override
          public void onItemClick(int id) {
            if (id == -1) {
              finishFragment();
            }
          }
        });

    fragmentView = new LinearLayout(context);
    LinearLayout linearLayout = (LinearLayout) fragmentView;
    linearLayout.setOrientation(LinearLayout.VERTICAL);
    linearLayout.setWeightSum(100);
    linearLayout.setBackgroundColor(0xfff0f0f0);
    fragmentView.setOnTouchListener(
        new View.OnTouchListener() {
          @Override
          public boolean onTouch(View v, MotionEvent event) {
            return true;
          }
        });

    FrameLayout frameLayout = new FrameLayout(context);
    frameLayout.setPadding(
        AndroidUtilities.dp(20),
        AndroidUtilities.dp(20),
        AndroidUtilities.dp(20),
        AndroidUtilities.dp(20));
    linearLayout.addView(
        frameLayout,
        LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, 50.0f));

    ImageView identiconView = new ImageView(context);
    identiconView.setScaleType(ImageView.ScaleType.FIT_XY);
    frameLayout.addView(
        identiconView,
        LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));

    frameLayout = new FrameLayout(context);
    frameLayout.setBackgroundColor(0xffffffff);
    frameLayout.setPadding(
        AndroidUtilities.dp(10), 0, AndroidUtilities.dp(10), AndroidUtilities.dp(10));
    linearLayout.addView(
        frameLayout,
        LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, 50.0f));

    TextView textView = new TextView(context);
    textView.setTextColor(0xff7f7f7f);
    textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 16);
    textView.setLinksClickable(true);
    textView.setClickable(true);
    textView.setMovementMethod(new LinkMovementMethodMy());
    // textView.setAutoLinkMask(Linkify.WEB_URLS);
    textView.setLinkTextColor(0xff316f9f);
    textView.setGravity(Gravity.CENTER);
    frameLayout.addView(
        textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));

    TLRPC.EncryptedChat encryptedChat = MessagesController.getInstance().getEncryptedChat(chat_id);
    if (encryptedChat != null) {
      IdenticonDrawable drawable = new IdenticonDrawable();
      identiconView.setImageDrawable(drawable);
      drawable.setEncryptedChat(encryptedChat);
      TLRPC.User user = MessagesController.getInstance().getUser(encryptedChat.user_id);
      SpannableStringBuilder hash = new SpannableStringBuilder();
      if (encryptedChat.key_hash.length > 16) {
        String hex = Utilities.bytesToHex(encryptedChat.key_hash);
        for (int a = 0; a < 32; a++) {
          if (a != 0) {
            if (a % 8 == 0) {
              hash.append('\n');
            } else if (a % 4 == 0) {
              hash.append(' ');
            }
          }
          hash.append(hex.substring(a * 2, a * 2 + 2));
          hash.append(' ');
        }
        hash.append("\n\n");
      }
      hash.append(
          AndroidUtilities.replaceTags(
              LocaleController.formatString(
                  "EncryptionKeyDescription",
                  R.string.EncryptionKeyDescription,
                  user.first_name,
                  user.first_name)));
      final String url = "telegram.org";
      int index = hash.toString().indexOf(url);
      if (index != -1) {
        hash.setSpan(
            new URLSpanReplacement(
                LocaleController.getString("EncryptionKeyLink", R.string.EncryptionKeyLink)),
            index,
            index + url.length(),
            Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
      }
      textView.setText(hash);
    }

    return fragmentView;
  }