1. 修复场景地图界面选择场景点时可能由于列表下标越界导致崩溃问题;
2. 修复自定义PagerAdapter时,没有重写destroyItem可能会导致的崩溃问题;
3. 修改数据库实体类MediaTypeAlias的主键id类型从龙变更为Long,否则无法自增;
4. 新增部分列表相关的工具函数;
| | |
| | | applicationId "cn.flightfeather.thirdapp" |
| | | minSdkVersion 19 |
| | | targetSdkVersion 28 |
| | | versionCode 24 |
| | | versionName "1.1.14.07" |
| | | versionCode 25 |
| | | versionName "1.1.14.08" |
| | | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| | | renderscriptTargetApi 25 |
| | | renderscriptSupportModeEnabled true |
| | |
| | | implementation 'com.amap.api:location:4.6.0' |
| | | implementation 'com.amap.api:search:6.5.0.1' |
| | | |
| | | //recyclerViewAdapter |
| | | implementation "com.github.CymChad:BaseRecyclerViewAdapterHelper:${adaper_version}" |
| | | |
| | | //lifecycle |
| | | implementation "android.arch.lifecycle:extensions:${lifecycle_version}" |
| | | |
| | |
| | | |
| | | private void selectScense(Marker marker) { |
| | | mSelectedScense = mShownScenseList.get(curPos); |
| | | if (mLastPos != -1) { |
| | | if (mLastPos != -1 && mLastPos < markerList.size()) { |
| | | markerList.get(mLastPos).setIcon(mLastBitmapDesc); |
| | | } |
| | | mLastBitmapDesc = marker.getIcons().get(0); |
| | |
| | | package cn.flightfeather.thirdapp.adapter; |
| | | |
| | | import android.support.annotation.NonNull; |
| | | import android.support.v4.view.PagerAdapter; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | |
| | | |
| | | return viewList.get(position); |
| | | } |
| | | |
| | | @Override |
| | | public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { |
| | | // super.destroyItem(container, position, object); |
| | | container.removeView(viewList.get(position)); |
| | | } |
| | | } |
| | |
| | | @Entity |
| | | public class MediaTypeAlias { |
| | | @Id(autoincrement = true) |
| | | private long id; |
| | | private Long id; |
| | | @Property |
| | | private int sceneTypeId; |
| | | @Property |
| | |
| | | private String typeName; |
| | | @Property |
| | | private String alias; |
| | | @Generated(hash = 1531076614) |
| | | public MediaTypeAlias(long id, int sceneTypeId, int typeId, String typeName, |
| | | @Generated(hash = 626593863) |
| | | public MediaTypeAlias(Long id, int sceneTypeId, int typeId, String typeName, |
| | | String alias) { |
| | | this.id = id; |
| | | this.sceneTypeId = sceneTypeId; |
| | |
| | | @Generated(hash = 849869520) |
| | | public MediaTypeAlias() { |
| | | } |
| | | public long getId() { |
| | | public Long getId() { |
| | | return this.id; |
| | | } |
| | | public void setId(long id) { |
| | |
| | | public void setAlias(String alias) { |
| | | this.alias = alias; |
| | | } |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | } |
| | |
| | | |
| | | private val viewList = mutableListOf<View>() |
| | | |
| | | private val listMap = mutableMapOf<MediaFileType, RecyclerView>() |
| | | |
| | | var subTask: Subtask? = null |
| | | var inspection: Inspection? = null |
| | | var scene: Scense? = null |
| | |
| | | } |
| | | |
| | | })) |
| | | |
| | | if (!listMap.containsKey(type)) { |
| | | listMap[type] = this |
| | | } |
| | | } |
| | | |
| | | viewList.add(view) |
| | |
| | | } |
| | | |
| | | private fun addPhoto(mediaFile: Mediafile) { |
| | | getDataSet(currentType).run { |
| | | first.value?.add(mediaFile) |
| | | second.adapter?.run { |
| | | notifyDataSetChanged() |
| | | if (listMap.containsKey(currentType)) { |
| | | viewModel.fileList.value?.forEach { |
| | | if (it.type == currentType) { |
| | | it.dataList.add(mediaFile)//第ä¸ä¸ªæ°æ®ä¸ºæç
§æé® |
| | | listMap[currentType]?.adapter?.notifyDataSetChanged() |
| | | } |
| | | } |
| | | } |
| | | // getDataSet(currentType).run { |
| | | // first.value?.add(mediaFile) |
| | | // second.adapter?.run { |
| | | // notifyDataSetChanged() |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | private fun deletePhoto(pos: Int) { |
| | | getDataSet(currentType).run { |
| | | first.value?.removeAt(pos + 1)//第ä¸ä¸ªæ°æ®ä¸ºæç
§æé® |
| | | second.adapter?.run { |
| | | notifyDataSetChanged() |
| | | if (listMap.containsKey(currentType)) { |
| | | viewModel.fileList.value?.forEach { |
| | | if (it.type == currentType) { |
| | | it.dataList.removeAt(pos + 1)//第ä¸ä¸ªæ°æ®ä¸ºæç
§æé® |
| | | listMap[currentType]?.adapter?.notifyDataSetChanged() |
| | | } |
| | | } |
| | | } |
| | | // getDataSet(currentType).run { |
| | | // first.value?.removeAt(pos + 1)//第ä¸ä¸ªæ°æ®ä¸ºæç
§æé® |
| | | // second.adapter?.run { |
| | | // notifyDataSetChanged() |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | private fun getDataSet(type: MediaFileType) = when (type) { |
| | | MediaFileType.RoutineRecord -> Pair(viewModel.routineRecordList, rv_photo_list_1) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.module.nightwork |
| | | |
| | | import android.arch.lifecycle.ViewModelProviders |
| | | import android.os.Bundle |
| | | import android.view.View |
| | | import cn.flightfeather.thirdapp.R |
| | | import cn.flightfeather.thirdapp.module.base.BaseActivity |
| | | import kotlinx.android.synthetic.main.activity_night_work.* |
| | | import kotlinx.android.synthetic.main.layout_toolbar_2.* |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/12/24 |
| | | */ |
| | | class NightWorkRecordActivity : BaseActivity(), View.OnClickListener { |
| | | override fun getLayoutId(): Int = R.layout.activity_night_work |
| | | |
| | | lateinit var viewModel: NightWorkViewModel |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | | viewModel = ViewModelProviders.of(this).get(NightWorkViewModel::class.java) |
| | | |
| | | initToolbar() |
| | | initRecyclerView1() |
| | | initRecyclerView2() |
| | | initObserver() |
| | | } |
| | | |
| | | private fun initToolbar() { |
| | | img_back.setOnClickListener(this) |
| | | tv_main_title.text = "å¤é´æ½å·¥è®¸å¯" |
| | | } |
| | | |
| | | private fun initRecyclerView1() { |
| | | recycler_view |
| | | } |
| | | |
| | | private fun initRecyclerView2() { |
| | | |
| | | } |
| | | |
| | | private fun initObserver() { |
| | | |
| | | } |
| | | |
| | | override fun onClick(v: View?) { |
| | | TODO("Not yet implemented") |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.module.nightwork |
| | | |
| | | import cn.flightfeather.thirdapp.module.base.BaseViewModel |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/12/24 |
| | | */ |
| | | class NightWorkViewModel : BaseViewModel() { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.view.recyclerview |
| | | |
| | | import android.content.res.ColorStateList |
| | | import android.os.Build |
| | | import android.support.annotation.DrawableRes |
| | | import android.support.annotation.IdRes |
| | | import android.support.annotation.RequiresApi |
| | | import android.support.design.widget.FloatingActionButton |
| | | import android.support.v4.content.ContextCompat |
| | | import android.view.View |
| | | import com.chad.library.adapter.base.BaseViewHolder |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2019/4/19 |
| | | * æ©å±viewHolder,ä¹åå¯è½æ·»å databindingï¼ä»¥åæ©å±viewç屿§è®¾ç½®æ¹æ³ |
| | | */ |
| | | class BaseCustomViewHolder(view: View?) : BaseViewHolder(view) { |
| | | |
| | | // @RequiresApi(Build.VERSION_CODES.LOLLIPOP) |
| | | // fun setBackgroundTint(@IdRes viewId: Int, colorStateList: ColorStateList?): BaseCustomViewHolder { |
| | | // val view = getView<View>(viewId) |
| | | // view.backgroundTintList = colorStateList |
| | | // return this |
| | | // } |
| | | |
| | | fun setSelected(@IdRes viewId: Int, selected: Boolean): BaseCustomViewHolder { |
| | | val view = getView<View>(viewId) |
| | | view.isSelected = selected |
| | | return this |
| | | } |
| | | |
| | | fun setClickable(@IdRes viewId: Int, clickable: Boolean): BaseCustomViewHolder { |
| | | val view = getView<View>(viewId) |
| | | view.isClickable = clickable |
| | | return this |
| | | } |
| | | |
| | | // fun setMyProgress(@IdRes viewId: Int, progress: Long, max: Long): BaseCustomViewHolder { |
| | | // val view = getView<CircularProgressBar>(viewId) |
| | | // view.apply { |
| | | // this.progress = progress.toFloat() |
| | | // this.progressMax = max.toFloat() |
| | | // } |
| | | // return this |
| | | // } |
| | | |
| | | fun setMyVisible(@IdRes viewId: Int, visible: Int): BaseCustomViewHolder { |
| | | val view = getView<View>(viewId) |
| | | view.visibility = visible |
| | | return this |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.view.recyclerview |
| | | |
| | | import com.chad.library.adapter.base.BaseMultiItemQuickAdapter |
| | | import com.chad.library.adapter.base.entity.AbstractExpandableItem |
| | | import com.chad.library.adapter.base.entity.MultiItemEntity |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2019/4/18 |
| | | * recyclerViewçåºç±»adapter |
| | | */ |
| | | abstract class BaseRecyclerAdapter<T> constructor( |
| | | layoutIdMap: Map<Int, Int>, |
| | | sectionLayoutId: Int?, |
| | | mData: List<MySection<T>> |
| | | ) : BaseMultiItemQuickAdapter<MySection<T>, BaseCustomViewHolder>(mData) { |
| | | |
| | | companion object { |
| | | const val SECTION_HEADER_VIEW = 0x00000444 |
| | | } |
| | | init { |
| | | sectionLayoutId?.let { addItemType(SECTION_HEADER_VIEW, it) } |
| | | layoutIdMap.forEach { |
| | | addItemType(it.key, it.value) |
| | | } |
| | | } |
| | | |
| | | override fun onBindViewHolder(holder: BaseCustomViewHolder, position: Int) { |
| | | when (holder.itemViewType) { |
| | | SECTION_HEADER_VIEW -> { |
| | | setFullSpan(holder) |
| | | convertHead(holder, getItem(position - headerLayoutCount)) |
| | | } |
| | | else -> super.onBindViewHolder(holder, position) |
| | | } |
| | | } |
| | | |
| | | override fun onBindViewHolder( |
| | | holder: BaseCustomViewHolder, |
| | | position: Int, |
| | | payloads: MutableList<Any> |
| | | ) { |
| | | if (payloads.isEmpty()) { |
| | | super.onBindViewHolder(holder, position, payloads) |
| | | } else { |
| | | convertPartView(holder, getItem(position - headerLayoutCount), payloads) |
| | | } |
| | | } |
| | | |
| | | protected abstract fun convertHead(holder: BaseCustomViewHolder, item: MySection<T>?) |
| | | |
| | | //å±é¨å·æ° |
| | | protected abstract fun convertPartView(holder: BaseCustomViewHolder, item: MySection<T>?, payloads: MutableList<Any>) |
| | | |
| | | // override fun convertHead(helper: BaseCustomViewHolder?, item: MySection<T>?) { |
| | | // convertListener?.onConvertHead(helper, item) |
| | | // } |
| | | // |
| | | // override fun convert(helper: BaseCustomViewHolder, item: MySection<T>?) { |
| | | // convertListener?.onConvert(helper, item) |
| | | // } |
| | | } |
| | | |
| | | class MySection<T> : AbstractExpandableItem<MySection<T>>, MultiItemEntity { |
| | | |
| | | var mItemType: Int = DEFAULT_ITEM_TYPE |
| | | var isHeader: Boolean = false |
| | | var t: T |
| | | var header: String? = null |
| | | var myLevel = 1 |
| | | |
| | | constructor (isHeader: Boolean, header: String?, t: T) { |
| | | this.isHeader = isHeader |
| | | this.header = header |
| | | this.myLevel = 1 |
| | | this.mItemType = BaseRecyclerAdapter.SECTION_HEADER_VIEW |
| | | this.t = t |
| | | } |
| | | |
| | | constructor(t: T, mItemType: Int = DEFAULT_ITEM_TYPE, level: Int = 1) { |
| | | this.mItemType = mItemType |
| | | this.t = t |
| | | this.myLevel = level |
| | | } |
| | | |
| | | companion object { |
| | | const val DEFAULT_ITEM_TYPE = -1 |
| | | /** |
| | | * å°æ®éçlist转å为SectionEntityå表 |
| | | */ |
| | | fun <T> convert2Section(list: List<T>?): ArrayList<MySection<T>> { |
| | | val resultList = ArrayList<MySection<T>>() |
| | | list?.forEach { |
| | | resultList.add(MySection(it)) |
| | | } |
| | | return resultList |
| | | } |
| | | |
| | | /** |
| | | * å°SectionEntityå表转å为æ®éçlist |
| | | */ |
| | | fun <T> convert2List(list: List<MySection<T>>?): List<T> { |
| | | val resultList = mutableListOf<T>() |
| | | list?.forEach { |
| | | resultList.add(it.t) |
| | | } |
| | | return resultList |
| | | } |
| | | } |
| | | |
| | | override fun getItemType(): Int = mItemType |
| | | |
| | | override fun getLevel(): Int = myLevel |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.view.recyclerview |
| | | |
| | | import cn.flightfeather.thirdapp.common.net.ResultCallBack |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2020/12/24 |
| | | * åè¡¨æ°æ®å è½½é»è¾æ¥å£ |
| | | */ |
| | | interface DataLoadInterface<T> : ResultCallBack<List<T>> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.view.recyclerview |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2019/4/10 |
| | | * ä¸ä¸æå è½½ç¶æ |
| | | */ |
| | | enum class LoadState { |
| | | Refresh, |
| | | LoadMore, |
| | | RefreshDone, |
| | | LoadMoreEnd, |
| | | LoadMoreComplete, |
| | | NONE, |
| | | RefreshFail, |
| | | LoadMoreFail |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | //package cn.flightfeather.thirdapp.view.recyclerview |
| | | // |
| | | //import android.annotation.SuppressLint |
| | | //import android.arch.lifecycle.LifecycleOwner |
| | | //import android.arch.lifecycle.Observer |
| | | //import android.content.Context |
| | | //import android.support.v4.content.ContextCompat |
| | | //import android.support.v4.widget.SwipeRefreshLayout |
| | | //import android.support.v7.widget.LinearLayoutManager |
| | | //import android.support.v7.widget.RecyclerView |
| | | //import android.view.LayoutInflater |
| | | //import android.view.View |
| | | //import com.chad.library.adapter.base.BaseQuickAdapter |
| | | //import com.chad.library.adapter.base.BaseViewHolder |
| | | // |
| | | ///** |
| | | // * RecyclerView模å |
| | | // * @author riku |
| | | // * Date: 2019/11/22 |
| | | // * reference layout is [R.layout.layout_recycler_view_refresh] |
| | | // */ |
| | | //abstract class RecyclerViewPanel<T>( |
| | | // private val viewModel: BaseViewModel<T>, |
| | | // private val lifecycleObserver: LifecycleOwner, |
| | | // private val rootView: View? = null |
| | | //) : RecyclerViewSetInterface<T>, SwipeRefreshLayoutSetInterface { |
| | | // |
| | | // constructor( |
| | | // viewModel: BaseViewModel<T>, |
| | | // lifecycleObserver: LifecycleOwner, |
| | | // recyclerView: RecyclerView, |
| | | // context: Context?, |
| | | // refreshLayout: SwipeRefreshLayout? = null |
| | | // ) : this(viewModel, lifecycleObserver) { |
| | | // context?.let { this.context = it } |
| | | // tempRecyclerView = recyclerView |
| | | // this.tempRefreshLayout = refreshLayout |
| | | // } |
| | | // |
| | | // private lateinit var context: Context |
| | | // private var tempRecyclerView: RecyclerView? = null |
| | | // private var tempRefreshLayout: SwipeRefreshLayout? = null |
| | | // |
| | | // override var adapter: BaseRecyclerAdapter<T>? = null |
| | | // |
| | | // private var mRecyclerView: RecyclerView? = null |
| | | // |
| | | // private var refreshLayout: SwipeRefreshLayout? = null |
| | | // |
| | | // init { |
| | | // if (rootView != null) { |
| | | // this@RecyclerViewPanel.context = rootView.context |
| | | // } |
| | | // } |
| | | // |
| | | // open fun init() { |
| | | // initViews() |
| | | // initList() |
| | | // initSwipeRefreshLayout() |
| | | // initObserver() |
| | | // } |
| | | // |
| | | // private fun initViews() { |
| | | // mRecyclerView = rootView?.findViewById(R.id.recycler_view) ?: tempRecyclerView |
| | | // refreshLayout = rootView?.findViewById(R.id.refresh_layout) ?: tempRefreshLayout |
| | | // } |
| | | // |
| | | // open fun initObserver() { |
| | | // viewModel.loading.observe(lifecycleObserver, Observer { |
| | | // refreshLoadingStatus(it) |
| | | // }) |
| | | // |
| | | // viewModel.dataList.observe(lifecycleObserver, Observer { dataList -> |
| | | // dataList?.let { |
| | | // if (viewModel.isFirstData()) { |
| | | // setNewData(it) |
| | | // } else { |
| | | // addData(it) |
| | | // } |
| | | // } |
| | | // }) |
| | | // |
| | | // viewModel.dataChanged.observe(lifecycleObserver, Observer { |
| | | // if (it == true) { |
| | | // adapter?.notifyDataSetChanged() |
| | | // } |
| | | // }) |
| | | // } |
| | | // |
| | | // override fun getRecyclerView(): RecyclerView? = |
| | | // mRecyclerView ?: rootView?.findViewById(R.id.recycler_view) ?: tempRecyclerView |
| | | // |
| | | // override fun onRefreshDone() = stopRefresh() |
| | | // override fun onRefreshFail() = stopRefresh() |
| | | // override fun onLoadMoreEnd() = Unit |
| | | // override fun onLoadMoreComplete() = Unit |
| | | // override fun onLoadMoreFail() = Unit |
| | | // override fun onRefreshNone() = stopRefresh() |
| | | // |
| | | // override fun getMyLayoutManager(): RecyclerView.LayoutManager = |
| | | // LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) |
| | | // |
| | | // override fun getItemLayoutIdMap(): Map<Int, Int> = emptyMap() |
| | | // |
| | | // override fun getSectionLayoutId(): Int = R.layout.recycler_item_section_head |
| | | // |
| | | // override fun getSectionDataList(): List<MySection<T>> = |
| | | // MySection.convert2Section(viewModel.dataList.value) |
| | | // |
| | | // override fun onItemClick( |
| | | // adapter: BaseQuickAdapter<Any?, BaseViewHolder>, |
| | | // view: View, |
| | | // position: Int, |
| | | // dataList: List<T> |
| | | // ) = Unit |
| | | // |
| | | // override fun onItemChildClick( |
| | | // adapter: BaseQuickAdapter<Any?, BaseViewHolder>, |
| | | // view: View, |
| | | // position: Int, |
| | | // dataList: List<T> |
| | | // ) = Unit |
| | | // |
| | | // override fun enableLoadMore(): Boolean = true |
| | | // |
| | | // override fun onLoadMoreStart() { |
| | | // if (getSwipeRefreshLayout()?.isRefreshing == true) { |
| | | // adapter?.loadMoreComplete() |
| | | // return |
| | | // } |
| | | // } |
| | | // |
| | | // override fun onLoadMoreRequested() = viewModel.loadMore() |
| | | // |
| | | // override fun enableUpFetch(): Boolean = false |
| | | // |
| | | // @SuppressLint("InflateParams") |
| | | // override fun getMyEmptyView(): View? = |
| | | // LayoutInflater.from(context).inflate(R.layout.layout_empty_view, null) |
| | | // |
| | | // @SuppressLint("InflateParams") |
| | | // override fun getMyLoadingView(): View? = LayoutInflater.from(context).inflate(R.layout.layout_loading_view, null) |
| | | // |
| | | // @SuppressLint("InflateParams") |
| | | // override fun getMyLoadFailView(): View? = LayoutInflater.from(context).inflate(R.layout.layout_load_fail_view, null) |
| | | // |
| | | // //******************************SwipeRefreshLayout************************************************************ |
| | | // |
| | | // override fun getSwipeRefreshLayout(): SwipeRefreshLayout? = |
| | | // refreshLayout ?: rootView?.findViewById(R.id.refresh_layout) ?: tempRefreshLayout |
| | | // |
| | | // override fun enableRefresh(): Boolean = true |
| | | // |
| | | // override fun needSwipeRefresh(): Boolean = true |
| | | // |
| | | // override fun onRefreshRequested() { |
| | | // //ç¬¬ä¸æ¹recyclerViewç䏿å è½½ç»æåï¼å¦æä¸æå·æ°æ§è¡ï¼ååºè¯¥éæ°æå¼çå¬ |
| | | // try { |
| | | // if (!adapter?.isLoadMoreEnable!!) { |
| | | // setLoadMore() |
| | | // } |
| | | // } catch (e: Exception) { |
| | | // e.printStackTrace() |
| | | // } |
| | | // viewModel.refresh() |
| | | // } |
| | | // |
| | | // override fun getColorList(): Array<Int> = arrayOf( |
| | | // ContextCompat.getColor(context, R.color.colorPrimary), |
| | | // ContextCompat.getColor(context, R.color.colorPrimaryDark), |
| | | // ContextCompat.getColor(context, R.color.colorAccent) |
| | | // ) |
| | | //} |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.view.recyclerview |
| | | |
| | | import android.support.v7.widget.RecyclerView |
| | | import android.view.View |
| | | import android.view.ViewGroup |
| | | import com.chad.library.adapter.base.BaseQuickAdapter |
| | | import com.chad.library.adapter.base.BaseViewHolder |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2019/5/17 |
| | | * recyclerView设置æ¥å£ |
| | | */ |
| | | interface RecyclerViewSetInterface<T> { |
| | | |
| | | var adapter: BaseRecyclerAdapter<T>? |
| | | |
| | | fun getRecyclerView(): RecyclerView? |
| | | |
| | | fun initList() { |
| | | val layoutIdMap = if (getItemLayoutId() == null) { |
| | | getItemLayoutIdMap() |
| | | } else { |
| | | mapOf(Pair(MySection.DEFAULT_ITEM_TYPE, getItemLayoutId()!!)) |
| | | } |
| | | adapter = object : |
| | | BaseRecyclerAdapter<T>(layoutIdMap, getSectionLayoutId(), getSectionDataList()) { |
| | | override fun convertHead(holder: BaseCustomViewHolder, item: MySection<T>?) { |
| | | onBindSectionView(holder, item) |
| | | } |
| | | |
| | | override fun convert(helper: BaseCustomViewHolder, item: MySection<T>?) { |
| | | onBindView(helper, item) |
| | | } |
| | | |
| | | override fun convertPartView(holder: BaseCustomViewHolder, item: MySection<T>?, payloads: MutableList<Any>) { |
| | | onBindPartView(holder, item, payloads) |
| | | } |
| | | }.apply { |
| | | getRecyclerView()?.let { bindToRecyclerView(it) } |
| | | //æ·»å header |
| | | getHeadViews().iterator().forEach { |
| | | addHeaderView(it) |
| | | } |
| | | //æ·»å footer |
| | | getFootViews(getRecyclerView()?.parent as ViewGroup).iterator().forEach { |
| | | addFooterView(it, 0) |
| | | } |
| | | //æ·»å itemç¹å»äºä»¶ |
| | | onItemClickListener = BaseQuickAdapter.OnItemClickListener { adapter, view, position -> |
| | | onItemClick(adapter, view, position, getAllDataList()) |
| | | } |
| | | onItemLongClickListener = BaseQuickAdapter.OnItemLongClickListener { adapter, view, position -> |
| | | onItemLongClick(adapter, view, position, getAllDataList()) |
| | | } |
| | | //æ·»å childItemç¹å»äºä»¶ |
| | | onItemChildClickListener = BaseQuickAdapter.OnItemChildClickListener { adapter, view, position -> |
| | | onItemChildClick(adapter, view, position, getAllDataList()) |
| | | } |
| | | onItemChildLongClickListener = BaseQuickAdapter.OnItemChildLongClickListener { adapter, view, position -> |
| | | onItemChildLongClick(adapter, view, position, getAllDataList()) |
| | | } |
| | | //æ·»å å¨ç» |
| | | openLoadAnimation(getLoadAnimationByDefault()) |
| | | //设置空å¸å± |
| | | getMyLoadingView()?.let { emptyView = it } |
| | | |
| | | // setLoadMoreView(SimpleLoadMoreView()) |
| | | } |
| | | //å è½½æ´å¤ |
| | | setLoadMore() |
| | | //䏿è·å |
| | | setUpFetch() |
| | | |
| | | getRecyclerView()?.apply { |
| | | layoutManager = getMyLayoutManager() |
| | | getDivider()?.let { addItemDecoration(it) } |
| | | }?.adapter = adapter |
| | | } |
| | | |
| | | fun setLoadMore() { |
| | | if (enableLoadMore()) { |
| | | adapter?.apply { |
| | | setOnLoadMoreListener((BaseQuickAdapter.RequestLoadMoreListener { |
| | | onLoadMoreStart() |
| | | onLoadMoreRequested() |
| | | }), getRecyclerView()) |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun setUpFetch() { |
| | | if (enableUpFetch()) { |
| | | adapter?.apply { |
| | | isUpFetchEnable = true |
| | | setStartUpFetchPosition(0) |
| | | setUpFetchListener { |
| | | isUpFetching = true |
| | | onUpFetchRequested(this, getRecyclerView()) |
| | | if (!isLoadMoreEnable) { |
| | | setLoadMore() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun getAllDataList(): List<T> { |
| | | val list = adapter?.data as List<MySection<T>> |
| | | val datas = mutableListOf<T>() |
| | | list.forEach { |
| | | datas.add(it.t) |
| | | } |
| | | return datas |
| | | } |
| | | |
| | | /** |
| | | * å°åè¡¨æ°æ®æ¿æ¢ææ°çæ°æ® |
| | | */ |
| | | fun setNewData(dataList: ArrayList<T>) { |
| | | val resultList = convertToSection(dataList) |
| | | addSection(resultList) |
| | | adapter?.setNewData(resultList) |
| | | onDataUpdated(adapter) |
| | | } |
| | | |
| | | /** |
| | | * å¨åæ°æ®åºç¡ä¸æ·»å æ°æ°æ® |
| | | */ |
| | | fun addData(dataList: ArrayList<T>) { |
| | | val resultList = convertToSection(dataList) |
| | | addSection(resultList) |
| | | adapter?.addData(resultList) |
| | | onDataUpdated(adapter) |
| | | } |
| | | |
| | | fun addData(pos: Int, dataList: ArrayList<T>){ |
| | | val resultList = convertToSection(dataList) |
| | | addSection(resultList) |
| | | adapter?.addData(pos, resultList) |
| | | onDataUpdated(adapter, pos) |
| | | } |
| | | |
| | | /** |
| | | * æç
§æ°æ®ç¶æå·æ°çé¢ |
| | | */ |
| | | fun refreshLoadingStatus(state: LoadState?) { |
| | | when (state) { |
| | | LoadState.RefreshDone -> { |
| | | onRefreshDone() |
| | | getMyEmptyView()?.let { adapter?.emptyView = it } |
| | | } |
| | | LoadState.LoadMoreEnd -> { |
| | | onLoadMoreEnd() |
| | | adapter?.loadMoreEnd(getLoadMoreEndGone()) |
| | | getMyEmptyView()?.let { adapter?.emptyView = it } |
| | | } |
| | | LoadState.LoadMoreComplete -> { |
| | | onLoadMoreComplete() |
| | | adapter?.loadMoreComplete() |
| | | getMyEmptyView()?.let { adapter?.emptyView = it } |
| | | } |
| | | LoadState.NONE -> { |
| | | onRefreshNone() |
| | | adapter?.loadMoreEnd(getLoadMoreEndGone()) |
| | | getMyLoadingView()?.let { adapter?.emptyView = it } |
| | | } |
| | | LoadState.RefreshFail -> { |
| | | onRefreshFail() |
| | | getMyLoadFailView()?.let { adapter?.emptyView = it } |
| | | } |
| | | LoadState.LoadMoreFail -> { |
| | | onLoadMoreFail() |
| | | adapter?.loadMoreFail() |
| | | getMyLoadFailView()?.let { adapter?.emptyView = it } |
| | | } |
| | | else -> onRefreshNone() |
| | | } |
| | | } |
| | | |
| | | fun onRefreshDone() |
| | | fun onRefreshFail() |
| | | fun onLoadMoreEnd() |
| | | fun onLoadMoreComplete() |
| | | fun onLoadMoreFail() |
| | | fun onRefreshNone() |
| | | |
| | | fun getMyLayoutManager(): RecyclerView.LayoutManager |
| | | |
| | | //è·åå表çitemViewçID |
| | | fun getItemLayoutId(): Int? |
| | | |
| | | //è·åå表çitemViewçID, æ ¹æ®èªå®ä¹çitemTypeåç±»ï¼å®ç°åæ¶å±ç¤ºå¤ç§itemæ ·å¼ |
| | | fun getItemLayoutIdMap(): Map<Int, Int> |
| | | |
| | | //è·ååç»å¤´é¨viewçID |
| | | fun getSectionLayoutId(): Int |
| | | |
| | | //èªå®ä¹æ¯å¦éè¦æ·»å å表åç» |
| | | fun addSection(dataList: ArrayList<MySection<T>>) = Unit |
| | | |
| | | //å°æ°æ®è½¬æ¢ä¸ºåè¡¨è½æ¥åçåºå®ç»æ |
| | | fun convertToSection(list: ArrayList<T>): ArrayList<MySection<T>> = MySection.convert2Section(list) |
| | | |
| | | //æ°æ®æ´æ°ç»æ |
| | | fun onDataUpdated(adapter: BaseRecyclerAdapter<T>?, pos: Int? = null) = Unit |
| | | |
| | | //è·åéé
卿°æ®ç»æå表 |
| | | fun getSectionDataList(): List<MySection<T>> |
| | | |
| | | //è·åheaderçviewç»å®æ¹æ³ |
| | | fun onBindSectionView(holder: BaseCustomViewHolder?, item: MySection<T>?) = Unit |
| | | |
| | | //è·åå表itemä¸çviewç»å®æ¹æ³ |
| | | fun onBindView(holder: BaseCustomViewHolder, item: MySection<T>?) |
| | | |
| | | fun onBindPartView(holder: BaseCustomViewHolder, item: MySection<T>?, payloads: MutableList<Any>)= Unit |
| | | |
| | | //è·åheadView |
| | | fun getHeadViews(): Array<View> = emptyArray() |
| | | |
| | | //è·åfootView |
| | | fun getFootViews(viewGroup: ViewGroup): Array<View> = emptyArray() |
| | | |
| | | //itemç¹å»äºä»¶ |
| | | fun onItemClick(adapter: BaseQuickAdapter<Any?, BaseViewHolder>, view: View, position: Int, dataList: List<T>) |
| | | |
| | | //itemé¿ç¹å»äºä»¶ |
| | | fun onItemLongClick(adapter: BaseQuickAdapter<Any?, BaseViewHolder>, view: View, position: Int, dataList: List<T>) = |
| | | true |
| | | |
| | | //childItemç¹å»äºä»¶ |
| | | fun onItemChildClick(adapter: BaseQuickAdapter<Any?, BaseViewHolder>, view: View, position: Int, dataList: List<T>) |
| | | |
| | | //childItemé¿ç¹å»äºä»¶ |
| | | fun onItemChildLongClick(adapter: BaseQuickAdapter<Any?, BaseViewHolder>, view: View, position: Int, dataList: List<T>):Boolean = true |
| | | |
| | | //å
¥åºå¨ç» |
| | | fun getLoadAnimationByDefault(): Int = BaseQuickAdapter.ALPHAIN |
| | | |
| | | //<editor-fold desc="å è½½æ´å¤"> |
| | | fun enableLoadMore(): Boolean |
| | | |
| | | fun onLoadMoreStart() |
| | | |
| | | fun onLoadMoreRequested() |
| | | //</editor-fold> |
| | | |
| | | //<editor-fold desc="䏿è·å"> |
| | | fun enableUpFetch(): Boolean |
| | | |
| | | fun onUpFetchRequested(adapter: BaseRecyclerAdapter<T>, recyclerView: RecyclerView?) = Unit |
| | | //</editor-fold> |
| | | |
| | | fun getMyLoadingView(): View? = null |
| | | |
| | | //è·å空å¸å± |
| | | fun getMyEmptyView(): View? |
| | | |
| | | //è·å空å¸å± |
| | | fun getMyLoadFailView(): View? = null |
| | | |
| | | //åå²çº¿ |
| | | fun getDivider(): RecyclerView.ItemDecoration? = null |
| | | |
| | | //å è½½å®æå, å è½½ç颿¯å¦æ¶å¤± |
| | | fun getLoadMoreEndGone(): Boolean = false |
| | | |
| | | } |
| | | |
| | | /** |
| | | * æ©å±remove æ¹æ³, å¯ä»¥æ ¹æ®ä¼ å
¥çç¼å·å表éä¸ªå®æå é¤å¨ç» |
| | | */ |
| | | fun <T> BaseRecyclerAdapter<T>.remove(posList: List<Int>) { |
| | | val tempPosList = posList.sortedBy { it } |
| | | for (i in tempPosList.indices) { |
| | | this.remove((tempPosList[i] - i)) |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package cn.flightfeather.thirdapp.view.recyclerview |
| | | |
| | | import android.support.v4.widget.SwipeRefreshLayout |
| | | |
| | | /** |
| | | * @author riku |
| | | * Date: 2019/5/17 |
| | | */ |
| | | interface SwipeRefreshLayoutSetInterface { |
| | | |
| | | fun initSwipeRefreshLayout(){ |
| | | //䏿巿° |
| | | getSwipeRefreshLayout()?.let { |
| | | it.isEnabled = needSwipeRefresh() |
| | | if (getColorList().size == 3) { |
| | | it.setColorSchemeColors(getColorList()[0], getColorList()[1], getColorList()[2]) |
| | | } |
| | | it.setOnRefreshListener { |
| | | onRefreshRequested() |
| | | it.postDelayed({ |
| | | it.isRefreshing = false |
| | | }, 10000) |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun startRefresh(){ |
| | | if (enableRefresh()) { |
| | | onRefreshRequested() |
| | | if (needSwipeRefresh()) { |
| | | getSwipeRefreshLayout()?.let { |
| | | it.isRefreshing = true |
| | | it.postDelayed({ |
| | | it.isRefreshing = false |
| | | }, 10000) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun stopRefresh(){ |
| | | if (enableRefresh()) { |
| | | if (getSwipeRefreshLayout()?.isRefreshing == true) { |
| | | getSwipeRefreshLayout()?.isRefreshing = false |
| | | } |
| | | } |
| | | } |
| | | |
| | | fun getSwipeRefreshLayout(): SwipeRefreshLayout? |
| | | |
| | | //æ¯å¦å
许é»è®¤ç¬¬ä¸æ¬¡èªå¨å·æ° |
| | | fun enableRefresh(): Boolean |
| | | |
| | | //å¯ç¨layoutå¨ç»ææç䏿巿°,è½å¤æå¨å·æ° |
| | | fun needSwipeRefresh():Boolean |
| | | |
| | | fun onRefreshRequested() |
| | | |
| | | fun getColorList(): Array<Int> |
| | | |
| | | } |
| | |
| | | * Can be used for QueryBuilder and for referencing column names. |
| | | */ |
| | | public static class Properties { |
| | | public final static Property Id = new Property(0, long.class, "id", true, "_id"); |
| | | public final static Property Id = new Property(0, Long.class, "id", true, "_id"); |
| | | public final static Property SceneTypeId = new Property(1, int.class, "sceneTypeId", false, "SCENE_TYPE_ID"); |
| | | public final static Property TypeId = new Property(2, int.class, "typeId", false, "TYPE_ID"); |
| | | public final static Property TypeName = new Property(3, String.class, "typeName", false, "TYPE_NAME"); |
| | |
| | | public static void createTable(Database db, boolean ifNotExists) { |
| | | String constraint = ifNotExists? "IF NOT EXISTS ": ""; |
| | | db.execSQL("CREATE TABLE " + constraint + "\"MEDIA_TYPE_ALIAS\" (" + // |
| | | "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ," + // 0: id |
| | | "\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ," + // 0: id |
| | | "\"SCENE_TYPE_ID\" INTEGER NOT NULL ," + // 1: sceneTypeId |
| | | "\"TYPE_ID\" INTEGER NOT NULL ," + // 2: typeId |
| | | "\"TYPE_NAME\" TEXT," + // 3: typeName |
| | |
| | | @Override |
| | | protected final void bindValues(DatabaseStatement stmt, MediaTypeAlias entity) { |
| | | stmt.clearBindings(); |
| | | stmt.bindLong(1, entity.getId()); |
| | | |
| | | Long id = entity.getId(); |
| | | if (id != null) { |
| | | stmt.bindLong(1, id); |
| | | } |
| | | stmt.bindLong(2, entity.getSceneTypeId()); |
| | | stmt.bindLong(3, entity.getTypeId()); |
| | | |
| | |
| | | @Override |
| | | protected final void bindValues(SQLiteStatement stmt, MediaTypeAlias entity) { |
| | | stmt.clearBindings(); |
| | | stmt.bindLong(1, entity.getId()); |
| | | |
| | | Long id = entity.getId(); |
| | | if (id != null) { |
| | | stmt.bindLong(1, id); |
| | | } |
| | | stmt.bindLong(2, entity.getSceneTypeId()); |
| | | stmt.bindLong(3, entity.getTypeId()); |
| | | |
| | |
| | | |
| | | @Override |
| | | public Long readKey(Cursor cursor, int offset) { |
| | | return cursor.getLong(offset + 0); |
| | | return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); |
| | | } |
| | | |
| | | @Override |
| | | public MediaTypeAlias readEntity(Cursor cursor, int offset) { |
| | | MediaTypeAlias entity = new MediaTypeAlias( // |
| | | cursor.getLong(offset + 0), // id |
| | | cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id |
| | | cursor.getInt(offset + 1), // sceneTypeId |
| | | cursor.getInt(offset + 2), // typeId |
| | | cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3), // typeName |
| | |
| | | |
| | | @Override |
| | | public void readEntity(Cursor cursor, MediaTypeAlias entity, int offset) { |
| | | entity.setId(cursor.getLong(offset + 0)); |
| | | entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); |
| | | entity.setSceneTypeId(cursor.getInt(offset + 1)); |
| | | entity.setTypeId(cursor.getInt(offset + 2)); |
| | | entity.setTypeName(cursor.isNull(offset + 3) ? null : cursor.getString(offset + 3)); |
| | |
| | | |
| | | @Override |
| | | public boolean hasKey(MediaTypeAlias entity) { |
| | | throw new UnsupportedOperationException("Unsupported for entities with a non-null key"); |
| | | return entity.getId() != null; |
| | | } |
| | | |
| | | @Override |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <layer-list xmlns:tools="http://schemas.android.com/tools" |
| | | xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <item> |
| | | <shape android:shape="rectangle"> |
| | | <gradient |
| | | android:angle="-90" |
| | | android:startColor="#FDAC43" |
| | | android:centerColor="#FECD8B" |
| | | android:endColor="@color/white"/> |
| | | </shape> |
| | | </item> |
| | | <item android:bottom="46dp" |
| | | android:end="46dp"> |
| | | <shape android:shape="oval" |
| | | android:tint="#FECD8B"> |
| | | </shape> |
| | | </item> |
| | | |
| | | </layer-list> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:background="@color/white"> |
| | | |
| | | <include layout="@layout/layout_toolbar_2" /> |
| | | |
| | | <android.support.v4.widget.NestedScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | <android.support.constraint.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | <TextView |
| | | android:id="@+id/txt_title" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dimen16" |
| | | android:layout_marginStart="@dimen/dimen16" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textColor="@color/main_color_1" |
| | | android:textStyle="bold" |
| | | android:textSize="@dimen/textSize_18" |
| | | android:text="ææ°æä»¶"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_more" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="@dimen/dimen16" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="@id/txt_title" |
| | | android:text="æ´å¤"/> |
| | | |
| | | <android.support.v7.widget.RecyclerView |
| | | android:id="@+id/recycler_view" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | tools:listitem="@layout/item_night_work" |
| | | tools:itemCount="2" |
| | | app:layoutManager="android.support.v7.widget.LinearLayoutManager" |
| | | android:orientation="horizontal" |
| | | android:layout_marginStart="@dimen/dimen16" |
| | | android:layout_marginTop="@dimen/dimen16" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_title"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_history" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="@dimen/dimen16" |
| | | android:layout_marginTop="@dimen/dimen16" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/recycler_view" |
| | | android:textColor="@color/main_color_1" |
| | | android:textStyle="bold" |
| | | android:textSize="@dimen/textSize_18" |
| | | android:text="å岿件"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_more_2" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="@dimen/dimen16" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="@id/txt_history" |
| | | android:text="æ´å¤"/> |
| | | |
| | | <android.support.v7.widget.RecyclerView |
| | | android:id="@+id/recycler_view_2" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="@dimen/dimen16" |
| | | android:layout_marginStart="@dimen/dimen16" |
| | | android:layout_marginEnd="@dimen/dimen16" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_history" |
| | | tools:listitem="@layout/item_night_work_2" |
| | | tools:itemCount="6" |
| | | app:layoutManager="android.support.v7.widget.LinearLayoutManager" |
| | | android:orientation="vertical"/> |
| | | </android.support.constraint.ConstraintLayout> |
| | | </android.support.v4.widget.NestedScrollView> |
| | | |
| | | </LinearLayout> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <android.support.design.card.MaterialCardView |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | android:orientation="horizontal" |
| | | android:layout_width="220dp" |
| | | android:layout_height="wrap_content" |
| | | app:cardCornerRadius="@dimen/dimen16" |
| | | app:cardBackgroundColor="@color/white" |
| | | android:layout_marginEnd="@dimen/dimen16" |
| | | android:layout_marginBottom="@dimen/dimen4"> |
| | | |
| | | <android.support.constraint.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/transparent" |
| | | android:padding="@dimen/dimen16" |
| | | android:elevation="@dimen/dimen2" |
| | | tools:ignore="UnusedAttribute"> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category" |
| | | android:text="æä»¶ç¼å·" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_night_work_num" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | tools:text="å¤é´è®¸å¯è¯ç¼å·" |
| | | style="@style/TextStyle.Category.Item" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_1"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_2" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category" |
| | | android:text="æ½å·¥å
容" |
| | | android:layout_marginTop="@dimen/dimen16" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_night_work_num"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_content" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category.Item" |
| | | tools:text="æ½å·¥å
容" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_2"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_3" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category" |
| | | android:text="æ½å·¥æ¶é´" |
| | | android:layout_marginTop="@dimen/dimen16" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_content"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_time" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category.Item" |
| | | tools:text="2020.12.01-12.03" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_3"/> |
| | | |
| | | </android.support.constraint.ConstraintLayout> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="160dp" |
| | | android:src="@mipmap/ic_file" |
| | | android:layout_gravity="bottom|end" |
| | | android:layout_marginTop="150dp" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_time" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent"/> |
| | | |
| | | </android.support.design.card.MaterialCardView> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <android.support.constraint.ConstraintLayout |
| | | xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | android:orientation="horizontal" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:paddingTop="@dimen/dimen8" |
| | | android:paddingBottom="@dimen/dimen8"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/img_icon" |
| | | android:layout_width="46dp" |
| | | android:layout_height="46dp" |
| | | android:src="@drawable/button_bg_enable_2" |
| | | android:tint="#1C1E33" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category" |
| | | android:textColor="@color/main_color_1" |
| | | android:text="æ½å·¥å
容" |
| | | android:visibility="gone" |
| | | android:layout_marginStart="@dimen/dimen16" |
| | | app:layout_constraintStart_toEndOf="@id/img_icon" |
| | | app:layout_constraintTop_toTopOf="parent"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_time" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category.Item" |
| | | android:textColor="@color/main_color_1" |
| | | tools:text="æ½å·¥å
容" |
| | | android:layout_marginStart="@dimen/dimen16" |
| | | app:layout_constraintStart_toEndOf="@id/img_icon" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_1"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_2" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category" |
| | | android:textColor="@color/main_color_1" |
| | | android:text="æ½å·¥æ¶é´" |
| | | android:visibility="gone" |
| | | android:layout_marginTop="@dimen/dimen16" |
| | | app:layout_constraintStart_toStartOf="@id/txt_time" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_time"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/txt_content" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | style="@style/TextStyle.Category" |
| | | android:textColor="@color/main_color_1" |
| | | tools:text="2020.12.01-12.03" |
| | | app:layout_constraintStart_toStartOf="@id/txt_time" |
| | | app:layout_constraintTop_toBottomOf="@id/txt_2" |
| | | app:layout_constraintBottom_toBottomOf="@id/img_icon" |
| | | app:layout_constraintVertical_bias="1"/> |
| | | |
| | | |
| | | </android.support.constraint.ConstraintLayout> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="@dimen/actionbarHeight" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | android:id="@+id/toolbar" |
| | | app:contentInsetStart="0dp" |
| | | android:background="@color/transparent"> |
| | | |
| | | <android.support.constraint.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:visibility="visible"> |
| | | <ImageView |
| | | android:id="@+id/img_back" |
| | | android:layout_width="40dp" |
| | | android:layout_height="40dp" |
| | | android:padding="@dimen/dimen8" |
| | | android:src="@drawable/ic_menu_back" |
| | | android:tint="#1C1E33" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent"/> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_main_title" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:textColor="#1C1E33" |
| | | style="@style/ToolbarTitleStyle" |
| | | tools:text="æ é¢"/> |
| | | |
| | | |
| | | </android.support.constraint.ConstraintLayout> |
| | | |
| | | </android.support.v7.widget.Toolbar> |
| | |
| | | |
| | | <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> |
| | | |
| | | <!--æ 颿 æ é¢æåæ ·å¼--> |
| | | <style name="ToolbarTitleStyle"> |
| | | <item name="android:textColor">@color/white</item> |
| | | <item name="android:textSize">16sp</item> |
| | | <item name="android:maxLines">1</item> |
| | | <item name="android:ellipsize">end</item> |
| | | <item name="layout_constrainedWidth">true</item> |
| | | <item name="layout_constraintWidth_percent">0.8</item> |
| | | <item name="android:gravity">center</item> |
| | | </style> |
| | | |
| | | <!--设置--> |
| | | <style name="settingItemStyle"> |
| | | <item name="item_text_size">5sp</item> |
| | |
| | | <item name="android:windowEnterAnimation">@anim/bottom_menu_enter</item> |
| | | <item name="android:windowExitAnimation">@anim/bottom_menu_exit</item> |
| | | </style> |
| | | |
| | | <style name="TextStyle.Category"> |
| | | <item name="android:textSize">@dimen/textSize_notes</item> |
| | | <item name="android:textColor">@color/main_color_3</item> |
| | | </style> |
| | | |
| | | <style name="TextStyle.Category.Item"> |
| | | <item name="android:textSize">@dimen/textSize_16</item> |
| | | <item name="android:textStyle">bold</item> |
| | | <item name="android:textColor">@color/main_color_1</item> |
| | | </style> |
| | | </resources> |
| | |
| | | ext.event_bus = '3.1.1' |
| | | ext.image_picker_version = '2.2.7' |
| | | ext.glide_version = '4.9.0' |
| | | ext.adaper_version = '2.9.46' |
| | | |
| | | repositories { |
| | | jcenter() |