我会尝试在自定义 rom 中更改系统最近的应用程序布局。实际上,在 android stock 中,我们有一个简单的垂直滚动列,其中包含最近的应用程序。我会更改它并制作一个像 LG 一样的 gridview --> http://www.androidcentral.com/sites/androidcentral.com/files/styles /large_wm_brw/public/article_images/2014/07/task-switchers.jpg?itok=DQwWAMpQ这并不容易,我需要帮助.. 我有一些问题;
1)只改变xml就够了?2)我是否也要在java中更改适配器或在java代码中更改适配器?
xml是这个:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.recent.RecentsPanelView
android:id="@id/recents_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:foreground="@drawable/bg_protect"
systemui:recentItemLayout="@layout/status_bar_recent_item"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:id="@id/recents_bg_protect"
android:background="@drawable/status_bar_recents_background"
android:fitsSystemWindows="true"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true">
<com.android.systemui.recent.RecentsVerticalScrollView
android:layout_gravity="top|left|center"
android:id="@id/recents_container"
android:scrollbars="none"
android:fadingEdge="vertical"
android:fadingEdgeLength="@dimen/status_bar_recents_scroll_fading_edge_length"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stackFromBottom="true"
android:divider="@null"
android:layout_marginEnd="0.0dip">
<LinearLayout
android:id="@id/recents_linear_layout"
android:fitsSystemWindows="true"
android:clipChildren="false"
android:clipToPadding="false"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</com.android.systemui.recent.RecentsVerticalScrollView>
<ImageView
android:layout_gravity="bottom|left|center"
android:id="@id/recents_clear"
android:clickable="true"
android:layout_width="50.0dip"
android:layout_height="50.0dip"
android:src="@drawable/ic_notify_clear"
android:scaleType="center" />
</FrameLayout>
<include android:id="@id/recents_no_apps" android:visibility="invisible" android:layout_width="fill_parent" android:layout_height="fill_parent" layout="@layout/status_bar_no_recent_apps" />
</com.android.systemui.recent.RecentsPanelView>
该类RecentsPanelView
扩展了 FrameLayout.. 我尝试了简单的更改并扩展了 gridview 但没有任何更改.. 我认为更改这一点太容易了.. 但是,实际上使用这个 xml 我可以水平显示最近的应用程序,但只有在一排..有什么想法吗?也许在这个布局中添加一个gridview?