たとえば、アプリケーションPlumeで、ListViewアイテム(ツイート)をクリックすると、その下に展開され、いくつかのアクション(返信、リンク、リツイートなど)が表示されます。アプリケーションでこの動作を再現するにはどうすればよいですか?ListViewアイテムをクリックしてから、(選択したアイテムに対して)自分のアクションで「展開」できるようにしたい。
スクリーンショットの例:
ここで使用されているUIデザインパターンは何ですか?
たとえば、アプリケーションPlumeで、ListViewアイテム(ツイート)をクリックすると、その下に展開され、いくつかのアクション(返信、リンク、リツイートなど)が表示されます。アプリケーションでこの動作を再現するにはどうすればよいですか?ListViewアイテムをクリックしてから、(選択したアイテムに対して)自分のアクションで「展開」できるようにしたい。
スクリーンショットの例:
ここで使用されているUIデザインパターンは何ですか?
自分で作成する必要があります。拡張するカスタムアダプタを作成しBaseExpandableListAdapter
、getChildView
ボタンを水平に配置LinearLayout
し、使用するアイコンで'TextViews
を設定する必要があります。TextView
android:drawableTop
このレイアウトの非常に簡単な使用法:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/replyText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="@string/app_name"
android:drawableTop="@drawable/ic_launcher" />
<TextView
android:id="@+id/someText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"
android:layout_margin="5dp"
android:drawableTop="@drawable/ic_launcher" />
<TextView
android:id="@+id/otherText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="@string/app_name"
android:drawableTop="@drawable/ic_launcher" />
</LinearLayout>
ドローアブルと文字列を使用できます。それは単なるアプローチです。
Plumeがこのライブラリを使用しているかどうかはわかりませんが、Androidを使用して成功しました-この機能のためのSlideExplandableListView 。