当前位置: 首页>>代码示例>>Java>>正文


Java View.DragShadowBuilder方法代码示例

本文整理汇总了Java中android.view.View.DragShadowBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java View.DragShadowBuilder方法的具体用法?Java View.DragShadowBuilder怎么用?Java View.DragShadowBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.DragShadowBuilder方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLongClick

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onLongClick(View v) {
    ClipData.Item item = new ClipData.Item("" + v.getTag());
    ClipData dragData = new ClipData("" + v.getTag(), new String[] {ClipDescription.MIMETYPE_TEXT_PLAIN},item);

    View.DragShadowBuilder myShadow = new MyDragShadowBuilder(v);

    showDragBuide();
    v.startDrag(dragData,  // the data to be dragged
            myShadow,  // the drag shadow builder
            null,      // no need to use local data
            0          // flags (not currently used, set to 0)
    );
    v.setAlpha(0.2f);
    return true;
}
 
开发者ID:monthlypub,项目名称:SmingZZick_App,代码行数:17,代码来源:StickerApplyAdapter.java

示例2: onLongClick

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);




    return (true);
}
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:17,代码来源:LacoDeRepeticao7.java

示例3: startDrag

import android.view.View; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public final void startDrag(View.DragShadowBuilder dragShadowBuilder) {
    Point shadowSize = new Point();
    Point shadowTouchPoint = new Point();
    dragShadowBuilder.onProvideShadowMetrics(shadowSize, shadowTouchPoint);

    itemView.startDrag(null, dragShadowBuilder,
            new DragInfo(getItemId(), shadowSize, shadowTouchPoint, adapter.getLastTouchPoint()), 0);

    adapter.notifyItemChanged(getAdapterPosition());
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:DragSortAdapter.java

示例4: startDrag

import android.view.View; //导入方法依赖的package包/类
public boolean startDrag() {

        if (mDragPotential==null) return false;

        AppLauncher dragitem = (AppLauncher) mDragPotential.getTag();
        String label = dragitem.getLabel();
        ClipData data = ClipData.newPlainText(label, label);
        View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(mDragPotential);

        boolean dragstarted;
        if (Build.VERSION.SDK_INT>=24) {
            dragstarted = mDragPotential.startDragAndDrop(data, shadowBuilder, mDragPotential, 0);
        } else {
            dragstarted = mDragPotential.startDrag(data, shadowBuilder, mDragPotential, 0);
        }

        if (dragstarted) {
            mBeingDragged = dragitem;
            mDragDropSource = (ViewGroup) mDragPotential.getParent();
            Log.d(TAG, "Drag started: " + dragitem.getActivityName() +  ", source = " + mDragDropSource);
            showHiddenCategories();

           // Log.d(TAG, "source = " + mDragDropSource);
            //if (mDragDropSource.getId()!=R.id.icontarget) {
                showRemoveDropzone();
            //}
            return true;
        }


        return false;
    }
 
开发者ID:quaap,项目名称:LaunchTime,代码行数:33,代码来源:MainActivity.java

示例5: startDrag

import android.view.View; //导入方法依赖的package包/类
/**
 * Start a drag motion.
 *
 * @param source source
 * @param shadow shadow
 * @param data   data
 */
public void startDrag(View source, View.DragShadowBuilder shadow, Object data) {
    ClipData clipData = ClipData.newPlainText(data.getClass().getName(), "");
    DragData dragData = new DragData(source, data);
    int token = clipData.getDescription().hashCode();
    mDraggedItems.put(token, dragData);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
        DragStarterPostNougatImpl.startDrag(source, clipData, shadow, token, 0);
    } else {
        DragStarterPreNougatImpl.startDrag(source, clipData, shadow, token, 0);
    }
}
 
开发者ID:elimu-ai,项目名称:egma-shapi,代码行数:19,代码来源:DragHelper.java

示例6: getShadowBuilder

import android.view.View; //导入方法依赖的package包/类
public View.DragShadowBuilder getShadowBuilder(View itemView, Point touchPoint) {
    return new DragSortShadowBuilder(itemView, touchPoint);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:DragSortAdapter.java

示例7: getShadowBuilder

import android.view.View; //导入方法依赖的package包/类
@Override public View.DragShadowBuilder getShadowBuilder(View itemView, Point touchPoint) {
    return new NoForegroundShadowBuilder(itemView, touchPoint);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:DragAdatper.java

示例8: onLongClick

import android.view.View; //导入方法依赖的package包/类
@Override
public boolean onLongClick(View v) {
    ClipData data = ClipData.newPlainText("simple_text", "text");


    View.DragShadowBuilder sb = new View.DragShadowBuilder(v);

    v.startDrag(data, sb, v, 0);

    v.setVisibility(View.INVISIBLE);


    return (true);
}
 
开发者ID:jvbeltra,项目名称:JavaIsFun,代码行数:15,代码来源:Matrizes6.java

示例9: startDrag

import android.view.View; //导入方法依赖的package包/类
/**
 * Used to start a drag on the given view.
 *
 * @param source   view from which the drag motion is started.
 * @param clipData data linked to the drag motion.
 * @param shadow   shadow displayed during the drag.
 * @param token    token.
 * @param i        flags.
 */
public static void startDrag(View source, ClipData clipData, View.DragShadowBuilder shadow, int token, int i) {
    source.startDrag(clipData, shadow, token, i);
}
 
开发者ID:elimu-ai,项目名称:egma-shapi,代码行数:13,代码来源:DragStarterPreNougatImpl.java

示例10: startDrag

import android.view.View; //导入方法依赖的package包/类
/**
 * Used to start a drag on the given view.
 *
 * @param source   view from which the drag motion is started.
 * @param clipData data linked to the drag motion.
 * @param shadow   shadow displayed during the drag.
 * @param token    token.
 * @param i        flags.
 */
public static void startDrag(View source, ClipData clipData, View.DragShadowBuilder shadow, int token, int i) {
    source.startDragAndDrop(clipData, shadow, token, i);
}
 
开发者ID:elimu-ai,项目名称:egma-shapi,代码行数:13,代码来源:DragStarterPostNougatImpl.java


注:本文中的android.view.View.DragShadowBuilder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。