增加导航提示窗口
This commit is contained in:
@@ -36,7 +36,7 @@ android {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
implementation rootProject.ext.dependencies.androidxcardview
|
||||||
implementation rootProject.ext.dependencies.androidxappcompat
|
implementation rootProject.ext.dependencies.androidxappcompat
|
||||||
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
implementation rootProject.ext.dependencies.androidxconstraintlayout
|
||||||
implementation rootProject.ext.dependencies.arouter
|
implementation rootProject.ext.dependencies.arouter
|
||||||
|
|||||||
@@ -0,0 +1,73 @@
|
|||||||
|
package com.mogo.module.extensions.dialog;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import com.alibaba.android.arouter.launcher.ARouter;
|
||||||
|
import com.mogo.module.extensions.R;
|
||||||
|
import com.mogo.service.MogoServicePaths;
|
||||||
|
import com.mogo.service.map.IMogoMapService;
|
||||||
|
import com.mogo.utils.logger.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lixiaopeng
|
||||||
|
* @description 通用分享dialog
|
||||||
|
* @since 2020-01-10
|
||||||
|
*/
|
||||||
|
public class NaviNoticeDialog extends Dialog implements View.OnClickListener {
|
||||||
|
private TextView txtOk;
|
||||||
|
private Context mContext;
|
||||||
|
private View tvCancel;
|
||||||
|
private IMogoMapService mMogoMapService;
|
||||||
|
|
||||||
|
public NaviNoticeDialog(@NonNull Context context) {
|
||||||
|
super(context);
|
||||||
|
this.mContext = context;
|
||||||
|
mMogoMapService = (IMogoMapService) ARouter.getInstance()
|
||||||
|
.build(MogoServicePaths.PATH_SERVICES_MAP)
|
||||||
|
.navigation(getContext());
|
||||||
|
getWindow().setBackgroundDrawableResource(android.R.color.transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NaviNoticeDialog(@NonNull Context context, int themeResId) {
|
||||||
|
super(context, R.style.Theme_AppCompat_Dialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
initView();
|
||||||
|
initListener();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initView() {
|
||||||
|
setContentView(R.layout.dialog_navi_notice);
|
||||||
|
txtOk = findViewById(R.id.tv_dialog_ok);
|
||||||
|
tvCancel = findViewById(R.id.tv_dialog_cancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initListener() {
|
||||||
|
txtOk.setOnClickListener(this);
|
||||||
|
tvCancel.setOnClickListener(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
int id = view.getId();
|
||||||
|
if (id == R.id.tv_dialog_ok) {
|
||||||
|
mMogoMapService.getNavi(getContext()).stopNavi();
|
||||||
|
} else if (id == R.id.tv_dialog_cancel) {
|
||||||
|
|
||||||
|
}
|
||||||
|
dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,6 +27,7 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
|||||||
import com.mogo.module.common.MogoModulePaths;
|
import com.mogo.module.common.MogoModulePaths;
|
||||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||||
import com.mogo.module.extensions.R;
|
import com.mogo.module.extensions.R;
|
||||||
|
import com.mogo.module.extensions.dialog.NaviNoticeDialog;
|
||||||
import com.mogo.module.extensions.navi.NaviInfoView;
|
import com.mogo.module.extensions.navi.NaviInfoView;
|
||||||
import com.mogo.module.share.ShareControl;
|
import com.mogo.module.share.ShareControl;
|
||||||
import com.mogo.module.share.dialog.LaucherShareDialog;
|
import com.mogo.module.share.dialog.LaucherShareDialog;
|
||||||
@@ -132,7 +133,8 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
|||||||
mExitNavi.setOnClickListener( view -> {
|
mExitNavi.setOnClickListener( view -> {
|
||||||
if ( mMogoNavi != null ) {
|
if ( mMogoNavi != null ) {
|
||||||
if ( mIsLock ) {
|
if ( mIsLock ) {
|
||||||
mMogoNavi.stopNavi();
|
NaviNoticeDialog naviNoticeDialog = new NaviNoticeDialog(getContext());
|
||||||
|
naviNoticeDialog.show();
|
||||||
} else {
|
} else {
|
||||||
mMApUIController.recoverLockMode();
|
mMApUIController.recoverLockMode();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="#3E7FFC"
|
||||||
|
android:startColor="#5CC1FF" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||||
|
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:endColor="#50526E"
|
||||||
|
android:startColor="#333F4057" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="@dimen/dp_790"
|
||||||
|
android:layout_height="@dimen/dp_440"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:cardBackgroundColor="#3F4057"
|
||||||
|
app:cardCornerRadius="@dimen/dp_20"
|
||||||
|
>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/dp_56"
|
||||||
|
android:layout_marginTop="@dimen/dp_134"
|
||||||
|
android:text="是否退出导航?"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_40"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_dialog_ok"
|
||||||
|
android:layout_width="@dimen/dp_395"
|
||||||
|
android:layout_height="@dimen/dp_128"
|
||||||
|
android:background="@drawable/shape_react_blue_grident"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="确认"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/dp_40"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_dialog_cancel"
|
||||||
|
android:layout_width="@dimen/dp_395"
|
||||||
|
android:layout_height="@dimen/dp_128"
|
||||||
|
android:background="@drawable/shape_react_gray_grident"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="取消"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/dp_40"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
Reference in New Issue
Block a user