Commit 8e8787fa authored by Nicolas Jager's avatar Nicolas Jager
Browse files

fix : message text bugs

- fix wrong unread notifications.
- fix, closes the chat panel at the end of a call.
- cleanup some tricky code.

Change-Id: I65beca257bd4aee5451165ef6dc0a9ad5236161e
Tuleap: #790
parent cc883242
...@@ -232,7 +232,6 @@ void RingClientUWP::MainPage::OnsummonVideoPage() ...@@ -232,7 +232,6 @@ void RingClientUWP::MainPage::OnsummonVideoPage()
} }
} }
videoPage->chatOpen = false;
videoPage->updatePageContent(); videoPage->updatePageContent();
showFrame(_videoFrame_); showFrame(_videoFrame_);
} }
......
...@@ -72,6 +72,7 @@ RingClientUWP::Views::MessageTextPage::updatePageContent() ...@@ -72,6 +72,7 @@ RingClientUWP::Views::MessageTextPage::updatePageContent()
/* show the name of contact on the page */ /* show the name of contact on the page */
_title_->Text = contact->_name; _title_->Text = contact->_name;
_profilName_->Text = contact->_displayName; _profilName_->Text = contact->_displayName;
contact->_unreadMessages = 0;
String^ image_path = Utils::toPlatformString(RingD::instance->getLocalFolder()) + ".vcards\\" + contact->_vcardUID + ".png"; String^ image_path = Utils::toPlatformString(RingD::instance->getLocalFolder()) + ".vcards\\" + contact->_vcardUID + ".png";
if (Utils::fileExists(Utils::toString(image_path))) { if (Utils::fileExists(Utils::toString(image_path))) {
......
...@@ -256,8 +256,6 @@ ...@@ -256,8 +256,6 @@
</Border>--> </Border>-->
<Border x:Name="_visualNotificationNewMessage_" <Border x:Name="_visualNotificationNewMessage_"
Visibility="{x:Bind _contact._unreadMessages, Converter={StaticResource _NewMessageBubleNotification_}, Mode=OneWay}" Visibility="{x:Bind _contact._unreadMessages, Converter={StaticResource _NewMessageBubleNotification_}, Mode=OneWay}"
BorderThickness="2"
BorderBrush="White"
Style="{StaticResource BorderStyle2}"> Style="{StaticResource BorderStyle2}">
<TextBlock Text="{x:Bind _contact._unreadMessages, Mode=OneWay}" <TextBlock Text="{x:Bind _contact._unreadMessages, Mode=OneWay}"
Style="{StaticResource TextStyle3}"/> Style="{StaticResource TextStyle3}"/>
......
...@@ -136,6 +136,10 @@ VideoPage::VideoPage() ...@@ -136,6 +136,10 @@ VideoPage::VideoPage()
} }
case CallStatus::ENDED: case CallStatus::ENDED:
Video::VideoManager::instance->rendererManager()->raiseClearRenderTarget(); Video::VideoManager::instance->rendererManager()->raiseClearRenderTarget();
/* "close" the chat panel */
_rowChatBx_->Height = 0;
break; break;
case CallStatus::PEER_PAUSED: case CallStatus::PEER_PAUSED:
case CallStatus::PAUSED: case CallStatus::PAUSED:
...@@ -267,15 +271,13 @@ void RingClientUWP::Views::VideoPage::_btnPause__Tapped(Platform::Object^ sender ...@@ -267,15 +271,13 @@ void RingClientUWP::Views::VideoPage::_btnPause__Tapped(Platform::Object^ sender
void RingClientUWP::Views::VideoPage::_btnChat__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e) void RingClientUWP::Views::VideoPage::_btnChat__Tapped(Platform::Object^ sender, Windows::UI::Xaml::Input::TappedRoutedEventArgs^ e)
{ {
chatOpen = !chatOpen; if (_rowChatBx_->Height == 0) {
_rowChatBx_->Height = (chatOpen) ? 200 : 0;
/*if (chatOpen) {
_rowChatBx_->Height = 200; _rowChatBx_->Height = 200;
chatPanelCall(); SmartPanelItemsViewModel::instance->_selectedItem->_contact->_unreadMessages = 0;
} }
else { else {
_rowChatBx_->Height = 0; _rowChatBx_->Height = 0;
}*/ }
} }
...@@ -395,19 +397,8 @@ VideoPage::WriteFrameAsSoftwareBitmapAsync(String^ id, uint8_t* buf, int width, ...@@ -395,19 +397,8 @@ VideoPage::WriteFrameAsSoftwareBitmapAsync(String^ id, uint8_t* buf, int width,
void RingClientUWP::Views::VideoPage::OnincomingMessage(Platform::String ^callId, Platform::String ^payload) void RingClientUWP::Views::VideoPage::OnincomingMessage(Platform::String ^callId, Platform::String ^payload)
{ {
if (!chatOpen) { if (_rowChatBx_->Height == 0)
_rowChatBx_->Height = 200; _rowChatBx_->Height = 200;
chatOpen = true;
}
auto item = SmartPanelItemsViewModel::instance->_selectedItem;
//if (item)
// if (item->_callId != callId) {
// SmartPanelItemsViewModel::instance->findItem(callId)->_contact->_unreadMessages++;
// //item->_contact->_unreadMessages++;
// }
scrollDown(); scrollDown();
} }
......
...@@ -63,18 +63,6 @@ public: ...@@ -63,18 +63,6 @@ public:
} }
} }
property bool chatOpen // use this with a converter to set the height to 200px for the chatpanel...
{
bool get()
{
return chatOpen_;
}
void set(bool value)
{
chatOpen_ = value;
}
}
void scrollDown(); void scrollDown();
void screenVideo(bool state); void screenVideo(bool state);
...@@ -95,7 +83,6 @@ internal: ...@@ -95,7 +83,6 @@ internal:
private: private:
bool barFading_; bool barFading_;
bool chatOpen_;
void _sendBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e); void _sendBtn__Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e);
void _messageTextBox__KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e); void _messageTextBox__KeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment