Skip to content

Commit

Permalink
Concerns #43 and #46
Browse files Browse the repository at this point in the history
  • Loading branch information
prajjwaldimri committed May 12, 2016
1 parent 07a4751 commit edf1edd
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 75 deletions.
16 changes: 16 additions & 0 deletions Windows/FriendProject/BeFriendUWP/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,22 @@
<value>Open-Source, Non-Profit and Made for community!</value>
<comment>AboutPage.xaml</comment>
</data>
<data name="AboutPageLibraries.Text" xml:space="preserve">
<value>3rd Party Libraries</value>
<comment>AboutPage.xaml</comment>
</data>
<data name="AboutPageLicenses.Text" xml:space="preserve">
<value>Licenses:</value>
<comment>AboutPage.xaml</comment>
</data>
<data name="AboutPageOthers.Text" xml:space="preserve">
<value>Other Resources</value>
<comment>AboutPage.xaml</comment>
</data>
<data name="AboutPageTranslators.Text" xml:space="preserve">
<value>Translators:</value>
<comment>AboutPage.xaml</comment>
</data>
<data name="AboutPivotItem.Header" xml:space="preserve">
<value>ABOUT</value>
<comment>MainPage.xaml</comment>
Expand Down
84 changes: 70 additions & 14 deletions Windows/FriendProject/BeFriendUWP/ViewModel/BaseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,32 +193,73 @@ private async void InAppMessages()
switch (Convert.ToInt64(localSettings.Values["InAppMessageCount"]))
{
case 1:

var dialog =
new MessageDialog(
"Use the Gitter chat or " +
"Github issues to report any bugs or new feature suggestions.",
"Any Bugs or suggestions?") {Options = MessageDialogOptions.None};
dialog.Commands.Add(new UICommand("Gitter Chat", CommandInvokedHandler));
dialog.Commands.Add(new UICommand("Github Issues", CommandInvokedHandler));

break;
dialog.DefaultCommandIndex = 0;
dialog.CancelCommandIndex = 1;

await dialog.ShowAsync();

break;

case 2:
var dialog1 =
new MessageDialog(
"Translate the app to your native language in easy to use web interface " +
"using Crowdin.",
"Native language not English?") {Options = MessageDialogOptions.None};
dialog1.Commands.Add(new UICommand("Translate Now!", CommandInvokedHandler));
dialog1.Commands.Add(new UICommand("Translate Later", CommandInvokedHandler));

dialog1.DefaultCommandIndex = 0;
dialog1.CancelCommandIndex = 1;

await dialog1.ShowAsync();

break;

case 4:
var dialog2 =
new MessageDialog(
"Did you know that BeFriend is completely Open-Source which means you can actively contribute in the " +
"development of the app. \n\nWhether it is coding, designing, documenting, testing or translating, all " +
"contributions are welcome",
"Develop with Us!") {Options = MessageDialogOptions.None};
dialog2.Commands.Add(new UICommand("Join the Development!", CommandInvokedHandler));
dialog2.Commands.Add(new UICommand("Not interested", CommandInvokedHandler));

dialog2.DefaultCommandIndex = 0;
dialog2.CancelCommandIndex = 1;

await dialog2.ShowAsync();

break;
}

var count = (int) localSettings.Values["InAppMessageCount"];
var count = Convert.ToInt64(localSettings.Values["InAppMessageCount"]);
count++;
localSettings.Values["InAppMessageCount"] = count.ToString();



}
}
else
{
var dialog = new MessageDialog("Your personal information is and will never be " +
"shared with any 3rd party. \n The only information collected is by using " +
"HockeyApp SDK which stores the debug log whenever a crash occurs and sends it " +
"so that I can check what bugs are happening in the app.", "Privacy Policy");
dialog.Options = MessageDialogOptions.None;
"shared with any 3rd party. \n\nThe only information collected is by using " +
"HockeyApp SDK which stores the debug log whenever a crash occurs and sends it " +
"so that I can check what bugs are happening in the app.",
"Privacy Policy") {Options = MessageDialogOptions.None};
dialog.Commands.Add(new UICommand("I Understand!", CommandInvokedHandler));
dialog.Commands.Add(new UICommand("I didn't Understand", CommandInvokedHandler));

dialog.DefaultCommandIndex = 0;
dialog.CancelCommandIndex = 1;
await dialog.ShowAsync();
localSettings.Values.Add("InAppMessageCount","1");
localSettings.Values.Add("InAppMessageCount", "1");
}
}

Expand All @@ -230,9 +271,24 @@ private async void CommandInvokedHandler(IUICommand command)

break;
case "I didn't Understand":
var uri = new Uri("mailto:prajjwaldimri@outlook.com");
await Launcher.LaunchUriAsync(uri);
await Launcher.LaunchUriAsync(new Uri("mailto:prajjwaldimri@outlook.com"));
break;
case "Gitter Chat":
await Launcher.LaunchUriAsync(new Uri("https://gitter.im/prajjwaldimri/Friend-App"));
break;

case "Github Issues":
await Launcher.LaunchUriAsync(new Uri("https://github.com/prajjwaldimri/Friend-App/issues"));
break;

case "Translate Now!":
await Launcher.LaunchUriAsync(new Uri("https://crowdin.com/project/befriend/invite"));
break;

case "Join the Development!":
await Launcher.LaunchUriAsync(new Uri("https://gitter.im/prajjwaldimri/Friend-App"));
break;

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ private async void ButtonClickEventMethod(object obj)
//}


var uri = new Uri("mailto:prajjwaldimri@outlook.com");
var uri = new Uri("https://gitter.im/prajjwaldimri/Friend-App#");
await Launcher.LaunchUriAsync(uri);
break;

Expand Down
104 changes: 100 additions & 4 deletions Windows/FriendProject/BeFriendUWP/Views/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,109 @@

<Border Margin="10,5,10,10" BorderBrush="GhostWhite" BorderThickness="0.2"/>

<TextBlock x:Uid="AcknowledgmentHeader" FontSize="18" Text="Acknowledgments:" FontWeight="Bold" FontFamily="ms-appx:/Fonts/Karla-Bold.ttf#Karla"/>
<TextBlock x:Uid="AcknowledgmentHeader" FontSize="20" Text="Acknowledgments:"
FontWeight="Bold" FontFamily="ms-appx:/Fonts/Karla-Bold.ttf#Karla"
Margin="5,10,0,10"/>

<TextBlock FontSize="14" Text="www.flaticon.com" FontFamily="ms-appx:/Fonts/Karla-Bold.ttf#Karla"/>

<TextBlock FontSize="14" Text="www.pexels.com" FontFamily="ms-appx:/Fonts/Karla-Bold.ttf#Karla"/>
<TextBlock x:Uid="AboutPageTranslators" FontSize="18" Text="Translators:"
FontWeight="Bold" FontFamily="ms-appx:/Fonts/Karla-Bold.ttf#Karla"
Margin="10,10,0,10"/>


<StackPanel Margin="15,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="2*"/>
</Grid.ColumnDefinitions>

<TextBlock Text="French" Grid.Row="0" Grid.Column="0"/>
<TextBlock Text="@arimhan" Grid.Row="0" Grid.Column="1"/>

<TextBlock Text="Portuguese" Grid.Row="1" Grid.Column="0"/>
<TextBlock Text="Marcelo Jardim, João da Costa Santos"
Grid.Row="1" Grid.Column="1" TextWrapping="WrapWholeWords"/>

<TextBlock Text="Portuguese-Brazilian" Grid.Row="2" Grid.Column="0"
TextWrapping="WrapWholeWords"/>
<TextBlock Text="Marcelo Jardim, Rapahel Oliveira" Grid.Row="2"
Grid.Column="1" TextWrapping="WrapWholeWords"/>

<TextBlock Text="Russian" Grid.Row="3" Grid.Column="0"/>
<TextBlock Text="Timothy Kanarsky" Grid.Row="3" Grid.Column="1"/>

<TextBlock Text="Turkish" Grid.Row="4" Grid.Column="0"/>
<TextBlock Text="Cemre Serpal" Grid.Row="4" Grid.Column="1"/>
</Grid>

</StackPanel>


<TextBlock x:Uid="AboutPageLibraries" FontSize="18" Text="Libraries:"
FontWeight="Bold" FontFamily="ms-appx:/Fonts/Karla-Bold.ttf#Karla"
Margin="10,10,0,10"/>

<StackPanel Margin="15,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>

<TextBlock Text="MvvmLight" Grid.Row="0"/>
<TextBlock Text="NewtonSoft.JSON" Grid.Row="1"/>
<TextBlock Text="TweetInvi" Grid.Row="2"/>


</Grid>
</StackPanel>

<TextBlock x:Uid="AboutPageOthers" FontSize="18" Text="Others:"
FontWeight="Bold" FontFamily="ms-appx:/Fonts/Karla-Bold.ttf#Karla"
Margin="10,10,0,10"/>

<StackPanel Margin="15,0,0,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>

<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>

<TextBlock Text="Pexels" Grid.Row="0"/>
<TextBlock Text="FlatIcon" Grid.Row="1"/>
<TextBlock Text="FontAwesome" Grid.Row="2"/>


</Grid>
</StackPanel>

<TextBlock FontSize="22" Text="A big Thanks to Microsoft for providing the restricted cellularMessaging
capability!" Margin="10,10,10,0" TextWrapping="WrapWholeWords"/>



</StackPanel>

</ScrollViewer>
Expand Down
5 changes: 2 additions & 3 deletions Windows/FriendProject/BeFriendUWP/Views/ChatBot.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@
<TextBox BorderBrush="{StaticResource SystemControlBackgroundAccentBrush}"
BorderThickness="4"
PlaceholderText="Write a message..." VerticalContentAlignment="Center"
HorizontalContentAlignment="Center" KeyUp="InputText_OnKeyUp"
HorizontalContentAlignment="Center"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="InputText"
Grid.Column="0"/>
<Button HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Background="{StaticResource SystemControlBackgroundAccentBrush}"
Name="SendButton" Grid.Column="1"
Click="SendButton_OnClick">
Name="SendButton" Grid.Column="1">
<Button.Content>
<FontIcon Glyph="&#xf1d8;" Margin="-4,0,0,0" FontSize="25" Foreground="White"
FontFamily="Fonts/fontawesome-webfont.ttf#FontAwesome"/>
Expand Down
54 changes: 2 additions & 52 deletions Windows/FriendProject/BeFriendUWP/Views/ChatBot.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Syn.Bot;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

Expand All @@ -16,56 +15,7 @@ namespace BeFriend.Views
/// </summary>
public sealed partial class ChatBot : Page
{
private readonly SynBot _chatbot;
public ChatBot()
{
this.InitializeComponent();
_chatbot = new SynBot();
_chatbot.PackageManager.LoadFromString(File.ReadAllText("BeFriendBot.simlpk"));
}




private void SendButton_OnClick(object sender, RoutedEventArgs e)
{
ChatBotConnector();
}

private void InputText_OnKeyUp(object sender, KeyRoutedEventArgs e)
{
if (e.Key != VirtualKey.Enter) return;
try
{
ChatBotConnector();
e.Handled = true; LoseFocus(sender);
}
catch (Exception exception)
{
Debug.WriteLine(exception);
}
}

private void ChatBotConnector()
{
var result = _chatbot.Chat(InputText.Text);
//OutputText = string.Format("User: {0}\nBot: {1}\n{2}", InputText.Text, result.BotMessage);

InputText.Text = string.Empty;
}

/// <summary>
/// Makes virtual keyboard disappear
/// </summary>
/// <param name="sender"></param>
private void LoseFocus(object sender)
{
var control = sender as Control;
var isTabStop = control.IsTabStop;
control.IsTabStop = false;
control.IsEnabled = false;
control.IsEnabled = true;
control.IsTabStop = isTabStop;
}


}
}
1 change: 0 additions & 1 deletion Windows/FriendProject/BeFriendUWP/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"Newtonsoft.Json": "8.0.3",
"NotificationsExtensions.Win10": "14295.0.1",
"QueryString.NET": "1.0.0",
"Syn.Bot": "1.2.3",
"TweetinviAPI": "0.9.12.2",
"Win2D.uwp": "1.17.0",
"WindowsAzure.Messaging.Managed": "0.1.7.9"
Expand Down

0 comments on commit edf1edd

Please sign in to comment.