fix: 定时推送(未完成)
This commit is contained in:
parent
94526a9054
commit
fd1be59439
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
// ndkVersion '23.0.7123448'
|
||||
ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -55,7 +55,7 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.GetPhoneBean;
|
||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
||||
import com.navinfo.outdoor.bean.TaskPrefectureBean;
|
||||
import com.navinfo.outdoor.bean.MessageNoticeBean;
|
||||
import com.navinfo.outdoor.bean.UserBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
@ -136,7 +136,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (msg.what == 0x100) {
|
||||
isBack = false;
|
||||
}
|
||||
if (msg.what == 0x101){
|
||||
if (msg.what == 0x101) {
|
||||
initMessageNotice();
|
||||
}
|
||||
return false;
|
||||
@ -144,7 +144,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* bitmapDescriptor1
|
||||
*/
|
||||
@ -161,7 +160,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private ArrayList<LatLng> latList;
|
||||
private ArrayList<PoiEntity> poiEntityArrayList;
|
||||
private ImageView ivMassNotification;
|
||||
private int messageType=0;
|
||||
private int messageType = 0;
|
||||
|
||||
|
||||
public static TreasureFragment newInstance(Bundle bundle) {
|
||||
@ -185,40 +184,45 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
dismissLoadingDialog();
|
||||
removableHashMap.clear();
|
||||
initThread(); // 刷新筛选的本地数据
|
||||
if (Constant.currentLocation!=null){
|
||||
if (Constant.currentLocation != null) {
|
||||
initList(Constant.currentLocation); // 刷新筛选的网络数据
|
||||
}else {
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "未开启定位服务", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
private void initMessageNotice() {
|
||||
|
||||
private void initMessageNotice() {
|
||||
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.MESSAGE_INFO_PUSH)
|
||||
.params( new HttpParams("type",messageType+""))
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.params(new HttpParams("type", messageType + ""))
|
||||
.cls(MessageNoticeBean.class)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.getRequest(new Callback<GetPhoneBean>() {
|
||||
.getRequest(new Callback<MessageNoticeBean>() {
|
||||
@Override
|
||||
public void onSuccess(GetPhoneBean getPhoneBean, int id) {
|
||||
if (getPhoneBean.getCode() == 200) {
|
||||
String code = getPhoneBean.getBody().getCode();
|
||||
Integer telLength = getPhoneBean.getBody().getTelLength();
|
||||
Constant.CODE = code;
|
||||
Constant.TelLength = telLength;
|
||||
public void onSuccess(MessageNoticeBean messageNoticeBean, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (messageNoticeBean.getCode() == 200) {
|
||||
if (messageType == 0) {
|
||||
ivMassNotification.setVisibility(View.GONE);
|
||||
} else if (messageType == 1) {
|
||||
ivMassNotification.setVisibility(View.VISIBLE);
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(getActivity(), getPhoneBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(getActivity(), messageNoticeBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@ -329,7 +333,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
treasureMap.getLayoutParams().height = widthHeight[1];
|
||||
|
||||
//消息通知:
|
||||
|
||||
handler.sendEmptyMessageDelayed(0x101,10000);
|
||||
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,18 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<!-- android:lines="1"-->
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/cb_filter"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_form"
|
||||
app:layout_constraintLeft_toLeftOf="parent"/>
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="260dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:text="测试彼此"
|
||||
android:textColor="#333"
|
||||
android:textSize="15sp"
|
||||
@ -20,7 +27,7 @@
|
||||
android:id="@+id/tv_form"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/underline"
|
||||
android:padding="5dp"
|
||||
@ -51,7 +58,7 @@
|
||||
android:text="任务id:11315"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_money"
|
||||
|
Loading…
x
Reference in New Issue
Block a user