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

Commit 00bef5a

Browse files
committed
Fixed themeing & video upload prevention.
1 parent 70e0340 commit 00bef5a

4 files changed

Lines changed: 18 additions & 23 deletions

File tree

CodeHub.iOS/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@
6868
</dict>
6969
</array>
7070
<key>CFBundleVersion</key>
71-
<string>1</string>
71+
<string>3</string>
7272
</dict>
7373
</plist>

CodeHub.iOS/RELEASE-NOTES.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
- Fixed crash issue
2-
- Improved issue comments & pull request comments (now will event statues)
3-
- Enabled Push Notifications for all Beta users (Enable it in the settings)
1+
- Better error messages
2+
- Comments can now be viewed in markdown before posting
3+
- You can now upload images!!!
4+
- Input accessory view for quick access to markdown characters when commenting.

CodeHub.iOS/Theme.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static void Setup()
3636
UserVoice.UVStyleSheet.Instance.NavigationBarTextColor = UIColor.White;
3737

3838
UISegmentedControl.Appearance.TintColor = UIColor.FromRGB(110, 110, 117);
39-
UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationController)).TintColor = UIColor.White;
39+
UISegmentedControl.AppearanceWhenContainedIn(typeof(UINavigationBar)).TintColor = UIColor.White;
4040

4141
// Composer Input Accessory Buttons
4242
UIButton.AppearanceWhenContainedIn(typeof(UIScrollView)).TintColor = UIColor.FromRGB(50, 50, 50);

CodeHub.iOS/ViewControllers/MarkdownComposerViewController.cs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.IO;
1111
using System.Threading.Tasks;
1212
using CodeFramework.Core.Services;
13+
using System.Linq;
1314

1415
namespace CodeHub.iOS.ViewControllers
1516
{
@@ -116,27 +117,21 @@ private void SelectImage()
116117
imagePicker.NavigationControllerDelegate = new ImagePickerDelegate();
117118
imagePicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
118119
imagePicker.MediaTypes = UIImagePickerController.AvailableMediaTypes(UIImagePickerControllerSourceType.PhotoLibrary);
119-
imagePicker.FinishedPickingMedia += (object sender, UIImagePickerMediaPickedEventArgs e) =>
120+
imagePicker.MediaTypes = imagePicker.MediaTypes.Where(x => !(x.Contains("movie") || x.Contains("video"))).ToArray();
121+
122+
imagePicker.FinishedPickingMedia += (sender, e) =>
120123
{
121124
// determine what was selected, video or image
122125
bool isImage = false;
123126
switch(e.Info[UIImagePickerController.MediaType].ToString()) {
124127
case "public.image":
125-
Console.WriteLine("Image selected");
126128
isImage = true;
127129
break;
128-
case "public.video":
129-
Console.WriteLine("Video selected");
130-
break;
131130
}
132131

133-
// get common info (shared between images and video)
134-
NSUrl referenceURL = e.Info[new NSString("UIImagePickerControllerReferenceUrl")] as NSUrl;
135-
if (referenceURL != null)
136-
Console.WriteLine("Url:"+referenceURL.ToString ());
137-
138132
// if it was an image, get the other image info
139-
if(isImage) {
133+
if(isImage)
134+
{
140135
// get the original image
141136
UIImage originalImage = e.Info[UIImagePickerController.OriginalImage] as UIImage;
142137
if(originalImage != null) {
@@ -145,15 +140,14 @@ private void SelectImage()
145140
{
146141
UploadImage(originalImage);
147142
}
148-
catch (Exception ex)
143+
catch
149144
{
150-
Console.WriteLine("Fudge...");
151145
}
152-
Console.WriteLine ("got the original image");
153-
//imageView.Image = originalImage; // display
154146
}
155-
} else { // if it's a video
156-
//TODO: Don't support video...
147+
}
148+
else
149+
{ // if it's a video
150+
MonoTouch.Utilities.ShowAlert("Not supported!", "Video upload is currently not supported.");
157151
}
158152

159153
// dismiss the picker
@@ -162,7 +156,7 @@ private void SelectImage()
162156
};
163157

164158

165-
imagePicker.Canceled += (object sender, EventArgs e) =>
159+
imagePicker.Canceled += (sender, e) =>
166160
{
167161
imagePicker.DismissViewController(true, null);
168162
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;

0 commit comments

Comments
 (0)