po.java
3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package com.lotus.town.notify;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.text.Html;
import android.widget.TextView;
import com.ad.lib.AdPlacement;
import com.ad.lib.RequestInfo;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.controller.NotifyType;
import com.lotus.town.R;
/**
* 挂机电话
*/
public class po extends BaseNotifyActivity {
private TextView mPhoneTime;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void initSmallView() {
}
@Override
protected void initLayout() {
setContentView(R.layout.po_notify_layout);
}
@Override
protected void initSmallAd() {
}
@Override
protected String getEventName() {
return "p_o_a_d";
}
@Override
protected String getEventClickName() {
return "p_o_s_c";
}
@Override
protected String getEventPageName() {
return "p_o_s_p";
}
@Override
protected RequestInfo getSmallPlacementId() {
RequestInfo info = new RequestInfo();
info.setId(AdPlacement.getPhoneOverId());
info.setWidth(1080);
info.setHeight(1920);
info.setType(AdSlot.TYPE_INTERACTION_AD);
return info;
}
@Override
protected RequestInfo getBigPlacementId() {
RequestInfo info = new RequestInfo();
info.setId(AdPlacement.getPhoneOverId());
info.setWidth(1080);
info.setHeight(1920);
info.setType(AdSlot.TYPE_INTERACTION_AD);
return info;
}
@Override
protected void initInfo() {
if(NotifyManager.PhoneStartTime == 0){
String html="<font color='black'>本次通话</font>";
html+="<font color='#FF6861'> <big> "+"已结束"+" </big> </font>";
CharSequence charSequence= Html.fromHtml(html);
mPhoneTime.setText(charSequence);
} else {
long time = NotifyManager.PhoneEndTime - NotifyManager.PhoneStartTime;
String times = getTimeString(time);
String html="<font color='black'>本次通话</font>";
html+="<font color='#FF6861'> <big> "+times+" </big> </font>";
CharSequence charSequence= Html.fromHtml(html);
mPhoneTime.setText(charSequence);
}
}
private String getTimeString(long time){
String result = "";
if(time <=60000){
result = time/1000 +"秒";
} else if(time >60000 && time <60*60*1000){
//70000 10000
result = time/60/1000 +"分钟"+time%(60*1000)/(1000) +"秒";
} else if(time >= 60*60*1000){
//60 * 60 *1000 3600000
result = time/(60*60*1000) +"小时"+time%(60*60*1000)/60/1000 +"分";
}
return result;
}
@Override
protected void initView(){
super.initView();
mPhoneTime = findViewById(R.id.phone_time);
}
@Override
protected int getSmallAdType() {
return 0;
}
@Override
protected int getBitAdType() {
return 0;
}
@Override
protected int getBigAdNotifyType() {
return NotifyType.PHONE_OVER_NOTIRY;
}
}