Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Okey. So, i fixed it! The reason to why i couldn't get it to work was because i was moving the handle. So, i needed to lock it when i (possible) would like to move then thumb if the seekbar. This is my solution:</p> <p>I added a "tab" on the leftTop side of the handle.</p> <p>This is my XML code for the SlidingDrawer now</p> <pre><code> &lt;SlidingDrawer android:id="@+id/slidingDrawer1" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="bottom" android:allowSingleTap="false" android:content="@+id/content" android:handle="@+id/handle" &gt; &lt;LinearLayout android:id="@+id/handle" android:layout_width="match_parent" android:layout_height="68dp" android:orientation="vertical" &gt; &lt;TableRow android:layout_width="101px" android:layout_height="wrap_content" android:background="@drawable/test" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/tvToggleSD" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Visa" android:layout_marginLeft="12dp" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;/TableRow&gt; &lt;TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/hz_background_gradient" android:orientation="vertical" &gt; &lt;ImageView android:id="@+id/buttonPlay" android:layout_width="40dp" android:layout_height="40dp" android:src="@drawable/playback_play" android:layout_marginLeft="6dp" android:layout_marginTop="4dp" /&gt; &lt;SeekBar android:id="@+id/seekbar1" android:layout_width="203dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_weight="0.45" android:layout_marginTop="8dp" android:max="100" /&gt; &lt;ImageView android:id="@+id/buttonstop" android:layout_width="40dp" android:layout_height="40dp" android:src="@drawable/playback_stop" android:layout_marginLeft="6dp" android:layout_marginTop="4dp" android:layout_marginRight="5dp" /&gt; &lt;/TableRow&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="167dp" android:orientation="vertical" &gt; &lt;ImageView android:id="@+id/imgCover" android:layout_width="fill_parent" android:layout_height="272dp" android:layout_weight="0.83" android:src="@drawable/test_cover" android:layout_marginLeft="25dp" android:layout_marginRight="25dp" android:layout_marginTop="25dp" /&gt; &lt;TableRow android:layout_width="fill_parent" android:layout_height="55dp" android:background="@drawable/hz_background_gradient" android:orientation="vertical" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="30dp" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Titel: " android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/tvTitel" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Put a spell on you" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;/LinearLayout&gt; &lt;LinearLayout android:id="@+id/linearLayout5" android:layout_width="match_parent" android:layout_height="30dp" android:orientation="horizontal" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Artist: " android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/tvArtist" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Credence Clearwater Revival" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; &lt;/TableRow&gt; &lt;/LinearLayout&gt; &lt;/SlidingDrawer&gt; </code></pre> <p>And then, i did some really simple java code. This idea is that, you have to click on the tab to open and close the slidingDrawer. Here is the relevant java code:</p> <pre><code>sd = (SlidingDrawer) findViewById(R.id.slidingDrawer1); tvToggleSD = (TextView) findViewById(R.id.tvToggleSD); sd.lock(); tvToggleSD.setonclickListener(new onclickListener() { public void onclick(View v) { sd.unlock(); if (sd.isOpened()) { sd.animateClose(); tvToggleSD.setText("Visa"); } else { sd.animateOpen(); tvToggleSD.setText("Dölj"); } sd.lock(); } }); </code></pre> <p>Hope this helps someone else :)</p>
    singulars
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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