添加权限说明,推送冲突注释
This commit is contained in:
parent
5fdaa0b213
commit
9dc92a1bc7
@ -63,8 +63,8 @@ public class App extends Application {
|
|||||||
}
|
}
|
||||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||||
// 路由初始化
|
// 路由初始化
|
||||||
JVerificationInterface.setDebugMode(true);
|
// JVerificationInterface.setDebugMode(true);
|
||||||
JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
// JVerificationInterface.init(this, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||||
//友盟
|
//友盟
|
||||||
//设置非debug版本开启
|
//设置非debug版本开启
|
||||||
if (!isDebugVersion(con)) {
|
if (!isDebugVersion(con)) {
|
||||||
|
@ -5,17 +5,20 @@ import com.arpa.hndahesudintocctmsdriver.R
|
|||||||
import com.lxj.xpopup.core.PositionPopupView
|
import com.lxj.xpopup.core.PositionPopupView
|
||||||
import com.lxj.xpopup.enums.DragOrientation
|
import com.lxj.xpopup.enums.DragOrientation
|
||||||
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvMessage
|
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvMessage
|
||||||
|
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvTitle
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description: 自定义自由定位Position弹窗
|
* Description: 自定义自由定位Position弹窗
|
||||||
* Create by dance, at 2019/6/14
|
* Create by dance, at 2019/6/14
|
||||||
*/
|
*/
|
||||||
class TopMsgPopup(context: Context, message: String) : PositionPopupView(context) {
|
class TopMsgPopup(context: Context,title:String, message: String) : PositionPopupView(context) {
|
||||||
|
|
||||||
private var message: String
|
private var message: String
|
||||||
|
private var title: String
|
||||||
|
|
||||||
init {
|
init {
|
||||||
this.message = message
|
this.message = message
|
||||||
|
this.title = title
|
||||||
}
|
}
|
||||||
override fun getImplLayoutId(): Int {
|
override fun getImplLayoutId(): Int {
|
||||||
return R.layout.popup_qq_msg
|
return R.layout.popup_qq_msg
|
||||||
@ -28,5 +31,6 @@ class TopMsgPopup(context: Context, message: String) : PositionPopupView(context
|
|||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
tvMessage.text = message
|
tvMessage.text = message
|
||||||
|
tvTitle.text = title
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,14 +62,14 @@ public class MakeUpService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
palyMp3();
|
// palyMp3();
|
||||||
}
|
}
|
||||||
|
|
||||||
//开始
|
//开始
|
||||||
@Override
|
@Override
|
||||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||||
Log.e("服务开启","-----");
|
Log.e("服务开启","-----");
|
||||||
|
palyMp3();
|
||||||
return START_STICKY;
|
return START_STICKY;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ public class UiAuxiliary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void delLogin(Context con){
|
public static void delLogin(Context con){
|
||||||
JPushInterface.deleteAlias(con,0);
|
// JPushInterface.deleteAlias(con,0);
|
||||||
SPUtils.remove(con,"curWaybillId");
|
SPUtils.remove(con,"curWaybillId");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_TOKEN,"");
|
||||||
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,"");
|
||||||
|
@ -566,7 +566,7 @@ public class HomeFragment extends BaseFragment {
|
|||||||
v1.setOnClickListener(v2 -> {
|
v1.setOnClickListener(v2 -> {
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case 0:
|
case 0:
|
||||||
PermissionUtils.Companion.getInstance().showPermissionMessage(getActivity(), "用于向您推荐可能感兴趣的住宿、饮食、加油站、汽车维修等",
|
PermissionUtils.Companion.getInstance().showPermissionMessage(getActivity(),"位置权限使用说明", "用于向您推荐可能感兴趣的住宿、饮食、加油站、汽车维修等",
|
||||||
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
|
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
|
||||||
(allGranted, grantedList, deniedList) -> {
|
(allGranted, grantedList, deniedList) -> {
|
||||||
if (allGranted) {
|
if (allGranted) {
|
||||||
@ -1114,35 +1114,35 @@ public class HomeFragment extends BaseFragment {
|
|||||||
public void initAlct() {
|
public void initAlct() {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
// if (!OneDayShowUtils.getInstance().todayIsShowQx(con)){
|
// if (!OneDayShowUtils.getInstance().todayIsShowQx(con)){
|
||||||
boolean b = EasyPermissions.hasPermissions(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
// boolean b = EasyPermissions.hasPermissions(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
// Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
// Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
Manifest.permission.ACCESS_COARSE_LOCATION);
|
// Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||||
if (b) {
|
// if (b) {
|
||||||
ALProcess.verification(con);
|
// ALProcess.verification(con);
|
||||||
}
|
// }
|
||||||
// PermissionX.init(getActivity())
|
PermissionX.init(getActivity())
|
||||||
// .permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
.permissions(Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||||
// Manifest.permission.READ_EXTERNAL_STORAGE,
|
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||||
// Manifest.permission.ACCESS_FINE_LOCATION,
|
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||||
// Manifest.permission.ACCESS_COARSE_LOCATION)
|
Manifest.permission.ACCESS_COARSE_LOCATION)
|
||||||
// .request((allGranted, grantedList, deniedList) -> {
|
.request((allGranted, grantedList, deniedList) -> {
|
||||||
// if (allGranted) {
|
if (allGranted) {
|
||||||
// ALProcess.verification(con);
|
ALProcess.verification(con);
|
||||||
// } else {
|
} else {
|
||||||
// boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
boolean accessCoarseLocation = deniedList.contains("android.permission.ACCESS_FINE_LOCATION");
|
||||||
// boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
boolean contains = deniedList.contains("android.permission.WRITE_EXTERNAL_STORAGE");
|
||||||
// if (accessCoarseLocation | contains) {
|
if (accessCoarseLocation | contains) {
|
||||||
// new MessageUtils().showSimCenPop(con, "缺少定位权限或媒体和文件权限,会导致无法结算运费,去开启!", "取消", "确认", () -> {
|
new MessageUtils().showSimCenPop(con, "缺少定位权限或媒体和文件权限,会导致无法结算运费,去开启!", "取消", "确认", () -> {
|
||||||
// Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
// Uri uri = Uri.fromParts("package", getPackageName(), null);
|
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||||
// intent.setData(uri);
|
intent.setData(uri);
|
||||||
// startActivity(intent);
|
startActivity(intent);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
// });
|
});
|
||||||
// }
|
// }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -103,7 +103,7 @@ public class LoginActivity extends BaseActivity {
|
|||||||
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname());
|
||||||
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname());
|
||||||
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + "");
|
||||||
JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
// JPushInterface.setAlias(con, 0, loginBean.getData().getUname());
|
||||||
appInfoBean.setStatus("0");
|
appInfoBean.setStatus("0");
|
||||||
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
appInfoBean.setUserPhone(String.valueOf(input_phone.getText()));
|
||||||
ur.postAppInfo(appInfoBean,"post");
|
ur.postAppInfo(appInfoBean,"post");
|
||||||
|
@ -343,8 +343,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
|||||||
}
|
}
|
||||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||||
// 路由初始化
|
// 路由初始化
|
||||||
JVerificationInterface.setDebugMode(true);
|
// JVerificationInterface.setDebugMode(true);
|
||||||
JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
// JVerificationInterface.init(con, 5000, (code, msg) -> Log.d("tag", "code = " + code + " msg = " + msg));
|
||||||
//友盟
|
//友盟
|
||||||
//设置非debug版本开启
|
//设置非debug版本开启
|
||||||
if (!isDebugVersion(con)) {
|
if (!isDebugVersion(con)) {
|
||||||
|
@ -39,7 +39,7 @@ class PermissionUtils {
|
|||||||
* @param callback RequestCallback
|
* @param callback RequestCallback
|
||||||
* @return BasePopupView?
|
* @return BasePopupView?
|
||||||
*/
|
*/
|
||||||
fun showPermissionMessage(activity: FragmentActivity, message: String,vararg permission:String,callback: MyRequestCallback){
|
fun showPermissionMessage(activity: FragmentActivity,title:String, message: String,vararg permission:String,callback: MyRequestCallback){
|
||||||
val show = XPopup.Builder(activity)
|
val show = XPopup.Builder(activity)
|
||||||
.hasShadowBg(false)
|
.hasShadowBg(false)
|
||||||
.hasBlurBg(false)
|
.hasBlurBg(false)
|
||||||
@ -49,6 +49,7 @@ class PermissionUtils {
|
|||||||
.asCustom(
|
.asCustom(
|
||||||
TopMsgPopup(
|
TopMsgPopup(
|
||||||
activity,
|
activity,
|
||||||
|
title,
|
||||||
message
|
message
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
<corners android:radius="100dp"/>
|
<corners android:radius="@dimen/dp_10"/>
|
||||||
<solid android:color="#fff"/>
|
<solid android:color="#fff"/>
|
||||||
</shape>
|
</shape>
|
@ -4,14 +4,23 @@
|
|||||||
android:background="@drawable/bg_round2"
|
android:background="@drawable/bg_round2"
|
||||||
android:layout_marginLeft="@dimen/dp_16"
|
android:layout_marginLeft="@dimen/dp_16"
|
||||||
android:layout_marginRight="@dimen/dp_16"
|
android:layout_marginRight="@dimen/dp_16"
|
||||||
|
android:padding="20dp"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvMessage"
|
android:id="@+id/tvTitle"
|
||||||
android:padding="20dp"
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="提示"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="16sp"
|
android:textSize="@dimen/sp_16"
|
||||||
android:text="我是QQ的消息弹窗,嘿嘿!!!"
|
android:textStyle="bold"
|
||||||
android:gravity="center"
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvMessage"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_14"
|
||||||
|
android:text=""
|
||||||
|
android:layout_marginTop="@dimen/dp_4"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user