Commit a7a59a7f by luofan

最新代码提交

parent a32d47e1
Showing with 626 additions and 505 deletions
......@@ -25,7 +25,6 @@
<option value="$PROJECT_DIR$/pickerview" />
<option value="$PROJECT_DIR$/provider" />
<option value="$PROJECT_DIR$/saleCenter" />
<option value="$PROJECT_DIR$/umeng" />
<option value="$PROJECT_DIR$/userCenter" />
<option value="$PROJECT_DIR$/wheelview" />
</set>
......@@ -34,5 +33,6 @@
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
<option name="offlineMode" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="baseSDK/src/main/res/drawable/bg_input_black_react.xml" value="0.265625" />
<entry key="baseSDK/src/main/res/drawable/blue_commom.xml" value="0.265625" />
<entry key="baseSDK/src/main/res/layout/dialog_register.xml" value="0.225" />
<entry key="baseSDK/src/main/res/layout/lrecycle_layout.xml" value="0.25052083333333336" />
<entry key="orderCenter/src/main/res/layout/fragment_commom_recycle.xml" value="0.25052083333333336" />
<entry key="orderCenter/src/main/res/layout/fragment_multi_detail.xml" value="0.24947916666666667" />
<entry key="saleCenter/src/main/res/layout/fragment_product_instruction.xml" value="0.24947916666666667" />
<entry key="saleCenter/src/main/res/layout/fragment_sale_instruction.xml" value="0.375" />
<entry key="saleCenter/src/main/res/layout/item_sale_product.xml" value="0.24947916666666667" />
<entry key="userCenter/src/main/res/drawable/personal_center_selector.xml" value="0.265625" />
<entry key="userCenter/src/main/res/layout/activity_register.xml" value="0.12760416666666666" />
<entry key="userCenter/src/main/res/layout/activity_register_verify.xml" value="0.375" />
<entry key="userCenter/src/main/res/layout/fragment_home_user.xml" value="0.5026232948583421" />
</map>
</option>
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="7">
<list size="14">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
......@@ -13,18 +32,33 @@
<item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
<item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
<item index="7" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
<item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
<item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.Nullable" />
<item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="6">
<list size="14">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
<item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
<item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
<item index="6" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
<item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
<item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
<item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
<item index="10" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" />
<item index="11" class="java.lang.String" itemvalue="io.reactivex.annotations.NonNull" />
<item index="12" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.NonNull" />
<item index="13" class="java.lang.String" itemvalue="lombok.NonNull" />
</list>
</value>
</option>
......
......@@ -18,7 +18,6 @@
<module fileurl="file://$PROJECT_DIR$/.idea/modules/pickerview/dayu-saas-android.pickerview.iml" filepath="$PROJECT_DIR$/.idea/modules/pickerview/dayu-saas-android.pickerview.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/provider/dayu-saas-android.provider.iml" filepath="$PROJECT_DIR$/.idea/modules/provider/dayu-saas-android.provider.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/saleCenter/dayu-saas-android.saleCenter.iml" filepath="$PROJECT_DIR$/.idea/modules/saleCenter/dayu-saas-android.saleCenter.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/umeng/dayu-saas-android.umeng.iml" filepath="$PROJECT_DIR$/.idea/modules/umeng/dayu-saas-android.umeng.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/userCenter/dayu-saas-android.userCenter.iml" filepath="$PROJECT_DIR$/.idea/modules/userCenter/dayu-saas-android.userCenter.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/modules/wheelview/dayu-saas-android.wheelview.iml" filepath="$PROJECT_DIR$/.idea/modules/wheelview/dayu-saas-android.wheelview.iml" />
</modules>
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
......@@ -19,7 +19,7 @@
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />-->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.access_network_state" />
<!-- 读取日志 -->
......
......@@ -70,7 +70,7 @@ public class MyApplication extends BaseApplication {
//初始化greendao
GreenDaoManager.getInstance();
//初始化高德地图
LocationUtils.init(getApplicationContext());
// LocationUtils.init(getApplicationContext());
//初始化环信
// HxManager.getInstance().init(mContext);
if ((boolean) SPUtils.get("privacy",false)){
......@@ -79,7 +79,7 @@ public class MyApplication extends BaseApplication {
//直播
LiveUtils.initLive(this);
// LiveUtils.initLive(this);
}
......
......@@ -49,9 +49,9 @@ public class MainPresenter extends MainContract.Presenter {
mUser = UserManager.getInstance().getUser();
mAccountId = Integer.parseInt(mUser.getAccountId());
mSiteId = mUser.getSiteId();
if (!TextUtils.isEmpty(mUser.getNewAccount())) {
mView.showInvateCodeView();
}
// if (!TextUtils.isEmpty(mUser.getNewAccount())) {
// mView.showInvateCodeView();
// }
request();
}
......
......@@ -5,6 +5,7 @@ import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.location.Address;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Environment;
......@@ -21,6 +22,7 @@ import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.amap.api.location.AMapLocation;
import com.bigfish.salecenter.ui.fragment.HomeSaleFragment;
import com.dayu.base.api.Api;
import com.dayu.base.api.DownloadService;
......@@ -46,6 +48,7 @@ import com.dayu.learncenter.ui.fragment.HomeLearnFragment;
import com.dayu.livemodule.LiveUtils;
import com.dayu.livemodule.event.UserKickOutEvent;
import com.dayu.location.base.LocationUtils;
import com.dayu.location.base.LocationUtils1;
import com.dayu.order.common.TabNumEvent;
import com.dayu.order.ui.activity.OrderDetailsActivity;
import com.dayu.order.ui.activity.ReceivingActivity;
......@@ -622,7 +625,7 @@ public class MainActivity extends BaseActivity<MainPresenter, ActivityMainBindin
@Override
protected void onDestroy() {
LocationUtils.destroy();
// LocationUtils.destroy();
TimeUtils.onDestory();
handler = null;
super.onDestroy();
......
......@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.Service;
import android.content.Intent;
import android.location.Address;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
......@@ -13,6 +14,8 @@ import android.support.annotation.Nullable;
import com.dayu.bigfish.api.ApiFactory;
import com.dayu.common.Constants;
import com.dayu.location.base.LocationUtils;
import com.dayu.location.base.LocationUtils1;
import com.dayu.utils.LogUtils;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -43,7 +46,7 @@ public class LocationService extends Service {
super.onCreate();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
try {
startForeground(1,new Notification());
startForeground(1, new Notification());
} catch (Exception e) {
e.printStackTrace();
}
......@@ -51,29 +54,61 @@ public class LocationService extends Service {
mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
if (mAccountId == 0 || mSiteId == 0 || mHandler == null) {
if (mAccountId == 0 || mSiteId == 0 || mHandler == null) {
return;
}
mHandler.post(() -> LocationUtils.getCurrentLocation(location -> {
if (location != null) {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("accountId", mAccountId);
jsonObject.put("siteId", mSiteId);
jsonObject.put("longitude", location.getLongitude());
jsonObject.put("latitude", location.getLatitude());
jsonObject.put("provinceName", location.getProvince());
jsonObject.put("cityName", location.getCity());
jsonObject.put("districtName", location.getDistrict());
} catch (JSONException e) {
e.printStackTrace();
// mHandler.post(() -> LocationUtils.getCurrentLocation(location -> {
// if (location != null) {
// JSONObject jsonObject = new JSONObject();
// try {
// jsonObject.put("accountId", mAccountId);
// jsonObject.put("siteId", mSiteId);
// jsonObject.put("longitude", location.getLongitude());
// jsonObject.put("latitude", location.getLatitude());
// jsonObject.put("provinceName", location.getProvince());
// jsonObject.put("cityName", location.getCity());
// jsonObject.put("districtName", location.getDistrict());
// LogUtils.d("dayulocaiton: "+location.toString());
// } catch (JSONException e) {
// e.printStackTrace();
// }
// RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
// Disposable disposable = ApiFactory.commiteLocation(requestBody).subscribe(aBoolean -> {
// }, throwable -> {
// });
// }
// }));
mHandler.post(() -> {
LocationUtils1.getInstance(getApplicationContext()).setAddressCallback(new LocationUtils1.AddressCallback() {
@Override
public void onGetAddress(Address location) {
if (location != null) {
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("accountId", mAccountId);
jsonObject.put("siteId", mSiteId);
jsonObject.put("longitude", location.getLongitude());
jsonObject.put("latitude", location.getLatitude());
jsonObject.put("provinceName", location.getAdminArea());
jsonObject.put("cityName", location.getLocality());
jsonObject.put("districtName", location.getSubLocality());
} catch (JSONException e) {
e.printStackTrace();
}
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
Disposable disposable = ApiFactory.commiteLocation(requestBody).subscribe(aBoolean -> {
}, throwable -> {
});
}
}
@Override
public void onGetLocation(double lat, double lng) {
}
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json"), jsonObject.toString());
Disposable disposable = ApiFactory.commiteLocation(requestBody).subscribe(aBoolean -> {
}, throwable -> {
});
}
}));
});
});
super.handleMessage(msg);
}
};
......@@ -84,7 +119,7 @@ public class LocationService extends Service {
sendMessage();
}
};
mTimer.schedule(mTask, 2000, 1000*60*10);
mTimer.schedule(mTask, 2000, 1000 * 10);
}
public void sendMessage() {
......
......@@ -100,7 +100,7 @@ public class AppManager {
ActivityManager activityMgr = (ActivityManager) context
.getSystemService(Context.ACTIVITY_SERVICE);
// activityMgr.
activityMgr.restartPackage(context.getPackageName());
// activityMgr.restartPackage(context.getPackageName());
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
......
......@@ -3,7 +3,7 @@
<stroke
android:width="1dp"
android:color="#333"
android:color="@color/view_color"
/>
<corners android:radius="0.5dp"/>
</shape>
\ No newline at end of file
......@@ -5,8 +5,8 @@ buildscript {
ext.build_tools_version = "27.0.3"
ext.min_sdk_version = 19
ext.target_sdk_version = 26
ext.version_code = 300
ext.verson_name = "3.0.0"
ext.version_code = 301
ext.verson_name = "3.0.1"
ext.gradle_version = '3.1.4'
ext.isReleaseMinify = false
ext.isDebugMinify = false
......@@ -15,13 +15,13 @@ buildscript {
// ext.kotlin_version = '1.2.50'
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
maven { url 'https://dl.bintray.com/umsdk/release' }
google()
}
dependencies {
classpath "com.android.tools.build:gradle:$gradle_version"
......@@ -32,12 +32,13 @@ buildscript {
allprojects {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
maven { url 'https://maven.google.com' }
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
maven { url 'https://dl.bintray.com/umsdk/release' }
google()
}
}
......
......@@ -15,6 +15,6 @@ isLearnModule=true
##maven依赖
mavenMode=false
BASE_URL=http://47.94.101.239:3112
IS_64_BIT=false
IS_64_BIT=true
Android.useDeprecatedNdk=true
\ No newline at end of file
......@@ -42,7 +42,7 @@ dependencies {
// MLVB 需要使用 gson 进行 json 解析
implementation 'com.google.code.gson:gson:2.3.1'
// MLVB 需要依赖腾讯云 IM 服务
api 'com.tencent.imsdk:imsdk:4.5.45'
// api 'com.tencent.imsdk:imsdk:4.5.45'
// 弹幕功能需要依赖此库
implementation 'com.github.ctiao:dfm:0.4.4'
// Demo 依赖的图片加载库
......
......@@ -12,7 +12,7 @@
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />-->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
......@@ -105,14 +105,14 @@
<!-- android:permission="android.permission.BIND_JOB_SERVICE"-->
<!-- android:process=":network" />-->
<receiver android:name="com.tencent.imsdk.session.SessionBroadcastReceiver" >
<intent-filter>
<action android:name="com.tencent.imsdk.session.boot" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
<action android:name="com.tencent.qcloud.qal.TASK_REMOVED" />
</intent-filter>
</receiver>
<!-- <receiver android:name="com.tencent.imsdk.session.SessionBroadcastReceiver" >-->
<!-- <intent-filter>-->
<!-- <action android:name="com.tencent.imsdk.session.boot" />-->
<!-- <action android:name="android.intent.action.BOOT_COMPLETED" />-->
<!-- <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />-->
<!-- <action android:name="com.tencent.qcloud.qal.TASK_REMOVED" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
</application>
</manifest>
......@@ -21,7 +21,7 @@ public class LiveUtils {
TXLiveBase.getInstance().setLicence(context, TCGlobalConfig.LICENCE_URL, TCGlobalConfig.LICENCE_KEY);
// 必须:初始化 MLVB 组件
MLVBLiveRoomImpl.sharedInstance(context);
// MLVBLiveRoomImpl.sharedInstance(context);
// 必须:初始化全局的 用户信息管理类,记录个人信息。
TCUserMgr.getInstance().initContext(context);
......
......@@ -54,7 +54,7 @@ public abstract class MLVBLiveRoom {
* @note 可以调用 {@link MLVBLiveRoom#destroySharedInstance()} 销毁单例对象
*/
public static MLVBLiveRoom sharedInstance(Context context) {
return MLVBLiveRoomImpl.sharedInstance(context);
return null;
}
/**
......@@ -63,7 +63,7 @@ public abstract class MLVBLiveRoom {
* @note 销毁实例后,外部缓存的 MLVBLiveRoom 实例不能再使用,需要重新调用 {@link MLVBLiveRoom#sharedInstance(Context)} 获取新实例
*/
public static void destroySharedInstance() {
MLVBLiveRoomImpl.destroySharedInstance();
// MLVBLiveRoomImpl.destroySharedInstance();
}
/**
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -43,65 +43,65 @@ public class TCVideoListMgr {
* @param listener
*/
public void fetchLiveList(Context context, final Listener listener) {
MLVBLiveRoom liveRoom = MLVBLiveRoom.sharedInstance(context);
liveRoom.getRoomList(0, PAGE_SIZE, new IMLVBLiveRoomListener.GetRoomListCallback() {
@Override
public void onError(int errCode, String errInfo) {
if (listener != null) {
listener.onVideoList(errCode, null, false);
}
}
@Override
public void onSuccess(ArrayList<RoomInfo> data) {
ArrayList<TCVideoInfo> infos = new ArrayList();
if (data != null && data.size() > 0) {
for (RoomInfo value : data) {
List<AnchorInfo> pushers = value.pushers;
String envStr = "";
TCVideoInfo info = new TCVideoInfo();
info.playUrl = value.mixedPlayURL;
info.title = value.roomName;
info.userId = value.roomCreator;
info.groupId = value.roomID;
info.viewerCount = value.audienceCount;
info.livePlay = true;
info.roomInfo = value.roomInfo;
if (pushers != null && !pushers.isEmpty()) {
AnchorInfo pusher = pushers.get(0);
info.nickname = pusher.userName;
info.avatar = pusher.userAvatar;
}
try {
JSONObject jsonRoomInfo = new JSONObject(value.roomInfo);
info.title = jsonRoomInfo.optString("title");
info.frontCover = jsonRoomInfo.optString("frontcover");
info.location = jsonRoomInfo.optString("location");
envStr = jsonRoomInfo.optString(TCGlobalConfig.LIVE_ENVIRONMENT);
} catch (Exception e) {
e.printStackTrace();
if (!TextUtils.isEmpty(value.roomInfo)) {
info.title = value.roomInfo;
}
}
try {
JSONObject jsonCunstomInfo = new JSONObject(value.custom);
info.likeCount = jsonCunstomInfo.optInt("praise");
} catch (Exception e) {
e.printStackTrace();
}
if (envStr.equals(TCGlobalConfig.ENVIRONMENT))
infos.add(info);
}
}
if (listener != null) {
listener.onVideoList(0, infos, true);
}
}
});
// MLVBLiveRoom liveRoom = MLVBLiveRoom.sharedInstance(context);
// liveRoom.getRoomList(0, PAGE_SIZE, new IMLVBLiveRoomListener.GetRoomListCallback() {
// @Override
// public void onError(int errCode, String errInfo) {
// if (listener != null) {
// listener.onVideoList(errCode, null, false);
// }
// }
//
// @Override
// public void onSuccess(ArrayList<RoomInfo> data) {
// ArrayList<TCVideoInfo> infos = new ArrayList();
// if (data != null && data.size() > 0) {
// for (RoomInfo value : data) {
// List<AnchorInfo> pushers = value.pushers;
//
// String envStr = "";
// TCVideoInfo info = new TCVideoInfo();
// info.playUrl = value.mixedPlayURL;
// info.title = value.roomName;
// info.userId = value.roomCreator;
// info.groupId = value.roomID;
// info.viewerCount = value.audienceCount;
// info.livePlay = true;
// info.roomInfo = value.roomInfo;
// if (pushers != null && !pushers.isEmpty()) {
// AnchorInfo pusher = pushers.get(0);
// info.nickname = pusher.userName;
// info.avatar = pusher.userAvatar;
// }
//
// try {
// JSONObject jsonRoomInfo = new JSONObject(value.roomInfo);
// info.title = jsonRoomInfo.optString("title");
// info.frontCover = jsonRoomInfo.optString("frontcover");
// info.location = jsonRoomInfo.optString("location");
// envStr = jsonRoomInfo.optString(TCGlobalConfig.LIVE_ENVIRONMENT);
// } catch (Exception e) {
// e.printStackTrace();
// if (!TextUtils.isEmpty(value.roomInfo)) {
// info.title = value.roomInfo;
// }
// }
//
// try {
// JSONObject jsonCunstomInfo = new JSONObject(value.custom);
// info.likeCount = jsonCunstomInfo.optInt("praise");
// } catch (Exception e) {
// e.printStackTrace();
// }
// if (envStr.equals(TCGlobalConfig.ENVIRONMENT))
// infos.add(info);
// }
// }
// if (listener != null) {
// listener.onVideoList(0, infos, true);
// }
// }
// });
}
/**
......
......@@ -29,6 +29,6 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
api files('libs/Amap_2DMap_V5.2.0_20170627.jar')
api files('libs/AMap_Search_V7.3.0_20200331.jar')
// api files('libs/Amap_2DMap_V5.2.0_20170627.jar')
// api files('libs/AMap_Search_V7.3.0_20200331.jar')
}
package com.dayu.location.base;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.provider.Settings;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class LocationUtils1 {
private volatile static LocationUtils1 uniqueInstance;
private LocationManager locationManager;
private Context mContext;
private static ArrayList<AddressCallback> addressCallbacks;
private AddressCallback addressCallback;
public AddressCallback getAddressCallback() {
return addressCallback;
}
public void setAddressCallback(AddressCallback addressCallback) {
this.addressCallback = addressCallback;
if(isInit){
showLocation();
}else {
isInit = true;
}
}
private static Location location;
private boolean isInit = false;//是否加载过
private LocationUtils1(Context context) {
mContext = context;
getLocation();
}
//采用Double CheckLock(DCL)实现单例
public static LocationUtils1 getInstance(Context context) {
if (uniqueInstance == null) {
synchronized (LocationUtils1.class) {
if (uniqueInstance == null) {
addressCallbacks = new ArrayList<>();
uniqueInstance = new LocationUtils1(context);
}
}
}
return uniqueInstance;
}
/**
* 添加回调事件
* @param addressCallback
*/
private void addAddressCallback(AddressCallback addressCallback){
addressCallbacks.add(addressCallback);
if(isInit){
showLocation();
}
}
/**
* 移除回调事件
* @param addressCallback
*/
public void removeAddressCallback(AddressCallback addressCallback){
if(addressCallbacks.contains(addressCallback)){
addressCallbacks.remove(addressCallback);
}
}
/**
* 清空回调事件
*/
public void cleareAddressCallback(){
removeLocationUpdatesListener();
addressCallbacks.clear();
}
private void getLocation() {
//1.获取位置管理器
locationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
//添加用户权限申请判断
//2.获取位置提供器,GPS或是NetWork
// 获取所有可用的位置提供器
List<String> providerList = locationManager.getProviders(true);
String locationProvider;
if (providerList.contains(LocationManager.GPS_PROVIDER)) {
//GPS 定位的精准度比较高,但是非常耗电。
// System.out.println("=====GPS_PROVIDER=====");
locationProvider = LocationManager.GPS_PROVIDER;
} else if (providerList.contains(LocationManager.NETWORK_PROVIDER)) {//Google服务被墙不可用
//网络定位的精准度稍差,但耗电量比较少。
// System.out.println("=====NETWORK_PROVIDER=====");
locationProvider = LocationManager.NETWORK_PROVIDER;
} else {
// System.out.println("=====NO_PROVIDER=====");
// 当没有可用的位置提供器时,弹出Toast提示用户
Intent intent = new Intent();
intent.setAction(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
return;
}
//3.获取上次的位置,一般第一次运行,此值为null
location = locationManager.getLastKnownLocation(locationProvider);
if (location != null) {
// 显示当前设备的位置信息
// System.out.println("==显示当前设备的位置信息==");
showLocation();
} else {//当GPS信号弱没获取到位置的时候可从网络获取
// System.out.println("==Google服务被墙的解决办法==");
getLngAndLatWithNetwork();//Google服务被墙的解决办法
}
// 监视地理位置变化,第二个和第三个参数分别为更新的最短时间minTime和最短距离minDistace
//LocationManager 每隔 5 秒钟会检测一下位置的变化情况,当移动距离超过 10 米的时候,
// 就会调用 LocationListener 的 onLocationChanged() 方法,并把新的位置信息作为参数传入。
// locationManager.requestLocationUpdates(locationProvider, 5000, 10, locationListener);
}
//获取经纬度
private void showLocation() {
if(location == null){
getLocation();
}else {
double latitude = location.getLatitude();//纬度
double longitude = location.getLongitude();//经度
// for(AddressCallback addressCallback:addressCallbacks){
// addressCallback.onGetLocation(latitude,longitude);
// }
if(addressCallback != null){
addressCallback.onGetLocation(latitude,longitude);
}
getAddress(latitude, longitude);
}
}
private void getAddress(double latitude, double longitude) {
//Geocoder通过经纬度获取具体信息
Geocoder gc = new Geocoder(mContext, Locale.getDefault());
try {
List<Address> locationList = gc.getFromLocation(latitude, longitude, 1);
if (locationList != null) {
Address address = locationList.get(0);
String countryName = address.getCountryName();//国家
String countryCode = address.getCountryCode();
String adminArea = address.getAdminArea();//省
String locality = address.getLocality();//市
String subLocality = address.getSubLocality();//区
String featureName = address.getFeatureName();//街道
for (int i = 0; address.getAddressLine(i) != null; i++) {
String addressLine = address.getAddressLine(i);
//街道名称:广东省深圳市罗湖区蔡屋围一街深圳瑞吉酒店
// System.out.println("addressLine=====" + addressLine);
}
if(addressCallback != null){
addressCallback.onGetAddress(address);
}
// for(AddressCallback addressCallback:addressCallbacks){
// addressCallback.onGetAddress(address);
// }
}
} catch (IOException e) {
e.printStackTrace();
}
}
private void removeLocationUpdatesListener() {
if (locationManager != null) {
uniqueInstance = null;
locationManager.removeUpdates(locationListener);
}
}
private LocationListener locationListener = new LocationListener() {
// Provider的状态在可用、暂时不可用和无服务三个状态直接切换时触发此函数
@Override
public void onStatusChanged(String provider, int status, Bundle arg2) {
}
// Provider被enable时触发此函数,比如GPS被打开
@Override
public void onProviderEnabled(String provider) {
}
// Provider被disable时触发此函数,比如GPS被关闭
@Override
public void onProviderDisabled(String provider) {
}
//当坐标改变时触发此函数,如果Provider传进相同的坐标,它就不会被触发
@Override
public void onLocationChanged(Location loc) {
// System.out.println("==onLocationChanged==");
// location = loc;
// showLocation();
}
};
//从网络获取经纬度
private void getLngAndLatWithNetwork() {
//添加用户权限申请判断
LocationManager locationManager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 5000, 10, locationListener);
location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
showLocation();
}
public interface AddressCallback{
void onGetAddress(Address address);
void onGetLocation(double lat,double lng);
}
}
......@@ -88,6 +88,15 @@ public class OrderDetail implements Serializable {
private String showPrice;
private String needShortVideo;
private String teamName;
private String referenceTime;
public String getReferenceTime() {
return referenceTime;
}
public void setReferenceTime(String referenceTime) {
this.referenceTime = referenceTime;
}
public String getTeamName() {
return teamName;
......
......@@ -7,6 +7,7 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Paint;
import android.location.Address;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
......@@ -30,6 +31,7 @@ import com.dayu.base.ui.adapter.SpacesItemDecoration;
import com.dayu.base.ui.presenter.SImplePresenter;
import com.dayu.common.Constants;
import com.dayu.location.base.LocationUtils;
import com.dayu.location.base.LocationUtils1;
import com.dayu.order.R;
import com.dayu.order.api.OrderService;
import com.dayu.order.api.protocol.Spu;
......@@ -433,24 +435,50 @@ public class SopLocalActivity extends BaseActivity<SImplePresenter, ActivitySopL
}
private void getLocation() {
LocationUtils.getLocation(location -> {
hideDialog();
if (location == null) return;
SopAddress bean = new SopAddress();
bean.setId(currentSop.getId());
bean.setEngineerName(mUserInfo.getAccountName());
bean.setMobile(mUserInfo.getMobile());
bean.setOrderId(orderDetailId);
bean.setLatitude(location.getLatitude());
bean.setLongitude(location.getLongitude());
bean.setProvince(location.getProvince());
bean.setCity(location.getCity());
bean.setDistrict(location.getDistrict());
bean.setAoiName(location.getAoiName());
bean.setPoiName(location.getPoiName());
bean.setAddress(location.getAddress());
waterMark(bean);
LocationUtils1.getInstance(mActivity).setAddressCallback(new LocationUtils1.AddressCallback() {
@Override
public void onGetAddress(Address address) {
hideDialog();
if (address == null) return;
SopAddress bean = new SopAddress();
bean.setId(currentSop.getId());
bean.setEngineerName(mUserInfo.getAccountName());
bean.setMobile(mUserInfo.getMobile());
bean.setOrderId(orderDetailId);
bean.setLatitude(address.getLatitude());
bean.setLongitude(address.getLongitude());
bean.setProvince(address.getAdminArea());
bean.setCity(address.getLocality());
bean.setDistrict(address.getSubLocality());
bean.setAoiName(address.getFeatureName());
bean.setPoiName(address.getFeatureName());
bean.setAddress(address.getAddressLine(0));
waterMark(bean);
}
@Override
public void onGetLocation(double lat, double lng) {
}
});
// LocationUtils.getLocation(location -> {
// hideDialog();
// if (location == null) return;
// SopAddress bean = new SopAddress();
// bean.setId(currentSop.getId());
// bean.setEngineerName(mUserInfo.getAccountName());
// bean.setMobile(mUserInfo.getMobile());
// bean.setOrderId(orderDetailId);
// bean.setLatitude(location.getLatitude());
// bean.setLongitude(location.getLongitude());
// bean.setProvince(location.getProvince());
// bean.setCity(location.getCity());
// bean.setDistrict(location.getDistrict());
// bean.setAoiName(location.getAoiName());
// bean.setPoiName(location.getPoiName());
// bean.setAddress(location.getAddress());
// waterMark(bean);
// });
}
private void toNext() {
......
......@@ -7,6 +7,7 @@ import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.location.Address;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
......@@ -20,6 +21,7 @@ import com.dayu.base.ui.adapter.CoreAdapter;
import com.dayu.common.Constants;
import com.dayu.event.UserInfo;
import com.dayu.location.base.LocationUtils;
import com.dayu.location.base.LocationUtils1;
import com.dayu.order.R;
import com.dayu.order.api.protocol.Order;
import com.dayu.order.api.protocol.Spu;
......@@ -479,16 +481,17 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
}
private void getLocation(FragmentOrderdoingItemBinding h, int posiiton) {
LocationUtils.getLocation(new LocationUtils.MyLocationListener() {
LocationUtils1.getInstance(mContext).setAddressCallback(new LocationUtils1.AddressCallback() {
@Override
public void result(AMapLocation location) {
double latitude = 0;
double longitude = 0;
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
public void onGetAddress(Address address) {
}
@Override
public void onGetLocation(double lat, double lng) {
if (lat != 0) {
startFirstServe(lat, lng);
}
startFirstServe(latitude, longitude);
}
private void startFirstServe(double latitude, double longitude) {
......@@ -496,7 +499,6 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
mPresenter.startServer(mItem.getId(), latitude, longitude)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(mPresenter.baseObserver(integer -> {
LocationUtils.stop();
ProgressUtil.stopLoad();
mItem.setStatus(4);
mItem.setSubStatus(integer);
......@@ -513,6 +515,40 @@ public class OrderAdapter extends CoreAdapter<Order, FragmentOrderdoingItemBindi
}
}
});
// LocationUtils.getLocation(new LocationUtils.MyLocationListener() {
// @Override
// public void result(AMapLocation location) {
// double latitude = 0;
// double longitude = 0;
// if (location != null) {
// latitude = location.getLatitude();
// longitude = location.getLongitude();
// }
// startFirstServe(latitude, longitude);
// }
//
// private void startFirstServe(double latitude, double longitude) {
// if (mItem.getSubStatus() == 1 || mItem.getSubStatus() == 2) {
// mPresenter.startServer(mItem.getId(), latitude, longitude)
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(mPresenter.baseObserver(integer -> {
// LocationUtils.stop();
// ProgressUtil.stopLoad();
// mItem.setStatus(4);
// mItem.setSubStatus(integer);
// processClick(mItem, h, posiiton);
// mBind.tvItemProcess.setText(mContext.getString(R.string.process_order));
// mBind.itemUpdataTime.setText(mContext.getString(R.string.need_again_door));
// }, responeThrowable -> {
// if ("ORDER0006".equals(responeThrowable.subCode)) {
// EventBus.getDefault().post(new RefreshTab(3));
// EventBus.getDefault().post(new RefreshServe(1));
// }
// }));
//// MobclickAgent.onEvent(mContext, "start_server");
// }
// }
// });
}
private void dumpSubcribeTimeActivity(int id, int adapterPosition, int state, String time) {
......
......@@ -634,7 +634,6 @@
android:layout_height="wrap_content"
android:layout_below="@+id/tv_address"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="10dp"
android:text="@string/lookforword_time"
android:textColor="@color/tv_cl"
android:textSize="14sp" />
......@@ -646,11 +645,34 @@
android:layout_below="@+id/tv_address"
android:layout_marginLeft="19dp"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="10dp"
android:layout_toRightOf="@+id/tv_end_time"
android:text='@{!TextUtils.isEmpty(item.appointmentTime)?item.appointmentTime:@string/no_data}'
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
<TextView
android:id="@+id/workTimeTv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_end_time"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="10dp"
android:text="预计工时"
android:textColor="@color/tv_cl"
android:textSize="14sp" />
<TextView
android:id="@+id/workTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_end_time"
android:layout_marginLeft="19dp"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="10dp"
android:layout_toRightOf="@+id/workTimeTv"
android:text='@{!TextUtils.isEmpty(item.referenceTime)?item.referenceTime:@string/no_data}'
android:textColor="@color/cl_home_title_text_color"
android:textSize="14sp" />
</RelativeLayout>
<TextView
......
......@@ -30,6 +30,7 @@ public class RouterPath {
public final static String PATH_WEBVIEW = "/user/webView";
public final static String PATH_REDEPLOY = "/user/redeploy";
public final static String PATH_REGISTER = "/user/register";
public final static String PATH_SERVER_REGISTER = "/user/server_register";
public final static String PATH_BUSINESS_TYPE = "/user/businessType";
/**
* 学习模块.
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.umeng.message.lib"
android:versionCode="1"
android:versionName="1.0">
<!-- <uses-permission android:name="android.permission.INTERNET" />-->
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />-->
<!-- <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />-->
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
<!-- <uses-permission android:name="android.permission.WAKE_LOCK" />-->
<!-- <uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
<!-- <uses-permission android:name="android.permission.BROADCAST_PACKAGE_ADDED" />-->
<!-- <uses-permission android:name="android.permission.BROADCAST_PACKAGE_CHANGED" />-->
<!-- <uses-permission android:name="android.permission.BROADCAST_PACKAGE_INSTALL" />-->
<!-- <uses-permission android:name="android.permission.BROADCAST_PACKAGE_REPLACED" />-->
<!-- <uses-permission android:name="android.permission.RESTART_PACKAGES" />-->
<!-- <uses-permission android:name="android.permission.GET_TASKS" />-->
<!-- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />-->
<!-- <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />-->
<!-- <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />-->
<application>
<!-- <meta-data-->
<!-- android:name="com.vivo.push.api_key"-->
<!-- android:value="6444f965-8da8-40ba-9852-c06c10cb33e6" />-->
<!-- <meta-data-->
<!-- android:name="com.vivo.push.app_id"-->
<!-- android:value="19962" />-->
<!-- <service-->
<!-- android:name="com.taobao.accs.ChannelService"-->
<!-- android:exported="true"-->
<!-- android:process=":channel">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.taobao.accs.intent.action.SERVICE" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="com.taobao.accs.intent.action.ELECTION" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <service-->
<!-- android:name="com.taobao.accs.data.MsgDistributeService"-->
<!-- android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.taobao.accs.intent.action.RECEIVE" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <receiver-->
<!-- android:name="com.taobao.accs.EventReceiver"-->
<!-- android:process=":channel">-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.BOOT_COMPLETED" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.PACKAGE_REMOVED" />-->
<!-- <data android:scheme="package" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.USER_PRESENT" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<!-- <receiver-->
<!-- android:name="com.taobao.accs.ServiceReceiver"-->
<!-- android:process=":channel">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.taobao.accs.intent.action.COMMAND" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="com.taobao.accs.intent.action.START_FROM_AGOO" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<!-- <service-->
<!-- android:name="com.taobao.accs.internal.AccsJobService"-->
<!-- android:permission="android.permission.BIND_JOB_SERVICE"-->
<!-- android:process=":channel"/>-->
<!-- <service-->
<!-- android:name="com.taobao.accs.ChannelService$KernelService"-->
<!-- android:process=":channel" />-->
<!-- <service-->
<!-- android:name="org.android.agoo.accs.AgooService"-->
<!-- android:exported="true">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.taobao.accs.intent.action.RECEIVE" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <service-->
<!-- android:name="com.umeng.message.UmengIntentService"-->
<!-- android:exported="true"-->
<!-- android:process=":channel">-->
<!-- <intent-filter>-->
<!-- <action android:name="org.agoo.android.intent.action.RECEIVE" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <service-->
<!-- android:name="com.umeng.message.XiaomiIntentService"-->
<!-- android:exported="true"-->
<!-- android:process=":channel">-->
<!-- <intent-filter>-->
<!-- <action android:name="org.agoo.android.intent.action.RECEIVE" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <receiver-->
<!-- android:name="com.taobao.agoo.AgooCommondReceiver"-->
<!-- android:exported="true"-->
<!-- android:process=":channel">-->
<!-- <intent-filter>-->
<!-- <action android:name="${applicationId}.intent.action.COMMAND" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="android.intent.action.PACKAGE_REMOVED" />-->
<!-- <data android:scheme="package" />-->
<!-- </intent-filter>-->
<!-- </receiver>-->
<!-- <service-->
<!-- android:name="com.umeng.message.UmengMessageIntentReceiverService"-->
<!-- android:exported="true"-->
<!-- android:process=":channel">-->
<!-- <intent-filter>-->
<!-- <action android:name="org.android.agoo.client.MessageReceiverService" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <receiver-->
<!-- android:name="com.umeng.message.NotificationProxyBroadcastReceiver"-->
<!-- android:exported="false" />-->
<!-- <service-->
<!-- android:name="com.umeng.message.UmengMessageCallbackHandlerService"-->
<!-- android:permission="android.permission.BIND_JOB_SERVICE"-->
<!-- android:exported="false">-->
<!-- <intent-filter>-->
<!-- <action android:name="com.umeng.messge.registercallback.action" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="com.umeng.message.enablecallback.action" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="com.umeng.message.disablecallback.action" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="com.umeng.message.message.handler.action" />-->
<!-- </intent-filter>-->
<!-- <intent-filter>-->
<!-- <action android:name="com.umeng.message.message.sendmessage.action" />-->
<!-- </intent-filter>-->
<!-- </service>-->
<!-- <service-->
<!-- android:name="com.umeng.message.UmengDownloadResourceService"-->
<!-- android:permission="android.permission.BIND_JOB_SERVICE"-->
<!-- android:exported="false" />-->
<!-- <provider-->
<!-- android:name="com.umeng.message.provider.MessageProvider"-->
<!-- android:authorities="${applicationId}.umeng.message"-->
<!-- android:exported="false">-->
<!-- <grant-uri-permission android:pathPattern=".*" />-->
<!-- </provider>-->
</application>
</manifest>
\ No newline at end of file
apply plugin: 'com.android.library'
android {
compileSdkVersion compile_sdk_version
buildToolsVersion build_tools_version
defaultConfig {
minSdkVersion min_sdk_version
targetSdkVersion target_sdk_version
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
android {
lintOptions {
abortOnError false
}
}
}
dependencies {
api fileTree(include: ['*.jar'], dir: 'libs')
//小米Push通道
api 'com.umeng.umsdk:xiaomi-push:3.6.17'
api 'com.umeng.umsdk:xiaomi-umengaccs:1.1.0'
//华为Push通道
api 'com.umeng.umsdk:huawei-basetb:2.6.3.305'
api 'com.umeng.umsdk:huawei-pushtb:2.6.3.305'
api 'com.umeng.umsdk:huawei-umengaccs:1.2.1'
//Oppo Push通道
api 'com.umeng.umsdk:oppo-push:1.0.1'
api 'com.umeng.umsdk:oppo-umengaccs:1.0.3'
//vivo Push通道
api 'com.umeng.umsdk:vivo-push:2.3.1'
api 'com.umeng.umsdk:vivo-umengaccs:1.0.4'
}
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-19
android.library=true
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="64dp">
<ImageView
android:id="@+id/notification_bar_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="#ffffff"
android:layout_height="64dp">
<RelativeLayout
android:id="@+id/upush_notification1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp">
<ImageView
android:id="@+id/notification_large_icon1"
android:layout_width="48dp"
android:layout_height="48dp"
android:scaleType="fitXY" />
<TextView
android:id="@+id/notification_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:layout_toRightOf="@+id/notification_large_icon1"
android:maxLines="1"
android:text="Title"
android:textColor="#000000"
android:textSize="16sp" />
<TextView
android:id="@+id/notification_text"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/notification_title"
android:layout_marginLeft="10dp"
android:layout_marginTop="3dp"
android:layout_toRightOf="@+id/notification_large_icon1"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="false"
android:fadingEdge="horizontal"
android:singleLine="true"
android:text="Message"
android:textColor="#000000" />
<requestFocus />
</RelativeLayout>
<RelativeLayout
android:id="@+id/upush_notification2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
<ImageView
android:id="@+id/notification_large_icon2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
</resources>
......@@ -22,6 +22,7 @@ import com.dayu.usercenter.model.bean.SaleRecordListBean;
import com.dayu.usercenter.model.bean.SelfLicenceBean;
import com.dayu.usercenter.model.bean.ServiceBean;
import com.dayu.usercenter.model.bean.ServiceSaveBean;
import com.dayu.usercenter.model.bean.ServiceSaveBean1;
import com.dayu.usercenter.model.bean.ServiceTypeBean;
import com.dayu.usercenter.model.bean.StarRatioBean;
import com.dayu.usercenter.model.bean.TeamInfo;
......@@ -385,6 +386,17 @@ public interface UserService2 {
Observable<BaseResponse<Boolean>> commitData(@Body ServiceSaveBean saveBean, @Path("accountId") int accountId);
/**
* 提交注册信息.
*/
@POST(Constants.API_7100 + "/engineerRelationCategory/registerInfo/batch/accountId/{accountId}")
Observable<BaseResponse<Boolean>> commitData1(@Body ServiceSaveBean1 saveBean, @Path("accountId") int accountId);
/**
* 提交注册信息.
*/
@POST(Constants.API_7100 + "/engineerRelationCategory/labelAndPrice/batch/accountId/{accountId}")
Observable<BaseResponse<Boolean>> commitServerData(@Body ServiceSaveBean saveBean, @Path("accountId") int accountId);
/**
* 获取服务地址.
*/
@GET(Constants.API_7100 + "/engineerAddress/default/accountId/{accountId}")
......
......@@ -24,6 +24,10 @@ public class ServiceSaveBean {
this.accountUrl = accountUrl;
this.identityUrl = identityUrl;
}
public AccountExt(String realName) {
this.realName = realName;
}
}
public ServiceSaveBean(String lowestPriceDay, int provinceId, String provinceName, int cityId, String cityName, int districtId,
......@@ -51,4 +55,8 @@ public class ServiceSaveBean {
this.address = address;
this.accountExt = accountExt;
}
public ServiceSaveBean(AccountExt accountExt){
this.accountExt = accountExt;
}
}
package com.dayu.usercenter.model.bean;
import java.util.List;
public class ServiceSaveBean1 {
private String lowestPriceDay;
private List<Long> labelIds;
private String cityName;
private String districtName;
private String provinceName;
private String address;
private AccountExt accountExt;
public static class AccountExt {
private String realName;
private String accountUrl;
private String identityUrl;
public AccountExt(String realName, String accountUrl, String identityUrl) {
this.realName = realName;
this.accountUrl = accountUrl;
this.identityUrl = identityUrl;
}
public AccountExt(String realName) {
this.realName = realName;
}
}
public ServiceSaveBean1(String lowestPriceDay, int provinceId, String provinceName, int cityId, String cityName, int districtId,
String districtName, List<Long> labelIds) {
this.lowestPriceDay = lowestPriceDay;
this.labelIds = labelIds;
this.cityName = cityName;
this.districtName = districtName;
this.provinceName = provinceName;
}
public ServiceSaveBean1(String lowestPriceDay, int provinceId, String provinceName, int cityId, String cityName, int districtId,
String districtName, List<Long> labelIds, String address, AccountExt accountExt) {
this.lowestPriceDay = lowestPriceDay;
this.labelIds = labelIds;
this.cityName = cityName;
this.districtName = districtName;
this.provinceName = provinceName;
this.address = address;
this.accountExt = accountExt;
}
public ServiceSaveBean1(AccountExt accountExt){
this.accountExt = accountExt;
}
}
......@@ -148,7 +148,12 @@ public class SmsLoginPresenter extends SmsLoginContract.Presenter {
info.setSiteId(-1);
info.setMobile(phoneNume.get());
UserManager.getInstance().saveUser(info);
ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation();
if ("1".equals(info.getNewAccount())) {
ARouter.getInstance().build(RouterPath.PATH_SERVER_REGISTER).navigation();
}else {
ARouter.getInstance().build(RouterPath.PATH_MAIN).navigation();
}
} else {
ToastUtils.showShortToast(UIUtils.getString(R.string.login_faile_by_role));
}
......
......@@ -277,7 +277,7 @@ public class SmsLoginActivity extends BaseActivity<SmsLoginPresenter, ActivitySm
SPUtils.put("privacy", true);
dialog.dismiss();
//初始化高德地图
LocationUtils.init(getApplicationContext());
// LocationUtils.init(getApplicationContext());
initUM();
} else {
System.exit(0);
......
......@@ -90,16 +90,11 @@ public class BusinessTypeActivity extends BaseActivity<SImplePresenter, Activity
private void showDaySelect(String select) {
list = new ArrayMap<>();
list.put("200元/天", "200");
list.put("300元/天", "300");
list.put("350元/天", "350");
list.put("400元/天", "400");
list.put("450元/天", "450");
list.put("500元/天", "500");
list.put("600元/天", "600");
list.put("700元/天", "700");
list.put("800元/天", "800");
list.put("900元/天", "900");
list.put("1000元/天", "1000");
ArrayList<String> arrayList = new ArrayList<>();
arrayList.addAll(list.keySet());
ArrayList<String> values = new ArrayList<>();
......
......@@ -120,6 +120,10 @@
<activity
android:name=".ui.activity2.RegisterActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity2.ServerRegisterActivity"
android:screenOrientation="portrait" />
</application>
</manifest>
......@@ -393,6 +393,7 @@
android:gravity="center_vertical"
android:paddingStart="2dp"
android:paddingTop="1dp"
android:paddingEnd="10dp"
android:text="请选择省"
android:textColor="@color/default_text_color"
android:textSize="15dp" />
......@@ -408,6 +409,7 @@
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:paddingStart="2dp"
android:paddingEnd="10dp"
android:text="@string/setlect_ciy_hint"
android:textColor="@color/default_text_color"
android:textSize="15dp" />
......@@ -423,6 +425,7 @@
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:paddingStart="2dp"
android:paddingEnd="10dp"
android:text="请选择区"
android:textColor="@color/default_text_color"
android:textSize="15dp" />
......@@ -468,8 +471,8 @@
<LinearLayout
style="@style/ll_user_bottom"
android:visibility="gone"
android:layout_marginTop="10dp">
android:layout_marginTop="10dp"
android:visibility="gone">
<LinearLayout
style="@style/ll_user_bottom2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment