添加消息通知接口
This commit is contained in:
parent
7dd98af97d
commit
ddfea1b990
app/src/main
java/com/navinfo/outdoor
res
@ -0,0 +1,145 @@
|
||||
package com.navinfo.outdoor.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MessageNoticeBean {
|
||||
|
||||
private Integer code;
|
||||
private String message;
|
||||
private List<BodyBean> body;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(Integer code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public List<BodyBean> getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(List<BodyBean> body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public static class BodyBean {
|
||||
private Integer id;
|
||||
private String title;
|
||||
private String subtitle;
|
||||
private Object context;
|
||||
private String iconurl;
|
||||
private Integer createpid;
|
||||
private String createtime;
|
||||
private Integer fid;
|
||||
private Integer updatepid;
|
||||
private String updatetime;
|
||||
private Object status;
|
||||
private Object appoint;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public void setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
}
|
||||
|
||||
public Object getContext() {
|
||||
return context;
|
||||
}
|
||||
|
||||
public void setContext(Object context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public String getIconurl() {
|
||||
return iconurl;
|
||||
}
|
||||
|
||||
public void setIconurl(String iconurl) {
|
||||
this.iconurl = iconurl;
|
||||
}
|
||||
|
||||
public Integer getCreatepid() {
|
||||
return createpid;
|
||||
}
|
||||
|
||||
public void setCreatepid(Integer createpid) {
|
||||
this.createpid = createpid;
|
||||
}
|
||||
|
||||
public String getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(String createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public Integer getFid() {
|
||||
return fid;
|
||||
}
|
||||
|
||||
public void setFid(Integer fid) {
|
||||
this.fid = fid;
|
||||
}
|
||||
|
||||
public Integer getUpdatepid() {
|
||||
return updatepid;
|
||||
}
|
||||
|
||||
public void setUpdatepid(Integer updatepid) {
|
||||
this.updatepid = updatepid;
|
||||
}
|
||||
|
||||
public String getUpdatetime() {
|
||||
return updatetime;
|
||||
}
|
||||
|
||||
public void setUpdatetime(String updatetime) {
|
||||
this.updatetime = updatetime;
|
||||
}
|
||||
|
||||
public Object getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Object status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Object getAppoint() {
|
||||
return appoint;
|
||||
}
|
||||
|
||||
public void setAppoint(Object appoint) {
|
||||
this.appoint = appoint;
|
||||
}
|
||||
}
|
||||
}
|
@ -55,6 +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.UserBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
@ -104,7 +105,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* 寻宝的Fragment
|
||||
@ -136,9 +136,15 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (msg.what == 0x100) {
|
||||
isBack = false;
|
||||
}
|
||||
if (msg.what == 0x101){
|
||||
initMessageNotice();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* bitmapDescriptor1
|
||||
*/
|
||||
@ -154,6 +160,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private HashMap<String, List<Marker>> removableHashMap;
|
||||
private ArrayList<LatLng> latList;
|
||||
private ArrayList<PoiEntity> poiEntityArrayList;
|
||||
private ImageView ivMassNotification;
|
||||
private int messageType=0;
|
||||
|
||||
|
||||
public static TreasureFragment newInstance(Bundle bundle) {
|
||||
@ -184,7 +192,33 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
|
||||
}
|
||||
private void initMessageNotice() {
|
||||
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.MESSAGE_INFO_PUSH)
|
||||
.params( new HttpParams("type",messageType+""))
|
||||
.cls(TaskPrefectureBean.class)
|
||||
.token(Constant.ACCESS_TOKEN)
|
||||
.getRequest(new Callback<GetPhoneBean>() {
|
||||
@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;
|
||||
} else {
|
||||
Toast.makeText(getActivity(), getPhoneBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
@Override
|
||||
protected void initView() {
|
||||
super.initView();
|
||||
@ -206,6 +240,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
ivMessage.setOnClickListener(this);
|
||||
treasureMap = (MapView) findViewById(R.id.treasure_map);
|
||||
tencentMap = treasureMap.getMap();
|
||||
ivMassNotification = findViewById(R.id.iv_mas_notification);//定时消息小红点
|
||||
MapManager.getInstance().init(getActivity(), tencentMap);
|
||||
// if (getClass().getCanonicalName().equals("PioFragment")){
|
||||
// ivMessage.setVisibility(View.VISIBLE);
|
||||
@ -297,19 +332,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
|
||||
|
||||
}
|
||||
public class TimerTest {
|
||||
class MyTimerTask extends TimerTask {
|
||||
public void run() {
|
||||
|
||||
System.out.println("我爱你中国");
|
||||
}
|
||||
}
|
||||
public void main(String[] args) {
|
||||
Timer timer = new Timer();
|
||||
timer.schedule(new MyTimerTask(), 0, 5000);
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 得到电话区号,电话位数
|
||||
*/
|
||||
|
@ -135,6 +135,8 @@ public class HttpInterface {
|
||||
public static String UNRECEIVED_POLYGON_TASK;//所有類型结束领取
|
||||
public static String COMPLETE;//面状任务结束领取
|
||||
public static String SUBMIT_POLYGON_TASK;//面状任务开始采集
|
||||
//http://dtxbmaps.navinfo.com/dtxb_test/m4/msgList/InfoPush/28/push?type=0
|
||||
public static String MESSAGE_INFO_PUSH;//消息通知
|
||||
|
||||
public static void initHttpInter(String USERID) {
|
||||
/**
|
||||
@ -168,7 +170,7 @@ public class HttpInterface {
|
||||
EXAM_CONTENT = TEST_IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/exam_content";//发现 -能力测评获取试题接口
|
||||
//http://172.23.139.4:8002/findAndMessage/1/submitExam
|
||||
EXAM_SUBMIT = TEST_IP + MSG_LIST_PATH + "findAndMessage/" + USERID + "/submitExam";//发现 -能力测评提交试卷 post
|
||||
|
||||
MESSAGE_INFO_PUSH = TEST_IP+MSG_LIST_PATH+"InfoPush/"+USERID+"/push";//寻宝-消息通知
|
||||
/**
|
||||
* 提现 金额
|
||||
* Path=/m4/price/**
|
||||
|
5
app/src/main/res/drawable/ic_red_point.xml
Normal file
5
app/src/main/res/drawable/ic_red_point.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="50dp" />
|
||||
<solid android:color="#D0021B" />
|
||||
</shape>
|
@ -37,8 +37,10 @@
|
||||
</LinearLayout>
|
||||
<CheckBox
|
||||
android:id="@+id/cb_unSubmit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"/>
|
||||
|
@ -11,18 +11,19 @@
|
||||
sothree:umanoOverlay="false"
|
||||
sothree:umanoPanelHeight="0dp"
|
||||
sothree:umanoShadowHeight="0dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.tencent.tencentmap.mapsdk.maps.MapView
|
||||
android:id="@+id/treasure_map"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
android:focusable="false"
|
||||
android:focusableInTouchMode="false"
|
||||
android:gravity="center"
|
||||
android:focusable="false">
|
||||
</com.tencent.tencentmap.mapsdk.maps.MapView>
|
||||
android:gravity="center"></com.tencent.tencentmap.mapsdk.maps.MapView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
@ -34,13 +35,21 @@
|
||||
android:id="@+id/iv_message"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:background="@drawable/iv_message"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
</ImageView>
|
||||
app:layout_constraintTop_toTopOf="parent"></ImageView>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_mas_notification"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:src="@drawable/ic_red_point"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_message"
|
||||
app:layout_constraintRight_toRightOf="@+id/iv_message"
|
||||
/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_layout"
|
||||
@ -50,8 +59,7 @@
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cb_map_type"
|
||||
@ -63,8 +71,7 @@
|
||||
android:checked="false"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv_submit"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_zoom_add"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_zoom_add" />
|
||||
|
||||
|
||||
<ImageView
|
||||
@ -74,8 +81,7 @@
|
||||
android:src="@mipmap/submit"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_refrish"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cb_map_type"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_zoom_del"
|
||||
/>
|
||||
app:layout_constraintTop_toTopOf="@id/iv_zoom_del" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_filter"
|
||||
@ -84,8 +90,7 @@
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/filter"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cb_map_type"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_submit"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_submit" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_zoom_add"
|
||||
@ -94,10 +99,9 @@
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/zoom_add"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_zoom_del"
|
||||
@ -106,8 +110,7 @@
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/zoom_del"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_add"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_add" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_refrish"
|
||||
@ -116,8 +119,7 @@
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/refresh"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_zoom_del"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_zoom_del" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_location"
|
||||
@ -126,8 +128,7 @@
|
||||
android:layout_marginTop="15dp"
|
||||
android:src="@mipmap/mine_location"
|
||||
app:layout_constraintLeft_toLeftOf="@id/iv_refrish"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_refrish"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_refrish" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</FrameLayout>
|
||||
|
||||
@ -139,20 +140,21 @@
|
||||
android:focusable="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!-- <ScrollView
|
||||
<!-- <ScrollView
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"> </ScrollView>-->
|
||||
<LinearLayout
|
||||
android:id="@+id/scroll_parent_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<FrameLayout
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"></FrameLayout>
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"> </ScrollView>-->
|
||||
<LinearLayout
|
||||
android:id="@+id/scroll_parent_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"></FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
Loading…
x
Reference in New Issue
Block a user