Android Open Source - ShoppingList Shopping Lists Activity






From Project

Back to project page ShoppingList.

License

The source code is released under:

GNU General Public License

If you think the Android project ShoppingList listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.sledzdev.shoppinglist;
/* www.  j ava2 s . com*/
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import com.google.common.eventbus.EventBus;

import net.sledzdev.shoppinglist.event.EventBusFactory;
import net.sledzdev.shoppinglist.handlers.ItemDeleteEventHandler;
import net.sledzdev.shoppinglist.handlers.ListDeleteEventHandler;
import net.sledzdev.shoppinglist.handlers.ListSelectedEventHandler;
import net.sledzdev.shoppinglist.handlers.NewListEventHandler;
import net.sledzdev.shoppinglist.manager.ContentManager;

public class ShoppingListsActivity extends FragmentActivity {

    private boolean mTwoPane;
    private ContentManager contentManager;
    private long currentListId = -1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_shoppinglist_list);
        contentManager = ContentManager.createContentManager(this);

        registerListeners();

        if (findViewById(R.id.shoppinglist_detail_container) != null) {
            mTwoPane = true;

            ((ShoppingListsFragment) getSupportFragmentManager()
                    .findFragmentById(R.id.shoppinglist_list))
                    .setActivateOnItemClick(true);
        }
    }

    private void registerListeners() {
        EventBus eventBus = EventBusFactory.getEventBus();

        ListSelectedEventHandler listSelectedEventHandler = new ListSelectedEventHandler(this);
        eventBus.register(listSelectedEventHandler);

        ListDeleteEventHandler listDeleteHandler = new ListDeleteEventHandler(this);
        eventBus.register(listDeleteHandler);

        ItemDeleteEventHandler itemDeleteEventHandler = new ItemDeleteEventHandler(contentManager);
        eventBus.register(itemDeleteEventHandler);

        NewListEventHandler newListEventHandler = new NewListEventHandler(this);
        eventBus.register(newListEventHandler);
    }

    public boolean ismTwoPane() {
        return mTwoPane;
    }

    public ContentManager getContentManager() {
        return contentManager;
    }

    public long getCurrentListId() {
        return currentListId;
    }

    public void setCurrentListId(long currentListId) {
        this.currentListId = currentListId;
    }
}




Java Source Code List

net.sledzdev.shoppinglist.DetailFragmentHandlersRegister.java
net.sledzdev.shoppinglist.ItemDialogActivity.java
net.sledzdev.shoppinglist.ShoppingListDetailActivity.java
net.sledzdev.shoppinglist.ShoppingListDetailFragment.java
net.sledzdev.shoppinglist.ShoppingListsActivity.java
net.sledzdev.shoppinglist.ShoppingListsFragment.java
net.sledzdev.shoppinglist.adapter.DataModelAdapter.java
net.sledzdev.shoppinglist.adapter.DataModel.java
net.sledzdev.shoppinglist.adapter.ElementWithId.java
net.sledzdev.shoppinglist.adapter.ItemAdapterEventController.java
net.sledzdev.shoppinglist.adapter.ItemAdapter.java
net.sledzdev.shoppinglist.adapter.ListMapDataModelTest.java
net.sledzdev.shoppinglist.adapter.ListMapDataModel.java
net.sledzdev.shoppinglist.adapter.ShoppingListAdapterEventsHandler.java
net.sledzdev.shoppinglist.adapter.ShoppingListsAdapter.java
net.sledzdev.shoppinglist.content.DatabaseHelper.java
net.sledzdev.shoppinglist.content.DatabaseUriContentProvider.java
net.sledzdev.shoppinglist.content.ItemRowProvider.java
net.sledzdev.shoppinglist.content.ItemsProvider.java
net.sledzdev.shoppinglist.content.ItemsTable.java
net.sledzdev.shoppinglist.content.ListRowProvider.java
net.sledzdev.shoppinglist.content.ListsProvider.java
net.sledzdev.shoppinglist.content.ListsTable.java
net.sledzdev.shoppinglist.content.RowUriProvider.java
net.sledzdev.shoppinglist.content.ShoppingListProviderTest.java
net.sledzdev.shoppinglist.content.ShoppingListProvider.java
net.sledzdev.shoppinglist.content.ShoppingProviderContract.java
net.sledzdev.shoppinglist.content.TableUriProvider.java
net.sledzdev.shoppinglist.content.UriContentProvider.java
net.sledzdev.shoppinglist.event.ClearListEvent.java
net.sledzdev.shoppinglist.event.EventBusFactory.java
net.sledzdev.shoppinglist.event.ItemChangedEvent.java
net.sledzdev.shoppinglist.event.ItemCheckedChangedEvent.java
net.sledzdev.shoppinglist.event.ItemDeleteEvent.java
net.sledzdev.shoppinglist.event.ItemDialogCloseEvent.java
net.sledzdev.shoppinglist.event.ItemDialogOpenRequestEvent.java
net.sledzdev.shoppinglist.event.ListDeleteEvent.java
net.sledzdev.shoppinglist.event.ListSelectedEvent.java
net.sledzdev.shoppinglist.event.ListTitleChangedEvent.java
net.sledzdev.shoppinglist.event.NewItemEvent.java
net.sledzdev.shoppinglist.event.NewListEvent.java
net.sledzdev.shoppinglist.event.NewListRequestEvent.java
net.sledzdev.shoppinglist.event.TextWatcherAdapter.java
net.sledzdev.shoppinglist.event.UpdateListAdapterEvent.java
net.sledzdev.shoppinglist.handlers.ClearListEventHandler.java
net.sledzdev.shoppinglist.handlers.ItemChangedEventHandler.java
net.sledzdev.shoppinglist.handlers.ItemCheckedChangeEventHandler.java
net.sledzdev.shoppinglist.handlers.ItemDeleteEventHandler.java
net.sledzdev.shoppinglist.handlers.ItemDialogOpenRequestEventHandler.java
net.sledzdev.shoppinglist.handlers.ListDeleteEventHandler.java
net.sledzdev.shoppinglist.handlers.ListSelectedEventHandler.java
net.sledzdev.shoppinglist.handlers.ListTitleChangedEventHandler.java
net.sledzdev.shoppinglist.handlers.NewItemEventHandler.java
net.sledzdev.shoppinglist.handlers.NewListEventHandler.java
net.sledzdev.shoppinglist.manager.ContentManagerTests.java
net.sledzdev.shoppinglist.manager.ContentManager.java
net.sledzdev.shoppinglist.manager.ContentTransformer.java
net.sledzdev.shoppinglist.manager.ItemContentTransformer.java
net.sledzdev.shoppinglist.manager.ListsContentTransformer.java
net.sledzdev.shoppinglist.manager.MockContentManager.java
net.sledzdev.shoppinglist.manager.OnUiThreadFutureCallback.java
net.sledzdev.shoppinglist.model.ShoppingItemBuilderTest.java
net.sledzdev.shoppinglist.model.ShoppingItemBuilder.java
net.sledzdev.shoppinglist.model.ShoppingItem.java
net.sledzdev.shoppinglist.model.ShoppingListFactoryTest.java
net.sledzdev.shoppinglist.model.ShoppingListFactory.java
net.sledzdev.shoppinglist.model.ShoppingList.java