Vertical SeekBar?

by Jared » Mon, 09 Feb 2009 15:23:11 GMT


Sponsored Links
 Is it possible to have a vertical SeekBar? I would want this for a
tilt control slider.

--~--~---------~--~----~------------~-------~--~----~



Vertical SeekBar?

by Jared » Thu, 12 Feb 2009 06:37:37 GMT


 I am still interested in solving this. Does anyone have an idea on how
to accomplish this?



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Vertical SeekBar?

by Dianne Hackborn » Thu, 12 Feb 2009 07:38:55 GMT


 Probably copying the seek bar code and modifying it to work how you want.







-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Vertical SeekBar?

by nderraugh » Sun, 08 Mar 2009 13:50:35 GMT


 i,

I'm trying to get a vertical seekbar going with the emulator, but I'm
sort of stuck. I can get the seekbar to display the way I want it to,
and I can get the progress to do what I want, and I can modify the
onTouchEvent to get the thumb to go vertically instead of
horizontally. What I can't do is get the thumb to move outside of the
default 29 horizontal pixels without using setThumbOffset(). This in
itself isn't a problem. The problem is coming from the fact that I
don't understand the thumbOffset at all -- I guess.I suspect I'm just
not familar enough with developing UIs. I think I could resize the
widget, which I am pretty sure I'm not doing right. Or maybe I could
just use the thumbOffset if I could figure it out. Since I can
calculate the progress correctly I thought I would just use a linear
function of progress * (getTop() - getBottom()) of the widget but that
doesn't seem to do it. But I can't figure out what the offset is
centered around.

As a somewhat aside, I am really unsure if what I am doing in
onSizeChanged() is sane or if it's going to bite me in the ass later
one.

Here's the main.xml layout and the class (ignore the debugging junk):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<com.mobilsemantic.mobipoll.SlideBar
android:id="@+id/slide"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:max="100"
android:progress="0"
android:secondaryProgress="25" />

<Button android:id="@+id/button"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Hello, I am a Button" />

<TextView android:id="@+id/tracking"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />

</LinearLayout>


import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.SeekBar;

public class SlideBar extends SeekBar {

private int oHeight = 320, oWidth = 29;
private int oProgress = -1, oOffset = -1;;
private float xPos = -1, yPos = -1;
private int top = -1, bottom = -1, left = -1, right = -1;

public SlideBar(Context context) {
super(context);
}
public SlideBar(Context context, AttributeSet attrs)
{
super(context, attrs);
oOffset = this.getThumbOffset();
oProgress = this.getProgress();
}
public SlideBar(Context context, AttributeSet attrs, int defStyle)
{
super(context, attrs, defStyle);
}

protected synchronized void onMeasure(int widthMeasureSpec, int
heightMeasureSpec)
{
int height = View.MeasureSpec.getSize(heightMeasureSpec);
oHeight = height;
this.setMeasuredDimension(oWidth, oHeight



Other Threads

1. Alternate preference screens

To provide alternate resources you supply extra subdirectories under
the res directory. To provide other language strings you'd do
something like:

res/
    values/
        strings.xml
    values-en/
        strings.xml
    values-ja/
        strings.xml

Does this also work for preference screens? We'd like different sets
of preferences for pre OS 2.2 devices and OS 2.2 and greater devices.
I tried:

res/
    xml/
        preferences.xml
    xml-v8/
        preferences.xml

But the res/xml/preferences.xml file seems to be loaded on all devices
and the res/xml-v8/preferences.xml file is ignored.

I have a work around so it isn't critical, but would be nice to know.

-- 

2. HorizontalScrollView.

Hi,

I have a HorizontalScrollView.

In it, I have 3 TextViews and i have set it in a for loop as below:

public viod setActiveFeature(int no){
           activeFeature = no;
}

void display(){
            for(int i = 0; i < 3; i++){
                 //add TextView.
                 textView[i].setText("textView" + i);
                 layout.addView(textView[i] //layout with
horizontalScrollView...
            }
             hScrollView.smoothScrollTo( activeFeature *
hsv.getMeasuredWidth());
}



So, if I have set the variable activeFeature = 1;  In the end, it
should show the 2nd textView.... but it always displays the first
textview of the scrollView.

If I call the display() method for the first time, it does not work,
but then after it displays the textView depending on the variable
"activeFeature" is set to.

Why it does not happen for the first time? Can anyone help?

-- 

3. FileNotFoundException

4. We created a new mobile browser, please feel free to try it out and let us know what you think...=)

5. adding search option

6. New android users group in Columbia md

7. Resizing and relocating images/text (similar to powerpoint), on android