/*
* This is the source code of Telegram for Android v. 3.x.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2017.
*/
package org.telegram.ui.Cells;
import android.content.Context;
import android.graphics.Color;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import org.telegram.messenger.AndroidUtilities;
import org.telegram.ui.ActionBar.Theme;
public class LetterSectionCell extends FrameLayout {
private TextView textView;
public LetterSectionCell(Context context) {
super(context);
//这个页面的代码注释应该比较完全吧,还是会显示一块空白
// setLayoutParams(new ViewGroup.LayoutParams(AndroidUtilities.dp(54), AndroidUtilities.dp(64)));
setLayoutParams(new ViewGroup.LayoutParams(0,0));
setBackgroundColor(Color.RED);
setVisibility(GONE);
textView = new TextView(getContext());
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 22);
textView.setTypeface(AndroidUtilities.getTypeface("fonts/rmedium.ttf"));
textView.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteGrayText4));
textView.setGravity(Gravity.CENTER);
// addView(textView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
}
public void setLetter(String letter) {
// textView.setText(letter.toUpperCase());
textView.setText("");
textView.setVisibility(GONE);
}
public void setCellHeight(int height) {
// setLayoutParams(new ViewGroup.LayoutParams(AndroidUtilities.dp(54), height));
setLayoutParams(new ViewGroup.LayoutParams(0, 0));
}
}