优化提前显示面板
This commit is contained in:
parent
53bb2f3ca6
commit
4280c0bf0b
@ -37,7 +37,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"table": "OMDB_LANE_NUM",
|
"table": "OMDB_LANE_NUM",
|
||||||
"code": 5002,
|
"code": 2041,
|
||||||
"name": "车道数"
|
"name": "车道数"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -67,6 +67,6 @@ open class TaskBean @JvmOverloads constructor(
|
|||||||
var message: String = ""
|
var message: String = ""
|
||||||
) : RealmObject() {
|
) : RealmObject() {
|
||||||
fun getDownLoadUrl(): String {
|
fun getDownLoadUrl(): String {
|
||||||
return "${Constant.SERVER_ADDRESS}devcp/download?fileStr=26"
|
return "${Constant.SERVER_ADDRESS}devcp/download?fileStr=$id"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package com.navinfo.omqs.ui.activity.login
|
|||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.util.DisplayMetrics
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.activity.viewModels
|
import androidx.activity.viewModels
|
||||||
@ -33,8 +34,35 @@ class LoginActivity : CheckPermissionsActivity() {
|
|||||||
binding.lifecycleOwner = this
|
binding.lifecycleOwner = this
|
||||||
binding.activity = this
|
binding.activity = this
|
||||||
initView()
|
initView()
|
||||||
|
Log.e("jingo", getScreenParams())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getScreenParams(): String {
|
||||||
|
val dm = DisplayMetrics();
|
||||||
|
windowManager.defaultDisplay.getMetrics(dm);
|
||||||
|
val heightPixels = dm.heightPixels;//高的像素
|
||||||
|
val widthPixels = dm.widthPixels;//宽的像素
|
||||||
|
val densityDpi = dm.densityDpi;//dpi
|
||||||
|
val xdpi = dm.xdpi;//xdpi
|
||||||
|
val ydpi = dm.ydpi;//ydpi
|
||||||
|
val density = dm.density;//density=dpi/160,密度比
|
||||||
|
val scaledDensity = dm.scaledDensity;//scaledDensity=dpi/160 字体缩放密度比
|
||||||
|
val heightDP = heightPixels / density;//高度的dp
|
||||||
|
val widthDP = widthPixels / density;//宽度的dp
|
||||||
|
var str = "heightPixels: " + heightPixels + "px";
|
||||||
|
str += "\nwidthPixels: " + widthPixels + "px";
|
||||||
|
str += "\ndensityDpi: " + densityDpi + "dpi";
|
||||||
|
str += "\nxdpi: " + xdpi + "dpi";
|
||||||
|
str += "\nydpi: " + ydpi + "dpi";
|
||||||
|
str += "\ndensity: " + density;
|
||||||
|
str += "\nscaledDensity: " + scaledDensity;
|
||||||
|
str += "\nheightDP: " + heightDP + "dp";
|
||||||
|
str += "\nwidthDP: " + widthDP + "dp";
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 观察登录状态,把Observer提出来是为了防止每次数据变化都会有新的observer创建
|
* 观察登录状态,把Observer提出来是为了防止每次数据变化都会有新的observer创建
|
||||||
* 还有为了方便释放(需不需要手动释放?不清楚)不需要释放,当viewmodel观察到activity/fragment 的生命周期时会自动释放
|
* 还有为了方便释放(需不需要手动释放?不清楚)不需要释放,当viewmodel观察到activity/fragment 的生命周期时会自动释放
|
||||||
|
@ -17,7 +17,9 @@ import com.navinfo.omqs.R
|
|||||||
import com.navinfo.omqs.databinding.ActivityMainBinding
|
import com.navinfo.omqs.databinding.ActivityMainBinding
|
||||||
import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
import com.navinfo.omqs.http.offlinemapdownload.OfflineMapDownloadManager
|
||||||
import com.navinfo.omqs.ui.activity.BaseActivity
|
import com.navinfo.omqs.ui.activity.BaseActivity
|
||||||
|
import com.navinfo.omqs.ui.widget.RecyclerViewSpacesItemDecoration
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
import org.videolan.vlc.Util
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,7 +92,6 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return v?.onTouchEvent(event) ?: true
|
return v?.onTouchEvent(event) ?: true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -101,6 +102,14 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
binding.mainActivitySignRecyclerview.layoutManager = LinearLayoutManager(this)
|
binding.mainActivitySignRecyclerview.layoutManager = LinearLayoutManager(this)
|
||||||
binding.mainActivitySignRecyclerview.adapter = signAdapter
|
binding.mainActivitySignRecyclerview.adapter = signAdapter
|
||||||
|
//增加4dp的间隔
|
||||||
|
binding.mainActivitySignRecyclerview.addItemDecoration(
|
||||||
|
RecyclerViewSpacesItemDecoration(
|
||||||
|
Util.convertDpToPx(
|
||||||
|
this, 4
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
viewModel.liveDataSignList.observe(this) {
|
viewModel.liveDataSignList.observe(this) {
|
||||||
signAdapter.refreshData(it)
|
signAdapter.refreshData(it)
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import com.navinfo.omqs.bean.SignBean
|
|||||||
import com.navinfo.omqs.db.RealmOperateHelper
|
import com.navinfo.omqs.db.RealmOperateHelper
|
||||||
import com.navinfo.omqs.ui.dialog.CommonDialog
|
import com.navinfo.omqs.ui.dialog.CommonDialog
|
||||||
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
import com.navinfo.omqs.ui.manager.TakePhotoManager
|
||||||
|
import com.navinfo.omqs.ui.widget.SignUtil
|
||||||
import com.navinfo.omqs.util.DateTimeUtil
|
import com.navinfo.omqs.util.DateTimeUtil
|
||||||
import com.navinfo.omqs.util.SoundMeter
|
import com.navinfo.omqs.util.SoundMeter
|
||||||
import com.navinfo.omqs.util.SpeakMode
|
import com.navinfo.omqs.util.SpeakMode
|
||||||
@ -66,6 +67,7 @@ class MainViewModel @Inject constructor(
|
|||||||
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
val liveDataSignList = MutableLiveData<List<SignBean>>()
|
||||||
|
|
||||||
var testPoint = GeoPoint(0, 0)
|
var testPoint = GeoPoint(0, 0)
|
||||||
|
|
||||||
//语音窗体
|
//语音窗体
|
||||||
private var pop: PopupWindow? = null
|
private var pop: PopupWindow? = null
|
||||||
|
|
||||||
@ -84,7 +86,7 @@ class MainViewModel @Inject constructor(
|
|||||||
})
|
})
|
||||||
initLocation()
|
initLocation()
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
mapController.onMapClickFlow.collect {
|
mapController.onMapClickFlow.collectLatest {
|
||||||
testPoint = it
|
testPoint = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -154,8 +156,8 @@ class MainViewModel @Inject constructor(
|
|||||||
)
|
)
|
||||||
signList.add(
|
signList.add(
|
||||||
SignBean(
|
SignBean(
|
||||||
iconId = R.drawable.icon_speed_limit,
|
iconId = SignUtil.getSignIcon(element),
|
||||||
iconText = element.name,
|
iconText = SignUtil.getSignText(element),
|
||||||
distance = distance.toInt(),
|
distance = distance.toInt(),
|
||||||
elementId = element.id,
|
elementId = element.id,
|
||||||
linkId = linkId,
|
linkId = linkId,
|
||||||
@ -230,7 +232,7 @@ class MainViewModel @Inject constructor(
|
|||||||
|
|
||||||
fun startSoundMetter(context: Context, v: View) {
|
fun startSoundMetter(context: Context, v: View) {
|
||||||
|
|
||||||
if(mSpeakMode==null){
|
if (mSpeakMode == null) {
|
||||||
mSpeakMode = SpeakMode(context as Activity?)
|
mSpeakMode = SpeakMode(context as Activity?)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +276,8 @@ class MainViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
mSpeakMode!!.speakText("结束录音")
|
mSpeakMode!!.speakText("结束录音")
|
||||||
//获取右侧fragment容器
|
//获取右侧fragment容器
|
||||||
val naviController = (context as Activity).findNavController(R.id.main_activity_right_fragment)
|
val naviController =
|
||||||
|
(context as Activity).findNavController(R.id.main_activity_right_fragment)
|
||||||
val bundle = Bundle()
|
val bundle = Bundle()
|
||||||
bundle.putString("filePath", filePath)
|
bundle.putString("filePath", filePath)
|
||||||
naviController.navigate(R.id.EvaluationResultFragment, bundle)
|
naviController.navigate(R.id.EvaluationResultFragment, bundle)
|
||||||
|
@ -8,6 +8,10 @@ import android.widget.EditText
|
|||||||
import androidx.appcompat.widget.AppCompatEditText
|
import androidx.appcompat.widget.AppCompatEditText
|
||||||
import com.navinfo.omqs.R
|
import com.navinfo.omqs.R
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 滚动嵌套时,处理滚动的edittext
|
||||||
|
*/
|
||||||
|
|
||||||
class MyEditeText @JvmOverloads constructor(
|
class MyEditeText @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
attrs: AttributeSet? = null,
|
attrs: AttributeSet? = null,
|
||||||
|
@ -0,0 +1,86 @@
|
|||||||
|
package com.navinfo.omqs.ui.widget
|
||||||
|
|
||||||
|
import android.graphics.Rect
|
||||||
|
import android.view.View
|
||||||
|
import androidx.annotation.StringDef
|
||||||
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import androidx.recyclerview.widget.RecyclerView.ItemDecoration
|
||||||
|
import java.lang.annotation.Retention
|
||||||
|
import java.lang.annotation.RetentionPolicy
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用来设置recyclerView 要素间的间隔
|
||||||
|
*/
|
||||||
|
class RecyclerViewSpacesItemDecoration : ItemDecoration {
|
||||||
|
@StringDef(TOP_DECORATION, BOTTOM_DECORATION, LEFT_DECORATION, RIGHT_DECORATION)
|
||||||
|
@Retention(
|
||||||
|
RetentionPolicy.SOURCE
|
||||||
|
)
|
||||||
|
private annotation class Decoration
|
||||||
|
|
||||||
|
private var rightSpace = 0 //右边间距
|
||||||
|
private var topSpace = 0 //上边边间距
|
||||||
|
private var leftSpace = 0 //左边间距
|
||||||
|
private var bottomSpace = 0 //下边间距
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param bottomSpace 下间距
|
||||||
|
*/
|
||||||
|
constructor(bottomSpace: Int) {
|
||||||
|
this.bottomSpace = bottomSpace
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指定某一个属性
|
||||||
|
*
|
||||||
|
* @param decoration decoration
|
||||||
|
* @param space 间距
|
||||||
|
*/
|
||||||
|
constructor(@Decoration decoration: String?, space: Int) {
|
||||||
|
when (decoration) {
|
||||||
|
RIGHT_DECORATION -> rightSpace = space
|
||||||
|
TOP_DECORATION -> topSpace = space
|
||||||
|
LEFT_DECORATION -> leftSpace = space
|
||||||
|
BOTTOM_DECORATION -> bottomSpace = space
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param rightSpace 右间距
|
||||||
|
* @param topSpace 上间距
|
||||||
|
* @param leftSpace 左间距
|
||||||
|
* @param bottomSpace 下间距
|
||||||
|
*/
|
||||||
|
constructor(rightSpace: Int, topSpace: Int, leftSpace: Int, bottomSpace: Int) {
|
||||||
|
this.rightSpace = rightSpace
|
||||||
|
this.topSpace = topSpace
|
||||||
|
this.leftSpace = leftSpace
|
||||||
|
this.bottomSpace = bottomSpace
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param outRect Item的矩边界
|
||||||
|
* @param view ItemView
|
||||||
|
* @param parent RecyclerView
|
||||||
|
* @param state RecyclerView的状态
|
||||||
|
*/
|
||||||
|
override fun getItemOffsets(
|
||||||
|
outRect: Rect,
|
||||||
|
view: View,
|
||||||
|
parent: RecyclerView,
|
||||||
|
state: RecyclerView.State
|
||||||
|
) {
|
||||||
|
super.getItemOffsets(outRect, view, parent, state)
|
||||||
|
outRect.top = topSpace
|
||||||
|
outRect.left = leftSpace
|
||||||
|
outRect.right = rightSpace
|
||||||
|
outRect.bottom = bottomSpace
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
const val TOP_DECORATION = "top_decoration"
|
||||||
|
const val BOTTOM_DECORATION = "bottom_decoration"
|
||||||
|
const val LEFT_DECORATION = "left_decoration"
|
||||||
|
const val RIGHT_DECORATION = "right_decoration"
|
||||||
|
}
|
||||||
|
}
|
153
app/src/main/java/com/navinfo/omqs/ui/widget/SignUtil.kt
Normal file
153
app/src/main/java/com/navinfo/omqs/ui/widget/SignUtil.kt
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
package com.navinfo.omqs.ui.widget
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
|
import com.navinfo.collect.library.data.entity.RenderEntity
|
||||||
|
import com.navinfo.omqs.R
|
||||||
|
|
||||||
|
class SignUtil {
|
||||||
|
companion object {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取面板上的文字
|
||||||
|
*/
|
||||||
|
fun getSignText(data: RenderEntity): String {
|
||||||
|
return when (data.code) {
|
||||||
|
//常规点限速
|
||||||
|
4002 -> getSpeedLimitText(data)
|
||||||
|
// //道路种别
|
||||||
|
// 2008 -> getKindCodeIcon(data)
|
||||||
|
// //道路方向
|
||||||
|
// 2010 -> getRoadDirection(data)
|
||||||
|
// //车道数
|
||||||
|
// 2041 -> getLaneNumIcon(data)
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取限速值文字
|
||||||
|
*/
|
||||||
|
private fun getSpeedLimitText(data: RenderEntity): String {
|
||||||
|
try {
|
||||||
|
//限速标志 0 限速开始 1 限速解除
|
||||||
|
val maxSpeed = data.properties["max_speed"]
|
||||||
|
val minSpeed = data.properties["min_speed"]
|
||||||
|
return if (maxSpeed != "0")
|
||||||
|
maxSpeed.toString()
|
||||||
|
else
|
||||||
|
minSpeed.toString()
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("jingo", "获取限速面板ICON出错1 $e")
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 限速图标
|
||||||
|
*/
|
||||||
|
fun getSpeedLimitIcon(data: RenderEntity): Int {
|
||||||
|
try {
|
||||||
|
//限速标志 0 限速开始 1 限速解除
|
||||||
|
val speedFlag = data.properties["speed_flag"]
|
||||||
|
return when (speedFlag) {
|
||||||
|
"1" -> return R.drawable.icon_speed_limit_off
|
||||||
|
else -> return R.drawable.icon_speed_limit
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("jingo", "获取限速面板ICON出错2 $e")
|
||||||
|
}
|
||||||
|
return R.drawable.icon_speed_limit
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取看板图标
|
||||||
|
*/
|
||||||
|
|
||||||
|
fun getSignIcon(data: RenderEntity): Int {
|
||||||
|
return when (data.code) {
|
||||||
|
//道路种别
|
||||||
|
2008 -> getKindCodeIcon(data)
|
||||||
|
//道路方向
|
||||||
|
2010 -> getRoadDirection(data)
|
||||||
|
//车道数
|
||||||
|
2041 -> getLaneNumIcon(data)
|
||||||
|
//限速
|
||||||
|
4002 -> getSpeedLimitIcon(data)
|
||||||
|
else -> R.drawable.icon_speed_limit
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取种别图标
|
||||||
|
*/
|
||||||
|
fun getKindCodeIcon(data: RenderEntity): Int {
|
||||||
|
try {
|
||||||
|
val kind = data.properties["kind"]
|
||||||
|
return when (kind!!.toInt()) {
|
||||||
|
1 -> R.mipmap.icon_kind_code_k1
|
||||||
|
2 -> R.mipmap.icon_kind_code_k2
|
||||||
|
3 -> R.mipmap.icon_kind_code_k3
|
||||||
|
4 -> R.mipmap.icon_kind_code_k4
|
||||||
|
6 -> R.mipmap.icon_kind_code_k6
|
||||||
|
7 -> R.mipmap.icon_kind_code_k7
|
||||||
|
8 -> R.mipmap.icon_kind_code_k8
|
||||||
|
9 -> R.mipmap.icon_kind_code_k9
|
||||||
|
10 -> R.mipmap.icon_kind_code_k10
|
||||||
|
11 -> R.mipmap.icon_kind_code_k11
|
||||||
|
13 -> R.mipmap.icon_kind_code_k13
|
||||||
|
15 -> R.mipmap.icon_kind_code_k15
|
||||||
|
else -> R.mipmap.icon_kind_code
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("jingo", "获取种别面板ICON出错 $e")
|
||||||
|
}
|
||||||
|
return R.mipmap.icon_kind_code
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取到路线
|
||||||
|
*/
|
||||||
|
fun getLaneNumIcon(data: RenderEntity): Int {
|
||||||
|
try {
|
||||||
|
val lineNum = data.properties["laneNum"]
|
||||||
|
return when (lineNum!!.toInt()) {
|
||||||
|
1 -> R.mipmap.icon_lane_num1
|
||||||
|
2 -> R.mipmap.icon_lane_num2
|
||||||
|
3 -> R.mipmap.icon_lane_num3
|
||||||
|
4 -> R.mipmap.icon_lane_num4
|
||||||
|
5 -> R.mipmap.icon_lane_num5
|
||||||
|
6 -> R.mipmap.icon_lane_num6
|
||||||
|
7 -> R.mipmap.icon_lane_num7
|
||||||
|
8 -> R.mipmap.icon_lane_num8
|
||||||
|
9 -> R.mipmap.icon_lane_num9
|
||||||
|
10 -> R.mipmap.icon_lane_num10
|
||||||
|
11 -> R.mipmap.icon_lane_num11
|
||||||
|
12 -> R.mipmap.icon_lane_num12
|
||||||
|
else -> R.mipmap.icon_lane_num1
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("jingo", "获取车道数面板ICON出错 $e")
|
||||||
|
}
|
||||||
|
return R.mipmap.icon_road_direction
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getRoadDirection(data: RenderEntity): Int {
|
||||||
|
try {
|
||||||
|
val direct = data.properties["direct"]
|
||||||
|
return when (direct!!.toInt()) {
|
||||||
|
0 -> R.mipmap.icon_road_direction
|
||||||
|
1 -> R.mipmap.icon_road_direction
|
||||||
|
2 -> R.mipmap.icon_road_direction
|
||||||
|
3 -> R.mipmap.icon_road_direction
|
||||||
|
-99 -> R.mipmap.icon_road_direction
|
||||||
|
else -> R.mipmap.icon_road_direction
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e("jingo", "获取道路方向面板ICON出错 $e")
|
||||||
|
}
|
||||||
|
return R.mipmap.icon_road_direction
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
app/src/main/res/drawable/icon_speed_limit_off.xml
Normal file
12
app/src/main/res/drawable/icon_speed_limit_off.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval"
|
||||||
|
android:useLevel="false">
|
||||||
|
<stroke
|
||||||
|
android:width="1.33dp"
|
||||||
|
android:color="#000000" />
|
||||||
|
<size
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp" />
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
|
||||||
|
</shape>
|
@ -1,15 +1,15 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="193dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="78dp"
|
||||||
android:background="@mipmap/bg_sign"
|
android:background="@mipmap/bg_sign"
|
||||||
tools:context="com.navinfo.omqs.ui.activity.map.SignAdapter">
|
tools:context="com.navinfo.omqs.ui.activity.map.SignAdapter">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sign_main_icon"
|
android:id="@+id/sign_main_icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="40dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="40dp"
|
||||||
android:layout_marginLeft="19dp"
|
android:layout_marginLeft="19dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:background="@drawable/icon_speed_limit"
|
android:background="@drawable/icon_speed_limit"
|
||||||
|
@ -74,7 +74,7 @@ public class OMDBDataDecoder extends TileDecoder {
|
|||||||
listResult.stream().iterator().forEachRemaining(new Consumer<RenderEntity>() {
|
listResult.stream().iterator().forEachRemaining(new Consumer<RenderEntity>() {
|
||||||
@Override
|
@Override
|
||||||
public void accept(RenderEntity renderEntity) {
|
public void accept(RenderEntity renderEntity) {
|
||||||
Log.d("RealmDBTileDataSource", renderEntity.getGeometry());
|
// Log.d("RealmDBTileDataSource", renderEntity.getGeometry());
|
||||||
Map<String, Object> properties= new HashMap<>(renderEntity.getProperties().size());
|
Map<String, Object> properties= new HashMap<>(renderEntity.getProperties().size());
|
||||||
properties.putAll(renderEntity.getProperties());
|
properties.putAll(renderEntity.getProperties());
|
||||||
parseGeometry(renderEntity.getTable(), renderEntity.getWkt(), properties);
|
parseGeometry(renderEntity.getTable(), renderEntity.getWkt(), properties);
|
||||||
|
@ -54,7 +54,7 @@ public class OMDBTileDataSource implements ITileDataSource {
|
|||||||
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
||||||
}
|
}
|
||||||
mapDataSink.completed(QueryResult.SUCCESS);
|
mapDataSink.completed(QueryResult.SUCCESS);
|
||||||
Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||||
} else {
|
} else {
|
||||||
mapDataSink.completed(QueryResult.SUCCESS);
|
mapDataSink.completed(QueryResult.SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class RealmDBTileDataSource implements ITileDataSource {
|
|||||||
List<GeometryFeatureEntity> listResult = realmQuery.distinct("id").findAll();
|
List<GeometryFeatureEntity> listResult = realmQuery.distinct("id").findAll();
|
||||||
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
mThreadLocalDecoders.get().decode(tile, mapDataSink, listResult);
|
||||||
mapDataSink.completed(QueryResult.SUCCESS);
|
mapDataSink.completed(QueryResult.SUCCESS);
|
||||||
Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||||
} else {
|
} else {
|
||||||
mapDataSink.completed(QueryResult.SUCCESS);
|
mapDataSink.completed(QueryResult.SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package org.videolan.vlc;
|
package org.videolan.vlc;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
@ -364,10 +365,10 @@ public class Util {
|
|||||||
return dp;
|
return dp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int convertDpToPx(int dp) {
|
public static int convertDpToPx(Context context,int dp) {
|
||||||
return Math.round(
|
return Math.round(
|
||||||
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
|
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
|
||||||
VLCApplication.getAppResources().getDisplayMetrics())
|
context.getResources().getDisplayMetrics())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user