SwipeListView折叠-Android

SwipeListView折叠-Android,android,listview,Android,Listview,我试图在代码中集成“com.fortysevendeg.swipelistview.swipelistview” 我把代码从 实际上我遵循了指南,但我从“完整项目”中获取了代码,因此我知道项目和库工作得很好 首先,我尝试将“SwipeListView”集成到我的xml文件中(在我添加了所有设置文件后,如样式、图像等) 我的应用程序在活动加载前崩溃 这是我的Activity.XML: <LinearLayout xmlns:android="http://schemas.android

我试图在代码中集成“com.fortysevendeg.swipelistview.swipelistview”

我把代码从

实际上我遵循了指南,但我从“完整项目”中获取了代码,因此我知道项目和库工作得很好

首先,我尝试将“SwipeListView”集成到我的xml文件中(在我添加了所有设置文件后,如样式、图像等)

我的应用程序在活动加载前崩溃

这是我的Activity.XML:

   <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:background="@drawable/firstbackgroundclean"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:orientation="vertical"  >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >
<!-- ++++++++++++++++++ Row-1 ++++++++++++++++++ -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content" 
                android:layout_marginBottom="15dp">

                <Button
                    android:id="@+id/BtnBack"
                    android:layout_width="38dp"
                    style="@style/buttonnavigate"
                    android:background="@drawable/backbutton"
                    android:layout_marginTop="15dp"
                    android:layout_marginLeft="15dp"
                    android:layout_height="38dp" />

            </LinearLayout>     
<!-- ++++++++++++++++++++++++++++++++++++++++++ --> 
<!-- ++++++++++++++++++ Row2 ++++++++++++++++++ -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:gravity="center" 
                    android:id="@+id/textView0"
                    android:layout_width="match_parent"
                    android:textColor="@android:color/black"
                    android:textStyle="bold"
                    android:layout_height="wrap_content"
                    android:text="TEST RESULTS"
                    android:textSize="25sp" />

            </LinearLayout> 
<!-- ++++++++++++++++++++++++++++++++++++++++++ -->             
<!-- ++++++++++++++++++ Row1 ++++++++++++++++++ -->

                        <LinearLayout 
                android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">
       <com.fortysevendeg.swipelistview.SwipeListView
                xmlns:swipe="http://schemas.android.com/apk/res-auto"
                android:id="@+id/example_swipe_lv_list"
                android:listSelector="#00000000"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                swipe:swipeFrontView="@+id/front"
                swipe:swipeBackView="@+id/back"
                swipe:swipeDrawableChecked="@drawable/choice_selected"
                swipe:swipeDrawableUnchecked="@drawable/choice_unselected"
                swipe:swipeCloseAllItemsWhenMoveList="true"
                swipe:swipeMode="both"
                />
            </LinearLayout>
<!-- ++++++++++++++++++++++++++++++++++++++++++ --> 
<!-- ++++++++++++++++++ Row2 ++++++++++++++++++ -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:gravity="left" 
                    android:id="@+id/textView4"
                    android:layout_width="0sp"
                    android:layout_weight="1.0"
                    android:textColor="@android:color/black"
                    android:layout_height="wrap_content"
                    android:text="Sperm need to move to reach and egg.  This movement is called:  Motility or Motile Sperm."
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginBottom="5sp"
                    android:textSize="15sp" />

            </LinearLayout> 
<!-- ++++++++++++++++++++++++++++++++++++++++++ --> 
<!-- ++++++++++++++++++ Row3 ++++++++++++++++++ -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:gravity="left" 
                    android:id="@+id/textView3"
                    android:layout_width="0sp"
                    android:layout_weight="1.0"
                    android:textColor="@android:color/black"
                    android:layout_height="wrap_content"
                    android:text="According the World Health Organization, test results do not show if a man’s sperm  is normal or abnormal with 100% accuracy.  However, it is generally accepted that the normal # of moving sperm is > 12 Million in each milliliter of semen."
                    android:layout_marginTop="5dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginBottom="5sp"
                    android:textSize="15sp" />

            </LinearLayout> 
<!-- ++++++++++++++++++++++++++++++++++++++++++ --> 
<!-- ++++++++++++++++++ Row4 ++++++++++++++++++ -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:gravity="left" 
                    android:id="@+id/textView1"
                    android:layout_width="0sp"
                    android:layout_weight="1.0"
                    android:textColor="@android:color/black"
                    android:layout_height="wrap_content"
                    android:text="If your tests results are ABNORMAL or BORDERLINE re-run the test a second or third time with a week or between tests.  Your results can change over time.   Seek medical advice if all of your results are ABNORMAL or BORDERLINE."
                    android:layout_marginTop="5dp"
                    android:layout_marginLeft="5dp"
                    android:layout_marginRight="5dp"
                    android:layout_marginBottom="5sp"
                    android:textSize="15sp" />

            </LinearLayout> 
<!-- ++++++++++++++++++++++++++++++++++++++++++ --> 
<!-- ++++++++++++++++++ Row4 ++++++++++++++++++ -->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

               <Button
                   android:id="@+id/BtnDelete"
                   style="@style/button"
                   android:layout_width="match_parent"
                   android:layout_height="wrap_content"
                   android:layout_alignParentRight="true"
                   android:text="DELETE ARCHIVE"
                   android:textSize="18dip" />

            </LinearLayout> 
<!-- ++++++++++++++++++++++++++++++++++++++++++ --> 
        </LinearLayout>

    </LinearLayout>

这是我的日志:

    09-07 16:45:13.041: I/jdwp(13517): Ignoring second debugger -- accepting and dropping
09-07 16:45:20.996: W/ApplicationPackageManager(14043): getCSCPackageItemText()
09-07 16:45:21.076: D/dalvikvm(14043): GC_FOR_ALLOC freed 82K, 11% free 16837K/18892K, paused 24ms, total 25ms
09-07 16:45:21.091: I/dalvikvm-heap(14043): Grow heap (frag case) to 21.828MB for 3630224-byte allocation
09-07 16:45:21.106: D/dalvikvm(14043): GC_FOR_ALLOC freed <1K, 10% free 20382K/22440K, paused 12ms, total 12ms
09-07 16:45:21.446: D/OpenGLRenderer(14043): Enabling debug mode 0
09-07 16:45:22.616: I/dalvikvm(14043): Could not find method android.support.v4.app.NavUtils.navigateUpFromSameTask, referenced from method com.example.homedevice.VideoResultsScreenAct.onOptionsItemSelected
09-07 16:45:22.616: W/dalvikvm(14043): VFY: unable to resolve static method 256: Landroid/support/v4/app/NavUtils;.navigateUpFromSameTask (Landroid/app/Activity;)V
09-07 16:45:22.616: D/dalvikvm(14043): VFY: replacing opcode 0x71 at 0x000c
09-07 16:45:22.621: W/ApplicationPackageManager(14043): getCSCPackageItemText()
09-07 16:45:22.651: D/dalvikvm(14043): GC_FOR_ALLOC freed 67K, 9% free 21198K/23240K, paused 11ms, total 11ms
09-07 16:45:22.666: I/dalvikvm-heap(14043): Grow heap (frag case) to 26.086MB for 3630224-byte allocation
09-07 16:45:22.676: D/dalvikvm(14043): GC_FOR_ALLOC freed 1K, 8% free 24742K/26788K, paused 12ms, total 12ms
09-07 16:45:22.686: D/skia(14043): ---- fAsset->read(2729) returned 0
09-07 16:45:22.696: I/dalvikvm(14043): Could not find method android.support.v4.view.ViewConfigurationCompat.getScaledPagingTouchSlop, referenced from method com.fortysevendeg.swipelistview.SwipeListView.init
09-07 16:45:22.696: W/dalvikvm(14043): VFY: unable to resolve static method 259: Landroid/support/v4/view/ViewConfigurationCompat;.getScaledPagingTouchSlop (Landroid/view/ViewConfiguration;)I
09-07 16:45:22.696: D/dalvikvm(14043): VFY: replacing opcode 0x71 at 0x0141
09-07 16:45:22.696: I/dalvikvm(14043): Could not find method android.support.v4.view.MotionEventCompat.getActionMasked, referenced from method com.fortysevendeg.swipelistview.SwipeListView.onInterceptTouchEvent
09-07 16:45:22.696: W/dalvikvm(14043): VFY: unable to resolve static method 258: Landroid/support/v4/view/MotionEventCompat;.getActionMasked (Landroid/view/MotionEvent;)I
09-07 16:45:22.696: D/dalvikvm(14043): VFY: replacing opcode 0x71 at 0x0003
09-07 16:45:22.706: D/AbsListView(14043): Get MotionRecognitionManager
09-07 16:45:22.721: D/AndroidRuntime(14043): Shutting down VM
09-07 16:45:22.721: W/dalvikvm(14043): threadid=1: thread exiting with uncaught exception (group=0x418b0c08)
09-07 16:45:22.726: E/AndroidRuntime(14043): FATAL EXCEPTION: main
09-07 16:45:22.726: E/AndroidRuntime(14043): Process: com.example.homedevice, PID: 14043
09-07 16:45:22.726: E/AndroidRuntime(14043): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.homedevice/com.example.homedevice.VideoResultsScreenAct}: android.view.InflateException: Binary XML file line #52: Error inflating class com.fortysevendeg.swipelistview.SwipeListView
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.ActivityThread.access$900(ActivityThread.java:161)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.os.Handler.dispatchMessage(Handler.java:102)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.os.Looper.loop(Looper.java:157)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.ActivityThread.main(ActivityThread.java:5356)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at java.lang.reflect.Method.invokeNative(Native Method)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at java.lang.reflect.Method.invoke(Method.java:515)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at dalvik.system.NativeStart.main(Native Method)
09-07 16:45:22.726: E/AndroidRuntime(14043): Caused by: android.view.InflateException: Binary XML file line #52: Error inflating class com.fortysevendeg.swipelistview.SwipeListView
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.createView(LayoutInflater.java:626)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:359)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.Activity.setContentView(Activity.java:2010)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at com.example.homedevice.VideoResultsScreenAct.onCreate(VideoResultsScreenAct.java:93)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.Activity.performCreate(Activity.java:5426)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
09-07 16:45:22.726: E/AndroidRuntime(14043):    ... 11 more
09-07 16:45:22.726: E/AndroidRuntime(14043): Caused by: java.lang.reflect.InvocationTargetException
09-07 16:45:22.726: E/AndroidRuntime(14043):    at java.lang.reflect.Constructor.constructNative(Native Method)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at android.view.LayoutInflater.createView(LayoutInflater.java:600)
09-07 16:45:22.726: E/AndroidRuntime(14043):    ... 24 more
09-07 16:45:22.726: E/AndroidRuntime(14043): Caused by: java.lang.NoClassDefFoundError: android.support.v4.view.ViewConfigurationCompat
09-07 16:45:22.726: E/AndroidRuntime(14043):    at com.fortysevendeg.swipelistview.SwipeListView.init(SwipeListView.java:205)
09-07 16:45:22.726: E/AndroidRuntime(14043):    at com.fortysevendeg.swipelistview.SwipeListView.<init>(SwipeListView.java:149)
09-07 16:45:22.726: E/AndroidRuntime(14043):    ... 27 more
09-07 16:47:52.821: I/Process(14043): Sending signal. PID: 14043 SIG: 9
09-07 16:45:13.041:I/jdwp(13517):忽略第二个调试器--接受并删除
09-07 16:45:20.996:W/ApplicationPackageManager(14043):getCSCPackageItemText()
09-07 16:45:21.076:D/dalvikvm(14043):释放82K的所有元素的GC_,11%的自由元素16837K/18892K,暂停24毫秒,总计25毫秒
09-07 16:45:21.091:I/dalvikvm堆(14043):为3630224字节分配将堆(frag案例)增长到21.828MB
09-07 16:45:21.106:D/dalvikvm(14043):分配释放读取(2729)的GC返回0
09-07 16:45:22.696:I/dalvikvm(14043):找不到从方法com.fortysevendeg.swipelistview.swipelistview.init引用的方法android.support.v4.view.ViewConfigurationCompat.getscaledpagingtouchlop
09-07 16:45:22.696:W/dalvikvm(14043):VFY:无法解析静态方法259:Landroid/support/v4/view/ViewConfigurationCompat;。getScaledPagingTouchSlop(Landroid/view/ViewConfiguration;)I
09-07 16:45:22.696:D/dalvikvm(14043):VFY:在0x0141处替换操作码0x71
09-07 16:45:22.696:I/dalvikvm(14043):找不到从方法com.fortysevendeg.swipelistview.swipelistview.oninterceptouchevent引用的方法android.support.v4.view.MotionEventCompat.getActionMasked
09-07 16:45:22.696:W/dalvikvm(14043):VFY:无法解析静态方法258:Landroid/support/v4/view/MotionEventCompat;。getActionMasked(Landroid/view/MotionEvent;)I
09-07 16:45:22.696:D/dalvikvm(14043):VFY:在0x0003处替换操作码0x71
09-07 16:45:22.706:D/AblistView(14043):获取运动识别管理器
09-07 16:45:22.721:D/AndroidRuntime(14043):关闭虚拟机
09-07 16:45:22.721:W/dalvikvm(14043):threadid=1:线程以未捕获异常退出(组=0x418b0c08)
09-07 16:45:22.726:E/AndroidRuntime(14043):致命异常:主
09-07 16:45:22.726:E/AndroidRuntime(14043):进程:com.example.homedevice,PID:14043
09-07 16:45:22.726:E/AndroidRuntime(14043):java.lang.RuntimeException:无法启动活动组件信息{com.example.homedevice/com.example.homedevice.VideoResultsScreenAct}:android.view.InflateException:二进制XML文件行#52:对类com.fortysevendeg.swipelistview.swipelistview进行膨胀时出错
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.app.ActivityThread.access$900(ActivityThread.java:161)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.os.Handler.dispatchMessage(Handler.java:102)上
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.os.Looper.loop(Looper.java:157)上
09-07 16:45:22.726:E/AndroidRuntime(14043):位于android.app.ActivityThread.main(ActivityThread.java:5356)
09-07 16:45:22.726:E/AndroidRuntime(14043):位于java.lang.reflect.Method.Invokenactive(本机方法)
09-07 16:45:22.726:E/AndroidRuntime(14043):位于java.lang.reflect.Method.invoke(Method.java:515)
09-07 16:45:22.726:E/AndroidRuntime(14043):在com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
09-07 16:45:22.726:E/AndroidRuntime(14043):位于com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
09-07 16:45:22.726:E/AndroidRuntime(14043):在dalvik.system.NativeStart.main(本机方法)
09-07 16:45:22.726:E/AndroidRuntime(14043):由以下原因引起:android.view.InflateException:二进制XML文件行#52:对com.fortysevendeg.swipelistview.swipelistview类进行膨胀时出错
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.createView(LayoutInflater.java:626)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.rInflate(LayoutInflater.java:769)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.inflate(LayoutInflater.java:498)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.inflate(LayoutInflater.java:398)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.view.LayoutInflater.inflate(LayoutInflater.java:354)
09-07 16:45:22.726:E/AndroidRuntime(14043):位于com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:359)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.app.Activity.setContentView(Activity.java:2010)上
09-07 16:45:22.726:E/AndroidRuntime(14043):在com.example.homedevice.VideoResultsScreenAct.onCreate(VideoResultsScreenAct.java:93)
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.app.Activity.performCreate(Activity.java:5426)上
09-07 16:45:22.726:E/AndroidRuntime(14043):在android.ap