Problem getting a linearlayout to be scrollable

by Mike Topper » Tue, 25 May 2010 22:33:02 GMT


Sponsored Links
 ey,

I'm having problems with a layout I'm currently working with.
Everything looks fine with it in portrait mode, but when i switch to
landscape, the linearlayout that encompasses the textviews and
edittexts go below the end of the screen and you can't see/edit them.

I tried wrapping that linearlayout in a scrollview, but it didn't seem
to do anything.

below is the xml, i'm trying to wrap that first linear layout in a scrollview.

any help would be greatly appreciated.


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


<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/customer_id" />
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/customerid_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/customer_id"
android:singleLine="true" />
<Button android:id="@+id/customerSelectButton"
android:text="@string/button_get_customers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:bufferType="editable"
/>
</LinearLayout>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/po_number" />
<EditText android:id="@+id/ponumber_field"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/po_number"
android:singleLine="true" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/packet" />
<EditText android:id="@+id/packet_field"
android:layout_width="fill_parent"
android:layout_h



Other Threads

1. Touch screen Issue with Android + i.MX31- Help

Hi  Rajesh

Lastyear I was porting Android on IMX31 platform ,
(kernel ver 2.6.22 )

I adapted mxc_ts.c

====================================================================
,diff -ur linux-2.6.22/drivers/input/touchscreen/mxc_ts.c
linux-2.6.22/drivers/input/touchscreen/mxc_ts.c
--- linux-2.6.22/drivers/input/touchscreen/mxc_ts.c     2008-06-02
20:40:12.000000000 +0900
+++ linux-2.6.22.android/drivers/input/touchscreen/mxc_ts.c     2008-06-17
18:49:28.000000000 +0900
@@ -38,6 +38,15 @@

 #define MXC_TS_NAME    "mxc_ts"

+#define X_AXIS_MAX 1000
+#define X_AXIS_MIN 80
+#define Y_AXIS_MAX 1000
+#define Y_AXIS_MIN 80
+#define PRESSURE_MAX 1
+#define PRESSURE_MIN 0

 static struct input_dev *mxc_inputdev = NULL;
 static u32 input_ts_installed;

@@ -50,15 +59,39 @@
                try_to_freeze();
                memset(&ts_sample, 0, sizeof(t_touch_screen));
                pmic_adc_get_touch_sample(&ts_sample, !wait);
-
+#if 1
+               if((ts_sample.x_position >= X_AXIS_MIN) &&
+                       (ts_sample.x_position <= X_AXIS_MAX) &&
+                       (ts_sample.y_position >= Y_AXIS_MIN) &&
+                       (ts_sample.y_position <= Y_AXIS_MAX)) {
+               
+                       input_report_abs(mxc_inputdev, ABS_X, 
ts_sample.x_position);
+                       input_report_abs(mxc_inputdev, ABS_Y, 
ts_sample.y_position);
+                       input_report_abs(mxc_inputdev, ABS_PRESSURE,
+                                        ts_sample.contact_resistance);
+
+                       input_report_key(mxc_inputdev,BTN_TOUCH,1);
+               }
+               else {
+                       input_report_key(mxc_inputdev,BTN_TOUCH,0);
+               }
+               input_sync(mxc_inputdev);
+               
+               wait = ts_sample.contact_resistance;
+               msleep(20);
+#else
                input_report_abs(mxc_inputdev, ABS_X, ts_sample.x_position);
                input_report_abs(mxc_inputdev, ABS_Y, ts_sample.y_position);
                input_report_abs(mxc_inputdev, ABS_PRESSURE,
                                 ts_sample.contact_resistance);
+
                input_sync(mxc_inputdev);

                wait = ts_sample.contact_resistance;
                msleep(20);
+#endif
        }

        return 0;
@@ -77,6 +110,12 @@
        mxc_inputdev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
        mxc_inputdev->keybit[LONG(BTN_TOUCH)] |= BIT(BTN_TOUCH);
        mxc_inputdev->absbit[0] = BIT(ABS_X) | BIT(ABS_Y) | BIT(ABS_PRESSURE);
+       input_set_abs_params(mxc_inputdev,ABS_X,X_AXIS_MIN,X_AXIS_MAX,0,0);
+       input_set_abs_params(mxc_inputdev,ABS_Y,Y_AXIS_MIN,Y_AXIS_MAX,0,0);
+       
input_set_abs_params(mxc_inputdev,ABS_PRESSURE,PRESSURE_MIN,PRESSURE_MAX,0,0);
        input_register_device(mxc_inputdev);

        input_ts_installed = 1;

=======================================================================
BTW I found ipu had some problem.following image is fix image.


diff -ur linux-2.6.22/drivers/mxc/ipu/ipu_common.c
linux-2.6.22/drivers/mxc/ipu/ipu_common.c
--- linux-2.6.22/drivers/mxc/ipu/ipu_common.c   2008-06-02
20:40:13.000000000 +0900
+++ linux-2.6.22.android/drivers/mxc/ipu/ipu_common.c   2008-06-17
18:49:40.000000000 +0900
@@ -588,23 +587,28 @@

        if (dma_chan == IDMA_CHAN_INVALID)
                return -EINVAL;
-
        spin_lock_irqsave(&ipu_lock, lock_flags);

        if (bufNum == 0) {
                reg = __raw_readl(IPU_CHA_BUF0_RDY);
+#if 0
                if (reg & (1UL << dma_chan)) {
                        spin_unlock_irqrestore(&ipu_lock, lock_flags);
                        return -EACCES;
                }
+#endif
                __raw_writel(DMAParamAddr(dma_chan) + 0x0008UL, IPU_IMA_ADDR);
                __raw_writel(phyaddr, IPU_IMA_DATA);
        } else {
                reg = __raw_readl(IPU_CHA_BUF1_RDY);
+#if 0
                if (reg & (1UL << dma_chan)) {
                        spin_unlock_irqrestore(&ipu_lock, lock_flags);
                        return -EACCES;
                }
+#endif
                __raw_writel(DMAParamAddr(dma_chan) + 0x0009UL, IPU_IMA_ADDR);
                __raw_writel(phyaddr, IPU_IMA_DATA);
        }
@@ -1139,7 +1143,15 @@
        if (wait_for_stop && channel != MEM_SDC_FG && channel != MEM_SDC_BG) {
                timeout = 40;
                while ((__raw_readl(IDMAC_CHA_BUSY) & chan_mask) ||
+#if 0
                       (_ipu_channel_status(channel) == TASK_STAT_ACTIVE)) {
+#else
+                      (_ipu_channel_status(channel) == TASK_STAT_ACTIVE) ||
+                      __raw_readl(IPU_CHA_BUF0_RDY) & (1UL << out_dma) ||
+                      __raw_readl(IPU_CHA_BUF0_RDY) & (1UL << out_dma))
+                       {       
+#endif
                        timeout--;
                        msleep(10);
                        if (timeout == 0) {

BR
Jun'ichi






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

2. Unofficial SDK 1.5 with media files

Hi,

      Here i'm posting my SDK 1,5, based on Latest Cupcake
  source code, and this SDK includes the media files, that normally
are
 hidden under @hide directive. The emulator are ok in both Linux and
 Windows. Sorry Mac OX Users, i don't have one to build. Apparently,
 the SDK is ok, and the documentation also. The plugin is also there.

http://rapidshare.com/files/193806918/android-eclipse-0.9.0-plugin.zip
http://rapidshare.com/files/193811442/android-sdk_15_windows.zip
http://rapidshare.com/files/193814085/android_sdk_15_linux.zip

 Enjoy!!

Breno T. Minzon
--~--~---------~--~----~------------~-------~--~----~

3. Application label in the manifest

4. R.java file is not getting updated

5. bad packet exception - eclipse debugging

6. Using G1 as modem

7. Read Image with multiple Frames - Animated Gif