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


Java EnhancedListView类代码示例

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


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

示例1: onDismiss

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
@Override
public EnhancedListView.Undoable onDismiss(EnhancedListView enhancedListView, final int pos) {
    final FoodItem item = mAdapter.getItem(pos);
    mAdapter.remove(pos);

    return new EnhancedListView.Undoable() {
        @Override
        public void undo() {
            mAdapter.add(pos, item);
            checkShowInventoryLowView();
        }

        @Override
        public String getTitle() {
            checkShowInventoryLowView();
            return "Deleted " + item.getTitle();
        }
    };
}
 
开发者ID:levibostian,项目名称:PantryPirate,代码行数:20,代码来源:InventoryFragment.java

示例2: onCreate

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    taskList = (EnhancedListView) findViewById(R.id.TaskList);

    testingTasks = new ArrayList<Task>();

    Intent intent = new Intent(this, Notifier.class);
    bindService(intent, mConnection, Context.BIND_AUTO_CREATE);

    //Toast.makeText(this, "Service is apparently starting " + mBound, Toast.LENGTH_LONG).show();

    inflateTaskListAll();

    setUpGestureDetection();
}
 
开发者ID:asusoda,项目名称:TaskDevilFall,代码行数:18,代码来源:MainActivity.java

示例3: initGUI

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
@AfterViews
protected void initGUI(){
    List<Post> posts = Storage.get().getPosts();
    if (posts.size() > 0) updateList(posts);

    updater.setOnRefreshListener(this);
    updater.setColorScheme(android.R.color.holo_blue_bright,
            android.R.color.holo_green_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_red_light);

    mListPosts.setUndoStyle(EnhancedListView.UndoStyle.MULTILEVEL_POPUP);
    mListPosts.setRequireTouchBeforeDismiss(false);
    mListPosts.setUndoHideDelay(3000);
    mListPosts.setSwipeDirection(EnhancedListView.SwipeDirection.BOTH);
    mListPosts.setDismissCallback(dismissCalback);
    mListPosts.enableSwipeToDismiss();
}
 
开发者ID:mike-stetsenko,项目名称:Twister-Blog-Android,代码行数:19,代码来源:PostsListFragment.java

示例4: onCreate

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_contact);
    mListView = (EnhancedListView) findViewById(android.R.id.list);

    mContactDao = new ContactDao(this);

    mListView.setDismissCallback(new EnhancedListView.OnDismissCallback() {
        @Override
        public EnhancedListView.Undoable onDismiss(EnhancedListView enhancedListView, int i) {

            Contact contact = mAdapter.getItem(i);
            mContactDao.delete(contact.getId());
            mAdapter.remove(i);
            return null;
        }
    });

    mListView.enableSwipeToDismiss();
    getSupportLoaderManager().initLoader(1, null, this);
}
 
开发者ID:turbomanage,项目名称:storm-gen,代码行数:25,代码来源:ContactActivity.java

示例5: setViewItems

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
private void setViewItems(View view) {
    mInventoryList = (EnhancedListView) view.findViewById(R.id.inventory_list);
    mPantryBareView = (RelativeLayout) view.findViewById(R.id.pantry_bare_view);

    setButtonViews(view);

    populateInventory();
    checkShowInventoryLowView();
}
 
开发者ID:levibostian,项目名称:PantryPirate,代码行数:10,代码来源:InventoryFragment.java

示例6: onDismiss

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
@Override
public EnhancedListView.Undoable onDismiss(EnhancedListView listView, final int position) {
    final PostsAdapter adapter = (PostsAdapter) mListPosts.getAdapter();
    final Post post = (Post) adapter.getItem(position);

    if (post == null) return null;

    adapter.remove(position);

    return new EnhancedListView.Undoable() {
        @Override
        public void undo() {
            adapter.insert(position, post);
        }
        @Override
        public String getTitle() {
            return "post removed";
        }
        @Override
        public void discard() {
            mDeletePostRequest = new DeletePostRequest(post.id);
            RequestStatusObject.getInstance().setStarted();
            getSpiceManager().execute(mDeletePostRequest, post.id,
                    DurationInMillis.ALWAYS_EXPIRED, new DeleteRequestListener());
        }
    };
}
 
开发者ID:mike-stetsenko,项目名称:Twister-Blog-Android,代码行数:28,代码来源:PostsListFragment.java

示例7: setUpGestureDetection

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
public void setUpGestureDetection() {
    //giving all tasks the ability to open a context menu
    //on a long press


    //credit to https://github.com/timroes/EnhancedListView/ for the EnhancedListView

    //set up the delete and undo functionality
    taskList.setDismissCallback(new EnhancedListView.OnDismissCallback() {

        @Override
        public EnhancedListView.Undoable onDismiss(EnhancedListView listView, final int position) {

            // Store the item for later undo
            final Task item = (Task) taskAdapter.getItem(position);

            // Remove the item from the adapter
            taskAdapter.remove(taskAdapter.getItem(position));

            // return an Undoable
            return new EnhancedListView.Undoable() {
                // Reinsert the item to the adapter
                @Override
                public void undo() {
                    taskAdapter.insert(item, position);
                }

                // Return a string for your item
                @Override
                public String getTitle() {
                    return "Deleted '" + item.getTitle() + "'"; // Plz, use the resource system :)
                }

                // Delete item completely from your persistent storage
                @Override
                public void discard() {
                    DataAccess.deleteTask(getApplicationContext(), item);
                }
            };

        }

    });

    //allow for multilevel undoing
    taskList.setUndoStyle(EnhancedListView.UndoStyle.MULTILEVEL_POPUP);


    //add swipe functionality
    taskList.setShouldSwipeCallback(new EnhancedListView.OnShouldSwipeCallback() {
        @Override
        public boolean onShouldSwipe(EnhancedListView enhancedListView, int i) {
            return true;
        }
    });


    //enable the swipe/undo
    taskList.enableSwipeToDismiss();

    //register list view for context menu
    registerForContextMenu(taskList);


    taskList.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View view) {
            openContextMenu(view);
            return false;
        }
    });

}
 
开发者ID:asusoda,项目名称:TaskDevilFall,代码行数:74,代码来源:MainActivity.java

示例8: initView

import de.timroes.android.listview.EnhancedListView; //导入依赖的package包/类
private void initView() {
	listView = (EnhancedListView) getView().findViewById(R.id.cardListView);
}
 
开发者ID:felixWackernagel,项目名称:Android-Card-Design,代码行数:4,代码来源:CardListFragment.java


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