Note that there are some explanatory texts on larger screens.

plurals
  1. POError including Android-DirectionalViewPager .jar in Eclipse
    primarykey
    data
    text
    <p>I am trying to implement vertical swiping in my app. (Its just like the swiping with <a href="http://android-developers.blogspot.de/2011/08/horizontal-view-swiping-with-viewpager.html">ViewPager</a>, but vertically).</p> <p>I found Jake Whartons library <a href="https://github.com/JakeWharton/Android-DirectionalViewPager">Android-DirectionalViewPager</a>. It is a standalone .jar file which should be included in addition to the compatibility library. I included the file in my project. It is now under 'Referenced Libraries', just like the compatibility library.<br> But the problem is, I cant even get the example, which is given with the library, to work. The debugger stops at line</p> <pre><code>setContentView(R.layout.main); </code></pre> <p>with 'No source found'</p> <p>LogCat throws this error: "05-23 14:43:13.583: E/dalvikvm(329): Could not find class 'com.directionalviewpager.DirectionalViewPager', referenced from method own.vvp.MainActivity.onCreate "</p> <p>Has somebody already used this library? I need some help :)</p> <p>here is my code:</p> <p>the manifest:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="own.vvp" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="7" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" &gt; &lt;activity android:name=".MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>the layout:</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;com.directionalviewpager.DirectionalViewPager android:id="@+id/pager" android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1" /&gt; &lt;LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="2dp" android:orientation="horizontal"&gt; &lt;Button android:id="@+id/horizontal" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_marginRight="1dp" android:text="Horizontal" /&gt; &lt;Button android:id="@+id/vertical" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:layout_marginLeft="1dp" android:text="Vertical" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p>and the main activity:</p> <pre><code>package own.vvp; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.View; import android.widget.Button; import com.directionalviewpager.DirectionalViewPager; public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //Set up the pager final DirectionalViewPager pager = (DirectionalViewPager)findViewById(R.id.pager); pager.setAdapter(new TestFragmentAdapter(getSupportFragmentManager())); //Bind to control buttons ((Button)findViewById(R.id.horizontal)).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { pager.setOrientation(DirectionalViewPager.HORIZONTAL); } }); ((Button)findViewById(R.id.vertical)).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { pager.setOrientation(DirectionalViewPager.VERTICAL); } }); } } </code></pre> <p>it is the same code as in the example, except for the package name and the name of the main activity, so I guess, the way I included the library must be wrong.</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload