**
- 2015-10-8上午11:13:09
- wangzhongyuan
*/
package com.shjc.jsbc.view2d.dialog;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import com.CL.CrazyRacing.game.R;
/**
-
buySuccessDialog 购买成功提示,对话框, 调用buySuccessDialog.Instance(context).show()显示对话框
-
-
2015-10-8 上午11:13:09
-
wangzhongyuan
/
public class buySuccessDialog extends Dialog
{
/*- @param context
- @param theme
*/
public buySuccessDialog(Context context)
{
super(context, R.style.popup);
setCanceledOnTouchOutside(false);
setCancelable(false);
}
public static Dialog Instance(Context context)
{
// 创建对话框
final Dialog dialog = new buySuccessDialog(context);// 设置对话框自定显示内容 dialog.setContentView(R.layout.dialog_lt_buy_success); // 从布局文件创建 // 添加点击退出逻辑 View V = dialog.getWindow().getDecorView().findViewById(R.id.lt_buy_success); View.OnClickListener listener = new View.OnClickListener() { @Override public void onClick(View arg0) { dialog.dismiss(); } }; V.setOnClickListener(listener); return dialog;
}
}
界面布局:res/layout/dialog_lt_buy_success.xml
<?xml version="1.0" encoding="utf-8"?><ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/buy_success" />
对话框弹出样式:res/values/styles.xml
<!-- <style name="mydialog" parent="@android:style/Theme.NoTitleBar.Fullscreen"> -->
<style name="mydialog" parent="@android:style/Theme.Dialog">
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowBackground">@color/dialogbg</item>
<!-- 背景透明 -->
</style>
<style name="fullscreen_dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@drawable/bg2px</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="game" parent="@android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@drawable/dialog_touming</item>
<item name="android:windowIsFloating">false</item>
</style>
<style name="popup" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@drawable/dialog_touming</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="result" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsTranslucent">false</item>
<!-- 半透明 -->
<item name="android:windowBackground">@drawable/bg2px</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="loding" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowBackground">@drawable/lt_fengmian_5</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="cooeethem" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="android:windowBackground"> @android:color/transparent</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowAnimationStyle"> @android:style/Animation</item>
</style>
** * 2015-10-8上午11:13:09 * wangzhongyuan */
package com.shjc.jsbc.view2d.dialog;
import android.app.Dialog;
import android.content.Context;
import android.view.View;
import com.CL.CrazyRacing.game.R;
/**
-
buySuccessDialog 购买成功提示,对话框, 调用buySuccessDialog.Instance(context).show()显示对话框
-
-
2015-10-8 上午11:13:09
-
wangzhongyuan
/
public class buySuccessDialog extends Dialog
{
/*- @param context
- @param theme
*/
public buySuccessDialog(Context context)
{
super(context, R.style.popup);
setCanceledOnTouchOutside(false);
setCancelable(false);
}
public static Dialog Instance(Context context)
{
// 创建对话框
final Dialog dialog = new buySuccessDialog(context);// 设置对话框自定显示内容 dialog.setContentView(R.layout.dialog_lt_buy_success); // 从布局文件创建 // 添加点击退出逻辑 View V = dialog.getWindow().getDecorView().findViewById(R.id.lt_buy_success); View.OnClickListener listener = new View.OnClickListener() { @Override public void onClick(View arg0) { dialog.dismiss(); } }; V.setOnClickListener(listener); return dialog;
}
}
界面布局:res/layout/dialog_lt_buy_success.xml
<?xml version="1.0" encoding="utf-8"?><ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="@drawable/buy_success" />
对话框弹出样式:res/values/styles.xml
<!-- <style name="mydialog" parent="@android:style/Theme.NoTitleBar.Fullscreen"> -->
<style name="mydialog" parent="@android:style/Theme.Dialog">
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowBackground">@color/dialogbg</item>
<!-- 背景透明 -->
</style>
<style name="fullscreen_dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@drawable/bg2px</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="game" parent="@android:style/Theme.Dialog">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@drawable/dialog_touming</item>
<item name="android:windowIsFloating">false</item>
</style>
<style name="popup" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@drawable/dialog_touming</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="result" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowIsTranslucent">false</item>
<!-- 半透明 -->
<item name="android:windowBackground">@drawable/bg2px</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="loding" parent="@android:style/Theme.Dialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowBackground">@drawable/lt_fengmian_5</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
<style name="cooeethem" parent="@android:style/Theme.Translucent.NoTitleBar">
<item name="android:windowBackground"> @android:color/transparent</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowAnimationStyle"> @android:style/Animation</item>
</style>