diff --git a/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt b/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt index c79e9c2..7b11fc5 100644 --- a/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt +++ b/app/src/main/java/com/xjjk/healthyclients/retrofit/UrlConfig.kt @@ -37,10 +37,10 @@ object UrlConfig { private const val PRODUCT_HOME_BANK_IP = "https://api-jkglpt.iosp.ydpt.tech/" - val baseUrlType: BaseUrlType = BaseUrlType.PRODUCT + val baseUrlType: BaseUrlType = BaseUrlType.TEST -// const val middle = "xj_health/" //test - const val middle = "hb/" //product + const val middle = "xj_health/" //test +// const val middle = "hb/" //product var isOpenIm: Boolean = true diff --git a/app/src/main/java/com/xjjk/healthyclients/view/HomeWatchView.kt b/app/src/main/java/com/xjjk/healthyclients/view/HomeWatchView.kt index e095135..2dd1ac9 100644 --- a/app/src/main/java/com/xjjk/healthyclients/view/HomeWatchView.kt +++ b/app/src/main/java/com/xjjk/healthyclients/view/HomeWatchView.kt @@ -12,7 +12,6 @@ import androidx.databinding.DataBindingUtil import androidx.fragment.app.Fragment import com.sw.healthyclients.adapter.common.ViewPagerAdapter import com.sw.healthyclients.bean.common.TabItemBean -import com.sw.healthyclients.data.local.DataStoreManager import com.xjjk.healthyclients.R import com.xjjk.healthyclients.bean.home.HomeWatchAllDataBean import com.xjjk.healthyclients.bean.home.WatchInfoBean @@ -20,7 +19,6 @@ import com.xjjk.healthyclients.databinding.LayoutHomeItemWatchBinding import com.xjjk.healthyclients.event.WatchDataChangeEvent import com.xjjk.healthyclients.fragment.WatchItemFragment import com.xjjk.healthyclients.superfuntion.init -import com.xjjk.healthyclients.superfuntion.onCreateTab import org.greenrobot.eventbus.EventBus class HomeWatchView(context: Context?, attrs: AttributeSet?) : @@ -32,6 +30,8 @@ class HomeWatchView(context: Context?, attrs: AttributeSet?) : private const val AUTO_PLAY_INTERVAL = 5000L } private var hasWatch: Boolean = false +// private var tabIndex: Int? = 0 + var mContext: Context? = context var mBinding: LayoutHomeItemWatchBinding = DataBindingUtil.inflate( @@ -60,28 +60,29 @@ class HomeWatchView(context: Context?, attrs: AttributeSet?) : fun init(fragment: Fragment) { - val arrayOf = arrayOf("心脑血管", "癌症", "慢呼", "糖尿病", "亚健康") - mBinding.watchTabLayout.onCreateTab(arrayOf, 1) { tab -> - if (tab?.position != 0) { - mBinding.emptyText.visibility = View.VISIBLE - mBinding.emptyText.text = "紧急开发中" - mBinding.viewPager.visibility = View.GONE - mBinding.layoutNoWatch.visibility = View.GONE - stopAutoPlay() - } else { - if (!DataStoreManager.isLogin()) { - showLoginEmpty() - } else if (hasWatch) { - mBinding.viewPager.visibility = View.VISIBLE - mBinding.emptyText.visibility = View.GONE - mBinding.layoutNoWatch.visibility = View.GONE - startAutoPlay() - } else { - showNoWatchPlaceholder() - } - } - - } +// val arrayOf = arrayOf("心脑血管", "癌症", "慢呼", "糖尿病", "亚健康") +// mBinding.watchTabLayout.onCreateTab(arrayOf, 1) { tab -> +// tabIndex =tab?.position +// if (tab?.position != 0) { +// mBinding.emptyText.visibility = View.VISIBLE +// mBinding.emptyText.text = "紧急开发中" +// mBinding.viewPager.visibility = View.GONE +// mBinding.layoutNoWatch.visibility = View.GONE +// stopAutoPlay() +// } else { +// if (!DataStoreManager.isLogin()) { +// showLoginEmpty() +// } else if (hasWatch) { +// mBinding.viewPager.visibility = View.VISIBLE +// mBinding.emptyText.visibility = View.GONE +// mBinding.layoutNoWatch.visibility = View.GONE +// startAutoPlay() +// } else { +// showNoWatchPlaceholder() +// } +// } +// +// } val tabList: MutableList = mutableListOf() (0..4).forEach { _ -> @@ -109,6 +110,9 @@ class HomeWatchView(context: Context?, attrs: AttributeSet?) : } fun setWatchInfo(watchInfo: WatchInfoBean?) { +// if (tabIndex != 0) { +// return +// } if (watchInfo?.hasWatch == true) { hasWatch = true mBinding.viewPager.visibility = View.VISIBLE diff --git a/app/src/main/res/layout/dialog_bind_watch.xml b/app/src/main/res/layout/dialog_bind_watch.xml index 198df12..18e7a3a 100644 --- a/app/src/main/res/layout/dialog_bind_watch.xml +++ b/app/src/main/res/layout/dialog_bind_watch.xml @@ -18,89 +18,130 @@ android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginTop="@dimen/dp_20" - android:text="健康监测" + android:text="健康监测工具绑定" android:textColor="@color/text_black_33" android:textSize="@dimen/txt16" android:textStyle="bold" /> - + + + + + + + - + + + + + + + + - + + + + + + + + + - - + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + android:layout_height="wrap_content" + android:layout_below="@+id/tv_title" + android:layout_marginTop="10dp"> + + + + - - - - - - + android:textSize="15sp" /> - + + + + + + + + + android:textColorHint="#B6B6B6" + android:textSize="16sp" /> diff --git a/app/src/main/res/layout/layout_home_item_watch.xml b/app/src/main/res/layout/layout_home_item_watch.xml index ac71649..840bdfb 100644 --- a/app/src/main/res/layout/layout_home_item_watch.xml +++ b/app/src/main/res/layout/layout_home_item_watch.xml @@ -63,20 +63,20 @@ app:shapeCornersBottomLeftRadius="12dp" app:shapeSolidColor="@color/white"> - + + + + + + + + + + + + + + - - - - + android:orientation="vertical">