Example usage for android.view SoundEffectConstants CLICK

List of usage examples for android.view SoundEffectConstants CLICK

Introduction

In this page you can find the example usage for android.view SoundEffectConstants CLICK.

Prototype

int CLICK

To view the source code for android.view SoundEffectConstants CLICK.

Click Source Link

Usage

From source file:am.widget.tabstrip.TabStripView.java

@Override
public boolean performClick() {
    final boolean click = mHelper.performClick();
    final boolean result = super.performClick();
    if (result)/*ww w  . java  2  s.c  o m*/
        return true;
    if (click) {
        playSoundEffect(SoundEffectConstants.CLICK);
        return true;
    }
    return false;
}

From source file:com.finchuk.clock2.alarms.ui.TempCheckableImageButton.java

@Override // borrowed from CompoundButton#performClick()
public boolean performClick() {
    toggle();/*from   ww w .ja v  a2 s.  c o  m*/
    final boolean handled = super.performClick();
    if (!handled) {
        // View only makes a sound effect if the onClickListener was
        // called, so we'll need to make one here instead.
        playSoundEffect(SoundEffectConstants.CLICK);
    }
    return handled;
}

From source file:am.widget.basetabstrip.BaseTabStrip.java

/**
 * /*from  w  ww.  j av a  2s  .  c o m*/
 *
 * @param position       ?
 * @param smoothScroll   ?
 * @param notifyListener ??
 * @return ?
 */
public boolean performClick(int position, boolean smoothScroll, boolean notifyListener) {
    if (getViewPager() != null && position >= 0 && position < getItemCount()) {
        clickSelectedItem = position == mPosition;
        mPosition = position;
        if (!clickSelectedItem) {
            if (!smoothScroll) {
                mCurrentPager = position;
                mLastKnownPosition = mCurrentPager;
                mLastKnownPositionOffset = 0;
                jumpTo(mCurrentPager);
                notifyJumpTo(mCurrentPager);
            }
            getViewPager().setCurrentItem(position, smoothScroll);
        }
        if (clickListener != null && notifyListener) {
            clickListener.onItemClick(mPosition);
        }
        playSoundEffect(SoundEffectConstants.CLICK);
        return true;
    }
    return false;
}

From source file:org.opensilk.common.ui.widget.FloatingActionButton.java

protected boolean performDoubleClick() {
    if (mOnDoubleClickListener != null) {
        sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
        playSoundEffect(SoundEffectConstants.CLICK);
        mOnDoubleClickListener.onDoubleClick(this);
        return true;
    } else {//from   w w w.j ava 2  s.com
        return performClick();
    }
}

From source file:net.simonvt.staggeredgridview.StaggeredGridView.java

private void performClick(View view, int position, long id) {
    if (onItemClickListener != null) {
        playSoundEffect(SoundEffectConstants.CLICK);
        if (view != null) {
            view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
        }//ww w.  ja  v  a2s.  co  m
        onItemClickListener.onItemClick(this, view, position, id);
    }
}

From source file:com.actionbarsherlock.internal.widget.IcsAdapterView.java

/**
 * Call the OnItemClickListener, if it is defined.
 *
 * @param view The view within the AdapterView that was clicked.
 * @param position The position of the view in the adapter.
 * @param id The row id of the item that was clicked.
 * @return True if there was an assigned OnItemClickListener that was
 *         called, false otherwise is returned.
 *//*from  w w w  .j a v  a 2  s.c  o  m*/
public boolean performItemClick(View view, int position, long id) {
    if (mOnItemClickListener != null) {
        playSoundEffect(SoundEffectConstants.CLICK);
        if (view != null) {
            view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
        }
        mOnItemClickListener.onItemClick(/*this*/null, view, position, id);
        return true;
    }

    return false;
}

From source file:android.support.v7.app.MediaRouteButton.java

@Override
public boolean performClick() {
    // Send the appropriate accessibility events and call listeners
    boolean handled = super.performClick();
    if (!handled) {
        playSoundEffect(SoundEffectConstants.CLICK);
    }/*from   w w w  .  j a  v a  2  s. c o m*/
    return showDialog() || handled;
}

From source file:org.i_chera.wolfensteineditor.fragments.LevelFragment.java

private void hitTileOnView(MotionEvent event, int k, boolean makeSound) {
    int i, j;//from   w w w.j  a va2s.co m
    j = (int) (MotionEventCompat.getX(event, k) + mHorizontalScroll.getScrollX()) / mTileSize;
    i = (int) (MotionEventCompat.getY(event, k) + mVerticalScroll.getScrollY()) / mTileSize;
    if (j >= 0 && j < LevelContainer.MAPSIZE && i >= 0 && i < LevelContainer.MAPSIZE)
        if (mTileViews[i][j] != null) {
            onClick(mTileViews[i][j]);
            if (makeSound)
                mTileViews[i][j].playSoundEffect(SoundEffectConstants.CLICK);
        }
}

From source file:com.seek.ruler.SimpleRulerView.java

/**
 * allowed to tab up to select/*from  ww w.ja  v  a  2s.c om*/
 */
@Override
public boolean onSingleTapUp(MotionEvent e) {
    playSoundEffect(SoundEffectConstants.CLICK);
    refreshSelected((int) (getScrollX() + e.getX() - mMaxOverScrollDistance));
    adjustPosition();
    return true;
}

From source file:nz.ac.otago.psyanlab.common.designer.program.stage.StageView.java

public boolean performStageMultipleFingerClick(int fingersDown) {
    OnStageClickListener listener = mOnStageClickListeners.get(fingersDown);
    if (listener != null) {
        playSoundEffect(SoundEffectConstants.CLICK);
        sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
        listener.onStageClick(this);
        return true;
    }//from w w  w.  j a v  a 2 s  . co m

    return false;
}