mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 13:48:02 +08:00
View::performClick add SoundEffect
This commit is contained in:
parent
a24a1d6340
commit
1bee5f2235
@ -56,8 +56,8 @@ static void endElement(void *userData, const XML_Char *name){
|
||||
}
|
||||
|
||||
void Preferences::load(const std::string&fname){
|
||||
std::ifstream fin(fname);
|
||||
if(access(fname.c_str(),F_OK)==0){
|
||||
std::ifstream fin(fname);
|
||||
mFileName=fname;
|
||||
load(fin);
|
||||
}else if(fname.find("<sections>")!=std::string::npos){
|
||||
|
@ -6070,8 +6070,10 @@ void View::setHovered(bool hovered) {
|
||||
}
|
||||
|
||||
bool View::performClick(){
|
||||
if(mListenerInfo && mListenerInfo->mOnClickListener)
|
||||
if(mListenerInfo && mListenerInfo->mOnClickListener){
|
||||
playSoundEffect(SoundEffectConstants::CLICK);
|
||||
mListenerInfo->mOnClickListener(*this);
|
||||
}
|
||||
return mListenerInfo!=nullptr && mListenerInfo->mOnClickListener!=nullptr;
|
||||
}
|
||||
|
||||
|
@ -3311,7 +3311,7 @@ bool ViewGroup::performKeyboardGroupNavigation(int direction){
|
||||
if (cluster && cluster->isRootNamespace()) {
|
||||
// the default cluster. Try to find a non-clustered view to focus.
|
||||
if (cluster->restoreFocusNotInCluster()) {
|
||||
//playSoundEffect(SoundEffectConstants.getContantForFocusDirection(direction));
|
||||
playSoundEffect(SoundEffectConstants::getContantForFocusDirection(direction));
|
||||
return true;
|
||||
}
|
||||
// otherwise skip to next actual cluster
|
||||
@ -3319,7 +3319,7 @@ bool ViewGroup::performKeyboardGroupNavigation(int direction){
|
||||
}
|
||||
|
||||
if (cluster && cluster->restoreFocusInCluster(realDirection)) {
|
||||
//playSoundEffect(SoundEffectConstants.getContantForFocusDirection(direction));
|
||||
playSoundEffect(SoundEffectConstants::getContantForFocusDirection(direction));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1814,7 +1814,9 @@ bool ListView::handleHorizontalFocusWithinListItem(int direction) {
|
||||
|
||||
bool ListView::arrowScroll(int direction) {
|
||||
mInLayout = true;
|
||||
bool handled=arrowScrollImpl(direction);
|
||||
const bool handled=arrowScrollImpl(direction);
|
||||
if(handled)
|
||||
playSoundEffect(SoundEffectConstants::getContantForFocusDirection(direction));
|
||||
mInLayout=false;
|
||||
return handled;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user