/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/asset-manager/asset-manager.h>
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
const char* const ACTOR_FOCUSABLE("focusable");
const char* const IS_FOCUS_GROUP("isFocusGroup");
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.9.png";
+const char* FOCUS_BORDER_IMAGE_FILE_NAME = "B16-8_TTS_focus.9.png";
-const char* FOCUS_SOUND_FILE = DALI_SOUND_DIR "Focus.ogg";
-const char* FOCUS_CHAIN_END_SOUND_FILE = DALI_SOUND_DIR "End_of_List.ogg";
+const char* FOCUS_SOUND_FILE_NAME = "Focus.ogg";
+const char* FOCUS_CHAIN_END_SOUND_FILE_NAME = "End_of_List.ogg";
/**
* The function to be used in the hit-test algorithm to check whether the actor is hittable.
mFocusIndicatorActor(),
mPreviousPosition( 0.0f, 0.0f ),
mRecursiveFocusMoveCounter(0),
+ mFocusSoundFilePath(),
+ mFocusChainEndSoundFilePath(),
mIsWrapped(false),
mIsFocusWithinGroup(false),
mIsEndcapFeedbackEnabled(false),
mIsAccessibilityTtsEnabled(false),
mTtsCreated(false),
mIsFocusIndicatorEnabled(false),
- mContinuousPlayMode(false)
+ mContinuousPlayMode(false),
+ mIsFocusSoundFilePathSet(false),
+ mIsFocusChainEndSoundFilePathSet(false)
{
}
Dali::SoundPlayer soundPlayer = Dali::SoundPlayer::Get();
if(soundPlayer)
{
- soundPlayer.PlaySound(FOCUS_SOUND_FILE);
+ if (!mIsFocusSoundFilePathSet)
+ {
+ const std::string soundDirPath = AssetManager::GetDaliSoundPath();
+ mFocusSoundFilePath = soundDirPath + FOCUS_SOUND_FILE_NAME;
+ mIsFocusSoundFilePathSet = true;
+ }
+ soundPlayer.PlaySound(mFocusSoundFilePath);
}
// Play the accessibility attributes with the TTS player.
if( ! mFocusIndicatorActor )
{
// Create the default if it hasn't been set and one that's shared by all the keyboard focusable actors
- mFocusIndicatorActor = Toolkit::ImageView::New( FOCUS_BORDER_IMAGE_PATH );
+ const std::string imageDirPath = AssetManager::GetDaliImagePath();
+ const std::string focusBorderImagePath = imageDirPath + FOCUS_BORDER_IMAGE_FILE_NAME;
+
+ mFocusIndicatorActor = Toolkit::ImageView::New(focusBorderImagePath);
mFocusIndicatorActor.SetParentOrigin( ParentOrigin::CENTER );
mFocusIndicatorActor.SetZ( 1.0f );
Dali::SoundPlayer soundPlayer = Dali::SoundPlayer::Get();
if(soundPlayer)
{
- soundPlayer.PlaySound(FOCUS_CHAIN_END_SOUND_FILE);
+ if (!mIsFocusChainEndSoundFilePathSet)
+ {
+ const std::string soundDirPath = AssetManager::GetDaliSoundPath();
+ mFocusChainEndSoundFilePath = soundDirPath + FOCUS_CHAIN_END_SOUND_FILE_NAME;
+ mIsFocusChainEndSoundFilePathSet = true;
+ }
+ soundPlayer.PlaySound(mFocusChainEndSoundFilePath);
}
mIsEndcapFeedbackPlayed = true;
return handled;
}
-bool AccessibilityManager::HandlePanGesture(const Integration::PanGestureEvent& panEvent)
+bool AccessibilityManager::HandlePanGesture(const AccessibilityGestureEvent& panEvent)
{
bool handled = false;
- if( panEvent.state == Gesture::Started )
+ if( panEvent.state == AccessibilityGestureEvent::Started )
{
// Find the focusable actor at the event position
Dali::HitTestAlgorithm::Results results;
// Gesture::Finished (Up) events are delivered with previous (Motion) event position
// Use the real previous position; otherwise we may incorrectly get a ZERO velocity
- if ( Gesture::Finished != panEvent.state )
+ if ( AccessibilityGestureEvent::Finished != panEvent.state )
{
// Store the previous position for next Gesture::Finished iteration.
mPreviousPosition = panEvent.previousPosition;
Actor rootActor = Stage::GetCurrent().GetRootLayer();
- Dali::PanGesture pan(panEvent.state);
+ Dali::PanGesture pan( static_cast<Dali::Gesture::State>(panEvent.state) );
+
pan.time = panEvent.time;
pan.numberOfTouches = panEvent.numberOfTouches;
pan.screenPosition = panEvent.currentPosition;