UI-382
This commit is contained in:
@@ -34,9 +34,17 @@ object NaviManager {
|
||||
val key_type = intent.getIntExtra("KEY_TYPE", 0)
|
||||
Logger.d("NaviManager","key_type"+key_type,null)
|
||||
if (key_type == 10038||key_type == 10007) {
|
||||
val lat = intent.getDoubleExtra("LAT", 0.0)
|
||||
val lon = intent.getDoubleExtra("LON", 0.0)
|
||||
val lat: Double
|
||||
val lon: Double
|
||||
|
||||
if (key_type==10007){
|
||||
lat = intent.getDoubleExtra("ENTRY_LAT", 0.0)
|
||||
lon = intent.getDoubleExtra("ENTRY_LON", 0.0)
|
||||
}else{
|
||||
lat = intent.getDoubleExtra("LAT", 0.0)
|
||||
lon = intent.getDoubleExtra("LON", 0.0)
|
||||
|
||||
}
|
||||
showHome()
|
||||
|
||||
var newInstance =
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.mogo.module.navi.constants.AMapConstants
|
||||
import com.mogo.module.navi.constants.SearchServiceHolder
|
||||
import com.mogo.module.navi.ui.adapter.CalculatePathAdapter
|
||||
import com.mogo.module.navi.ui.base.BaseFragment
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.group_path
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.pb_path
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.rv_search_result
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.tv_navi_navi
|
||||
@@ -55,7 +56,7 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
startNavi()
|
||||
}
|
||||
|
||||
"cancel"->{
|
||||
"cancel" -> {
|
||||
SearchServiceHolder.fragmentManager
|
||||
.clearAll()
|
||||
}
|
||||
@@ -105,11 +106,17 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
mAdapter.setDatas(calculatedStrategies)
|
||||
mAdapter.selectTag = calculatedStrategies[0].tagId
|
||||
}
|
||||
pb_path.visibility=View.GONE
|
||||
pb_path.visibility = View.GONE
|
||||
group_path.visibility = View.GONE
|
||||
tv_navi_navi.text = getString(R.string.navi_to_there)
|
||||
|
||||
}
|
||||
|
||||
override fun onoCalculateFailed() {
|
||||
group_path.visibility = View.VISIBLE
|
||||
tv_navi_navi.text = "重试"
|
||||
pb_path.visibility=View.GONE
|
||||
|
||||
}
|
||||
|
||||
override fun onUpdateTraffic(traffic: MogoTraffic?) {
|
||||
@@ -165,7 +172,15 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
|
||||
rv_search_result.adapter = mAdapter
|
||||
tv_navi_navi.setOnClickListener {
|
||||
startNavi()
|
||||
|
||||
if (group_path.visibility == View.VISIBLE) {
|
||||
SearchServiceHolder.getNavi()
|
||||
.naviTo(mogoTip)
|
||||
pb_path.visibility=View.VISIBLE
|
||||
group_path.visibility=View.GONE
|
||||
} else {
|
||||
startNavi()
|
||||
}
|
||||
}
|
||||
|
||||
SearchServiceHolder.getNavi()
|
||||
@@ -195,8 +210,7 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
AIAssist.getInstance(context)
|
||||
.registerUnWakeupCommand("startNavi", arrayOf<String>(startNavi), this)
|
||||
AIAssist.getInstance(context)
|
||||
.registerUnWakeupCommand("cancel", arrayOf<String>("取消","退出","返回","退出导航","取消导航"), this)
|
||||
|
||||
.registerUnWakeupCommand("cancel", arrayOf<String>("取消", "退出", "返回", "退出导航", "取消导航"), this)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ import androidx.core.content.ContextCompat;
|
||||
* 2020-01-13.
|
||||
*/
|
||||
public class BitmapUtils {
|
||||
public static Bitmap createWaterMask(Context context, Bitmap src, String text, int textColor, int textSize) {
|
||||
public static Bitmap createWaterMask(Context context, Bitmap src, String text, int textColor,
|
||||
int textSize) {
|
||||
Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
paint.setColor(ContextCompat.getColor(context, textColor));
|
||||
paint.setTextSize(dp2px(context, textSize));
|
||||
@@ -20,7 +21,6 @@ public class BitmapUtils {
|
||||
paint.setDither(true); // 获取跟清晰的图像采样
|
||||
paint.setFilterBitmap(true);// 过滤一些
|
||||
|
||||
|
||||
int width = src.getWidth();
|
||||
int height = src.getHeight();
|
||||
//创建一个bitmap
|
||||
@@ -40,7 +40,16 @@ public class BitmapUtils {
|
||||
Bitmap ret = src.copy(config, true);
|
||||
//Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
|
||||
Canvas canvas = new Canvas(ret);
|
||||
canvas.drawText(text, (width-bounds.width())/2.0F, (float) ( bounds.height()*1.8), paint);
|
||||
|
||||
int i = Integer.parseInt(text);
|
||||
if (i == 1) {
|
||||
canvas.drawText(text, (width - bounds.width()*2) / 2.0F, (float) (bounds.height() * 1.8),
|
||||
paint);
|
||||
} else {
|
||||
canvas.drawText(text, (width - bounds.width()) / 2.0F, (float) (bounds.height() * 1.8),
|
||||
paint);
|
||||
}
|
||||
|
||||
// 保存
|
||||
//canvas.save();
|
||||
//canvas.restore();
|
||||
|
||||
Reference in New Issue
Block a user