private RelativeLayout getRelativeContainer(View topView) { LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); if (topView == null) { params.addRule(ALIGN_PARENT_TOP); } else { params.addRule(BELOW, topView.getId()); } RelativeLayout v = new RelativeLayout(getContext()); v.setId(RandomId.get()); v.setLayoutParams(params); v.setPadding( ruler.getW(designSpec.getPadding().getLeftRightOne()), ruler.getW(designSpec.getPadding().getLeftRightOne()), ruler.getW(designSpec.getPadding().getTopBottomOne()), 0); return v; }
protected RelativeLayout numberBoard(View topView) { LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); params.addRule(BELOW, topView.getId()); RelativeLayout v = new RelativeLayout(getContext()); v.setId(RandomId.get()); v.setLayoutParams(params); v.setPadding(0, ruler.getW(designSpec.getPadding().getTopBottomOne()), 0, 0); return v; }
public NotificationItem(Context context) { super(context); ruler = new WH(getContext()); borderColor = ColorTable._D9D9D9; statusBarWidth = ruler.getW(3); statusBarColor = Color.BLACK; statusConstant = new CephNotificationConstant.StatusConstant(getContext()); this.designSpec = ThemeManager.getStyle(context); messageTextStyle = new TextViewStyle(designSpec.getStyle().getBodyOne()); triggeredTextStyle = new TextViewStyle(designSpec.getStyle().getNote()); statusTextStyle = new TextViewStyle(designSpec.getStyle().getNote()); backgroundColor = designSpec.getPrimaryColors().getBackgroundThree(); topBottomPaddingOne = ruler.getW(designSpec.getPadding().getTopBottomOne()); leftRightPaddingOne = ruler.getW(designSpec.getPadding().getLeftRightOne()); stateIconSize = ruler.getW(designSpec.getIconSize().getSubhead()); setViewBackgroundColor(backgroundColor); setViewPadding( leftRightPaddingOne, topBottomPaddingOne, leftRightPaddingOne, topBottomPaddingOne); setStatusBarWidth(statusBarWidth); setStatusBarColor(statusBarColor); setBorderColor(borderColor); setBorderWidth(3); setRadius(10); message = message(); bottomContainer = bottomContainer(message); statusIcon = statusIcon(); status = status(statusIcon); triggerTime = triggerTime(status); addView(message); addView(bottomContainer); bottomContainer.addView(statusIcon); bottomContainer.addView(status); bottomContainer.addView(triggerTime); }
private TextView getNumberButton(int resourceText, int number) { LayoutParams params = new LayoutParams(ruler.getW(31), ruler.getW(23)); StateListDrawable states = new StateListDrawable(); states.addState( new int[] {android.R.attr.state_pressed}, new ColorDrawable(ColorTable._D5D5D5)); states.addState( new int[] {android.R.attr.state_focused}, new ColorDrawable(ColorTable._D5D5D5)); states.addState( new int[] {}, new ColorDrawable(designSpec.getPrimaryColors().getBackgroundOne())); TextView v = new TextView(getContext()); v.setId(RandomId.get()); v.setLayoutParams(params); v.setBackground(states); v.setGravity(Gravity.CENTER); v.setText(resourceText); v.setTag(number); v.setTextColor(ColorTable._666666); styleLargeButton.style(v); return v; }