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


Java DragSortListView类代码示例

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


DragSortListView类属于com.mobeta.android.dslv包,在下文中一共展示了DragSortListView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:ldsddn,项目名称:wordpress_app_android,代码行数:24,代码来源:MediaGalleryEditFragment.java

示例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;
	}
 
开发者ID:lnfscj,项目名称:webbroserBaiDu,代码行数:25,代码来源:RightFragment.java

示例3: onCreate

import com.mobeta.android.dslv.DragSortListView; //导入依赖的package包/类
@Override
 protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.checkable_main);
     
     String[] array = getResources().getStringArray(R.array.jazz_artist_names);
     ArrayList<String> arrayList = new ArrayList<String>(Arrays.asList(array));

     adapter = new ArrayAdapter<String>(this, R.layout.list_item_checkable, R.id.text, arrayList);
     
     setListAdapter(adapter);
     
     DragSortListView list = getListView();
     list.setDropListener(onDrop);
     list.setRemoveListener(onRemove);
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:17,代码来源:MultipleChoiceListView.java

示例4: onActivityCreated

import com.mobeta.android.dslv.DragSortListView; //导入依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);

    mDslv = (DragSortListView) getListView(); 

    mDslv.setDropListener(onDrop);
    mDslv.setRemoveListener(onRemove);

    Bundle args = getArguments();
    int headers = 0;
    int footers = 0;
    if (args != null) {
        headers = args.getInt("headers", 0);
        footers = args.getInt("footers", 0);
    }

    for (int i = 0; i < headers; i++) {
        addHeader(getActivity(), mDslv);
    }
    for (int i = 0; i < footers; i++) {
        addFooter(getActivity(), mDslv);
    }

    setListAdapter();
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:27,代码来源:DSLVFragment.java

示例5: 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.warp_main);

    DragSortListView lv = (DragSortListView) getListView(); 

    lv.setDropListener(onDrop);
    lv.setRemoveListener(onRemove);
    lv.setDragScrollProfile(ssProfile);

    array = getResources().getStringArray(R.array.countries);
    list = new ArrayList<String>(Arrays.asList(array));

    adapter = new ArrayAdapter<String>(this, R.layout.list_item_handle_right, R.id.text, list);
    setListAdapter(adapter);
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:19,代码来源:WarpDSLV.java

示例6: 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);
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:22,代码来源:Sections.java

示例7: onCreate

import com.mobeta.android.dslv.DragSortListView; //导入依赖的package包/类
@Override
 protected void onCreate(Bundle savedInstanceState) {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.checkable_main);
     
     String[] array = getResources().getStringArray(R.array.jazz_artist_names);
     ArrayList<String> arrayList = new ArrayList<String>(Arrays.asList(array));

     adapter = new ArrayAdapter<String>(this, R.layout.list_item_radio, R.id.text, arrayList);
     
     setListAdapter(adapter);
     
     DragSortListView list = getListView();
     list.setDropListener(onDrop);
     list.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:17,代码来源:SingleChoiceListView.java

示例8: 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);
}
 
开发者ID:newmanchen,项目名称:ShortcutBar,代码行数:25,代码来源:CursorDSLV.java

示例9: 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);
}
 
开发者ID:minstrelsy,项目名称:servestream,代码行数:23,代码来源:OrganizeUrlsActivity.java

示例10: 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;
}
 
开发者ID:BjoernPetersen,项目名称:AndroidMusicBot,代码行数:15,代码来源:SongFragment.java

示例11: selectFirstQueued

import com.mobeta.android.dslv.DragSortListView; //导入依赖的package包/类
private void selectFirstQueued() {
  if (songs.isEmpty()) {
    return;
  }
  int index = findFirstQueued(songs);
  DragSortListView listView = (DragSortListView) getView();
  listView.setSelection(index);
}
 
开发者ID:BjoernPetersen,项目名称:AndroidMusicBot,代码行数:9,代码来源:SongFragment.java

示例12: inflateListView

import com.mobeta.android.dslv.DragSortListView; //导入依赖的package包/类
@Override
protected View inflateListView(final Context context, final QuestionAdapter adapter) {
    View v = View.inflate(context, R.layout.survey_question_container_sortlistview, null);
    listView = (DragSortListView) v.findViewById(R.id.list);
    listView.setDropListener(new DragSortListView.DropListener() {
        @Override
        public void drop(int from, int to) {
            Collections.swap(getVariantsList(), from, to);
            adapter.notifyDataSetChanged();
        }
    });
    return v;
}
 
开发者ID:active-citizen,项目名称:android.java,代码行数:14,代码来源:RankingSurveyQuestion.java

示例13: 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;
}
 
开发者ID:hvmunlimited,项目名称:QuickControlPanel,代码行数:37,代码来源:PanelsOrderPrefsFragment.java

示例14: onCreateView

import com.mobeta.android.dslv.DragSortListView; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    mDslv = (DragSortListView) inflater.inflate(R.layout.memory_list,
            container, false);

    View v = inflater.inflate(R.layout.memory_list_item_top, null);
    View button = v.findViewById(R.id.save_button);
    button.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View arg0) {
            // Clicked the "Save" button.
            final Phonon ph = mUiState.mScratchPhonon.makeMutableCopy();
            mAdapter.insert(ph, 0);
            // Gray out the header row.
            setScratchPosAndDraw(findScratchCopy());
            // Fake-click the header row.
            onItemClick(null, null, 0, 0);
        }
    });
    mHeaderView = v;
    mDslv.addHeaderView(mHeaderView, null, true);

    mDslv.addHeaderView(
            inflater.inflate(R.layout.memory_list_divider, null), null,
            false);

    return mDslv;
}
 
开发者ID:pmarks-net,项目名称:chromadoze,代码行数:30,代码来源:MemoryFragment.java

示例15: onViewCreated

import com.mobeta.android.dslv.DragSortListView; //导入依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);

    listView = (DragSortListView)view.findViewById(R.id.pnp_list_view);
    listView.setEmptyView(view.findViewById(R.id.pnp_empty_view));
    listView.setOnItemClickListener(this);
    listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
    listView.setDragEnabled(false);
}
 
开发者ID:lenworthrose,项目名称:music-app,代码行数:11,代码来源:PlayingNowPlaylistFragment.java


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