--- /dev/null
+package com.ic.view.battery;
+
+import android.content.Context;
+import android.view.Gravity;
+import android.view.View;
+import android.view.WindowManager;
+
+import com.enqualcomm.support.ICApplication;
+import com.enqualcomm.support.R;
+import com.enqualcomm.support.utils.ICLogger;
+
+/**
+ * 低点请充电提示窗口
+ */
+public class ChargeTipsView {
+
+ private WindowManager windowManager;
+ private View view;
+
+ private ChargeTipsView() {
+ //获取到数据库里的数据,显示快捷回复列表
+ }
+
+ private static ChargeTipsView sInstance;
+
+ public static ChargeTipsView getInstance() {
+ if (sInstance == null) {
+ sInstance = new ChargeTipsView();
+ }
+ return sInstance;
+ }
+
+ private boolean isShow = false;
+
+ public void showMsgDialog() {
+ ICLogger.d("showMsgDialog..." + isShow);
+ if (isShow) {
+ return;
+ }
+ isShow = true;
+ Context context = ICApplication.sContext;
+ windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
+ //设置属性
+ WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams();
+ layoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ALERT;
+ //这个是针对S123的屏幕,如果要适配其他,可以动态获取屏幕宽度,高度,再以百分比的形式计算即可。
+ layoutParams.height = WindowManager.LayoutParams.MATCH_PARENT;
+ layoutParams.width = WindowManager.LayoutParams.MATCH_PARENT;
+ layoutParams.packageName = context.getPackageName();
+ layoutParams.gravity = Gravity.CENTER;
+ //加载布局
+ view = View.inflate(context, R.layout.msg_dialog_layout, null);
+ //设置适配器
+ initView(view);
+ windowManager.addView(view, layoutParams);
+ }
+
+
+ public void dismiss() {
+ windowManager.removeView(view);
+ sInstance = null;
+ windowManager = null;
+ }
+
+
+ private void initView(final View view) {
+
+ }
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/shape_urgent_call_bg_press" android:state_pressed="true" />
+ <item android:drawable="@drawable/shape_urgent_call_bg_normal" />
+</selector>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+
+ <solid android:color="#242424" />
+ <corners
+ android:bottomLeftRadius="10dp"
+ android:bottomRightRadius="10dp" />
+
+</shape>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+
+ <corners android:radius="4dp" />
+ <solid android:color="#F7392F" />
+
+</shape>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+
+ <corners android:radius="4dp" />
+ <solid android:color="#F22117" />
+
+</shape>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/shape_black_dialog_bg"
+ android:baselineAligned="false"
+ android:gravity="center_horizontal"
+ android:orientation="vertical"
+ android:padding="20dp">
+
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/tips_charge_text"
+ android:textColor="@color/white"
+ android:textSize="20sp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="10dp"
+ android:background="@drawable/selector_urgent_call_bg"
+ android:paddingLeft="14dp"
+ android:paddingTop="4dp"
+ android:paddingRight="14dp"
+ android:paddingBottom="4dp"
+ android:text="@string/urgent_call_text"
+ android:textColor="@color/white"
+ android:textSize="16sp" />
+
+
+</LinearLayout>
\ No newline at end of file
<string name="alarm_text">闹钟</string>\r
<string name="out_temp_too_high_text">环境温度过高</string>\r
<string name="out_temp_too_low_text">环境温度过低</string>\r
+ <string name="tips_charge_text">低电,请充电</string>\r
+ <string name="urgent_call_text">紧急呼救</string>\r
</resources>\r
<string name="alarm_text">闹钟</string>\r
<string name="out_temp_too_high_text">环境温度过高</string>\r
<string name="out_temp_too_low_text">环境温度过低</string>\r
+ <string name="tips_charge_text">低电,请充电</string>\r
+ <string name="urgent_call_text">紧急呼救</string>\r
</resources>\r
<string name="alarm_text">闹钟</string>\r
<string name="out_temp_too_high_text">环境温度过高</string>\r
<string name="out_temp_too_low_text">环境温度过低</string>\r
+ <string name="tips_charge_text">低电,请充电</string>\r
+ <string name="urgent_call_text">紧急呼救</string>\r
</resources>\r
<string name="alarm_text">目覚まし时计</string>
<string name="out_temp_too_high_text">環境温度が高すぎる</string>
<string name="out_temp_too_low_text">環境温度が低すぎる</string>
+ <string name="tips_charge_text">低电,请充电</string>
+ <string name="urgent_call_text">紧急呼救</string>
</resources>
<string name="alarm_text">闹钟</string>
<string name="out_temp_too_high_text">环境温度过高</string>
<string name="out_temp_too_low_text">环境温度过低</string>
+ <string name="tips_charge_text">低电,请充电</string>
+ <string name="urgent_call_text">紧急呼救</string>
</resources>
\ No newline at end of file
<string name="alarm_text">闹钟</string>
<string name="out_temp_too_high_text">环境温度过高</string>
<string name="out_temp_too_low_text">环境温度过低</string>
+ <string name="tips_charge_text">低电,请充电</string>
+ <string name="urgent_call_text">紧急呼救</string>
</resources>
<string name="alarm_text">闹钟</string>
<string name="out_temp_too_high_text">环境温度过高</string>
<string name="out_temp_too_low_text">环境温度过低</string>
+ <string name="tips_charge_text">低电,请充电</string>
+ <string name="urgent_call_text">紧急呼救</string>
</resources>