安卓闹钟的用户界面 [英] Android Alarm Clock UI
问题描述
我试图找出如何在UI的设计为Android闹钟应用程序。 这似乎是使用全息黑暗的主题。
I am trying to figure out how the UI was designed for the Android Alarm Clock app. This appears to be using the Holo Dark Theme.
截图包括为创建/编辑报警活动
屏幕。它类似于 Android设置。这是这样吗?因为打开报警器的&放大器; 震动的行看起来像 Chexbox preferences
。在铃声行看起来像铃声preference
。怎么样的时间列?
The screenshot included is the Create/Edit Alarm Activity
screen. It looks similar to Android Settings. Is this case? Because the "Turn the alarm on" & "Vibrate" rows look like ChexboxPreferences
. The "Ringtone" row looks like a RingtonePreference
. What about the "Time" row?
由于在评论中提到以下问题的答案之一@eric,我试图重新建立一个类似的接口的闹钟应用程序。我不想送的意图,从我的应用程序启动报警管理。
As @eric mentioned in the comments to one of the answers below, I am trying to recreate a similar interface to the alarm clock app. I do not want to send an intent to start the Alarm Manager from my app.
怎么样的标签行?其功能非常类似于的EditText
视图。你可以有浏览
和 preferences
在 preferenceScreen组合
XML标记?
What about the "Label" row? That functions a lot like an EditText
view. Can you have a combination of Views
and Preferences
inside a PreferenceScreen
xml tag?
另外,动作条
有一个垂直的管子,我不知道这是怎么创作的,而是完成查看的ImageButton
?
Also the ActionBar
has a vertical pipe, I am not sure how this was created but is the "Done" view an ImageButton
?
我并不完全相信这是preferences的组合,由于报警的应用程序可以有多个报警,而不仅仅是一个报警。如果有多个报警和您不使用多个共享preferences
文件,自然会是有意义的创建内容提供商存储与多个报警信息。
I am not completely convinced that it is a combination of Preferences, since the Alarm app can have multiple alarms and not just one alarm. If there are multiple alarms and you don't use multiple SharedPreferences
files, it would naturally make sense to create a content provider to store the information related to multiple alarms.
推荐答案
该股的闹钟应用程序是 开源 ,所以检查出来自己。
The stock alarm clock app is open source, so check it out by yourself.
preference布局看<一href="https://github.com/android/platform_packages_apps_alarmclock/blob/eb142ac59aa8039c409b5fe4f50a130f16960d41/res/xml/alarm_$p$pfs.xml">here:
Preference Layout see here:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/set_alarm">
<CheckBoxPreference android:key="on"
android:title="@string/enable"/>
<Preference android:key="time"
android:title="@string/time"/>
<com.android.alarmclock.AlarmPreference
android:key="alarm"
android:title="@string/alert"
android:ringtoneType="alarm"
android:showDefault="false"
android:showSilent="false" />
<CheckBoxPreference android:key="vibrate"
android:title="@string/alarm_vibrate"/>
<com.android.alarmclock.RepeatPreference
android:key="setRepeat"
android:title="@string/alarm_repeat" />
<EditTextPreference android:key="label"
android:title="@string/label"
android:dialogTitle="@string/label" />
</PreferenceScreen>
preference活动见<一href="https://github.com/android/platform_packages_apps_alarmclock/blob/eb142ac59aa8039c409b5fe4f50a130f16960d41/src/com/android/alarmclock/SetAlarm.java">here,请注意,我引用的链接是不是从修订版。
Preference activity see here, note that, the links I referenced are not from the head revision.
要点:
- 时间是一个普通的
机器人。preference。preference
,由TimePickerDialog
支持。 -
铃声
是的Android的定制化实施。preference.Ringtone preference
。 - 重复是
机器人。preference.List preferenc
E的定制化实施。 - 在报警由一个静态类<一个管理href="https://github.com/android/platform_packages_apps_alarmclock/blob/master/src/com/android/alarmclock/Alarms.java">com.android.alarmclock.Alarms它使用内容提供商存储的实际信息。
- 由于Android 4.0的Holo主题默认情况下使用,在其他Android版本,你可能会看到不同的主题。需要注意的是该应用程序实现也可以由不同的Android版本和设备供应商改变。
- Time is a plain
android.preference.Preference
, backed byTimePickerDialog
. Ringtone
is a customized implementation ofandroid.preference.RingtonePreference
.- Repeat is a customized implementation of
android.preference.ListPreferenc
e. - Alarms are managed by a static class com.android.alarmclock.Alarms which use Content Providers store the actual information.
- Holo theme is used by default since Android 4.0, on other Android version, you may see different theme. Note that the app implementation may also changed by different android version or device vendor.
这篇关于安卓闹钟的用户界面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!