Commit b34a0be1 authored by 周文华's avatar 周文华

【调整】调整创建fg样式与显示布局

parent 53196574
...@@ -10,6 +10,7 @@ import android.view.View ...@@ -10,6 +10,7 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.animation.LinearInterpolator import android.view.animation.LinearInterpolator
import androidx.core.animation.doOnEnd import androidx.core.animation.doOnEnd
import androidx.core.view.updatePadding
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
...@@ -17,6 +18,8 @@ import com.base.scanqrclear.R ...@@ -17,6 +18,8 @@ import com.base.scanqrclear.R
import com.base.scanqrclear.databinding.FragmentHomeBinding import com.base.scanqrclear.databinding.FragmentHomeBinding
import com.base.scanqrclear.luma.AdmobHelps.KEY_INSTALL_TIME import com.base.scanqrclear.luma.AdmobHelps.KEY_INSTALL_TIME
import com.base.scanqrclear.luma.AppHelps.dpToPx import com.base.scanqrclear.luma.AppHelps.dpToPx
import com.base.scanqrclear.utils.BarUtils
import com.gyf.immersionbar.ktx.immersionBar
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
...@@ -25,7 +28,7 @@ import java.util.concurrent.TimeUnit ...@@ -25,7 +28,7 @@ import java.util.concurrent.TimeUnit
class HomeFragment : BaseFragment() { class HomeFragment : BaseFragment() {
private val binding by lazy { private val binding by lazy(LazyThreadSafetyMode.NONE) {
FragmentHomeBinding.inflate(layoutInflater) FragmentHomeBinding.inflate(layoutInflater)
} }
...@@ -34,9 +37,17 @@ class HomeFragment : BaseFragment() { ...@@ -34,9 +37,17 @@ class HomeFragment : BaseFragment() {
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View { ): View {
binding.tvAppName.updatePadding(top = BarUtils.getStatusBarHeight())
return binding.root return binding.root
} }
override fun onResume() {
super.onResume()
immersionBar {
statusBarColor("#ef7246")
statusBarDarkFont(true)
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
......
...@@ -48,15 +48,19 @@ class CreateFragment : BaseFragment<FragmentCreateBinding>(FragmentCreateBinding ...@@ -48,15 +48,19 @@ class CreateFragment : BaseFragment<FragmentCreateBinding>(FragmentCreateBinding
FunctionUIBean(KEY_EVENT, R.mipmap.h_event, resources.getString(R.string.event)), FunctionUIBean(KEY_EVENT, R.mipmap.h_event, resources.getString(R.string.event)),
FunctionUIBean(KEY_CONTACT, R.mipmap.h_contact, resources.getString(R.string.contact)), FunctionUIBean(KEY_CONTACT, R.mipmap.h_contact, resources.getString(R.string.contact)),
// FunctionUIBean(KEY_LOCATION, R.mipmap.h_loction, resources.getString(R.string.location)), // FunctionUIBean(KEY_LOCATION, R.mipmap.h_loction, resources.getString(R.string.location)),
FunctionUIBean(KEY_TELEPHONE, R.mipmap.h_telephone, resources.getString(R.string.telephone)), FunctionUIBean(
KEY_TELEPHONE,
R.mipmap.h_telephone,
resources.getString(R.string.telephone)
),
FunctionUIBean(KEY_MESSAGE, R.mipmap.h_message, resources.getString(R.string.message)), FunctionUIBean(KEY_MESSAGE, R.mipmap.h_message, resources.getString(R.string.message)),
) )
} }
override fun initView() { override fun initView() {
super.initView() super.initView()
binding.tvTitle.updatePadding(top = BarUtils.getStatusBarHeight()) binding.space.layoutParams.height = BarUtils.getStatusBarHeight()
binding.ivVip.updatePadding(top = BarUtils.getStatusBarHeight()) // binding.ivVip.updatePadding(top = BarUtils.getStatusBarHeight())
adapter = FunctionAdapter() adapter = FunctionAdapter()
binding.rv.layoutManager = GridLayoutManager(requireContext(), 3) binding.rv.layoutManager = GridLayoutManager(requireContext(), 3)
binding.rv.adapter = adapter binding.rv.adapter = adapter
...@@ -144,7 +148,7 @@ class CreateFragment : BaseFragment<FragmentCreateBinding>(FragmentCreateBinding ...@@ -144,7 +148,7 @@ class CreateFragment : BaseFragment<FragmentCreateBinding>(FragmentCreateBinding
override fun initListener() { override fun initListener() {
super.initListener() super.initListener()
binding.tvTitle.setOnClickListener { binding.tvLogo.setOnClickListener {
if (isContinuousTimesClick()) { if (isContinuousTimesClick()) {
val sb = StringBuilder() val sb = StringBuilder()
val gson = Gson() val gson = Gson()
...@@ -152,7 +156,8 @@ class CreateFragment : BaseFragment<FragmentCreateBinding>(FragmentCreateBinding ...@@ -152,7 +156,8 @@ class CreateFragment : BaseFragment<FragmentCreateBinding>(FragmentCreateBinding
sb.append("ut:${ConfigBean.configBean.ut}").append("\n") sb.append("ut:${ConfigBean.configBean.ut}").append("\n")
val adLog = gson.toJson(ConfigBean.configBean.adConfigBean).replace(",", ",\n") val adLog = gson.toJson(ConfigBean.configBean.adConfigBean).replace(",", ",\n")
sb.append(adLog).append("\n") sb.append(adLog).append("\n")
val popupLog = gson.toJson(ConfigBean.configBean.popupConfigBean).replace(",", ",\n") val popupLog =
gson.toJson(ConfigBean.configBean.popupConfigBean).replace(",", ",\n")
sb.append(popupLog).append("\n") sb.append(popupLog).append("\n")
sb.append("uuid:").append(AppPreferences.getInstance().getString("uuid", "null")) sb.append("uuid:").append(AppPreferences.getInstance().getString("uuid", "null"))
requireContext().showLogDialog(sb.toString()) requireContext().showLogDialog(sb.toString())
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FF6473F8"
android:endColor="#FF8757E9"
android:angle="0" />
<corners android:radius="20dp"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#FFFEAE25"
android:endColor="#FFFF790C"
android:angle="0" />
<corners android:radius="20dp"/>
</shape>
...@@ -7,30 +7,67 @@ ...@@ -7,30 +7,67 @@
android:background="@color/white" android:background="@color/white"
tools:context=".ui.main.CreateFragment"> tools:context=".ui.main.CreateFragment">
<Space
android:id="@+id/space"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/tvTitle" android:id="@+id/tv_weather"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="10dp" android:includeFontPadding="false"
android:text="@string/create" android:background="@drawable/bg_gradient_weather"
android:textColor="@color/black" android:paddingHorizontal="17dp"
android:paddingVertical="8dp"
android:textColor="@color/white"
android:textSize="19sp" android:textSize="19sp"
android:textStyle="bold" app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/space"
app:layout_constraintTop_toTopOf="parent" /> tools:text="30℃" />
<ImageView <TextView
android:visibility="gone" android:id="@+id/tv_zodiac"
android:id="@+id/ivVip"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="20dp" android:includeFontPadding="false"
android:src="@mipmap/h_vip" android:background="@drawable/bg_gradient_zodiac"
app:layout_constraintBottom_toBottomOf="@id/tvTitle" android:paddingHorizontal="17dp"
app:layout_constraintEnd_toEndOf="parent" android:paddingVertical="8dp"
app:layout_constraintTop_toTopOf="@id/tvTitle" android:layout_marginEnd="16dp"
tools:ignore="ContentDescription" /> android:text="@string/zodiac"
android:textColor="@color/white"
android:textSize="19sp"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_weather" />
<TextView
android:id="@+id/tv_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="13dp"
android:text="@string/app_name"
android:textColor="@color/black"
android:textSize="19sp"
app:drawableTopCompat="@mipmap/codescan"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_zodiac" />
<!-- <ImageView-->
<!-- android:id="@+id/ivVip"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginEnd="20dp"-->
<!-- android:src="@mipmap/h_vip"-->
<!-- android:visibility="gone"-->
<!-- app:layout_constraintBottom_toBottomOf="@id/tvTitle"-->
<!-- app:layout_constraintEnd_toEndOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="@id/tvTitle"-->
<!-- tools:ignore="ContentDescription" />-->
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv" android:id="@+id/rv"
...@@ -41,6 +78,6 @@ ...@@ -41,6 +78,6 @@
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvTitle" /> app:layout_constraintTop_toBottomOf="@id/tv_logo" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
android:id="@+id/cl_container" android:id="@+id/cl_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="#ef7246"> android:background="#ef7246">
<androidx.appcompat.widget.AppCompatTextView <androidx.appcompat.widget.AppCompatTextView
......
...@@ -123,4 +123,5 @@ ...@@ -123,4 +123,5 @@
<string name="whatsapp_clean">WhatsApp Clean</string> <string name="whatsapp_clean">WhatsApp Clean</string>
<string name="app_process">App Process</string> <string name="app_process">App Process</string>
<string name="files">Files</string> <string name="files">Files</string>
<string name="zodiac">Zodiac</string>
</resources> </resources>
\ No newline at end of file
...@@ -123,4 +123,5 @@ ...@@ -123,4 +123,5 @@
<string name="whatsapp_clean">WhatsApp Clean</string> <string name="whatsapp_clean">WhatsApp Clean</string>
<string name="app_process">App Process</string> <string name="app_process">App Process</string>
<string name="files">Files</string> <string name="files">Files</string>
<string name="zodiac">Zodiac</string>
</resources> </resources>
\ No newline at end of file
...@@ -124,4 +124,5 @@ ...@@ -124,4 +124,5 @@
<string name="whatsapp_clean">WhatsApp Clean</string> <string name="whatsapp_clean">WhatsApp Clean</string>
<string name="app_process">App Process</string> <string name="app_process">App Process</string>
<string name="files">Files</string> <string name="files">Files</string>
<string name="zodiac">Zodiac</string>
</resources> </resources>
\ No newline at end of file
...@@ -123,4 +123,5 @@ ...@@ -123,4 +123,5 @@
<string name="whatsapp_clean">WhatsApp Clean</string> <string name="whatsapp_clean">WhatsApp Clean</string>
<string name="app_process">App Process</string> <string name="app_process">App Process</string>
<string name="files">Files</string> <string name="files">Files</string>
<string name="zodiac">Zodiac</string>
</resources> </resources>
\ No newline at end of file
...@@ -124,4 +124,5 @@ ...@@ -124,4 +124,5 @@
<string name="whatsapp_clean">WhatsApp Clean</string> <string name="whatsapp_clean">WhatsApp Clean</string>
<string name="app_process">App Process</string> <string name="app_process">App Process</string>
<string name="files">Files</string> <string name="files">Files</string>
<string name="zodiac">Zodiac</string>
</resources> </resources>
\ No newline at end of file
...@@ -281,5 +281,6 @@ ...@@ -281,5 +281,6 @@
<string name="device_ready">Device Ready</string> <string name="device_ready">Device Ready</string>
<string name="loading_point">loading...</string> <string name="loading_point">loading...</string>
<string name="files">Files</string> <string name="files">Files</string>
<string name="zodiac">Zodiac</string>
</resources> </resources>
\ 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