调整UI
This commit is contained in:
@@ -33,6 +33,15 @@ public class CalculatePathAdapter extends RecycleBaseAdapter<MogoCalculatePath>
|
||||
//holder.setText(R.id.tv_position, tip.getName());
|
||||
//holder.setText(R.id.tv_position_des, tip.getAddress());
|
||||
|
||||
int layoutPosition = holder.getLayoutPosition();
|
||||
|
||||
if (layoutPosition==0) {
|
||||
holder.itemView.setBackgroundResource(R.drawable.selector_first_item_category_background);
|
||||
}else {
|
||||
holder.itemView.setBackgroundResource(R.drawable.selector_item_category_background);
|
||||
|
||||
}
|
||||
|
||||
holder.itemView.setTag(R.id.tag_item, item);
|
||||
holder.itemView.setOnClickListener(onClickListener);
|
||||
holder.itemView.setSelected(TextUtils.equals(item.getTagId(), selectTag));
|
||||
|
||||
@@ -33,6 +33,18 @@ public class SearchCategoryAdapter extends RecycleBaseAdapter<MogoPoiItem> {
|
||||
@Override
|
||||
public void onBindViewHolder(RecycleViewHolder holder, MogoPoiItem tip) {
|
||||
|
||||
|
||||
|
||||
int layoutPosition = holder.getLayoutPosition();
|
||||
|
||||
if (layoutPosition==0) {
|
||||
holder.itemView.setBackgroundResource(R.drawable.selector_first_item_category_background);
|
||||
}else {
|
||||
holder.itemView.setBackgroundResource(R.drawable.selector_item_category_background);
|
||||
|
||||
}
|
||||
|
||||
|
||||
holder.setText(R.id.tv_position, tip.getTitle());
|
||||
holder.setText(R.id.tv_position_des, tip.getSnippet());
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.mogo.module.navi.uitls.BitmapUtils
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.cv_search_result
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.et_navi_search
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.iv_navi_back
|
||||
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
|
||||
|
||||
@@ -34,7 +35,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
override fun renderSearchPoiResult(datums: List<MogoPoiItem>?) {
|
||||
mAdapter.setDatas(datums)
|
||||
cv_search_result.visibility = View.VISIBLE
|
||||
|
||||
pb_path.visibility=View.GONE
|
||||
var arrayList = ArrayList<MogoMarkerOptions>()
|
||||
for (index in 0 until datums!!.size) {
|
||||
var decodeResource =
|
||||
|
||||
@@ -21,6 +21,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.pb_path
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.rv_search_result
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.tv_navi_navi
|
||||
import kotlinx.android.synthetic.main.include_search_bar.et_navi_search
|
||||
@@ -98,6 +99,8 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
mAdapter.setDatas(calculatedStrategies)
|
||||
mAdapter.selectTag = calculatedStrategies[0].tagId
|
||||
}
|
||||
pb_path.visibility=View.GONE
|
||||
|
||||
}
|
||||
|
||||
override fun onoCalculateFailed() {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:topLeftRadius="@dimen/dp_8" android:topRightRadius="@dimen/dp_8" />
|
||||
<gradient android:angle="180" android:endColor="#3E7FFC" android:startColor="#1A3E7FFC" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="@color/translate" />
|
||||
</selector>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<solid android:color="#3F4057"/>
|
||||
<corners android:bottomLeftRadius="@dimen/dp_8"
|
||||
android:bottomRightRadius="@dimen/dp_8"
|
||||
/>
|
||||
</shape>
|
||||
|
||||
@@ -30,10 +30,18 @@
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_path"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="#3F4057"
|
||||
android:background="@drawable/shape_round_gray_bottom"
|
||||
android:layout_height="@dimen/module_search_category_margin_bottom"/>
|
||||
|
||||
<View
|
||||
|
||||
Reference in New Issue
Block a user