本文整理汇总了Java中com.mobeta.android.dslv.DragSortListView.setAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java DragSortListView.setAdapter方法的具体用法?Java DragSortListView.setAdapter怎么用?Java DragSortListView.setAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.mobeta.android.dslv.DragSortListView
的用法示例。
在下文中一共展示了DragSortListView.setAdapter方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
mIds = new ArrayList<String>();
if (savedInstanceState != null) {
mIds = savedInstanceState.getStringArrayList(SAVED_MEDIA_IDS);
}
mGridAdapter = new MediaGalleryAdapter(getActivity(), R.layout.media_gallery_item, null, true,
MediaImageLoader.getInstance());
View view = inflater.inflate(R.layout.media_gallery_edit_fragment, container, false);
DragSortListView gridView = (DragSortListView) view.findViewById(R.id.edit_media_gallery_gridview);
gridView.setAdapter(mGridAdapter);
gridView.setOnCreateContextMenuListener(this);
gridView.setDropListener(this);
gridView.setRemoveListener(this);
refreshGridView();
return view;
}
示例2: onCreateView
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// TODO Auto-generated method stub
view = inflater.inflate(R.layout.right_behind, null);
initData();
adapter = new RightCheckAdapter(getActivity(),l);
list = (DragSortListView) view.findViewById(R.id.check_list);
list.setDropListener(onDrop);
list.setDragEnabled(true);
//
//
try {
list.setAdapter(adapter);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
list.setOnItemClickListener(new ListButtonListener());
setListViewHeightBasedOnChildren(list);
return view;
}
示例3: onCreate
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cursor_main);
String[] cols = {"name"};
int[] ids = {R.id.text};
adapter = new MAdapter(this,
R.layout.list_item_click_remove, null, cols, ids, 0);
DragSortListView dslv = (DragSortListView) findViewById(android.R.id.list);
dslv.setAdapter(adapter);
// build a cursor from the String array
MatrixCursor cursor = new MatrixCursor(new String[] {"_id", "name"});
String[] artistNames = getResources().getStringArray(R.array.jazz_artist_names);
for (int i = 0; i < artistNames.length; i++) {
cursor.newRow()
.add(i)
.add(artistNames[i]);
}
adapter.changeCursor(cursor);
}
示例4: onCreateView
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_song_list, container, false);
// Set the adapter
if (view instanceof DragSortListView) {
DragSortListView listView = (DragSortListView) view;
songAdapter = new QueueSongArrayAdapter(songs);
songAdapter.setNotifyOnChange(false);
listView.setAdapter(songAdapter);
listView.setDropListener(new QueueSongDropListener());
}
return view;
}
示例5: 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;
}
示例6: onServiceConnected
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
playbackService = ((PlaybackService.LocalBinder)service).getService();
adapter = new PlayingNowPlaylistAdapter(this, playbackService.getPlaylist());
adapter.setEditModeEnabled(true);
DragSortListView listView = (DragSortListView)findViewById(R.id.ep_list_view);
listView.setAdapter(adapter);
listView.setSelection(playbackService.getPlaylistPosition());
}
示例7: initUi
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
private void initUi(View v) {
listView = (DragSortListView) v.findViewById(R.id.playlist_list_view_playlist_tab);
listView.setAdapter(mainActivity.getPlaylistItemsAdapter());
searchPlaylistEditText = (EditText) v.findViewById(R.id.search_edit_text_playlist_tab);
searchPlaylistEditText.setVisibility(PreferencesManager.getSavePreferences()
.getBoolean(Constants.SEARCH_PLAYLIST_VISIBILITY, false)
? View.VISIBLE : View.GONE);
clearEditTextButton = (ImageButton) v.findViewById(
R.id.clear_edit_text_button_playlist_tab);
PlaybackControlFragment playbackControlFragment =
mainActivity.getPlaybackControlFragment();
playPauseButton = playbackControlFragment.getPlayPauseButton();
seekBar = playbackControlFragment.getSeekBar();
timeTextView = playbackControlFragment.getTimeTextView();
timeDurationTextView = playbackControlFragment.getTimeDurationTextView();
nextButton = playbackControlFragment.getNextButton();
prevButton = playbackControlFragment.getPrevButton();
shuffleButton = playbackControlFragment.getShuffleButton();
repeatButton = playbackControlFragment.getRepeatButton();
artistTextView = (TextView) v.findViewById(R.id.artist_text_view_playback_tab);
titleTextView = (TextView) v.findViewById(R.id.title_text_view_playback_tab);
albumTextView = (TextView) v.findViewById(R.id.album_title_text_view);
albumImageView = (ImageView) v.findViewById(R.id.album_cover_image_view);
artistImageView = (ImageView) v.findViewById(R.id.artist_image_view);
blackView = v.findViewById(R.id.view);
}
示例8: 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;
}
示例9: 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);
}
示例10: initUi
import com.mobeta.android.dslv.DragSortListView; //导入方法依赖的package包/类
private void initUi(View v) {
initViewPager(v);
modeGridView = (StickyGridHeadersGridView) modeTab.findViewById(R.id.mode_gridview);
mainActivity.init();
modeGridView.setAdapter(mainActivity.getModeAdapter());
listView = (DragSortListView) playlistTab.findViewById(
R.id.playlist_list_view_playlist_tab);
listView.setAdapter(mainActivity.getPlaylistItemsAdapter());
searchPlaylistEditText = (EditText) playlistTab.findViewById(
R.id.search_edit_text_playlist_tab);
searchPlaylistEditText.setVisibility(PreferencesManager.getSavePreferences()
.getBoolean(Constants.SEARCH_PLAYLIST_VISIBILITY, false) ? View.VISIBLE : View.GONE);
clearEditTextButton = (ImageButton) playlistTab.findViewById(
R.id.clear_edit_text_button_playlist_tab);
artistTextView = (TextView) playbackTab.findViewById(R.id.artist_text_view_playback_tab);
titleTextView = (TextView) playbackTab.findViewById(R.id.title_text_view_playback_tab);
playPauseButton = (ImageButton) playbackTab.findViewById(
R.id.play_pause_button_playback_tab);
seekBar = (SeekBar) playbackTab.findViewById(R.id.seek_bar_playback_tab);
timeTextView = (TextView) playbackTab.findViewById(
R.id.time_text_view_playback_tab);
timeDurationTextView = (TextView) playbackTab.findViewById(
R.id.time_inverted_text_view_playback_tab);
nextButton = (ImageButton) playbackTab.findViewById(
R.id.next_button_playback_tab);
prevButton = (ImageButton) playbackTab.findViewById(
R.id.prev_button_playback_tab);
shuffleButton = (ImageButton) playbackTab.findViewById(
R.id.shuffle_button_playback_tab);
repeatButton = (ImageButton) playbackTab.findViewById(
R.id.repeat_button_playback_tab);
artistImageView = (ImageView) playbackTab.findViewById(
R.id.artist_image_view_headset);
artistImageView.setImageResource(R.drawable.artist_placeholder);
timePlateTextView = (TextView) playbackTab.findViewById(
R.id.time_plate_text_view_playback_tab);
albumImageView = (ImageView) playbackTab.findViewById(
R.id.album_cover_image_view);
albumTextView = (TextView) playbackTab.findViewById(
R.id.album_title_text_view);
blackView = playbackTab.findViewById(R.id.view);
// Tutorial
boolean tutorialEnabled = !PreferencesManager.getStartPreferences()
.getBoolean(Constants.TUTORIAL_DISABLED, false);
if (tutorialEnabled) {
swipeLeftImageView = (ImageView) playbackTab.findViewById(R.id.swipe_left_image_view);
swipeRightImageView = (ImageView) playbackTab.findViewById(R.id.swipe_right_image_view);
tutorialLayout = playbackTab.findViewById(R.id.tutorial_layout);
tutorialLayout.setVisibility(View.VISIBLE);
tutorialBlinkAnimation = AnimationUtils.loadAnimation(mainActivity,
R.anim.blink_animation);
swipeLeftImageView.startAnimation(tutorialBlinkAnimation);
swipeRightImageView.startAnimation(tutorialBlinkAnimation);
}
}