Ejemplo n.º 1
0
 public virtual bool onChildClick(android.widget.ExpandableListView arg0, android.view.View arg1, int arg2, int arg3, long arg4)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallBooleanMethod(this.JvmHandle, global::android.app.ExpandableListActivity._onChildClick540, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4)));
     }
     else
     {
         return(@__env.CallNonVirtualBooleanMethod(this.JvmHandle, global::android.app.ExpandableListActivity.staticClass, global::android.app.ExpandableListActivity._onChildClick540, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4)));
     }
 }
Ejemplo n.º 2
0
 bool android.widget.ExpandableListView.OnGroupClickListener.onGroupClick(android.widget.ExpandableListView arg0, android.view.View arg1, int arg2, long arg3)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(@__env.CallBooleanMethod(this.JvmHandle, global::android.widget.ExpandableListView.OnGroupClickListener_._onGroupClick11234, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3)));
     }
     else
     {
         return(@__env.CallNonVirtualBooleanMethod(this.JvmHandle, global::android.widget.ExpandableListView.OnGroupClickListener_.staticClass, global::android.widget.ExpandableListView.OnGroupClickListener_._onGroupClick11234, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3)));
     }
 }
Ejemplo n.º 3
0
        internal virtual void scrollTo(float position)
        {
            int count = mList.getCount();

            mScrollCompleted = false;
            float fThreshold = (1.0f / count) / 8;

            object[] sections = mSections;
            int      sectionIndex;

            if (sections != null && sections.Length > 1)
            {
                int nSections = sections.Length;
                int section   = (int)(position * nSections);
                if (section >= nSections)
                {
                    section = nSections - 1;
                }
                int exactSection = section;
                sectionIndex = section;
                int index = mSectionIndexer.getPositionForSection(section);
                // Given the expected section and index, the following code will
                // try to account for missing sections (no names starting with..)
                // It will compute the scroll space of surrounding empty sections
                // and interpolate the currently visible letter's range across the
                // available space, so that there is always some list movement while
                // the user moves the thumb.
                int nextIndex   = count;
                int prevIndex   = index;
                int prevSection = section;
                int nextSection = section + 1;
                // Assume the next section is unique
                if (section < nSections - 1)
                {
                    nextIndex = mSectionIndexer.getPositionForSection(section + 1);
                }
                // Find the previous index if we're slicing the previous section
                if (nextIndex == index)
                {
                    // Non-existent letter
                    while (section > 0)
                    {
                        section--;
                        prevIndex = mSectionIndexer.getPositionForSection(section);
                        if (prevIndex != index)
                        {
                            prevSection  = section;
                            sectionIndex = section;
                            break;
                        }
                        else
                        {
                            if (section == 0)
                            {
                                // When section reaches 0 here, sectionIndex must follow it.
                                // Assuming mSectionIndexer.getPositionForSection(0) == 0.
                                sectionIndex = 0;
                                break;
                            }
                        }
                    }
                }
                // Find the next index, in case the assumed next index is not
                // unique. For instance, if there is no P, then request for P's
                // position actually returns Q's. So we need to look ahead to make
                // sure that there is really a Q at Q's position. If not, move
                // further down...
                int nextNextSection = nextSection + 1;
                while (nextNextSection < nSections && mSectionIndexer.getPositionForSection(nextNextSection
                                                                                            ) == nextIndex)
                {
                    nextNextSection++;
                    nextSection++;
                }
                // Compute the beginning and ending scroll range percentage of the
                // currently visible letter. This could be equal to or greater than
                // (1 / nSections).
                float fPrev = (float)prevSection / nSections;
                float fNext = (float)nextSection / nSections;
                if (prevSection == exactSection && position - fPrev < fThreshold)
                {
                    index = prevIndex;
                }
                else
                {
                    index = prevIndex + (int)((nextIndex - prevIndex) * (position - fPrev) / (fNext -
                                                                                              fPrev));
                }
                // Don't overflow
                if (index > count - 1)
                {
                    index = count - 1;
                }
                if (mList is android.widget.ExpandableListView)
                {
                    android.widget.ExpandableListView expList = (android.widget.ExpandableListView)mList;
                    expList.setSelectionFromTop(expList.getFlatListPosition(android.widget.ExpandableListView
                                                                            .getPackedPositionForGroup(index + mListOffset)), 0);
                }
                else
                {
                    if (mList is android.widget.ListView)
                    {
                        ((android.widget.ListView)mList).setSelectionFromTop(index + mListOffset, 0);
                    }
                    else
                    {
                        mList.setSelection(index + mListOffset);
                    }
                }
            }
            else
            {
                int index = (int)(position * count);
                // Don't overflow
                if (index > count - 1)
                {
                    index = count - 1;
                }
                if (mList is android.widget.ExpandableListView)
                {
                    android.widget.ExpandableListView expList = (android.widget.ExpandableListView)mList;
                    expList.setSelectionFromTop(expList.getFlatListPosition(android.widget.ExpandableListView
                                                                            .getPackedPositionForGroup(index + mListOffset)), 0);
                }
                else
                {
                    if (mList is android.widget.ListView)
                    {
                        ((android.widget.ListView)mList).setSelectionFromTop(index + mListOffset, 0);
                    }
                    else
                    {
                        mList.setSelection(index + mListOffset);
                    }
                }
                sectionIndex = -1;
            }
            if (sectionIndex >= 0)
            {
                string text = mSectionText = sections[sectionIndex].ToString();
                mDrawOverlay = (text.Length != 1 || text[0] != ' ') && sectionIndex < sections.Length;
            }
            else
            {
                mDrawOverlay = false;
            }
        }
Ejemplo n.º 4
0
 public virtual bool onChildClick(android.widget.ExpandableListView parent, android.view.View
                                  v, int groupPosition, int childPosition, long id)
 {
     throw new System.NotImplementedException();
 }