Android Open Source - links Requests Group Card






From Project

Back to project page links.

License

The source code is released under:

MIT License

If you think the Android project links 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 org.iiitb.se.links.home.cards;
// w w w. j a  va 2s.  co m
import it.gmariotti.cardslib.library.internal.CardHeader;
import it.gmariotti.cardslib.library.internal.base.BaseCard;

import org.iiitb.se.links.R;
import org.iiitb.se.links.utils.network.groups.requests.GroupRequestsDecider;
import org.json.JSONObject;

import android.content.Context;
import android.view.MenuItem;
import android.widget.PopupMenu;

public class RequestsGroupCard extends AbstractGroupCard {

  
  private GroupRequestsDecider groupRequestsDecider;
  private MenuItem accept = null;
  private MenuItem reject = null;

  public RequestsGroupCard(Context context, JSONObject group) {
    super(context, group);
    groupRequestsDecider = new GroupRequestsDecider(context, this);
  }  

  /**
   * Init
   */
  protected void init() {
    header = new CardHeader(context);
    // Add a popup menu. This method set OverFlow button to visible
    header.setButtonOverflowVisible(true);
    header
        .setPopupMenuListener(new CardHeader.OnClickCardHeaderPopupMenuListener() {
          @Override
          public void onMenuItemClick(BaseCard card, MenuItem item) {
            initData();
            if (item == accept) {
              groupRequestsDecider.setActionStatus(0);
            } else if (item == reject) {
              groupRequestsDecider.setActionStatus(1);
            }
            groupRequestsDecider.acceptOrRejectSubscriptionToGroup();
          }
        });
    // Add a PopupMenuPrepareListener to add dynamically a menu entry it is
    // optional.
    header
        .setPopupMenuPrepareListener(new CardHeader.OnPrepareCardHeaderPopupMenuListener() {
          @Override
          public boolean onPreparePopupMenu(BaseCard card, PopupMenu popupMenu) {
            accept = popupMenu.getMenu().add(
                context.getString(R.string.accept_group_invite));
            reject = popupMenu.getMenu().add(
                context.getString(R.string.reject_group_invite));
            return true;
          }
        });
    addCardHeader(header);
  }
}




Java Source Code List

org.iiitb.se.links.GroupActivity.java
org.iiitb.se.links.MainActivity.java
org.iiitb.se.links.custom.ExpandableHeightGridView.java
org.iiitb.se.links.group.fragments.AddBookmarkInGroupFragment.java
org.iiitb.se.links.group.fragments.BookmarkSearchInGroupsFragment.java
org.iiitb.se.links.group.fragments.GroupLinkFragment.java
org.iiitb.se.links.home.ResourceLoader.java
org.iiitb.se.links.home.cards.AbstractGroupCard.java
org.iiitb.se.links.home.cards.BookmarkCard.java
org.iiitb.se.links.home.cards.RequestsGroupCard.java
org.iiitb.se.links.home.cards.ShareGroupCard.java
org.iiitb.se.links.home.cards.SubscribedGroupCard.java
org.iiitb.se.links.home.cards.expand.BookmarkCardExpand.java
org.iiitb.se.links.home.cards.expand.adapter.TagViewAdapter.java
org.iiitb.se.links.home.fragments.AddBookmarkFragment.java
org.iiitb.se.links.home.fragments.BookmarkSearchFragment.java
org.iiitb.se.links.home.fragments.EditBookmarkFragment.java
org.iiitb.se.links.home.fragments.LinkFragment.java
org.iiitb.se.links.home.fragments.RequestsGroupFragment.java
org.iiitb.se.links.home.fragments.SubscribedGroupFragment.java
org.iiitb.se.links.home.fragments.adapter.AbstractGroupsAdapter.java
org.iiitb.se.links.home.fragments.adapter.BookmarksAdapter.java
org.iiitb.se.links.home.fragments.adapter.RequestsGroupsAdapter.java
org.iiitb.se.links.home.fragments.adapter.ShareGroupsAdapter.java
org.iiitb.se.links.home.fragments.adapter.SubscribedGroupsAdapter.java
org.iiitb.se.links.utils.AuthorizationClient.java
org.iiitb.se.links.utils.BookmarkLoadType.java
org.iiitb.se.links.utils.BookmarkOperations.java
org.iiitb.se.links.utils.DomainExtractor.java
org.iiitb.se.links.utils.FragmentTypes.java
org.iiitb.se.links.utils.StringConstants.java
org.iiitb.se.links.utils.URLConstants.java
org.iiitb.se.links.utils.network.AbstractResourceDownloader.java
org.iiitb.se.links.utils.network.MyProperties.java
org.iiitb.se.links.utils.network.WebpageLoader.java
org.iiitb.se.links.utils.network.bookmarks.BookmarkAdder.java
org.iiitb.se.links.utils.network.bookmarks.BookmarkDeleter.java
org.iiitb.se.links.utils.network.bookmarks.BookmarkEditor.java
org.iiitb.se.links.utils.network.bookmarks.BookmarkGroupAdder.java
org.iiitb.se.links.utils.network.bookmarks.BookmarkSharer.java
org.iiitb.se.links.utils.network.bookmarks.Logout.java
org.iiitb.se.links.utils.network.bookmarks.TimelineLoader.java
org.iiitb.se.links.utils.network.bookmarks.search.BookmarkInGroupsSearchLoader.java
org.iiitb.se.links.utils.network.bookmarks.search.BookmarkSearchLoader.java
org.iiitb.se.links.utils.network.groups.GroupTimelineLoader.java
org.iiitb.se.links.utils.network.groups.requests.GroupRequestsDecider.java
org.iiitb.se.links.utils.network.groups.requests.RequestsGroupsLoader.java
org.iiitb.se.links.utils.network.groups.subscribed.GroupUnsubscriber.java
org.iiitb.se.links.utils.network.groups.subscribed.SubscribedGroupsLoader.java