當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。