Commit b9cddd3b authored by Nicolas Jager's avatar Nicolas Jager
Browse files

smartpanel : updates menu buttons

- set the same style to all buttons.

Change-Id: Id70e6d0121521a45686b04ca6a86e75514b8089e
Tuleap: #790
parent 670e7f77
......@@ -113,6 +113,8 @@
<!-- hamburger button. -->
<Button x:Name="_toggleSmartBoxButton_"
Grid.Row="0"
FontWeight="Bold"
FontSize="20"
Content="&#xE700;"
Click="_toggleSmartBoxButton__Click"
HorizontalAlignment="Center"
......
......@@ -391,7 +391,7 @@
<Grid.RowDefinitions>
<!-- where the selected account is shown. -->
<RowDefinition x:Name="_selectedAccountRow_"
Height="90"/>
Height="60"/>
<!-- where the drop down menus are shown. -->
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
......@@ -399,13 +399,13 @@
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="_selectedAccountAvatarColumn_"
Width="90"/>
Width="60"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Ellipse
x:Name="_selectedAccountAvatarContainer_"
Height="80"
Width="80"
Height="50"
Width="50"
Grid.Column="0"
Stroke="White"
StrokeThickness="3"
......@@ -422,8 +422,8 @@
<Ellipse
x:Name="_shaderPhotoboothIcon_"
Visibility="Collapsed"
Height="80"
Width="80"
Height="50"
Width="50"
Grid.Column="0"
IsHitTestVisible="False"
Fill="Black"
......@@ -440,46 +440,52 @@
<StackPanel Grid.Column="1"
VerticalAlignment="Bottom">
<TextBlock x:Name="_selectedAccountName_"
Text="[TEXT MISSING]"
Margin="10,0,0,10"
Text="the wizard will be sumoned..."
Margin="10"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
Style="{StaticResource TextStyle2}"/>
<StackPanel Orientation="Horizontal">
<!--Content="&#xE0A1;-->
<Button x:Name="_smartGridButton_"
<!-- contacts list -->
<ToggleButton x:Name="_contactsListMenuButton_"
VerticalAlignment="Bottom"
Content="&#xe716;"
Click="_smartGridButton__Clicked"
Style="{StaticResource smartGridButtonStyle}"/>
Click="_contactsListMenuButton__Click"
Style="{StaticResource ToggleButtonStyle2}"/>
<!-- account menu -->
<ToggleButton x:Name="_accountsMenuButton_"
VerticalAlignment="Bottom"
Click="_accountsMenuButton__Click"
Content="&#xE168;"
Checked="_accountsMenuButton__Checked"
Unchecked="_accountsMenuButton__Unchecked"
Style="{StaticResource ToggleButtonStyle1}"/>
Style="{StaticResource ToggleButtonStyle2}"/>
<!-- _shareMenuButton_ -->
<ToggleButton x:Name="_shareMenuButton_"
VerticalAlignment="Bottom"
Checked="_shareMenuButton__Checked"
Unchecked="_shareMenuButton__Unchecked"
Style="{StaticResource ToggleButtonStyle1}">
<Image Source="Assets/qrCodeIcon.png"
Stretch="Uniform"/>
Click="_shareMenuButton__Click"
Style="{StaticResource ToggleButtonStyle2}">
<StackPanel>
<Image x:Name="_qrCodeIconWhite_"
Source="Assets/qrCodeIconWhite.png"
Visibility="Visible"
Stretch="None"/>
<Image x:Name="_qrCodeIconBlack_"
Visibility="Collapsed"
Source="Assets/qrCodeIconBlack.png"
Stretch="None"/>
</StackPanel>
</ToggleButton>
<!-- _devicesMenuButton_ -->
<ToggleButton x:Name="_devicesMenuButton_"
VerticalAlignment="Bottom"
Click="_devicesMenuButton__Click"
Content="&#xE836;"
Checked="_devicesMenuButton__Checked"
Unchecked="_devicesMenuButton__Unchecked"
Style="{StaticResource ToggleButtonStyle1}"/>
Style="{StaticResource ToggleButtonStyle2}"/>
<!-- _settingsMenuButton_ -->
<ToggleButton x:Name="_settingsMenuButton_"
Click="_settingsMenuButton__Click"
VerticalAlignment="Bottom"
Content="&#xE115;"
Checked="_settingsMenu__Checked"
Unchecked="_settingsMenu__Unchecked"
Style="{StaticResource ToggleButtonStyle1}"/>
Style="{StaticResource ToggleButtonStyle2}"/>
</StackPanel>
</StackPanel>
</Grid>
......@@ -487,9 +493,6 @@
<!--sub menus like the accounts list or the share menu are just below, technicaly they are nested inside the
same row. To summon them we use the visibility of their own grid, by linking it to a toggle button-->
</Grid>
<!-- smartList and settings. -->
<Grid Grid.Row="1"
......@@ -916,8 +919,7 @@
Grid.Row="0"
Background="#3bc1d3">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal"
......@@ -936,7 +938,7 @@
<StackPanel x:Name="_step1Menu_"
Background="#FFE4F1F9"
Padding="10"
Grid.Row="1">
Grid.Row="0">
<TextBlock Text="To link this device to a Ring account, you'll first need to generate a PIN from Ring on a device hosting the account."
TextWrapping="Wrap"
TextAlignment="Justify"/>
......@@ -948,7 +950,7 @@
<StackPanel x:Name="_step2Menu_"
Background="#FFE4F1F9"
Visibility="Collapsed"
Grid.Row="1">
Grid.Row="0">
<TextBox x:Name="_PINTextBox_"
Margin="10"
GotFocus="_PINTextBox__GotFocus"
......@@ -962,7 +964,7 @@
Text=""/>
</StackPanel>
<!-- buttons next step and yes/no to add the account. -->
<Grid Grid.Row="2">
<Grid Grid.Row="1">
<StackPanel Orientation="Horizontal"
Padding="10,0"
HorizontalAlignment="Center">
......@@ -1120,6 +1122,7 @@
<PasswordBox x:Name="_passwordForPinGenerator_"
Margin="10"
Grid.Row="1"
KeyUp="_passwordForPinGenerator__KeyUp"
PlaceholderText="Enter your password"/>
</Grid>
<!-- buttons yes/no to generate a PIN. -->
......@@ -1209,7 +1212,6 @@
Foreground="Black"
Background="White"
TextWrapping="Wrap"
KeyDown="_ringTxtBx__KeyDown"
KeyUp="_ringTxtBx__KeyUp"
Text="">
</TextBox>
......
......@@ -177,7 +177,7 @@ SmartPanel::SmartPanel()
RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Views::SmartPanel::OncallPlaced);
RingD::instance->incomingAccountMessage += ref new RingClientUWP::IncomingAccountMessage(this, &RingClientUWP::Views::SmartPanel::OnincomingAccountMessage);
menuOpen = MenuOpen::CONTACTS_LIST;
selectMenu(MenuOpen::CONTACTS_LIST);
}
void
......@@ -220,152 +220,10 @@ RingClientUWP::Views::SmartPanel::updatePageContent()
}
// refacto : rm me
void RingClientUWP::Views::SmartPanel::unselectContact()
{
// _smartList_->SelectedItem = nullptr;
}
void RingClientUWP::Views::SmartPanel::_smartGridButton__Clicked(Object^ sender, RoutedEventArgs^ e)
{
_accountsMenuButton__Unchecked(nullptr,nullptr);
_accountsMenuButton_->IsChecked = false;
_shareMenuButton__Unchecked(nullptr,nullptr);
_shareMenuButton_->IsChecked = false;
_devicesMenuButton__Unchecked(nullptr,nullptr);
_devicesMenuButton_->IsChecked = false;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
void RingClientUWP::Views::SmartPanel::_accountsMenuButton__Checked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen = MenuOpen::ACCOUNTS_LIST;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_shareMenuButton_->IsChecked = false;
_devicesMenuButton_->IsChecked = false;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
void RingClientUWP::Views::SmartPanel::_accountsMenuButton__Unchecked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountEditionGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountAddMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
void RingClientUWP::Views::SmartPanel::_settingsMenu__Checked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen - MenuOpen::SETTINGS;
_accountsMenuButton__Unchecked(nullptr,nullptr);
_accountsMenuButton_->IsChecked = false;
_shareMenuButton__Unchecked(nullptr,nullptr);
_shareMenuButton_->IsChecked = false;
_devicesMenuButton__Unchecked(nullptr,nullptr);
_devicesMenuButton_->IsChecked = false;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
auto vcm = Video::VideoManager::instance->captureManager();
if (vcm->deviceList->Size > 0) {
if (!vcm->isInitialized)
vcm->InitializeCameraAsync(true);
else
vcm->StartPreviewAsync(true);
}
summonPreviewPage();
}
void RingClientUWP::Views::SmartPanel::_settingsMenu__Unchecked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
auto vcm = Video::VideoManager::instance->captureManager();
if (vcm->deviceList->Size > 0) {
vcm->StopPreviewAsync()
.then([](task<void> stopPreviewTask)
{
try {
stopPreviewTask.get();
Video::VideoManager::instance->captureManager()->isSettingsPreviewing = false;
}
catch (Exception^ e) {
WriteException(e);
}
});
}
hidePreviewPage();
}
void RingClientUWP::Views::SmartPanel::setMode(RingClientUWP::Views::SmartPanel::Mode mode)
{
if (mode == RingClientUWP::Views::SmartPanel::Mode::Normal) {
_rowRingTxtBx_->Height = 40;
_selectedAccountAvatarContainer_->Height = 80;
_shaderPhotoboothIcon_->Height = 80;
_selectedAccountAvatarColumn_->Width = 90;
_selectedAccountRow_->Height = 90;
}
else {
_rowRingTxtBx_->Height = 0;
_selectedAccountAvatarContainer_->Height = 50;
_shaderPhotoboothIcon_->Height = 50;
_selectedAccountAvatarColumn_->Width = 60;
_selectedAccountRow_->Height = 60;
}
_selectedAccountAvatarContainer_->Width = _selectedAccountAvatarContainer_->Height;
_shaderPhotoboothIcon_->Width = _shaderPhotoboothIcon_->Height;
_settingsMenuButton_->IsChecked = false;
_accountsMenuButton_->IsChecked = false;
_shareMenuButton_->IsChecked = false;
_devicesMenuButton_->IsChecked = false;
}
void RingClientUWP::Views::SmartPanel::_shareMenuButton__Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::SHARE;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_shareMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountEditionGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton_->IsChecked = false;
_devicesMenuButton_->IsChecked = false;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
generateQRcode();
}
void RingClientUWP::Views::SmartPanel::_shareMenuButton__Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_shareMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountEditionGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_rowRingTxtBx_->Height = (mode == RingClientUWP::Views::SmartPanel::Mode::Normal)? 40 : 0;
selectMenu(MenuOpen::CONTACTS_LIST);
}
void RingClientUWP::Views::SmartPanel::_addAccountBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
......@@ -414,14 +272,14 @@ void RingClientUWP::Views::SmartPanel::_createAccountYes__Click(Platform::Object
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton__Checked(nullptr, nullptr);
selectMenu(MenuOpen::ACCOUNTS_LIST);
}
void RingClientUWP::Views::SmartPanel::_createAccountNo__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
_accountsMenuButton_->IsChecked = false;
_accountsMenuButton__Unchecked(nullptr,nullptr);
selectMenu(MenuOpen::ACCOUNTS_LIST);
}
/* using the usual selection behaviour doesn't allow us to deselect by simple click. The selection is managed
......@@ -458,30 +316,6 @@ SmartPanel::_accountList__SelectionChanged(Platform::Object^ sender, Windows::UI
updatePageContent();
}
// (XXX) use only KeyUp
void RingClientUWP::Views::SmartPanel::_ringTxtBx__KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
{
/* add contact, test purpose but will be reused later in some way */
//if (e->Key == Windows::System::VirtualKey::Enter && !_ringTxtBx_->Text->IsEmpty()) {
// for (auto it : SmartPanelItemsViewModel::instance->itemsList) {
// if (it->_contact->name_ == _ringTxtBx_->Text) {
// _smartList_->SelectedItem = it;
// _ringTxtBx_->Text = "";
// return;
// }
// }
// /* if the string has 40 chars, we simply consider it as a ring id. It has to be improved */
// if (_ringTxtBx_->Text->Length() == 40) {
// ContactsViewModel::instance->addNewContact(_ringTxtBx_->Text, _ringTxtBx_->Text);
// _ringTxtBx_->Text = "";
// }
// RingD::instance->lookUpName(_ringTxtBx_->Text);
//}
}
void RingClientUWP::Views::SmartPanel::_ringTxtBx__Click(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
{
RingD::instance->lookUpName(_ringTxtBx_->Text);
......@@ -593,19 +427,6 @@ void RingClientUWP::Views::SmartPanel::Grid_PointerExited(Platform::Object^ send
}
}
// refacto : rm
void RingClientUWP::Views::SmartPanel::_contactItem__PointerReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
{
/*auto listBoxItem = dynamic_cast<ListBoxItem^>(sender);
auto smartPanelItem = dynamic_cast<SmartPanelItem^>(listBoxItem->DataContext);
if (_smartList_->SelectedItem != smartPanelItem)
_smartList_->SelectedItem = smartPanelItem;
else
_smartList_->SelectedItem = nullptr;
*/
}
void RingClientUWP::Views::SmartPanel::generateQRcode()
{
auto ringId = AccountListItemsViewModel::instance->_selectedItem->_account->ringID_;
......@@ -901,51 +722,6 @@ Object ^ RingClientUWP::Views::NewMessageBubleNotification::ConvertBack(Object ^
RingClientUWP::Views::NewMessageBubleNotification::NewMessageBubleNotification()
{}
void RingClientUWP::Views::SmartPanel::_devicesMenuButton__Unchecked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::CONTACTS_LIST;
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_waitingForPin_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_passwordForPinGenerator_->Password = "";
// refacto : do something better...
_waitingAndResult_->Text = "Exporting account on the Ring...";
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
void RingClientUWP::Views::SmartPanel::_devicesMenuButton__Checked(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
menuOpen = MenuOpen::DEVICE;
_settingsMenu_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = false;
_waitingDevicesList_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_devicesIdList_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
auto account = AccountListItemsViewModel::instance->_selectedItem->_account;
_deviceId_->Text = account->_deviceId;
if (_deviceId_->Text->IsEmpty()) {
_deviceId_->Text = "No device id found!";
ERR_("device Id not found for account " + Utils::toString(account->_deviceId));
}
RingD::instance->askToRefreshKnownDevices(account->accountID_);
_shareMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Visible;
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton_->IsChecked = false;
_shareMenuButton_->IsChecked = false;
_smartGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
}
void RingClientUWP::Views::SmartPanel::_addDevice__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
_devicesMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
......@@ -965,17 +741,7 @@ void RingClientUWP::Views::SmartPanel::OndevicesListRefreshed(Platform::Collecti
void RingClientUWP::Views::SmartPanel::_pinGeneratorYes__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_waitingForPin_->Visibility = Windows::UI::Xaml::Visibility::Visible;
auto accountId = AccountListItemsViewModel::instance->_selectedItem->_account->accountID_;
auto password = _passwordForPinGenerator_->Password;
_passwordForPinGenerator_->Password = "";
/* hide the button while we are waiting... */
_closePin_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
RingD::instance->askToExportOnRing(accountId, password);
requestPin();
}
......@@ -984,6 +750,8 @@ void RingClientUWP::Views::SmartPanel::_pinGeneratorNo__Click(Platform::Object^
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuButton_->IsChecked = false;
_passwordForPinGenerator_->Password = "";
selectMenu(MenuOpen::CONTACTS_LIST);
}
......@@ -997,8 +765,7 @@ void RingClientUWP::Views::SmartPanel::OnexportOnRingEnded(Platform::String ^acc
void RingClientUWP::Views::SmartPanel::_closePin__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
_waitingForPin_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuButton_->IsChecked = false;
selectMenu(MenuOpen::CONTACTS_LIST);
// refacto : do something better...
_waitingAndResult_->Text = "Exporting account on the Ring...";
......@@ -1007,9 +774,7 @@ void RingClientUWP::Views::SmartPanel::_closePin__Click(Platform::Object^ sender
void RingClientUWP::Views::SmartPanel::_shareMenuDone__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
_shareMenuButton_->IsChecked = false;
_shareMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
selectMenu(MenuOpen::CONTACTS_LIST);
}
Object ^ RingClientUWP::Views::AccountTypeToSourceImage::Convert(Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object ^ parameter, String ^ language)
......@@ -1139,9 +904,7 @@ void RingClientUWP::Views::SmartPanel::_acceptAccountModification__Click(Platfor
RingD::instance->updateAccount(accountId);
}
_accountEditionGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton_->IsChecked = false;
selectMenu(MenuOpen::CONTACTS_LIST);
if (_usernameValidEdition_->Visibility == Windows::UI::Xaml::Visibility::Visible && _usernameTextBoxEdition_->Text->Length() > 2)
RingD::instance->registerName_new(Utils::toString(account->accountID_), "", Utils::toString(_usernameTextBoxEdition_->Text));
......@@ -1235,7 +998,7 @@ RingClientUWP::Views::SmartPanel::_selectedAccountAvatarContainer__PointerReleas
{
CameraCaptureUI^ cameraCaptureUI = ref new CameraCaptureUI();
cameraCaptureUI->PhotoSettings->Format = CameraCaptureUIPhotoFormat::Jpeg;
cameraCaptureUI->PhotoSettings->CroppedSizeInPixels = Size(80, 80);
cameraCaptureUI->PhotoSettings->CroppedSizeInPixels = Size(40, 40);
create_task(cameraCaptureUI->CaptureFileAsync(CameraCaptureUIMode::Photo))
.then([this](StorageFile^ photoFile)
......@@ -1244,8 +1007,8 @@ RingClientUWP::Views::SmartPanel::_selectedAccountAvatarContainer__PointerReleas
auto brush = ref new ImageBrush();
auto circle = ref new Ellipse();
circle->Height = 80;
circle->Width = 80;
circle->Height = 40;
circle->Width = 40;
auto path = photoFile->Path;
auto uri = ref new Windows::Foundation::Uri(path);
auto bitmapImage = ref new Windows::UI::Xaml::Media::Imaging::BitmapImage();
......@@ -1769,8 +1532,7 @@ void RingClientUWP::Views::SmartPanel::_step1button__Click(Platform::Object^ sen
void RingClientUWP::Views::SmartPanel::_addAccountNo__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
_accountsMenuButton_->IsChecked = false;
_accountsMenuButton__Unchecked(nullptr, nullptr);
selectMenu(MenuOpen::CONTACTS_LIST);
}
......@@ -1825,6 +1587,88 @@ RingClientUWP::Views::ContactStatusNotification::ContactStatusNotification()
{}
void RingClientUWP::Views::SmartPanel::selectMenu(MenuOpen menu)
{
_contactsListMenuButton_->IsChecked = (menu == MenuOpen::CONTACTS_LIST) ? true : false;
_smartGrid_->Visibility = (menu == MenuOpen::CONTACTS_LIST)
? Windows::UI::Xaml::Visibility::Visible
: Windows::UI::Xaml::Visibility::Collapsed;
_accountsMenuButton_->IsChecked = (menu == MenuOpen::ACCOUNTS_LIST) ? true : false;
_accountsMenuGrid_->Visibility = (menu == MenuOpen::ACCOUNTS_LIST)
? Windows::UI::Xaml::Visibility::Visible
: Windows::UI::Xaml::Visibility::Collapsed;
_shareMenuButton_->IsChecked = (menu == MenuOpen::SHARE) ? true : false;
_shareMenuGrid_->Visibility = (menu == MenuOpen::SHARE)
? Windows::UI::Xaml::Visibility::Visible
: Windows::UI::Xaml::Visibility::Collapsed;
_devicesMenuButton_->IsChecked = (menu == MenuOpen::DEVICE) ? true : false;
_devicesMenuGrid_->Visibility = (menu == MenuOpen::DEVICE)
? Windows::UI::Xaml::Visibility::Visible
: Windows::UI::Xaml::Visibility::Collapsed;
_settingsMenuButton_->IsChecked = (menu == MenuOpen::SETTINGS) ? true : false;
_settingsMenu_->Visibility = (menu == MenuOpen::SETTINGS)
? Windows::UI::Xaml::Visibility::Visible
: Windows::UI::Xaml::Visibility::Collapsed;
/* manage the account menu */
_accountCreationMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountEditionGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_accountAddMenuGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
/* manage the share icon*/
if (menu == MenuOpen::SHARE && menuOpen != MenuOpen::SHARE) {
generateQRcode();
_qrCodeIconWhite_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_qrCodeIconBlack_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
else if (menu != MenuOpen::SHARE && menuOpen == MenuOpen::SHARE) {
_qrCodeIconBlack_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_qrCodeIconWhite_->Visibility = Windows::UI::Xaml::Visibility::Visible;
}
/* manage adding device menu */
_addingDeviceGrid_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_waitingDevicesList_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
_waitingForPin_->Visibility = Windows::UI::Xaml::Visibility::Collapsed;
/* manage the video preview */
if (menu == MenuOpen::SETTINGS && menuOpen != MenuOpen::SETTINGS) {
auto vcm = Video::VideoManager::instance->captureManager();
if (vcm->deviceList->Size > 0) {
if (!vcm->isInitialized)
vcm->InitializeCameraAsync(true);
else
vcm->StartPreviewAsync(true);
}
summonPreviewPage();
}
else if (menu != MenuOpen::SETTINGS && menuOpen == MenuOpen::SETTINGS) {