本文整理汇总了Java中com.mobeta.android.dslv.DragSortListView.setOnTouchListener方法的典型用法代码示例。如果您正苦于以下问题:Java DragSortListView.setOnTouchListener方法的具体用法?Java DragSortListView.setOnTouchListener怎么用?Java DragSortListView.setOnTouchListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mobeta.android.dslv.DragSortListView
的用法示例。
在下文中一共展示了DragSortListView.setOnTouchListener方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sections_main);
DragSortListView dslv = (DragSortListView) getListView();
// get jazz artist names and make adapter
String[] array = getResources().getStringArray(R.array.jazz_artist_names);
List<String> list = new ArrayList<String>(Arrays.asList(array));
SectionAdapter adapter = new SectionAdapter(this, list);
dslv.setDropListener(adapter);
// make and set controller on dslv
SectionController c = new SectionController(dslv, adapter);
dslv.setFloatViewManager(c);
dslv.setOnTouchListener(c);
// pass it to the ListActivity
setListAdapter(adapter);
}
示例2: onCreate
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的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);
}
示例3: onCreateView
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的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;
}
示例4: onCreateView
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mDslv = (DragSortListView) inflater.inflate(getLayout(), container, false);
mController = buildController(mDslv);
mDslv.setFloatViewManager(mController);
mDslv.setOnTouchListener(mController);
mDslv.setDragEnabled(dragEnabled);
return mDslv;
}
示例5: onCreateView
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的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;
}
示例6: onCreateView
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
@SuppressLint("ClickableViewAccessibility")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
listView = (DragSortListView) inflater.inflate(R.layout.act_route_edit, container, false);
dragController = buildController(listView);
listView.setFloatViewManager(dragController);
listView.setOnTouchListener(dragController);
listView.setOnItemClickListener(clickListener);
listView.setDragEnabled(true);
return listView;
}
示例7: onCreate
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
setTheme(UserPreferences.getTheme());
super.onCreate(icicle);
setContentView(R.layout.activity_now_playing);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
int imageThumbSize = getResources().getDimensionPixelSize(R.dimen.image_thumbnail_size);
ImageCache.ImageCacheParams cacheParams =
new ImageCache.ImageCacheParams(this, IMAGE_CACHE_DIR);
cacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of app memory
// The ImageFetcher takes care of loading images into our ImageView children asynchronously
mImageFetcher = new DatabaseImageResizer(this, imageThumbSize);
mImageFetcher.setLoadingImage(R.drawable.albumart_mp_unknown_list);
mImageFetcher.addImageCache(getSupportFragmentManager(), cacheParams);
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);
mList = (DragSortListView) findViewById(android.R.id.list);
mList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
if (mTrackCursor.getCount() == 0) {
return;
}
// When selecting a track from the queue, just jump there instead of
// reloading the queue. This is both faster, and prevents accidentally
// dropping out of party shuffle.
if (MusicUtils.sService != null) {
try {
int queuePosition = MusicUtils.sService.getQueuePosition();
if (position == queuePosition) {
if (MusicUtils.sService.isPlaying()) {
MusicUtils.sService.pause();
} else {
MusicUtils.sService.play();
}
} else {
MusicUtils.sService.setQueuePosition(position);
}
} catch (RemoteException ex) {
}
}
}
});
DragSortController controller = new DragSortController(mList);
controller.setDragInitMode(DragSortController.ON_DRAG);
controller.setDragHandleId(R.id.drag);
mList.setOnTouchListener(controller);
mList.setOnCreateContextMenuListener(this);
mAdapter = (TrackListAdapter) getLastCustomNonConfigurationInstance();
if (mAdapter != null) {
mAdapter.setActivity(this);
mList.setAdapter(mAdapter);
}
mToken = MusicUtils.bindToService(this, this);
}
示例8: onCreate
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.activity_now_playing);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);
DragSortListView list = (DragSortListView) getListView();
list.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
if (mTrackCursor.getCount() == 0) {
return;
}
// When selecting a track from the queue, just jump there instead of
// reloading the queue. This is both faster, and prevents accidentally
// dropping out of party shuffle.
if (MusicUtils.sService != null) {
try {
int queuePosition = MusicUtils.sService.getQueuePosition();
if (position == queuePosition) {
if (MusicUtils.sService.isPlaying()) {
MusicUtils.sService.pause();
} else {
MusicUtils.sService.play();
}
} else {
MusicUtils.sService.setQueuePosition(position);
}
} catch (RemoteException ex) {
}
}
}
});
DragSortController controller = new DragSortController(list);
controller.setDragInitMode(DragSortController.ON_DRAG);
controller.setRemoveMode(DragSortController.FLING_REMOVE);
controller.setRemoveEnabled(true);
controller.setDragHandleId(R.id.drag);
list.setOnTouchListener(controller);
list.setOnCreateContextMenuListener(this);
mAdapter = (TrackListAdapter) getLastNonConfigurationInstance();
if (mAdapter != null) {
mAdapter.setActivity(this);
setListAdapter(mAdapter);
}
mToken = MusicUtils.bindToService(this, this);
}