Commit 06897a1e authored by wanglei's avatar wanglei

[拆包]首页ui

parent be4a7600
......@@ -91,5 +91,13 @@ object SpConstObject {
}
//是否上报过useType
var useTypeEvent = false
get() {
return AppPreferences.getInstance().getBoolean("fcmToken", field)
}
set(value) {
field = value
AppPreferences.getInstance().put("fcmToken", value, true)
}
}
\ No newline at end of file
......@@ -8,9 +8,9 @@ class FeatureBean(
val titleRes: Int = 0,
val icon: Int = 0,
val content: Int = 0,
val color: Int = 0,
) {
var span: Int = 1
var color: Int = 0
var span: Int = 2
var todayUsed = false
companion object {
......
......@@ -4,6 +4,7 @@ import android.util.Base64
import android.util.Log
import com.base.appzxhy.BuildConfig
import com.base.appzxhy.GlobalConfig
import com.base.appzxhy.SpConstObject.useTypeEvent
import com.base.appzxhy.bean.config.AdConfigBean
import com.base.appzxhy.bean.config.ConfigBean
import com.base.appzxhy.bean.config.PopupConfigBean
......@@ -159,9 +160,12 @@ object NewComUtils {
try {
val configBean = Gson().fromJson(config, ConfigBean::class.java)
val jsonObject = JSONObject()
jsonObject.put("ut", configBean.ut)
EventUtils.event("user_type", ext = jsonObject)
if (!useTypeEvent) {
val jsonObject = JSONObject()
jsonObject.put("ut", configBean.ut)
EventUtils.event("user_type", ext = jsonObject)
useTypeEvent = true
}
//配置
ConfigBean.configBean = configBean
......
......@@ -21,6 +21,7 @@ import com.base.appzxhy.bean.FeatureBean.Companion.SCREENSHOT_CLEAN
import com.base.appzxhy.bean.FeatureBean.Companion.SETTINGS
import com.base.appzxhy.bean.FeatureBean.Companion.SIMILAR_PHOTOS
import com.base.appzxhy.bean.FeatureBean.Companion.UNINSTALL_APP
import com.base.appzxhy.databinding.FragmentHome2Binding
import com.base.appzxhy.databinding.FragmentHome3Binding
import com.base.appzxhy.ui.dialog.permissionStorageJump
import com.base.appzxhy.ui.set.SettingActivity
......@@ -31,7 +32,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.async
import kotlinx.coroutines.launch
class HomeFragment : BaseFragment<FragmentHome3Binding>(FragmentHome3Binding::inflate) {
class HomeFragment : BaseFragment<FragmentHome2Binding>(FragmentHome2Binding::inflate) {
private val adapter = FeatureItemAdapter()
......@@ -42,43 +43,50 @@ class HomeFragment : BaseFragment<FragmentHome3Binding>(FragmentHome3Binding::in
JUNK_CLEAN,
R.string.clean_junk,
R.drawable.icon_clean_h,
),
).apply {
color=R.color.color_fffaf7
},
FeatureBean(
BATTERY_INFO,
R.string.battery_info,
R.drawable.icon_battery_h,
),
).apply {
color=R.color.color_fdfff5
},
FeatureBean(
SIMILAR_PHOTOS,
R.string.similar_photos,
R.drawable.icon_similar_h,
),
).apply {
color=R.color.color_fefaff
},
FeatureBean(
UNINSTALL_APP,
R.string.uninstall_app,
R.drawable.icon_app_uninstall,
),
R.drawable.icon_app_uninstall_h,
).apply {
color=R.color.color_fffafa
},
FeatureBean(
PHOTO_COMPRESSION,
R.string.photo_compression,
R.drawable.icon_compression_h,
).apply {
span = 2
color=R.color.color_f5fff9
},
FeatureBean(
SCREENSHOT_CLEAN,
R.string.screenshot_clean,
R.drawable.icon_screenshot_h,
).apply {
span = 2
color=R.color.color_f7feff
},
FeatureBean(
LARGE_FILE_CLEAN,
R.string.large_file_clean,
R.drawable.icon_file_h,
R.drawable.icon_large_file_h,
).apply {
span = 2
color=R.color.color_fff7fe
},
)
}
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:endColor="#FEC300"
android:startColor="#FF8000" />
<corners android:radius="@dimen/dp_62" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape
android:shape="oval"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
</shape>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadiusRatio="3"
android:shape="ring"
android:thicknessRatio="18"
android:thicknessRatio="9"
android:useLevel="false">
<solid android:color="#80FFFFFF" />
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_400"
android:background="@drawable/lanse_bg"
app:layout_constraintTop_toTopOf="parent" />
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottie"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="-20dp"
android:cropToPadding="true"
android:scaleType="fitCenter"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/iv"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.45"
app:lottie_fileName="qiling_dongxiao.json" />
<FrameLayout
android:id="@+id/flTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/dp_24"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_16"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="@dimen/sp_19"
android:textStyle="bold" />
</FrameLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/flTop">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/dp_10">
<FrameLayout
android:id="@+id/flClean"
android:layout_width="@dimen/dp_220"
android:layout_height="@dimen/dp_220"
android:layout_gravity="center_horizontal"
android:layout_marginTop="0dp">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/dp_37"
android:background="@drawable/bg_oval" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_ring_home" />
<com.mikhaellopez.circularprogressbar.CircularProgressBar
android:id="@+id/circleProgress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/dp_20"
app:cpb_background_progressbar_color="#CCFFFFFF"
app:cpb_background_progressbar_width="@dimen/dp_8"
app:cpb_progress_direction="to_right"
app:cpb_progress_max="100"
app:cpb_progressbar_color="@color/colorPrimary"
app:cpb_progressbar_width="@dimen/dp_8"
app:cpb_round_border="true"
tools:cpb_progress="50" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:text="@string/CLEAN"
android:textColor="@color/colorPrimary"
android:textSize="@dimen/sp_18"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_10">
<TextView
android:id="@+id/tvUsed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_8"
android:text="0.0 GB"
android:textColor="#1A1A1A"
android:textSize="@dimen/sp_14"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tvTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" / 0.0GB"
android:textColor="#1A1A1A"
android:textSize="@dimen/sp_14"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_50"
android:layout_marginHorizontal="@dimen/dp_80"
android:layout_marginTop="@dimen/dp_20"
android:background="@drawable/bg_ff8000_fec300"
android:foreground="?attr/selectableItemBackground"
android:gravity="center"
android:text="@string/quick_clean"
android:textColor="@color/white"
android:textSize="@dimen/sp_19"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:overScrollMode="never"
android:paddingHorizontal="@dimen/dp_8" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
<color name="transparent">#00000000</color>
<color name="colorPrimary">#0456ed</color>
<color name="colorPrimary">#06D16C</color>
<color name="colorDisEnable">#F0F3FA</color>
<color name="color_66000000">#66000000</color>
......@@ -18,5 +18,12 @@
<color name="color_d9d9d9">#D9D9D9</color>
<color name="color_9b9595">#9B9595</color>
<color name="color_999999">#999999</color>
<color name="color_fffaf7">#FFFAF7</color>
<color name="color_fdfff5">#FDFFF5</color>
<color name="color_fefaff">#FEFAFF</color>
<color name="color_fffafa">#FFFAFA</color>
<color name="color_f5fff9">#F5FFF9</color>
<color name="color_f7feff">#F7FEFF</color>
<color name="color_fff7fe">#FFF7FE</color>
</resources>
\ No newline at end of file
......@@ -55,4 +55,7 @@
<dimen name="dp_54">54dp</dimen>
<dimen name="dp_25">25dp</dimen>
<dimen name="dp_37">37dp</dimen>
<dimen name="dp_220">220dp</dimen>
<dimen name="dp_39">39dp</dimen>
<dimen name="dp_62">62dp</dimen>
</resources>
\ No newline at end of file
......@@ -166,6 +166,7 @@ Please rest assured that we will handle your information in strict accordance wi
<string name="screenshot">Screenshot</string>
<string name="exit_uninstall_app_content">Exit Uninstall App? Unused applications may occupy phone storage</string>
<string name="notify_uninstall_app">Uninstall unused applications save phone storage.</string>
<string name="quick_clean">Quick Clean</string>
</resources>
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