Commit 9b3d63bf authored by shiyl's avatar shiyl

Merge branch 'dev_7.2' of https://git.yidian-inc.com:8021/bp/ShenghuoquanBusiness into dev_7.2

parents 4ba35d74 708e3fc8
package com.yidian.shenghuoquan.newscontent.adapter
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.yidian.shenghuoquan.newscontent.R
import com.yidian.shenghuoquan.newscontent.bean.Store
import com.yidian.shenghuoquan.newscontent.viewholder.StoreViewHolder
/**
* Author: sym
* Date: 2021/6/22 3:15 PM
* Describe:
*/
class StoreAdapter(private val context: Context, private val dataList: ArrayList<Store>) : RecyclerView.Adapter<StoreViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): StoreViewHolder {
val view = LayoutInflater.from(context).inflate(R.layout.store_management_item, parent, false)
return StoreViewHolder(view)
}
override fun onBindViewHolder(holder: StoreViewHolder, position: Int) {
val store = dataList[position]
holder.setData(store, position)
}
override fun getItemCount(): Int {
return dataList.size
}
interface HolderListener {
fun jump()
}
}
package com.yidian.shenghuoquan.newscontent.bean
/**
* Author: sym
* Date: 2021/6/22 3:18 PM
* Describe:
*/
class Store(var title: String)
object StoreDataList {
val data = arrayListOf(
Store("Cherry"),
Store("Grape"),
Store("Mango"),
Store("Orange"),
Store("Pear"),
Store("Pineapple"),
Store("Strawberry"),
Store("Watermelon")
)
}
package com.yidian.shenghuoquan.newscontent.ui
import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager
import com.yidian.common.XRouterPathConstants.Companion.STORE_MANAGEMENT
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.adapter.StoreAdapter
import com.yidian.shenghuoquan.newscontent.bean.StoreDataList
import com.yidian.shenghuoquan.newscontent.databinding.ActivityStoreManagementBinding
/**
......@@ -17,4 +21,15 @@ class StoreManagementActivity : BaseActivity<ActivityStoreManagementBinding>() {
override fun getXPageName(): String {
return STORE_MANAGEMENT
}
override fun init(savedInstanceState: Bundle?) {
super.init(savedInstanceState)
val layoutManager = LinearLayoutManager(this)
layoutManager.orientation = LinearLayoutManager.VERTICAL
viewBind.storeList.layoutManager = layoutManager
val adapter = StoreAdapter(this, StoreDataList.data)
viewBind.storeList.adapter = adapter
}
}
package com.yidian.shenghuoquan.newscontent.viewholder
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.yidian.shenghuoquan.newscontent.bean.Store
import com.yidian.shenghuoquan.newscontent.bean.StoreDataList
/**
* Author: sym
* Date: 2021/6/22 3:23 PM
* Describe:
*/
class StoreViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
fun setData(data: Store, pos: Int) {
/* val title = itemView.findViewById<TextView>(R.id.tvTitle)
title.text = hobby?.title */
}
}
......@@ -19,11 +19,7 @@ class LifeAccountAuthCardView @JvmOverloads constructor(
) : CardView(context, attrs, defStyle) {
private val viewBinding: ViewLifeAccountAuthCardBinding = ViewLifeAccountAuthCardBinding.bind(
View.inflate(
getContext(),
R.layout.view_life_account_auth_card,
this
)
View.inflate(getContext(), R.layout.view_life_account_auth_card, this)
)
/**
......@@ -44,4 +40,4 @@ class LifeAccountAuthCardView @JvmOverloads constructor(
viewBinding.tvDescription.text = description
viewBinding.ivAuthenticated.visibility = if (isAuthenticated) View.VISIBLE else View.GONE
}
}
\ No newline at end of file
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="10dp" />
<solid android:color="#fff" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
android:id="@+id/bv_top_bar"
......@@ -12,5 +13,10 @@
app:CommonTopBarView_title_text="@string/store_management_title"
app:layout_constraintTop_toTopOf="parent" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/store_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp">
<ImageView
android:id="@+id/store_edit_icon"
android:layout_width="wrap_content"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:layout_marginLeft="23dp"
android:layout_alignParentRight="true"
android:background="@mipmap/store_edit"/>
<LinearLayout
android:layout_toLeftOf="@id/store_edit_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:orientation="vertical"
android:paddingStart="23dp">
<TextView
android:id="@+id/store_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="一点资讯生活号实体店1分店"
android:textColor="#FF333333"
android:textSize="16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/store_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="2"
android:text="朝阳区恒通国际创新园C7一点资讯北侧.朝阳区恒通国际创新园C7一点资讯北侧.朝阳区恒通国际创新园C7一点资讯北侧"
android:textColor="#9d9d9d"
android:textSize="12sp" />
<TextView
android:id="@+id/store_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:includeFontPadding="false"
android:text="13888888888"
android:textColor="#9d9d9d"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_marginTop="20dp"
android:background="#f2f2f2" />
</RelativeLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment