mirror of
https://gitee.com/houstudio/Cdroid.git
synced 2024-12-05 05:37:53 +08:00
View::soundEffectEnable set default to true
This commit is contained in:
parent
1bee5f2235
commit
0a1bb3a9c8
@ -207,11 +207,11 @@ View::View(Context*ctx,const AttributeSet&attrs){
|
||||
setVisibility(attrs.getInt("visibility",std::map<const std::string,int>{
|
||||
{"gone",(int)GONE},{"invisible",(int)INVISIBLE},{"visible",(int)VISIBLE} },(int)VISIBLE));
|
||||
|
||||
if(attrs.getBoolean("soundEffectsEnabled",true)){
|
||||
if(!attrs.getBoolean("soundEffectsEnabled",true)){
|
||||
viewFlagValues &= ~SOUND_EFFECTS_ENABLED;
|
||||
viewFlagMasks |= SOUND_EFFECTS_ENABLED;
|
||||
}
|
||||
if(attrs.getBoolean("hapticFeedbackEnabled",true)){
|
||||
if(!attrs.getBoolean("hapticFeedbackEnabled",true)){
|
||||
viewFlagValues &= ~HAPTIC_FEEDBACK_ENABLED;
|
||||
viewFlagMasks |= HAPTIC_FEEDBACK_ENABLED;
|
||||
}
|
||||
@ -479,7 +479,7 @@ void View::initView(){
|
||||
mBoundsChangedmDefaultFocusHighlightSizeChanged = false;
|
||||
|
||||
mOldWidthMeasureSpec = mOldHeightMeasureSpec = INT_MIN;
|
||||
mViewFlags = ENABLED|VISIBLE|FOCUSABLE_AUTO;
|
||||
mViewFlags = SOUND_EFFECTS_ENABLED | HAPTIC_FEEDBACK_ENABLED | ENABLED|VISIBLE|FOCUSABLE_AUTO;
|
||||
mPrivateFlags = mPrivateFlags2 = mPrivateFlags3 = 0;
|
||||
mPrivateFlags2 = (LAYOUT_DIRECTION_DEFAULT << PFLAG2_LAYOUT_DIRECTION_MASK_SHIFT) |
|
||||
(TEXT_DIRECTION_DEFAULT << PFLAG2_TEXT_DIRECTION_MASK_SHIFT) |
|
||||
@ -6741,6 +6741,7 @@ bool View::isSoundEffectsEnabled()const{
|
||||
}
|
||||
|
||||
void View::playSoundEffect(int soundConstant){
|
||||
LOGD_IF(mAttachInfo&&mAttachInfo->mPlaySoundEffect,"%p:%d fun=%p soundConstant=%d enabled=%d",this,mID,mAttachInfo->mPlaySoundEffect,soundConstant,isSoundEffectsEnabled());
|
||||
if(mAttachInfo==nullptr||mAttachInfo->mPlaySoundEffect==nullptr||isSoundEffectsEnabled()==false)
|
||||
return ;
|
||||
mAttachInfo->mPlaySoundEffect(soundConstant);
|
||||
|
@ -640,12 +640,6 @@ protected:
|
||||
int getSuggestedMinimumHeight();
|
||||
void setMeasuredDimension(int measuredWidth, int measuredHeight);
|
||||
bool handleScrollBarDragging(MotionEvent& event);
|
||||
void setSoundEffectsEnabled(bool soundEffectsEnabled);
|
||||
bool isSoundEffectsEnabled()const;
|
||||
void playSoundEffect(int soundConstant);
|
||||
void setHapticFeedbackEnabled(bool hapticFeedbackEnabled);
|
||||
bool isHapticFeedbackEnabled()const;
|
||||
bool performHapticFeedback(int feedbackConstant, int flags=0);
|
||||
bool performButtonActionOnTouchDown(MotionEvent&);
|
||||
|
||||
void onAnimationStart();
|
||||
@ -754,6 +748,13 @@ public:
|
||||
void clearAnimation();
|
||||
void setAnimation(Animation* animation);
|
||||
|
||||
void setSoundEffectsEnabled(bool soundEffectsEnabled);
|
||||
bool isSoundEffectsEnabled()const;
|
||||
void playSoundEffect(int soundConstant);
|
||||
void setHapticFeedbackEnabled(bool hapticFeedbackEnabled);
|
||||
bool isHapticFeedbackEnabled()const;
|
||||
bool performHapticFeedback(int feedbackConstant, int flags=0);
|
||||
|
||||
void setDrawingCacheEnabled(bool);
|
||||
bool isDrawingCacheEnabled()const;
|
||||
|
||||
|
@ -1816,7 +1816,7 @@ bool ListView::arrowScroll(int direction) {
|
||||
mInLayout = true;
|
||||
const bool handled=arrowScrollImpl(direction);
|
||||
if(handled)
|
||||
playSoundEffect(SoundEffectConstants::getContantForFocusDirection(direction));
|
||||
playSoundEffect(SoundEffectConstants::getContantForFocusDirection(direction));
|
||||
mInLayout=false;
|
||||
return handled;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user