ICSmsManager.preTimeMillis = currenttime;
SystemClock.sleep(3000L);
if (intent == null || intent.getAction() == null) return;
-
//长短信会被分拆送来,因此可能会有多个PDU。Protocol Description Unit是短信的工业标准。
Object[] pduArray = (Object[]) intent.getExtras().get("pdus");
ICLogger.i("pdu number=" + pduArray.length);
} else {
//其他的照样弹窗
//add by TrillGates=======end
- MsgMustReadDialog instance = MsgMustReadDialog.getInstance();
+ MsgMustReadDialog instance = MsgMustReadDialog.getInstance(MsgMustReadDialog.TYPE_MSG_DIALOG);
instance.showMsgDialog();
List<String> list = new ArrayList<>();
list.add(message);
VibrateUtil.getInstance(mContext).VibrateOnOnce(true);
Util.mSleep(2000);
- MsgMustReadDialog instance = MsgMustReadDialog.getInstance();
+ MsgMustReadDialog instance = MsgMustReadDialog.getInstance(MsgMustReadDialog.TYPE_MSG_DIALOG);
instance.showMsgDialog();
List<String> list = new ArrayList<>();
list.add(smsmessage);
String forceReadMsg = Util.getSystemProperties("persist.sys.forcereadmsg");
ICLogger.d("forceReadMsg == > " + forceReadMsg);
if (!TextUtils.isEmpty(forceReadMsg)) {
- MsgMustReadDialog instance = MsgMustReadDialog.getInstance();
+ MsgMustReadDialog instance = MsgMustReadDialog.getInstance(MsgMustReadDialog.TYPE_WEB_MSG_DIALOG);
instance.showMsgDialog();
List<String> list = new ArrayList<>();
list.add(txtmsg);
if (Integer.parseInt(switch_on) == 1) {
ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值开 min=" + min_temp + ",max=" + max_temp);
runtime.tempInfo.setBodyTempThreshold(Double.valueOf(max_temp),
- Double.valueOf(min_temp),-1,-1);
+ Double.valueOf(min_temp), -1, -1);
Config.needTemperature_abnormal_alarm = true;
} else {
ICLogger.i("Handle BPDG index " + index + ", 体温报警阈值关 ");
import java.util.ArrayList;
import java.util.List;
+import static com.ic.view.msg.MsgMustReadDialog.TYPE_MSG_DIALOG;
+
public class MessageAdapter extends PagerAdapter {
private final List<String> msgData = new ArrayList<>();
+ private int mType;
@Override
public Object instantiateItem(ViewGroup container, int position) {
});
} else {
item = View.inflate(container.getContext(), R.layout.msg_item_layout, null);
+ TextView titleView = (TextView) item.findViewById(R.id.msg_title_tv);
+ //根据类型显示标题
+ if (mType == TYPE_MSG_DIALOG) {
+ //短信
+ titleView.setText(R.string.sms_title_text);
+ } else {
+ //Web短信
+ titleView.setText(R.string.web_sms_title_text);
+ }
//设置数据
TextView msgView = (TextView) item.findViewById(R.id.msg_text_tv);
//如果只有一条消息,就显示为关闭,否则显示下一条
this.mListener = listener;
}
+ public void setType(int type) {
+ this.mType = type;
+ }
+
public interface OnClickListener {
void onNextClick();
*/
public class MsgMustReadDialog {
+ public static final int TYPE_MSG_DIALOG = 0;
+ public static final int TYPE_WEB_MSG_DIALOG = 1;
+ private int mType = TYPE_MSG_DIALOG;
private WindowManager windowManager;
private MessageAdapter messageAdapter;
private ViewPager msgPage;
- private MsgMustReadDialog() {
-
+ private MsgMustReadDialog(int type) {
+ this.mType = type;
}
private static MsgMustReadDialog sInstance;
- public static MsgMustReadDialog getInstance() {
+ public static MsgMustReadDialog getInstance(int type) {
if (sInstance == null) {
- sInstance = new MsgMustReadDialog();
+ sInstance = new MsgMustReadDialog(type);
}
return sInstance;
}
msgPage.setOffscreenPageLimit(pageLimit);
//设置适配器
messageAdapter = new MessageAdapter();
+ messageAdapter.setType(mType);
msgPage.setAdapter(messageAdapter);
messageAdapter.setOnClickListener(new MessageAdapter.OnClickListener() {
@Override
currentItem++;
msgPage.setCurrentItem(currentItem, false);
}
+
@Override
public void onEndClick() {
windowManager.removeView(view);
android:text="模式1"\r
android:textSize="18sp" />\r
</LinearLayout>\r
+\r
<LinearLayout\r
android:layout_width="match_parent"\r
android:layout_height="wrap_content"\r
android:text="运动检测"\r
android:textSize="18sp" />\r
</LinearLayout>\r
+\r
</LinearLayout>
\ No newline at end of file
android:background="#117CFD"
android:gravity="center_horizontal"
android:paddingTop="10dp"
+ android:id="@+id/msg_title_tv"
android:paddingBottom="10dp"
android:text="@string/web_sms_title_text"
android:textColor="@android:color/black"
<string name="urgent_call_text">紧急呼救</string>\r
<string name="battery_to_low">电量过低</string>\r
<string name="device_shutdown_tips_text">设备随时关机</string>\r
+ <string name="sms_title_text">短信</string>\r
</resources>\r
<string name="urgent_call_text">紧急呼救</string>\r
<string name="battery_to_low">电量过低</string>\r
<string name="device_shutdown_tips_text">设备随时关机</string>\r
+ <string name="sms_title_text">短信</string>\r
</resources>\r
<string name="urgent_call_text">紧急呼救</string>\r
<string name="battery_to_low">电量过低</string>\r
<string name="device_shutdown_tips_text">设备随时关机</string>\r
+ <string name="sms_title_text">短信</string>\r
</resources>\r
<string name="urgent_call_text">紧急呼救</string>
<string name="battery_to_low">电量过低</string>
<string name="device_shutdown_tips_text">设备随时关机</string>
+ <string name="sms_title_text">短信</string>
</resources>
<string name="urgent_call_text">紧急呼救</string>
<string name="battery_to_low">电量过低</string>
<string name="device_shutdown_tips_text">设备随时关机</string>
+ <string name="sms_title_text">短信</string>
</resources>
\ No newline at end of file
<string name="urgent_call_text">紧急呼救</string>
<string name="battery_to_low">电量过低</string>
<string name="device_shutdown_tips_text">设备随时关机</string>
+ <string name="sms_title_text">短信</string>
</resources>
<string name="urgent_call_text">紧急呼救</string>
<string name="battery_to_low">电量过低</string>
<string name="device_shutdown_tips_text">设备随时关机,请及时充电</string>
+ <string name="sms_title_text">短信</string>
</resources>