Android之拨号界面图片风格,无信息默认显示界面修改
Android之拨号界面图片风格,无信息默认显示界面修改
点开Dialer app,出现拨号,联系人,收藏三个选项卡,也就是三个Fragment,在三个界面都没有信息的时候会显示一个时钟,联系人,收藏的三个
图片,怎么样能调整他们的位置以及大小呢?
首先找到图片的位置在哪里,路径为package/app/Dialer/res/drawable-xxhdpi(这个图片所在的文件夹就看手机对应的分辨率了)/empty_call_log.png
package/app/Dialer/res/drawable-xxhdpi(这个图片所在的文件夹就看手机对应的分辨率了)/empty_contacts.png
package/app/Dialer/res/drawable-xxhdpi(这个图片所在的文件夹就看手机对应的分辨率了)/empty_speed_dial.png
这样就可以修改图片了,
然后再修改布局文件,package/app/Dialer/res/layout/empty_content_view.xml
| <TextView | 25 | |||
| 25 | android:id="@+id/emptyListViewMessage" | android:id="@+id/emptyListViewMessage" | 26 | |
| 26 | android:layout_width="match_parent" | android:layout_width="match_parent" | 27 | |
| 27 | android:layout_height="wrap_content" | android:layout_height="wrap_content" | 28 | |
| 28 | android:gravity="center_horizontal|top" | android:gravity="center_horizontal|top" | 29 | |
| 29 | android:textSize="@dimen/empty_list_message_text_size" | android:textSize="@dimen/empty_list_message_text_size" | 30 | |
| 30 | android:textColor="@color/empty_list_text_color" | android:textColor="@color/empty_list_text_color" | 31 | |
| 31 | android:paddingRight="16dp" | android:paddingRight="16dp" | 32 | |
| 32 | android:paddingLeft="16dp" | android:paddingLeft="16dp" | 33 | |
| 33 | android:paddingTop="8dp" | android:paddingTop="20dp" | 34 | |
| 34 | android:paddingBottom="8dp" /> | android:paddingBottom="8dp" /> |
然后在package/app/Dialer/res/values/colors.xml
| <color name="empty_list_text_color">#b2b2b2</color> | <color name="empty_list_text_color">#80444444</color> |
然后在package/app/Dialer/res/values/dimens.xml
| <dimen name="empty_list_message_text_size">16sp</dimen> | <dimen name="empty_list_message_text_size">14sp</dimen> |
在src/com/android/dialer/widget/EmptyContentView.java中修改
| public void setActionLabel(int resourceId) { | public void setActionLabel(int resourceId) { | 91 | ||
| 92 | if (resourceId == NO_LABEL) { | if (resourceId == NO_LABEL) { | 92 | |
| 93 | mActionView.setText(null); | mActionView.setText(null); | 93 | |
| 94 | mActionView.setVisibility(View.GONE); | mActionView.setVisibility(View.INVISIBLE); | 94 | |
| 95 | } else { | } else { | 95 | |
| 96 | mActionView.setText(resourceId); | mActionView.setText(resourceId); | 96 | |
| 97 | mActionView.setVisibility(View.VISIBLE); | mActionView.setVisibility(View.VISIBLE); | 97 | |
| 98 | } | } | 98 | |
| 99 | } | } | 99 | |
| 100 |
浙公网安备 33010602011771号