Java Code Examples for android.view.View.OnLongClickListener

The following are Jave code examples for showing how to use OnLongClickListener of the android.view.View class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: SimpleUILauncher   File: AllAppsGridAdapter.java   Source Code and License Vote up 6 votes
public AllAppsGridAdapter(Launcher launcher, AlphabeticalAppsList apps, View.OnClickListener
        iconClickListener, View.OnLongClickListener iconLongClickListener) {
    Resources res = launcher.getResources();
    mLauncher = launcher;
    mApps = apps;
    mEmptySearchMessage = res.getString(R.string.all_apps_loading_message);
    mGridSizer = new GridSpanSizer();
    mGridLayoutMgr = new AppsGridLayoutManager(launcher);
    mGridLayoutMgr.setSpanSizeLookup(mGridSizer);
    mItemDecoration = new GridItemDecoration();
    mLayoutInflater = LayoutInflater.from(launcher);
    mIconClickListener = iconClickListener;
    mIconLongClickListener = iconLongClickListener;
    mSectionNamesMargin = res.getDimensionPixelSize(R.dimen.all_apps_grid_view_start_margin);
    mSectionHeaderOffset = res.getDimensionPixelSize(R.dimen.all_apps_grid_section_y_offset);
    mIsRtl = Utilities.isRtl(res);

    mSectionTextPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    mSectionTextPaint.setTextSize(res.getDimensionPixelSize(
            R.dimen.all_apps_grid_section_text_size));
    mSectionTextPaint.setColor(Utilities.getColorAccent(launcher));
}
 
Example 2
Project: Saiy-PS   File: UIBugsAdapter.java   Source Code and License Vote up 5 votes
/**
 * Constructor
 *
 * @param mObjects            list of {@link ContainerUI} elements
 * @param onClickListener     the listener of the parent
 * @param onLongClickListener the long click listener of the parent
 */
public UIBugsAdapter(@NonNull final ArrayList<ContainerUI> mObjects,
                     @NonNull final View.OnClickListener onClickListener,
                     @NonNull final View.OnLongClickListener onLongClickListener) {
    this.mObjects = mObjects;
    this.onClickListener = onClickListener;
    this.onLongClickListener = onLongClickListener;
}
 
Example 3
Project: BaseAdapterRel   File: ViewHolder.java   Source Code and License Vote up 5 votes
public ViewHolder setOnLongClickListener(int viewId,
                                         View.OnLongClickListener listener)
{
    View view = getView(viewId);
    view.setOnLongClickListener(listener);
    return this;
}
 
Example 4
Project: LaunchEnr   File: AllAppsGridAdapter.java   Source Code and License Vote up 5 votes
AllAppsGridAdapter(Launcher launcher, AlphabeticalAppsList apps, View.OnClickListener
        iconClickListener, View.OnLongClickListener iconLongClickListener) {
    Resources res = launcher.getResources();
    mLauncher = launcher;
    mApps = apps;
    mEmptySearchMessage = res.getString(R.string.all_apps_loading_message);
    mGridSizer = new GridSpanSizer();
    mGridLayoutMgr = new AppsGridLayoutManager(launcher);
    mGridLayoutMgr.setSpanSizeLookup(mGridSizer);
    mLayoutInflater = LayoutInflater.from(launcher);
    mIconClickListener = iconClickListener;
    mIconLongClickListener = iconLongClickListener;
}
 
Example 5
Project: FamilyBond   File: CustomPopupWindow.java   Source Code and License Vote up 4 votes
public void setOnLongClickListener(int viewId, View.OnLongClickListener listener) {
    View view = findView(viewId);
    view.setOnLongClickListener(listener);
}
 
Example 6
Project: YCBaseAdapter   File: BaseRvViewHolder.java   Source Code and License Vote up 4 votes
public BaseRvViewHolder setOnLongClickListener(int viewId, View.OnLongClickListener listener) {
    View view = getView(viewId);
    view.setOnLongClickListener(listener);
    return this;
}
 
Example 7
Project: MyFire   File: ViewHolderHelper.java   Source Code and License Vote up 4 votes
public ViewHolderHelper setOnLongClickListener(int viewId,
                                               View.OnLongClickListener listener) {
    View view = getView(viewId);
    view.setOnLongClickListener(listener);
    return this;
}
 
Example 8
Project: SDCardCleaner   File: FileListAdapter.java   Source Code and License Vote up 4 votes
public FileListAdapter(View.OnClickListener _listener_click, View.OnLongClickListener _listener_long) {
    this._listener_click = _listener_click;
    this._listener_long = _listener_long;
}
 
Example 9
Project: Bailan   File: ViewHolder.java   Source Code and License Vote up 4 votes
public ViewHolder setOnLongClickListener(int viewId,
                                         View.OnLongClickListener listener) {
    View view = getView(viewId);
    view.setOnLongClickListener(listener);
    return this;
}
 
Example 10
Project: RxJava2RetrofitDemo   File: MartianAdapterViewHolder.java   Source Code and License Vote up 4 votes
@Override
public IViewHolder setOnLongClickListener(int viewId, View.OnLongClickListener listener) {
    mMartianViewHolder.setOnLongClickListener(viewId, listener);
    return this;
}
 
Example 11
Project: Android-Code-Demos   File: CustomPopupWindow.java   Source Code and License Vote up 4 votes
public void setOnLongClickListener(int viewId, View.OnLongClickListener listener) {
    View view = findView(viewId);
    view.setOnLongClickListener(listener);
}
 
Example 12
Project: CoordinatorLayoutExample-master   File: BaseRecyclerHolder.java   Source Code and License Vote up 4 votes
public BaseRecyclerHolder setOnLongClickListener(int viewId, View.OnLongClickListener
        listener) {
    View view = getView(viewId);
    view.setOnLongClickListener(listener);
    return this;
}
 
Example 13
Project: PlayAndroid   File: ViewHolder.java   Source Code and License Vote up 4 votes
public ViewHolder setOnLongClickListener(@IdRes int viewId, View.OnLongClickListener listener) {
    View view = getView(viewId);
    view.setOnLongClickListener(listener);
    return this;
}
 
Example 14
Project: SimpleUILauncher   File: CheckLongPressHelper.java   Source Code and License Vote up 4 votes
public CheckLongPressHelper(View v, View.OnLongClickListener listener) {
    mView = v;
    mListener = listener;
}
 
Example 15
Project: HabitUp   File: EventListAdapter.java   Source Code and License Vote up 4 votes
public void setOnLongClickListener(View.OnLongClickListener listener) {
    this.longClickListener = listener;
}
 
Example 16
Project: GitHub   File: BaseViewHolder.java   Source Code and License Vote up 3 votes
/**
 * Sets the on long click listener of the view.
 *
 * @param viewId   The view id.
 * @param listener The on long click listener;
 * @return The BaseViewHolder for chaining.
 * Please use {@link #addOnLongClickListener(int)} (adapter.setOnItemChildLongClickListener(listener))}
 */
@Deprecated
public BaseViewHolder setOnLongClickListener(@IdRes int viewId, View.OnLongClickListener listener) {
    View view = getView(viewId);
    view.setOnLongClickListener(listener);
    return this;
}
 
Example 17
Project: encdroidMC   File: IPhotoView.java   Source Code and License Vote up 2 votes
/**
 * Register a callback to be invoked when the Photo displayed by this view is long-pressed.
 *
 * @param listener - Listener to be registered.
 */
void setOnLongClickListener(View.OnLongClickListener listener);
 
Example 18
Project: Recognize-it   File: IPhotoView.java   Source Code and License Vote up 2 votes
/**
 * Register a callback to be invoked when the Photo displayed by this view is long-pressed.
 *
 * @param listener - Listener to be registered.
 */
void setOnLongClickListener(View.OnLongClickListener listener);
 
Example 19
Project: RxJava2RetrofitDemo   File: IViewHolder.java   Source Code and License Vote up 2 votes
/**
 * Sets the on long click listener of the iView.
 */
IViewHolder setOnLongClickListener(int viewId, View.OnLongClickListener listener);
 
Example 20
Project: DailyStudy   File: IPhotoView.java   Source Code and License Vote up 2 votes
/**
 * Register a callback to be invoked when the Photo displayed by this view is long-pressed.
 *
 * @param listener - Listener to be registered.
 */
void setOnLongClickListener(View.OnLongClickListener listener);