Skip to content
This repository was archived by the owner on Jul 2, 2022. It is now read-only.

Commit 02cdf14

Browse files
committed
Larger fonts & improved Issue View body & comment entrence
1 parent edd6750 commit 02cdf14

4 files changed

Lines changed: 42 additions & 39 deletions

File tree

CodeHub.iOS/Views/Issues/IssueView.cs

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
namespace CodeHub.iOS.Views.Issues
1414
{
15-
public class IssueView : ViewModelDrivenDialogViewController
15+
public class IssueView : ViewModelDrivenDialogViewController
1616
{
17-
protected readonly HeaderView _header;
17+
protected HeaderView _header;
1818
protected WebElement _descriptionElement;
19-
protected WebElement2 _commentsElement;
19+
protected WebElement _commentsElement;
2020
protected StyledStringElement _milestoneElement;
2121
protected StyledStringElement _assigneeElement;
2222
protected StyledStringElement _labelsElement;
@@ -30,21 +30,24 @@ public class IssueView : ViewModelDrivenDialogViewController
3030

3131
public IssueView()
3232
{
33-
Root.UnevenRows = true;
34-
_header = new HeaderView();
33+
Root.UnevenRows = true;
3534
}
3635

3736
public override void ViewDidLoad()
3837
{
3938
base.ViewDidLoad();
4039

41-
var content = System.IO.File.ReadAllText("WebCell/body.html", System.Text.Encoding.UTF8);
42-
_descriptionElement = new WebElement(content);
43-
_descriptionElement.UrlRequested = ViewModel.GoToUrlCommand.Execute;
40+
_header = new HeaderView();
4441

45-
var content2 = System.IO.File.ReadAllText("WebCell/comments.html", System.Text.Encoding.UTF8);
46-
_commentsElement = new WebElement2(content2);
47-
_commentsElement.UrlRequested = ViewModel.GoToUrlCommand.Execute;
42+
var content = System.IO.File.ReadAllText("WebCell/body.html", System.Text.Encoding.UTF8);
43+
_descriptionElement = new WebElement(content, "body", false);
44+
_descriptionElement.UrlRequested = ViewModel.GoToUrlCommand.Execute;
45+
//_descriptionElement.HeightChanged = x => Render();
46+
47+
var content2 = System.IO.File.ReadAllText("WebCell/comments.html", System.Text.Encoding.UTF8);
48+
_commentsElement = new WebElement(content2, "comments", true);
49+
_commentsElement.UrlRequested = ViewModel.GoToUrlCommand.Execute;
50+
//_commentsElement.HeightChanged = x => Render();
4851

4952
_milestoneElement = new StyledStringElement("Milestone", "No Milestone", UITableViewCellStyle.Value1) {Image = Images.Milestone, Accessory = UITableViewCellAccessory.DisclosureIndicator};
5053
_milestoneElement.Tapped += () => ViewModel.GoToMilestoneCommand.Execute(null);
@@ -58,7 +61,7 @@ public override void ViewDidLoad()
5861
_addCommentElement = new StyledStringElement("Add Comment") { Image = Images.Pencil };
5962
_addCommentElement.Tapped += AddCommentTapped;
6063

61-
NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Compose, (s, e) => ViewModel.GoToEditCommand.Execute(null));
64+
NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Compose, (s, e) => ViewModel.GoToEditCommand.Execute(null));
6265
NavigationItem.RightBarButtonItem.Enabled = false;
6366
ViewModel.Bind(x => x.IsLoading, x =>
6467
{
@@ -141,11 +144,11 @@ public void RenderComments()
141144
});
142145
var data = s.Serialize(comments);
143146

144-
InvokeOnMainThread(() => {
147+
InvokeOnMainThread(() => {
145148
_commentsElement.Value = !comments.Any() ? string.Empty : data;
146-
if (_commentsElement.GetImmediateRootElement() == null)
149+
if (_commentsElement.GetImmediateRootElement() == null)
147150
Render();
148-
});
151+
});
149152
}
150153

151154
protected virtual void Render()
@@ -155,19 +158,19 @@ protected virtual void Render()
155158
return;
156159

157160
var root = new RootElement(Title);
158-
root.Add(new Section(_header));
161+
root.Add(new Section(_header));
159162

160-
var secDetails = new Section();
163+
var secDetails = new Section();
161164
if (!string.IsNullOrEmpty(_descriptionElement.Value))
162165
secDetails.Add(_descriptionElement);
163166

164167
secDetails.Add(_assigneeElement);
165168
secDetails.Add(_milestoneElement);
166169
secDetails.Add(_labelsElement);
167-
root.Add(secDetails);
170+
root.Add(secDetails);
168171

169172
if (!string.IsNullOrEmpty(_commentsElement.Value))
170-
root.Add(new Section { _commentsElement });
173+
root.Add(new Section { _commentsElement });
171174

172175
root.Add(new Section { _addCommentElement });
173176
Root = root;
@@ -176,21 +179,21 @@ protected virtual void Render()
176179
void AddCommentTapped()
177180
{
178181
var composer = new MarkdownComposerViewController();
179-
composer.NewComment(this, async (text) => {
180-
try
181-
{
182-
await composer.DoWorkAsync("Commenting...".t(), () => ViewModel.AddComment(text));
183-
composer.CloseComposer();
184-
}
185-
catch (Exception e)
186-
{
187-
MonoTouch.Utilities.ShowAlert("Unable to post comment!", e.Message);
188-
}
189-
finally
190-
{
191-
composer.EnableSendButton = true;
192-
}
193-
});
182+
composer.NewComment(this, async (text) => {
183+
try
184+
{
185+
await composer.DoWorkAsync("Commenting...".t(), () => ViewModel.AddComment(text));
186+
composer.CloseComposer();
187+
}
188+
catch (Exception e)
189+
{
190+
MonoTouch.Utilities.ShowAlert("Unable to post comment!", e.Message);
191+
}
192+
finally
193+
{
194+
composer.EnableSendButton = true;
195+
}
196+
});
194197
}
195198

196199
public override UIView InputAccessoryView

CodeHub.iOS/WebCell/body.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<style type="text/css">
44
* {
55
font-family: Helvetica;
6-
font-size: 12px;
6+
font-size: 13px;
77
-webkit-touch-callout: none;
88
-webkit-user-select: none;
99
}

CodeHub.iOS/WebCell/comments.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
-webkit-touch-callout: none;
1919
-webkit-user-select: none;
2020
font-family: Helvetica;
21-
font-size: 12px;
21+
font-size: 13px;
2222
}
2323

2424
body{
2525
font-family: Helvetica;
26-
font-size: 12px;
26+
font-size: 13px;
2727
margin: 0px;
2828
}
2929

@@ -58,7 +58,7 @@
5858
}
5959

6060
.comment > div > span {
61-
font-size: 10px;
61+
font-size: 11px;
6262
margin: 0;
6363
color: #404040;
6464
white-space: nowrap;

0 commit comments

Comments
 (0)