@Override protected void initComponents(Context context) { super.initComponents(context); LU.setPadding(this, 20, 0, 20, 20); LU.setMargin(mTalkEdit, 30, 0, 30, 0); LU.setMargin(mBtnSend, 30, 0, 0, 0); mShareText = new TextView(context); mShareIcon = new ImageView(context); addView(mShareText); addView(mShareIcon, LP.lp(DimensionUtil.w(45), DimensionUtil.w(45))); LU.setMargin(mShareIcon, 20, 0, 0, 0); }
public StarNewsView(Context context) { super(context); mTitle = new TextView(context); mImage = new ImageView(context); mContent = new TextView(context); mSendMessageView = new SendMessageView(context); mTitle.setGravity(Gravity.CENTER); mContainer = new LinearLayout(context); mContainer.setOrientation(LinearLayout.VERTICAL); mContainer.setGravity(Gravity.CENTER_HORIZONTAL); mContainer.addView(mTitle); mContainer.addView(mImage, LP.lp(LinearLayout.LayoutParams.MATCH_PARENT, DimensionUtil.h(200))); mContainer.addView(mContent); mContainer.addView(mSendMessageView); mSendMessageView.setDelegate(mDelegate); addView(mContainer); onLanguageChanged(); onThemeChanged(); }