Commit 7f34b772 authored by Nicolas Jager's avatar Nicolas Jager
Browse files

UI : visual updates

- stretches menus vertically.
- manages too long time lookup.
- moves element on welcomePage.
- adds profil name on the message text page.
- does lookups during incoming messages.
- show contact's avatar.

Change-Id: I2d482978281ecb0fb088cc93112a032e04e7501b
Tuleap: #790
parent f11cbec8
......@@ -36,7 +36,8 @@ using namespace ViewModel;
Contact::Contact(String^ name,
String^ ringID,
String^ GUID,
unsigned int unreadmessages)
unsigned int unreadmessages,
ContactStatus contactStatus)
{
vCard_ = ref new VCardUtils::VCard(this);
......@@ -73,6 +74,8 @@ Contact::Contact(String^ name,
_vcardUID = "";
_avatarImage = ref new String(L"ms-appx:///Assets/TESTS/contactAvatar.png");
_displayName = "";
contactStatus_ = contactStatus;
}
void
......
......@@ -43,12 +43,23 @@ ref class Conversation;
public ref class Contact sealed : public INotifyPropertyChanged
{
public:
Contact(String^ name, String^ ringID, String^ GUID, unsigned int unreadmessages);
Contact(String^ name, String^ ringID, String^ GUID, unsigned int unreadmessages, ContactStatus contactStatus);
JsonObject^ ToJsonObject();
virtual event PropertyChangedEventHandler^ PropertyChanged;
property String^ name_;
property String^ _name
{
String^ get()
{
return name_;
}
void set(String^ value)
{
name_ = value;
NotifyPropertyChanged("_name");
}
}
property String^ ringID_;
property String^ GUID_;
......@@ -122,6 +133,19 @@ public:
}
}
property ContactStatus _contactStatus
{
ContactStatus get()
{
return contactStatus_;
}
void set(ContactStatus value)
{
contactStatus_ = value;
NotifyPropertyChanged("_contactStatus");
}
}
VCardUtils::VCard^ getVCard();
internal:
......@@ -142,6 +166,8 @@ private:
String^ avatarImage_;
String^ displayName_;
Windows::UI::Xaml::GridLength contactBarHeight_ = 0;
ContactStatus contactStatus_;
String^ name_;
};
}
......@@ -51,6 +51,8 @@ ContactsViewModel::ContactsViewModel()
return;
}
RingD::instance->lookUpAddress(fromRingId);
contact->_conversation->addMessage(""/* date not yet used*/, MSG_FROM_CONTACT, payload);
/* save contacts conversation to disk */
......@@ -67,6 +69,9 @@ ContactsViewModel::ContactsViewModel()
});
RingD::instance->incomingMessage +=
ref new RingClientUWP::IncomingMessage(this, &RingClientUWP::ViewModel::ContactsViewModel::OnincomingMessage);
RingD::instance->registeredNameFound += ref new RingClientUWP::RegisteredNameFound(this, &RingClientUWP::ViewModel::ContactsViewModel::OnregisteredNameFound);
}
Contact^ // refacto : remove "byName"
......@@ -74,7 +79,7 @@ ContactsViewModel::findContactByName(String^ name)
{
auto trimmedName = Utils::Trim(name);
for each (Contact^ contact in contactsList_)
if (contact->name_ == trimmedName)
if (contact->_name == trimmedName)
return contact;
return nullptr;
......@@ -90,12 +95,12 @@ Contact ^ RingClientUWP::ViewModel::ContactsViewModel::findContactByRingId(Strin
}
Contact^
ContactsViewModel::addNewContact(String^ name, String^ ringId)
ContactsViewModel::addNewContact(String^ name, String^ ringId, ContactStatus contactStatus)
{
auto trimmedName = Utils::Trim(name);
if (contactsList_ && !findContactByName(trimmedName)) {
//if (contactsList_ && !findContactByName(trimmedName) && !findContactByRingId(ringId)) {
Contact^ contact = ref new Contact(trimmedName, ringId, nullptr, 0);
Contact^ contact = ref new Contact(trimmedName, ringId, nullptr, 0, contactStatus);
contactsList_->Append(contact);
saveContactsToFile();
contactAdded(contact);
......@@ -178,13 +183,13 @@ ContactsViewModel::Destringify(String^ data)
accountIdAssociated = contactObject->GetNamedString(accountIdAssociatedKey);
vcardUID = contactObject->GetNamedString(vcardUIDKey);
}
auto contact = ref new Contact(name, ringid, guid, unreadmessages);
auto contact = ref new Contact(name, ringid, guid, unreadmessages, ContactStatus::READY);
contact->_displayName = displayname;
contact->_accountIdAssociated = accountIdAssociated;
// contact image
contact->_vcardUID = vcardUID;
std::string contactImageFile = RingD::instance->getLocalFolder() + ".vcards\\"
+ Utils::toString(contact->_vcardUID) + ".png";
+ Utils::toString(contact->_vcardUID) + ".png";
if (Utils::fileExists(contactImageFile)) {
contact->_avatarImage = Utils::toPlatformString(contactImageFile);
}
......@@ -233,10 +238,23 @@ void RingClientUWP::ViewModel::ContactsViewModel::OnincomingMessage(Platform::St
saveContactsToFile();
}
}
}
void
ContactsViewModel::modifyContact(Contact^ contact)
{
contactDataModified(contact);
}
}
void RingClientUWP::ViewModel::ContactsViewModel::OnregisteredNameFound(RingClientUWP::LookupStatus status, const std::string &address, const std::string &name)
{
if (status == LookupStatus::SUCCESS) {
for each (Contact^ contact in contactsList_)
if (contact->ringID_ == Utils::toPlatformString(address)) {
contact->_name = Utils::toPlatformString(name);
saveContactsToFile();
}
}
}
......@@ -47,7 +47,7 @@ internal:
/* functions */
Contact^ findContactByName(String^ name);
Contact^ findContactByRingId(String^ ringId);
Contact^ addNewContact(String^ name, String^ ringId);
Contact^ addNewContact(String^ name, String^ ringId, ContactStatus contactStatus = ContactStatus::READY);
void saveContactsToFile();
void openContactsFromFile();
String^ Stringify();
......@@ -76,6 +76,7 @@ private:
Contact^ oldItem_;
void OnincomingMessage(Platform::String ^callId, Platform::String ^payload);
void OnregisteredNameFound(RingClientUWP::LookupStatus status, const std::string &address, const std::string &name);
};
}
}
......@@ -20,4 +20,9 @@ public enum class LookupStatus {
ERRORR // one cannot simply use ERROR
};
public enum class ContactStatus {
WAITING_FOR_ACTIVATION, // waiting for lookup
READY
};
}
\ No newline at end of file
......@@ -96,7 +96,7 @@ MainPage::MainPage()
RingD::instance->registrationStateRegistered += ref new RingClientUWP::RegistrationStateRegistered(this, &RingClientUWP::MainPage::OnregistrationStateRegistered);
RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::MainPage::OncallPlaced);
RingD::instance->setLoadingStatusText += ref new SetLoadingStatusText([this](String^ statusText, String^ color){
RingD::instance->setLoadingStatusText += ref new SetLoadingStatusText([this](String^ statusText, String^ color) {
_loadingStatus_->Text = statusText;
auto col = Utils::ColorFromString(color);
auto brush = ref new Windows::UI::Xaml::Media::SolidColorBrush(col);
......
......@@ -136,13 +136,13 @@
<Grid Background="#FFF2F2F2">
<Grid.RowDefinitions>
<RowDefinition Height="61" />
<RowDefinition Height="auto" />
<RowDefinition Height="*"/>
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0"
Background="White"
Height="61">
Height="auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="60"/>
<ColumnDefinition Width="auto"/>
......@@ -157,7 +157,8 @@
</Ellipse>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="31" />
<RowDefinition Height="25" />
<RowDefinition Height="25" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
......@@ -169,7 +170,7 @@
</Grid>
<TextBlock x:Name="_title_"
Grid.Column="0"
Text="[TEXT MISSING]"
Text=""
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis"
VerticalAlignment="Center"
......@@ -186,7 +187,14 @@
</ComboBox.ItemTemplate>
</ComboBox>
</Grid>
<Grid Grid.Row="1">
<TextBlock x:Name="_profilName_"
Grid.Row="1"
Text=""
FontStyle="Italic"
VerticalAlignment="Center"
FontSize="16"
Margin="4,0,4,0" />
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="auto"/>
......
......@@ -42,6 +42,7 @@ using namespace Windows::UI::Core;
using namespace Windows::UI::Popups;
// refacto : the message text page should be
MessageTextPage::MessageTextPage()
{
InitializeComponent();
......@@ -69,13 +70,18 @@ RingClientUWP::Views::MessageTextPage::updatePageContent()
return;
/* show the name of contact on the page */
_title_->Text = contact->name_;
_title_->Text = contact->_name;
_profilName_->Text = contact->_displayName;
String^ image_path = Utils::toPlatformString(RingD::instance->getLocalFolder()) + ".vcards\\" + contact->_vcardUID + ".png";
if (Utils::fileExists(Utils::toString(image_path))) {
auto uri = ref new Windows::Foundation::Uri(image_path);
_contactBarAvatar_->ImageSource = ref new Windows::UI::Xaml::Media::Imaging::BitmapImage(uri);
}
else {
auto uri = ref new Windows::Foundation::Uri("ms-appx:///Assets/TESTS/contactAvatar.png");
_contactBarAvatar_->ImageSource = ref new Windows::UI::Xaml::Media::Imaging::BitmapImage(uri);
}
/* show messages */
_messagesList_->ItemsSource = contact->_conversation->_messages;
......
......@@ -151,7 +151,7 @@ void RingConsolePanel::sendCommand()
auto list = ContactsViewModel::instance->contactsList;
MSG_("list of calls returned by the daemon :");
for (auto contact : list) {
MSG_("name : " + Utils::toString(contact->name_));
MSG_("name : " + Utils::toString(contact->_name));
MSG_("ringId : " + Utils::toString(contact->ringID_));
}
return;
......
......@@ -906,7 +906,9 @@ RingD::dequeueTasks()
item->_callId = Utils::toPlatformString(callId);
//MSG_("$1 place call with id : " + Utils::toString(item->_callId));
callPlaced(Utils::toPlatformString(callId));
/* if for any reason there is no callid, do not propagate the event*/
if (!callId.empty())
callPlaced(Utils::toPlatformString(callId));
}));
}
......@@ -1118,7 +1120,7 @@ RingD::dequeueTasks()
}
case Request::LookUpAddress:
{
//DRing::lookupAddress(accountID.toStdString(), nameServiceURL.toStdString(), address.toStdString());
DRing::lookupAddress("", "", Utils::toString(task->_address));
break;
}
case Request::RegisterName:
......@@ -1129,12 +1131,14 @@ RingD::dequeueTasks()
if (accountDetails[DRing::Account::ConfProperties::USERNAME].empty())
registerName_new(task->_accountId_new, task->_password_new, task->_publicUsername_new);
else
{
result = DRing::registerName(task->_accountId_new, task->_password_new, task->_publicUsername_new);
CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(CoreDispatcherPriority::High,
ref new DispatchedHandler([=]() {
nameRegistred(result);
}));
CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(CoreDispatcherPriority::High,
ref new DispatchedHandler([=]() {
nameRegistred(result);
}));
}
//const wchar_t* toto = task->_accountId->Data();
......
This diff is collapsed.
......@@ -170,6 +170,8 @@ SmartPanel::SmartPanel()
RingD::instance->registrationStateErrorGeneric += ref new RingClientUWP::RegistrationStateErrorGeneric(this, &RingClientUWP::Views::SmartPanel::OnregistrationStateErrorGeneric);
RingD::instance->registrationStateRegistered += ref new RingClientUWP::RegistrationStateRegistered(this, &RingClientUWP::Views::SmartPanel::OnregistrationStateRegistered);
RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Views::SmartPanel::OncallPlaced);
menuOpen = MenuOpen::CONTACTS_LIST;
}
void
......@@ -233,6 +235,7 @@ void RingClientUWP::Views::SmartPanel::_smartGridButton__Clicked(Object^ sender,
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;
......@@ -247,6 +250,7 @@ void RingClientUWP::Views::SmartPanel::_accountsMenuButton__Checked(Object^ send
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;
......@@ -257,6 +261,7 @@ void RingClientUWP::Views::SmartPanel::_accountsMenuButton__Unchecked(Object^ se
void RingClientUWP::Views::SmartPanel::_settingsMenu__Checked(Object^ sender, RoutedEventArgs^ e)
{
menuOpen - MenuOpen::SETTINGS;
_accountsMenuButton__Unchecked(nullptr,nullptr);
_accountsMenuButton_->IsChecked = false;
_shareMenuButton__Unchecked(nullptr,nullptr);
......@@ -279,6 +284,7 @@ void RingClientUWP::Views::SmartPanel::_settingsMenu__Checked(Object^ sender, Ro
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;
......@@ -327,6 +333,7 @@ void RingClientUWP::Views::SmartPanel::setMode(RingClientUWP::Views::SmartPanel:
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;
......@@ -345,6 +352,7 @@ void RingClientUWP::Views::SmartPanel::_shareMenuButton__Checked(Platform::Objec
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;
......@@ -414,6 +422,13 @@ SmartPanel::_smartList__SelectionChanged(Platform::Object^ sender, Windows::UI::
{
auto listbox = dynamic_cast<ListBox^>(sender);
auto item = dynamic_cast<SmartPanelItem^>(listbox->SelectedItem);
if (item)
if (item->_contact->_contactStatus == ContactStatus::WAITING_FOR_ACTIVATION) {
listbox->SelectedItem = nullptr;
return;
}
SmartPanelItemsViewModel::instance->_selectedItem = item;
if (!item) {
......@@ -467,27 +482,28 @@ 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 (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 = "";
}
// /* 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);
}
// RingD::instance->lookUpName(_ringTxtBx_->Text);
//}
}
void RingClientUWP::Views::SmartPanel::_ringTxtBx__Click(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
......@@ -907,6 +923,7 @@ 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;
......@@ -920,6 +937,7 @@ void RingClientUWP::Views::SmartPanel::_devicesMenuButton__Unchecked(Platform::O
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;
......@@ -1333,10 +1351,10 @@ void RingClientUWP::Views::SmartPanel::_usernameTextBoxEdition__KeyUp(Platform::
checkStateEditionMenu();
}
// (XXX) il ne faudrait plus de ringtextbox dans cette fonction, elle devrait etre vider avant de receveoir le resultat
void RingClientUWP::Views::SmartPanel::OnregisteredNameFound(RingClientUWP::LookupStatus status, const std::string& address, const std::string& name)
{
if (_ringTxtBx_->Text->IsEmpty()) { // if true, we consider we did the lookup for a new account
if (menuOpen == MenuOpen::ACCOUNTS_LIST) { // if true, we did the lookup for a new account
/* note : this code do both check for edit and creation menu. It doesn't affect the use and it's easier to
implement. */
auto currentNameEdition = Utils::toString(_usernameTextBoxEdition_->Text);
......@@ -1389,35 +1407,54 @@ void RingClientUWP::Views::SmartPanel::OnregisteredNameFound(RingClientUWP::Look
return;
}
} else {// if false, we consider we are looking for a registered user
}
else { // if false, we are looking for a registered user (contact)
auto contact = ContactsViewModel::instance->findContactByName(Utils::toPlatformString(name));
if (contact == nullptr)
return;
switch (status) {
case LookupStatus::SUCCESS:
ContactsViewModel::instance->addNewContact(Utils::toPlatformString(name), Utils::toPlatformString(address));
ringTxtBxPlaceHolderDelay("username found and added.", 1500);
if (contact->_contactStatus == ContactStatus::WAITING_FOR_ACTIVATION) {
contact->_contactStatus = ContactStatus::READY;
contact->ringID_ = Utils::toPlatformString(address);
ringTxtBxPlaceHolderDelay("username found and added.", 5000);
ContactsViewModel::instance->saveContactsToFile();
}
break;
case LookupStatus::INVALID_NAME:
ringTxtBxPlaceHolderDelay("username invalid.", 1500);
if (name.length() == 40) {
ringTxtBxPlaceHolderDelay("ring id added.", 5000); // (XXX) on devrait valider que ce soit bien une clee ring
contact->ringID_ = Utils::toPlatformString(name);
contact->_contactStatus = ContactStatus::READY;
ContactsViewModel::instance->saveContactsToFile();
}
else {
ringTxtBxPlaceHolderDelay("username invalid.", 5000);
auto item = SmartPanelItemsViewModel::instance->findItem(contact);
ContactsViewModel::instance->deleteContact(contact);
SmartPanelItemsViewModel::instance->removeItem(item);
ContactsViewModel::instance->saveContactsToFile();
}
break;
case LookupStatus::NOT_FOUND:
{
ringTxtBxPlaceHolderDelay("username not found.", 1500);
ringTxtBxPlaceHolderDelay("username not found.", 5000);
auto item = SmartPanelItemsViewModel::instance->findItem(contact);
ContactsViewModel::instance->deleteContact(contact);
SmartPanelItemsViewModel::instance->removeItem(item);
ContactsViewModel::instance->saveContactsToFile();
break;
}
case LookupStatus::ERRORR:
ringTxtBxPlaceHolderDelay("network error!", 1500);
ringTxtBxPlaceHolderDelay("network error!", 5000);
auto item = SmartPanelItemsViewModel::instance->findItem(contact);
ContactsViewModel::instance->deleteContact(contact);
SmartPanelItemsViewModel::instance->removeItem(item);
ContactsViewModel::instance->saveContactsToFile();
break;
}
_ringTxtBx_->Text = "";
for (auto it : SmartPanelItemsViewModel::instance->itemsList) {
if (it->_contact->ringID_ == Utils::toPlatformString(address)) {
_smartList_->SelectedItem = it;
return;
}
}
_smartList_->SelectedItem = nullptr;
}
}
......@@ -1660,9 +1697,20 @@ SmartPanel::populateVideoRateSettingsComboBox()
void RingClientUWP::Views::SmartPanel::_ringTxtBx__KeyUp(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
{
if (e->Key == Windows::System::VirtualKey::Enter ) {
if (e->Key == Windows::System::VirtualKey::Enter) {
/// (XXX) RingD::instance->lookUpName(_ringTxtBx_->Text);
for (auto item : SmartPanelItemsViewModel::instance->itemsList) {
if (item->_contact->_name == _ringTxtBx_->Text) {
_smartList_->SelectedItem = item;
return;
}
}
auto contact = ContactsViewModel::instance->addNewContact(_ringTxtBx_->Text, "", ContactStatus::WAITING_FOR_ACTIVATION);
RingD::instance->lookUpName(_ringTxtBx_->Text);
_ringTxtBx_->Text = "";
for (auto item : SmartPanelItemsViewModel::instance->itemsList) {
item->_showMe = Windows::UI::Xaml::Visibility::Visible;
}
......@@ -1670,7 +1718,7 @@ void RingClientUWP::Views::SmartPanel::_ringTxtBx__KeyUp(Platform::Object^ sende
}
for (auto item : SmartPanelItemsViewModel::instance->itemsList) {
auto str1 = Utils::toString(item->_contact->name_);
auto str1 = Utils::toString(item->_contact->_name);
auto str2 = Utils::toString(_ringTxtBx_->Text);
if (str1.find(str2) != std::string::npos)
......@@ -1750,3 +1798,21 @@ void RingClientUWP::Views::SmartPanel::OncallPlaced(Platform::String ^callId)
{
_smartList_->SelectedItem = nullptr;
}
Object ^ RingClientUWP::Views::ContactStatusNotification::Convert(Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object ^ parameter, String ^ language)
{
auto contactStatus = static_cast<ContactStatus>(value);
if (contactStatus == ContactStatus::WAITING_FOR_ACTIVATION)
return Windows::UI::Xaml::Visibility::Visible;
else
return Windows::UI::Xaml::Visibility::Collapsed;
}
Object ^ RingClientUWP::Views::ContactStatusNotification::ConvertBack(Object ^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object ^ parameter, String ^ language)
{
throw ref new Platform::NotImplementedException();
}
RingClientUWP::Views::ContactStatusNotification::ContactStatusNotification()
{}
......@@ -80,6 +80,13 @@ public:
CollapseEmptyString();
};
public ref class ContactStatusNotification sealed : IValueConverter {
public:
virtual Object^ Convert(Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object^ parameter, String^ language);
virtual Object^ ConvertBack(Object^ value, Windows::UI::Xaml::Interop::TypeName targetType, Object^ parameter, String^ language);
ContactStatusNotification();
};
public ref class SmartPanel sealed
{
public:
......@@ -172,6 +179,16 @@ private:
void _PINTextBox__GotFocus(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void OnregistrationStateRegistered();
void OncallPlaced(Platform::String ^callId);
enum class MenuOpen {
CONTACTS_LIST,
ACCOUNTS_LIST,
SHARE,
DEVICE,
SETTINGS
};
MenuOpen menuOpen;
};