创建短信链接HandcentSMS对话框的链接弹出 [英] Create Dialog-link popup for text message link HandcentSMS
问题描述
我在修改测试消息应用程序,那我想加入到这将是收到短信的时候,某种形式的对话框会弹出的功能之一的中间短信的东西,很快回复了,所有这些都无需进入实际应用的能力。以HandcentSMS为例,这里就是我所说的:
I'm in the middle of modifying a test message application and one of the features that I'd like to add to it would be that when a text message is received, a dialog box of some sort would pop up with the text message stuff and the ability to quickly reply to it, all without having to go into the actual application. Taking HandcentSMS as an example, here is what I'm talking about:
任何想法如何去这样做,或任何人都可以点我一个很好的方向,以便开始在此?
Any ideas how to go about doing this, or could anyone point me in a good direction to get started on this?
推荐答案
您可以进行的活动,并与自定义样式风格就应该继承Theme.Dialog
举例风格:
You can make an activity, and style it with custom style which should inherit Theme.Dialog Example style:
<style name="Theme.MyDialog" parent="android:style/Theme.Dialog">
<item name="android:windowBackground">@android:drawable/alert_light_frame</item>
<item name="android:textColorPrimary">@android:color/black</item>
<item name="android:textColor">@android:color/black</item>
<item name="android:overScrollMode">never</item>
<item name="android:windowNoTitle">true</item>
</style>
最重要的是活动的prepare XML布局正确。
我建议垂直WRAP_CONTENT的一切,和FILL_PARENT水平。
The most important thing is to prepare xml layout of the activity properly. I suggest to WRAP_CONTENT for everything vertically, and FILL_PARENT horizontally.
布局示例XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="280dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/frg_alert_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/topbar_logo"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:padding="10dp"
android:text="Title"/>
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="@android:drawable/divider_horizontal_bright"/>
</LinearLayout>
<FrameLayout
android:id="@+id/customPanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:visibility="gone">
<FrameLayout
android:id="@+id/custom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
<ScrollView
android:id="@+id/messagePanel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:fillViewport="true"
android:padding="10dp">
<TextView
android:id="@android:id/message"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Some text"/>
</ScrollView>
<View
android:layout_width="fill_parent"
android:layout_height="2dp"
android:background="@android:drawable/divider_horizontal_bright"/>
<LinearLayout
android:id="@+id/frg_alert_three_buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="5dp"
android:visibility="gone"
android:weightSum="3">
<Button
android:id="@+id/button_positive"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginRight="5dp"
android:layout_weight="1"
android:maxLines="2"
android:minLines="2"
android:text="Button"/>
<Button
android:id="@+id/button_neutral"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:maxLines="2"
android:text="Button"/>
<Button
android:id="@+id/button_negative"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:maxLines="2"
android:text="Button"/>
</LinearLayout>
<LinearLayout
android:id="@+id/frg_alert_two_buttons"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="@dimen/screenPadding"
android:weightSum="2">
<Button
android:id="@+id/button_positive"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:maxLines="2"
android:minLines="2"
android:text="Button"/>
<Button
android:id="@+id/button_negative"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:maxLines="2"
android:minLines="2"
android:text="Button"/>
</LinearLayout>
</LinearLayout>
这篇关于创建短信链接HandcentSMS对话框的链接弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!