private void CreateResultSection(LinearLayout mainLayout) { this.m_resultText = new TextView(this); this.m_resultText.LayoutParameters = LayoutParams.ForLL(margin: 7, marginBottom: 24); this.m_resultText.SetTextSize(ComplexUnitType.Px, GetPreferredListItemHeight() / 4); this.m_resultText.SetPadding(5, 2, 5, 2); this.m_resultText.SetBackgroundColor(new Color(35, 35, 35)); mainLayout.AddView(this.m_resultText); }
protected override View CreateHeaderView() { this.m_headerView = new ResultListItemView(this); this.m_headerView.LayoutParameters = LayoutParams.ForLL(marginBottom: 10); this.m_headerView.SetIcon(this.IconOutcomeError); this.m_headerView.SetBackgroundColor(new Color(110, 3, 15)); this.m_headerView.Clickable = true; this.m_headerView.Click += OnHeaderClick; this.m_headerView.Visibility = ViewStates.Gone; return(this.m_headerView); }
private void CreateHeaderSection(LinearLayout mainLayout) { LinearLayout headerLayout = new LinearLayout(this); headerLayout.Orientation = Orientation.Horizontal; headerLayout.LayoutParameters = LayoutParams.ForLL(marginBottom: 24); this.m_outcomeIcon = new ImageView(this); this.m_outcomeIcon.SetAdjustViewBounds(true); this.m_outcomeIcon.LayoutParameters = LayoutParams.ForLL(width: LayoutParams.WrapContent, margin: 7, gravity: GravityFlags.Top | GravityFlags.CenterHorizontal); this.m_outcomeIcon.SetMinimumHeight(GetPreferredListItemHeight() / 2); this.m_outcomeIcon.SetMaxHeight(GetPreferredListItemHeight() / 2); headerLayout.AddView(this.m_outcomeIcon); this.m_headerText = new TextView(this); this.m_headerText.LayoutParameters = LayoutParams.ForLL(); this.m_headerText.SetTextSize(ComplexUnitType.Px, GetPreferredListItemHeight() / 4); headerLayout.AddView(this.m_headerText); mainLayout.AddView(headerLayout); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); this.IconOutcomePassed = GetDrawable(this.m_iconFileNamePrefix + "outcome_passed.png"); this.IconOutcomeError = GetDrawable(this.m_iconFileNamePrefix + "outcome_error.png"); this.IconOutcomeInconclusive = GetDrawable(this.m_iconFileNamePrefix + "outcome_inconclusive.png"); LinearLayout mainLayout = new LinearLayout(this); mainLayout.Orientation = Orientation.Vertical; this.ResultBar = new ResultBarView(this); this.ResultBar.LayoutParameters = LayoutParams.ForLL(height: RESULT_BAR_HEIGHT); mainLayout.AddView(this.ResultBar); View mainView = CreateMainView(); mainView.LayoutParameters = LayoutParams.ForLL(); mainLayout.AddView(mainView); SetContentView(mainLayout); }
private void CreateStackTraceSection(LinearLayout mainLayout) { this.m_stackTraceInfo = new LinearLayout(this); this.m_stackTraceInfo.Orientation = Orientation.Vertical; this.m_stackTraceInfo.LayoutParameters = LayoutParams.ForLL(weight: 1); Button logButton = new Button(this); logButton.Text = "Dump exception to logcat"; logButton.Click += (s, e) => DumpStackTrace(); logButton.LayoutParameters = LayoutParams.ForLL(); this.m_stackTraceInfo.AddView(logButton); if (!AreLineNumbersAvailable()) { TextView noteText = new TextView(this); noteText.LayoutParameters = LayoutParams.ForLL(margin: 7, marginTop: 0); noteText.TextFormatted = Html.FromHtml("<b>Line numbers are unavailable because no debugger is attached."); noteText.SetPadding(5, 2, 5, 2); noteText.Gravity = GravityFlags.Center; noteText.SetBackgroundColor(new Color(110, 3, 15)); this.m_stackTraceInfo.AddView(noteText); } this.m_stackTraceText = new TextView(this); this.m_stackTraceText.Typeface = Typeface.Monospace; this.m_stackTraceText.SetTextSize(ComplexUnitType.Px, GetPreferredListItemHeight() / 6); this.m_stackTraceText.LayoutParameters = LayoutParams.ForLL(weight: 1); this.m_stackTraceText.VerticalScrollBarEnabled = true; this.m_stackTraceText.MovementMethod = new ScrollingMovementMethod(); // Necessary so that the text color doesn't get darkened when scrolling the text view this.m_stackTraceText.SetTextColor(Color.White); this.m_stackTraceInfo.AddView(this.m_stackTraceText); mainLayout.AddView(this.m_stackTraceInfo); }