Android Open Source - links Expandable Height Grid View






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.custom;
//from  w w w  .  j a v a 2s  . co m
import android.content.Context;
import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.GridView;

public class ExpandableHeightGridView extends GridView {
  boolean expanded = false;

  public ExpandableHeightGridView(Context context) {
    super(context);
  }

  public ExpandableHeightGridView(Context context, AttributeSet attrs) {
    super(context, attrs);
  }

  public ExpandableHeightGridView(Context context, AttributeSet attrs,
      int defStyle) {
    super(context, attrs, defStyle);
  }

  public boolean isExpanded() {
    return expanded;
  }

  @Override
  public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
    // HACK! TAKE THAT ANDROID!
    if (isExpanded()) {
      // Calculate entire height by providing a very large height hint.
      // View.MEASURED_SIZE_MASK represents the largest height possible.
      int expandSpec = MeasureSpec.makeMeasureSpec(MEASURED_SIZE_MASK,
          MeasureSpec.AT_MOST);
      super.onMeasure(widthMeasureSpec, expandSpec);

      ViewGroup.LayoutParams params = getLayoutParams();
      params.height = getMeasuredHeight();
    } else {
      super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
  }

  public void setExpanded(boolean expanded) {
    this.expanded = expanded;
  }
}




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