0

i'm trying the sonys add-on SDK 2.0 for sony smartwatch 2. I will develop some kinde of Messageviewer. Like the existing gmail App. It should show a list with messages (simple text, subject) and by selecting any item should be shown content viewer with header and text.

I created Sample project "SampleAdvancedControlExtension" which is almost that, what i want. I tried to create a new "ContentView" Control with following layout. The problem is, the Text is not scrollable, and i don't see any possibility to make the text scrollable. If i correctly do understand EXTRA_DATA_XML_LAYOUT, the ScrollView is not supported. But somehow the GMail app can scroll the content of eMail. How can they do that?

Thanks for any suggestions

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="@dimen/smart_watch_2_control_width"
    android:layout_height="@dimen/smart_watch_2_control_height"
    tools:ignore="PxUsage,UselessParent,HardcodedText" >

    <RelativeLayout
        android:id="@+id/header"
        android:layout_width="fill_parent"
        android:layout_height="28px"
        android:layout_alignParentTop="true"
        android:background="@android:color/black" >

        <TextView
            android:id="@+id/header_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:paddingLeft="6px"
            android:text="Это заголовок"
            android:textColor="@android:color/white"
            android:textSize="@dimen/smart_watch_2_text_size_medium"
            android:textStyle="bold" />
    </RelativeLayout>

    <View
        android:id="@+id/divider"
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:layout_below="@+id/header"
        android:background="@android:color/white" />

    <RelativeLayout
        android:id="@+id/content"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_below="@+id/divider"
        android:background="@android:color/black" >

        <TextView
            android:id="@+id/content_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:maxLines="5"
            android:paddingLeft="6px"
            android:text="Тут будет текст"
            android:textColor="@android:color/white"
            android:textSize="@dimen/smart_watch_2_text_size_medium"
            android:textStyle="bold" />
    </RelativeLayout>  


</RelativeLayout>
Lion
  • 18,729
  • 22
  • 80
  • 110
  • possible duplicate of [Scrolling via SmartWatch control](http://stackoverflow.com/questions/13583652/scrolling-via-smartwatch-control) – Eir Oct 17 '13 at 12:00

3 Answers3

0

Have you tried setting android:lines="5" and android:singleLine="false"?

see

http://developer.sonymobile.com/reference/sony-addon-sdk/com/sonyericsson/extras/liveware/aef/control/Control.Intents#EXTRA_DATA_XML_LAYOUT

for supported attributes by TextView

Oleg Skr
  • 386
  • 2
  • 9
0

Scroll is supported in the Notification extensions, that's where you're seeing it. Otherwise, don't bother with multi-line text views or the like, everything that doesn't fit the screen will simply be cut off.

Also, make sure you search StackOverflow before posting a new question, this question is the same as mine from one year ago, and it also has an "offical" answer from Sony Scrolling via SmartWatch control

Community
  • 1
  • 1
Eir
  • 1,003
  • 9
  • 24
0

I've made scrollable text by rendering it as a bitmap and then serving up chunks of the bitmap in a list: http://damianblog.com/2014/01/12/sw2-scrollable-text/

Damian
  • 4,723
  • 2
  • 32
  • 53
  • Note that [link-only answers](http://meta.stackoverflow.com/tags/link-only-answers/info) are discouraged, SO answers should be the end-point of a search for a solution (vs. yet another stopover of references, which tend to get stale over time). Please consider adding a stand-alone synopsis here, keeping the link as a reference. – kleopatra Jan 12 '14 at 14:33