Commit cea99ce9 authored by jyx's avatar jyx

代码优化

parent f5a06f34
...@@ -43,10 +43,7 @@ import com.mints.goodmoney.ui.widgets.ShareDialog ...@@ -43,10 +43,7 @@ import com.mints.goodmoney.ui.widgets.ShareDialog
import com.mints.goodmoney.ui.widgets.dialog.DialogListener import com.mints.goodmoney.ui.widgets.dialog.DialogListener
import com.mints.goodmoney.ui.widgets.dialog.DialogUtils import com.mints.goodmoney.ui.widgets.dialog.DialogUtils
import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils import com.mints.goodmoney.ui.widgets.seekbar.BubbleUtils
import com.mints.goodmoney.utils.AppUtil import com.mints.goodmoney.utils.*
import com.mints.goodmoney.utils.LogUtil
import com.mints.goodmoney.utils.QQJumpUtil
import com.mints.goodmoney.utils.SpanUtils
import com.mints.library.net.netstatus.NetUtils import com.mints.library.net.netstatus.NetUtils
import com.mints.library.utils.CommonUtils import com.mints.library.utils.CommonUtils
import com.mints.library.utils.GlideUtils import com.mints.library.utils.GlideUtils
...@@ -231,6 +228,7 @@ class MyFragment : BaseFragment(), ...@@ -231,6 +228,7 @@ class MyFragment : BaseFragment(),
vp_grid.visibility = View.VISIBLE vp_grid.visibility = View.VISIBLE
hotList.clear() hotList.clear()
hotList.addAll(it.list) hotList.addAll(it.list)
generateGridData(hotList) generateGridData(hotList)
} }
} }
...@@ -251,9 +249,16 @@ class MyFragment : BaseFragment(), ...@@ -251,9 +249,16 @@ class MyFragment : BaseFragment(),
gridView.onItemClickListener = this gridView.onItemClickListener = this
} }
if (pageCount <= 1) {
piv_grid.visibility = View.GONE
} else {
piv_grid.visibility = View.VISIBLE
piv_grid.count = pageCount
}
mCurrentIndex = 0 mCurrentIndex = 0
piv_grid.count = pageCount
vp_grid.adapter = ViewPagerAdapter(pagerList) vp_grid.adapter = ViewPagerAdapter(pagerList)
vp_grid.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { vp_grid.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) { override fun onPageScrollStateChanged(state: Int) {
...@@ -1389,13 +1394,22 @@ class MyFragment : BaseFragment(), ...@@ -1389,13 +1394,22 @@ class MyFragment : BaseFragment(),
*/ */
fun turnDayTask() { fun turnDayTask() {
if (signCardBean != null) { if (signCardBean != null) {
scrollviewMy.scrollTo(0, llMyRoot.height - viewTitleDayTask.height) scrollviewMy.scrollTo(0, llMyRoot.height -
viewTitleDayTask.height)
return return
} }
Timer().schedule(800) { Timer().schedule(800) {
activity?.runOnUiThread { activity?.runOnUiThread {
scrollviewMy.scrollTo(0, llMyRoot.height - viewTitleDayTask.height) // scrollviewMy.scrollTo(0, llMyRoot.height - viewTitleDayTask.height)
scrollviewMy.scrollTo(0, llMyRoot.height -
recy_my.height -
item_customer_service.height -
item_bottom_qqGroupNum.height -
item_bottom_info.height -
viewTitleDayTask.height -
Utils.dip2px(context,40f)
)
} }
} }
} }
...@@ -1411,7 +1425,7 @@ class MyFragment : BaseFragment(), ...@@ -1411,7 +1425,7 @@ class MyFragment : BaseFragment(),
} }
} }
fun gotoMoku() { private fun gotoMoku() {
RxPermissions(requireActivity()) RxPermissions(requireActivity())
.request(Manifest.permission.READ_PHONE_STATE, .request(Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_EXTERNAL_STORAGE) Manifest.permission.READ_EXTERNAL_STORAGE)
......
...@@ -237,8 +237,6 @@ class TaskCpdFragment : BaseFragment(), TaskView, ...@@ -237,8 +237,6 @@ class TaskCpdFragment : BaseFragment(), TaskView,
tzTaskBean.app_url = material.app_url tzTaskBean.app_url = material.app_url
tzTaskBean.trackerBean = material.tracker tzTaskBean.trackerBean = material.tracker
mFakeTaskList.add(tzTaskBean) mFakeTaskList.add(tzTaskBean)
LogUtil.d(tzTaskBean.title)
} }
// 圣于地广告 循环完成后去重 // 圣于地广告 循环完成后去重
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
android:layout_marginBottom="10dp" /> android:layout_marginBottom="10dp" />
<TextView <TextView
android:id="@+id/item_bottom_info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:visibility="gone"
app:piv_count="2" app:piv_count="2"
app:piv_dynamicCount="false"
app:piv_selectedColor="@color/color_FF9837" app:piv_selectedColor="@color/color_FF9837"
app:piv_unselectedColor="@color/color_20000000" app:piv_unselectedColor="@color/color_20000000"
app:piv_viewPager="@id/vp_grid" app:piv_viewPager="@id/vp_grid"
attrs:piv_padding="0dp" attrs:piv_padding="2dp"
attrs:piv_radius="2dp" /> attrs:piv_radius="4dp" />
</merge> </merge>
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ll_my_login" android:id="@+id/ll_my_login"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_marginLeft="15dp" android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp" android:layout_marginTop="15dp"
android:layout_marginBottom="15dp" android:layout_marginBottom="15dp">
android:layout_height="wrap_content">
<com.mints.goodmoney.ui.widgets.CircleImageView <com.mints.goodmoney.ui.widgets.CircleImageView
android:id="@+id/item_title_avatar" android:id="@+id/item_title_avatar"
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="50dp" android:layout_height="50dp"
android:background="@drawable/btn_my_friends"
android:paddingLeft="16dp" android:paddingLeft="16dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:background="@drawable/btn_my_friends"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"> app:layout_constraintTop_toTopOf="parent">
...@@ -48,18 +48,19 @@ ...@@ -48,18 +48,19 @@
android:id="@+id/item_title_friends" android:id="@+id/item_title_friends"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:drawableTop="@mipmap/ic_friends" android:drawableTop="@mipmap/ic_friends"
android:text="平台分红" android:text="平台分红"
android:textStyle="bold"
android:layout_centerVertical="true"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp" /> android:textSize="14sp"
android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:id="@+id/cl_coin"
android:layout_height="90dp" android:layout_height="90dp"
android:layout_marginStart="15dp" android:layout_marginStart="15dp"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
......
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