Как я могу создать «Пульс», как пользовательский интерфейс для приложения Android - PullRequest
5 голосов
/ 23 марта 2011

Я хотел бы знать, как я могу создать приложение, подобное Pulse, на Android. Вот скриншот: http://www.firstdroid.com/2010/11/17/top-android-app-pulse-news-reader/

Количество вещей:

  1. У него есть номериз строк горизонтального содержания.
  2. В каждой «строке» есть «ячейки содержимого».
  3. Я могу «швырять» влево и вправо, чтобы увидеть горизонтальное содержимое.
  4. По мере того, как оно достигает конца горизонтальногоконтент, он будет автоматически загружать больше контента.

Спасибо.

Ответы [ 3 ]

2 голосов
/ 23 марта 2011

Концептуально это просто ScrollView, содержащий набор макетов Gallery с использованием адаптера бесконечной прокрутки, например cwac-endless.Я думаю, если немного поработать, вы, вероятно, сможете заставить их всех хорошо играть вместе.

1 голос
/ 23 марта 2011

Я просто приведу несколько быстрых и грязных примеров:

Вот ваш макет xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">
    <TextView android:text="News One" android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_width="wrap_content"></TextView>
    <HorizontalScrollView android:id="@+id/horizontalScrollView1"
        android:layout_width="wrap_content" android:layout_height="wrap_content">
        <LinearLayout android:id="@+id/linearLayout1"
            android:orientation="horizontal" android:layout_height="wrap_content"
            android:layout_width="wrap_content">
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView1"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView2"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView3"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView4"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView5"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView6"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:src="@drawable/image"
                android:layout_width="wrap_content" android:id="@+id/imageView7"
                android:layout_height="wrap_content"></ImageView>
        </LinearLayout>
    </HorizontalScrollView>

    <TextView android:text="News Two" android:id="@+id/textView2" android:layout_height="wrap_content" android:layout_width="wrap_content"></TextView>
    <HorizontalScrollView android:id="@+id/horizontalScrollView2"
        android:layout_width="wrap_content" android:layout_height="wrap_content">
        <LinearLayout android:id="@+id/linearLayout2"
            android:orientation="horizontal" android:layout_height="wrap_content"
            android:layout_width="wrap_content">
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView21"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView22"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView23"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView24"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView25"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:layout_width="wrap_content" android:id="@+id/imageView26"
                android:layout_height="wrap_content" android:src="@drawable/image"></ImageView>
            <ImageView android:src="@drawable/image"
                android:layout_width="wrap_content" android:id="@+id/imageView27"
                android:layout_height="wrap_content"></ImageView>
        </LinearLayout>
    </HorizontalScrollView>
</LinearLayout>

Чтобы сделать его идеальным, вы можете добавить рамку к каждому изображению и т. Д., И т. Д.Но вы должны понять эту схему.

0 голосов
/ 23 марта 2011

Может быть, вы могли бы использовать как горизонтальную прокрутку с настраиваемым макетом для каждого элемента, а затем загрузить то, что вы хотите там? Я действительно не знаю, просто мозговой штурм. Похоже, это будет работать с этим типом макета.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...