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


Java DragSortController类代码示例

本文整理汇总了Java中com.mobeta.android.dslv.DragSortController的典型用法代码示例。如果您正苦于以下问题:Java DragSortController类的具体用法?Java DragSortController怎么用?Java DragSortController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: onActivityCreated

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setupFragmentData();
    mListView.setOnCreateContextMenuListener(this);
    mListView.setOnItemClickListener(this);
    mListView.setAdapter(mAdapter);
    DragSortController controller = new DragSortController(mListView);
    //设置拖拽控件
    controller.setDragHandleId(R.id.listview_drag_handle);
    controller.setRemoveEnabled(true);
    controller.setRemoveMode(1);
    mListView.setFloatViewManager(controller);
    mListView.setOnTouchListener(controller);
    getLoaderManager().initLoader(0, null, this);
}
 
开发者ID:cpoopc,项目名称:com.cp.monsterMod,代码行数:17,代码来源:DragSortListViewFragment.java

示例2: onCreate

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_organize_urls);
	
	ActionBar actionBar = getSupportActionBar();
	actionBar.setDisplayHomeAsUpEnabled(true);
	
	DragSortListView list = (DragSortListView) getListView();
	list.setDropListener(dropListener);
	list.setRemoveListener(removeListener);

	DragSortController controller = new DragSortController(list);
	controller.setDragInitMode(DragSortController.ON_DRAG);
	controller.setRemoveMode(DragSortController.FLING_REMOVE);
       controller.setRemoveEnabled(true);
	controller.setDragHandleId(R.id.drag_handle);
	list.setOnTouchListener(controller);
	
	mAdapter = new OrganizeAdapter(this, new ArrayList<UriBean>());
	setListAdapter(mAdapter);
}
 
开发者ID:minstrelsy,项目名称:servestream,代码行数:23,代码来源:OrganizeUrlsActivity.java

示例3: onCreateView

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	View v = inflater.inflate(R.layout.panels_order_prefs_layout, container, false);
	DragSortListView dragList = (DragSortListView) v.findViewById(android.R.id.list);
	List<String> panelsOrder = PanelsOrderResolver.getPanelsOrder(getActivity());
	mAdapter = new PanelsDragAdapter(getActivity().getApplicationContext(), 
			R.layout.toggles_list_item, R.id.list_item_text, 
			panelsOrder);
	
	dragList.setAdapter(mAdapter);
	dragList.setDropListener(new DropListener() {
		@Override
		public void drop(int from, int to) {
			String item = mAdapter.getItem(from);
			mAdapter.remove(item);
			mAdapter.insert(item, to);
			PanelsOrderEditor.savePanelsOrder(getActivity(), mAdapter.getList());
		}
	});

	DragSortController controller = new DragSortController(dragList);
	controller.setDragHandleId(R.id.list_item_image);
	controller.setRemoveEnabled(false);
	controller.setSortEnabled(true);
	controller.setDragInitMode(DragSortController.ON_DRAG);

	dragList.setFloatViewManager(controller);
	dragList.setOnTouchListener(controller);
	dragList.setDragEnabled(true);

	SimpleFloatViewManager simpleFloatViewManager = new SimpleFloatViewManager(dragList);
	simpleFloatViewManager.setBackgroundColor(Color.TRANSPARENT);
	dragList.setFloatViewManager(simpleFloatViewManager);
	
	return v;
}
 
开发者ID:hvmunlimited,项目名称:QuickControlPanel,代码行数:37,代码来源:PanelsOrderPrefsFragment.java

示例4: SectionController

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
public SectionController(ListView list_V, CategoriesAdapter adapter)
{
    super((DragSortListView) list_V, 0, DragSortController.ON_LONG_PRESS, 0);
    setRemoveEnabled(false);
    this.list_V = list_V;
    this.adapter = adapter;
}
 
开发者ID:kimkha,项目名称:Finanvita,代码行数:8,代码来源:CategoryListFragment.java

示例5: buildController

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
public DragSortController buildController(DragSortListView dslv) {
    DragSortController controller = new DragSortController(dslv);
    controller.setDragHandleId(R.id.handle_icon);
    controller.setDragInitMode(DragSortController.ON_DOWN);
    controller.setBackgroundColor(0x55000000);
    return controller;
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:8,代码来源:EditShortcutBar.java

示例6: getItemLayout

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
/**
 * Return list item layout resource passed to the ArrayAdapter.
 */
protected int getItemLayout() {
    /*if (removeMode == DragSortController.FLING_LEFT_REMOVE || removeMode == DragSortController.SLIDE_LEFT_REMOVE) {
        return R.layout.list_item_handle_right;
    } else */
	if (removeMode == DragSortController.CLICK_REMOVE) {
        return R.layout.list_item_click_remove;
    } else {
        return R.layout.list_item_handle_left;
    }
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:14,代码来源:DSLVFragment.java

示例7: buildController

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
/**
 * Called in onCreateView. Override this to provide a custom
 * DragSortController.
 */
public DragSortController buildController(DragSortListView dslv) {
    // defaults are
    //   dragStartMode = onDown
    //   removeMode = flingRight
    DragSortController controller = new DragSortController(dslv);
    controller.setDragHandleId(R.id.drag_handle);
    controller.setClickRemoveId(R.id.click_remove);
    controller.setRemoveEnabled(removeEnabled);
    controller.setSortEnabled(sortEnabled);
    controller.setDragInitMode(dragStartMode);
    controller.setRemoveMode(removeMode);
    return controller;
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:18,代码来源:DSLVFragment.java

示例8: startDragPosition

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public int startDragPosition(MotionEvent ev) {
    int res = super.dragHandleHitPosition(ev);
    int width = mDslv.getWidth();

    if ((int) ev.getX() < width / 3) {
        return res;
    } else {
        return DragSortController.MISS;
    }
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:12,代码来源:DSLVFragmentBGHandle.java

示例9: SectionController

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
public SectionController(DragSortListView dslv, SectionAdapter adapter) {
    super(dslv, R.id.text, DragSortController.ON_DOWN, 0);
    setRemoveEnabled(false);
    mDslv = dslv;
    mAdapter = adapter;
    mDivPos = adapter.getDivPosition();
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:8,代码来源:Sections.java

示例10: startDragPosition

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public int startDragPosition(MotionEvent ev) {
    int res = super.dragHandleHitPosition(ev);
    if (res == mDivPos) {
        return DragSortController.MISS;
    }

    int width = mDslv.getWidth();

    if ((int) ev.getX() < width / 3) {
        return res;
    } else {
        return DragSortController.MISS;
    }
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:16,代码来源:Sections.java

示例11: onActivityCreated

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    setupFragmentData();
    mListView.setOnCreateContextMenuListener(this);
    mListView.setOnItemClickListener(this);
    mListView.setAdapter(mAdapter);
    DragSortController controller = new DragSortController(mListView);
    controller.setDragHandleId(R.id.listview_drag_handle);
    controller.setRemoveEnabled(true);
    controller.setRemoveMode(1);
    mListView.setFloatViewManager(controller);
    mListView.setOnTouchListener(controller);
    getLoaderManager().initLoader(0, null, this);
}
 
开发者ID:C-Aniruddh,项目名称:xPlodMusic,代码行数:16,代码来源:DragSortListViewFragment.java

示例12: onCreateView

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	super.onCreateView(inflater, container, savedInstanceState);
	View v = inflater.inflate(R.layout.dragsort_list, container,false);
	mList = (DragSortListView) v.findViewById(R.id.dslist);
	mReboot = (Button) v.findViewById(R.id.reboot);
	mCancel = (Button) v.findViewById(R.id.cancel);
	mReboot.setOnClickListener(this);
	mCancel.setOnClickListener(this);
	mList.setEmptyView(v.findViewById(R.id.empty));
	list = new ArrayList<String>();
	names = new ArrayList<String>();
	values = new ArrayList<String>();
	backupString = new ArrayList<String>();

	for(int i=0; i<10; i++) {
		list.add("TEST "+i);
	}

	mAdapter = new RecoveryBaseAdapter(mContext, names, values);

	mList.setAdapter(mAdapter);
	mList.setDropListener(onDrop);
	mList.setRemoveListener(onRemove);

	DragSortController controller = new DragSortController(mList);
	controller.setDragHandleId(R.id.image);
	//controller.setClickRemoveId(R.id.);
	controller.setRemoveEnabled(true);
	controller.setSortEnabled(true);
	controller.setDragInitMode(1);
	controller.setFlingHandleId(R.id.item_container);
	//controller.setRemoveMode(removeMode);

	mList.setFloatViewManager(controller);
	mList.setOnTouchListener(controller);
	mList.setDragEnabled(true);
	checkEmptyList();
	return v;
}
 
开发者ID:cesco89,项目名称:android-kernel-tweaker,代码行数:41,代码来源:CustomRecoveryCommandFragment.java

示例13: startDragPosition

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
@Override
public int startDragPosition(MotionEvent ev) {
    int res = super.dragHandleHitPosition(ev);
    if (res >= mSelectedExtensionsAdapter.getCount() - 1) {
        return DragSortController.MISS;
    }

    return res;
}
 
开发者ID:JesusM,项目名称:DashClock,代码行数:10,代码来源:ConfigureExtensionsFragment.java

示例14: buildController

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
/**
 * Called in onCreateView. Override this to provide a custom
 * DragSortController.
 */
protected DragSortController buildController(DragSortListView dslv)
{
	DragSortController controller = new DragSortController(dslv);
	controller.setDragHandleId(R.id.drag_handle);
	// controller.setClickRemoveId(R.id.click_remove);
	controller.setRemoveEnabled(true);
	controller.setSortEnabled(true);
	controller.setDragInitMode(DragSortController.ON_DOWN);
	controller.setRemoveMode(DragSortController.FLING_REMOVE);
	return controller;
}
 
开发者ID:andreynovikov,项目名称:Androzic,代码行数:16,代码来源:RouteEdit.java

示例15: ConfigurationDragSortController

import com.mobeta.android.dslv.DragSortController; //导入依赖的package包/类
public ConfigurationDragSortController() {
    super(ConfigureExtensionsFragment.this.mListView, R.id.drag_handle,
            DragSortController.ON_DOWN, 0);
    setRemoveEnabled(false);
    mDragging = false;
}
 
开发者ID:mridang,项目名称:dashbar,代码行数:7,代码来源:ConfigureExtensionsFragment.java


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