// CLASS HEADER
#include "watch-application-impl.h"
+#include <style-monitor.h>
namespace Dali
{
}
WatchApplication::WatchApplication( int* argc, char** argv[], const std::string& stylesheet, Dali::Application::WINDOW_MODE windowMode )
-: Application(argc, argv, stylesheet, windowMode, Framework::WATCH)
+: Application(argc, argv, stylesheet, windowMode, PositionSize(), Framework::WATCH),
+ mState( UNINITIALIZED ),
+ mNeedForceRender( false )
{
+ Dali::StyleMonitor::Get().SetIgnoreGlobalFontSizeChange(1);
}
WatchApplication::~WatchApplication()
{
}
+void WatchApplication::OnInit()
+{
+ Application::OnInit();
+
+ Dali::Adaptor::Get().SetRenderRefreshRate( 2 ); // make 30 fps for watch applications
+
+ mState = INITIALIZED;
+}
+
+void WatchApplication::OnTerminate()
+{
+ Application::OnTerminate();
+
+ mState = TERMINATED;
+}
+
+void WatchApplication::OnResume()
+{
+ Application::OnResume();
+
+ mState = RESUMED;
+ mNeedForceRender = true;
+}
+
+void WatchApplication::OnPause()
+{
+ Application::OnPause();
+
+ mState = PAUSED;
+ mNeedForceRender = true;
+}
+
void WatchApplication::OnTimeTick(WatchTime& time)
{
Dali::WatchApplication watch(this);
mTickSignal.Emit( watch, time );
+
+ if( mNeedForceRender )
+ {
+ // This is a pre-resume scenario. All rendering engine of tizen SHOULD forcely update once at this time.
+ Internal::Adaptor::Adaptor::GetImplementation( GetAdaptor() ).RequestUpdateOnce();
+ mNeedForceRender = false;
+ }
+
+ // A watch application will queue messages to update the UI in the signal emitted above
+ // Process these immediately to avoid a blinking issue where the old time is briefly visible
+ CoreEventInterface& eventInterface = Internal::Adaptor::Adaptor::GetImplementation( GetAdaptor() );
+ eventInterface.ProcessCoreEvents();
}
void WatchApplication::OnAmbientTick(WatchTime& time)
{
Dali::WatchApplication watch(this);
mAmbientTickSignal.Emit( watch, time );
+
+ // A watch application will queue messages to update the UI in the signal emitted above
+ // Process these immediately to avoid a blinking issue where the old time is briefly visible
+ CoreEventInterface& eventInterface = Internal::Adaptor::Adaptor::GetImplementation( GetAdaptor() );
+ eventInterface.ProcessCoreEvents();
}
void WatchApplication::OnAmbientChanged(bool ambient)