Android Open Source - android-autostarts Fixed Expandable List View






From Project

Back to project page android-autostarts.

License

The source code is released under:

GNU General Public License

If you think the Android project android-autostarts 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 com.elsdoerfer.android.autostarts.compat;
/* w  w w.  jav a 2 s . c  om*/
import android.content.Context;
import android.util.AttributeSet;
import android.widget.ExpandableListView;


/**
 * To use fastScroll="true" with a ExpandableListView.
 */
public class FixedExpandableListView extends ExpandableListView {

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

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

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

  /**
   * Android's "android.widget.FastScroll" class has a bug when
   * used with an ExpandableListView. When calculating the
   * scroll target position, it mistakenly uses a flat index as
   * a group position.
   *
   * Specifically, it calls this function with a packed group
   * position that really is already the correct flat position.
   *
   * So we work around this by simply returning the incoming
   * group position as the desired result. This only works of
   * course as long as the FastScroll feature is the only thing
   * using this method, which seems to be be the case.
   *
   * The result differs slightly from what FastScroll itself
   * appears to attempt, namely instead of targeting only group
   * items in the scroll, we target all items, which isn't as
   * nice, but at least it works at all.
   *
   * It might also be possible to work around this by implementing
   * a SectionIndex, but that is too much work right now.
   *
   * https://review.source.android.com/#change,22024
   */
  @Override
  public int getFlatListPosition(long packedPosition) {
    return getPackedPositionGroup(packedPosition);
    }
}




Java Source Code List

com.elsdoerfer.android.autostarts.Actions.java
com.elsdoerfer.android.autostarts.DatabaseHelper.java
com.elsdoerfer.android.autostarts.EventDetailsFragment.java
com.elsdoerfer.android.autostarts.HelpActivity.java
com.elsdoerfer.android.autostarts.ListActivity.java
com.elsdoerfer.android.autostarts.LoadTask.java
com.elsdoerfer.android.autostarts.MyExpandableListAdapter.java
com.elsdoerfer.android.autostarts.ReceiverReader.java
com.elsdoerfer.android.autostarts.ToggleService.java
com.elsdoerfer.android.autostarts.ToggleTool.java
com.elsdoerfer.android.autostarts.Utils.java
com.elsdoerfer.android.autostarts.compat.FixedExpandableListView.java
com.elsdoerfer.android.autostarts.db.ComponentInfo.java
com.elsdoerfer.android.autostarts.db.IntentFilterInfo.java
com.elsdoerfer.android.autostarts.db.PackageInfo.java
com.stericson.RootTools.Constants.java
com.stericson.RootTools.RootTools.java
com.stericson.RootTools.containers.Mount.java
com.stericson.RootTools.containers.Permissions.java
com.stericson.RootTools.containers.RootClass.java
com.stericson.RootTools.containers.Symlink.java
com.stericson.RootTools.exceptions.RootDeniedException.java
com.stericson.RootTools.execution.CommandCapture.java
com.stericson.RootTools.execution.Command.java
com.stericson.RootTools.execution.JavaCommandCapture.java
com.stericson.RootTools.execution.Shell.java
com.stericson.RootTools.internal.Installer.java
com.stericson.RootTools.internal.InternalVariables.java
com.stericson.RootTools.internal.Remounter.java
com.stericson.RootTools.internal.RootToolsInternalMethods.java
com.stericson.RootTools.internal.Runner.java
src.com.elsdoerfer.android.autostarts.opt.MarketUtils.java
src.com.elsdoerfer.android.autostarts.opt.MarketUtils.java
src.com.elsdoerfer.android.autostarts.opt.RootFeatures.java
src.com.elsdoerfer.android.autostarts.opt.RootFeatures.java