fix: 定时推送(未完成)
This commit is contained in:
parent
94526a9054
commit
fd1be59439
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
// ndkVersion '23.0.7123448'
|
ndkVersion '23.0.7123448'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
|
@ -55,7 +55,7 @@ import com.navinfo.outdoor.base.BaseDrawerFragment;
|
|||||||
import com.navinfo.outdoor.base.BaseFragment;
|
import com.navinfo.outdoor.base.BaseFragment;
|
||||||
import com.navinfo.outdoor.bean.GetPhoneBean;
|
import com.navinfo.outdoor.bean.GetPhoneBean;
|
||||||
import com.navinfo.outdoor.bean.JobSearchBean;
|
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.bean.UserBean;
|
||||||
import com.navinfo.outdoor.http.Callback;
|
import com.navinfo.outdoor.http.Callback;
|
||||||
import com.navinfo.outdoor.http.HttpInterface;
|
import com.navinfo.outdoor.http.HttpInterface;
|
||||||
@ -144,7 +144,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bitmapDescriptor1
|
* bitmapDescriptor1
|
||||||
*/
|
*/
|
||||||
@ -192,33 +191,38 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initMessageNotice() {
|
private void initMessageNotice() {
|
||||||
|
|
||||||
OkGoBuilder.getInstance()
|
OkGoBuilder.getInstance()
|
||||||
.Builder(getActivity())
|
.Builder(getActivity())
|
||||||
.url(HttpInterface.MESSAGE_INFO_PUSH)
|
.url(HttpInterface.MESSAGE_INFO_PUSH)
|
||||||
.params(new HttpParams("type", messageType + ""))
|
.params(new HttpParams("type", messageType + ""))
|
||||||
.cls(TaskPrefectureBean.class)
|
.cls(MessageNoticeBean.class)
|
||||||
.token(Constant.ACCESS_TOKEN)
|
.token(Constant.ACCESS_TOKEN)
|
||||||
.getRequest(new Callback<GetPhoneBean>() {
|
.getRequest(new Callback<MessageNoticeBean>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(GetPhoneBean getPhoneBean, int id) {
|
public void onSuccess(MessageNoticeBean messageNoticeBean, int id) {
|
||||||
if (getPhoneBean.getCode() == 200) {
|
dismissLoadingDialog();
|
||||||
String code = getPhoneBean.getBody().getCode();
|
if (messageNoticeBean.getCode() == 200) {
|
||||||
Integer telLength = getPhoneBean.getBody().getTelLength();
|
if (messageType == 0) {
|
||||||
Constant.CODE = code;
|
ivMassNotification.setVisibility(View.GONE);
|
||||||
Constant.TelLength = telLength;
|
} else if (messageType == 1) {
|
||||||
|
ivMassNotification.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), getPhoneBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), messageNoticeBean.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e, int id) {
|
public void onError(Throwable e, int id) {
|
||||||
|
dismissLoadingDialog();
|
||||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
super.initView();
|
super.initView();
|
||||||
@ -329,7 +333,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
|||||||
treasureMap.getLayoutParams().height = widthHeight[1];
|
treasureMap.getLayoutParams().height = widthHeight[1];
|
||||||
|
|
||||||
//消息通知:
|
//消息通知:
|
||||||
|
handler.sendEmptyMessageDelayed(0x101,10000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,11 +5,18 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<!-- android:lines="1"-->
|
<!-- 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
|
<TextView
|
||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="260dp"
|
android:layout_width="260dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="20dp"
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginLeft="35dp"
|
||||||
android:text="测试彼此"
|
android:text="测试彼此"
|
||||||
android:textColor="#333"
|
android:textColor="#333"
|
||||||
android:textSize="15sp"
|
android:textSize="15sp"
|
||||||
@ -20,7 +27,7 @@
|
|||||||
android:id="@+id/tv_form"
|
android:id="@+id/tv_form"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="20dp"
|
android:layout_marginLeft="35dp"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
android:background="@drawable/underline"
|
android:background="@drawable/underline"
|
||||||
android:padding="5dp"
|
android:padding="5dp"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user