Commit 13dfc236 authored by wanglei's avatar wanglei

..

parent 0699b0b6
package com.base.scanqrclear.bean
//data class WeatherCityBean(
// val city: String,
// val list: List<WeatherBean>
//)
//
//data class WeatherBean(
// val fxDate: String,
// val tempMin: String,
// val tempMax: String,
// val textDay: String,
// val textNight: String,
// val iconDay: String,
// val windScaleDay: String,
// val pressure: String,
// val humidity: String,
//)
data class WeatherBean(val city: String, val list: List<ListBean>)
data class ListBean(
val tempMax: String,
val tempMin: String,
val humidity: String,
val fxDate: String,
val iconDay: String,
val windScaleDay: String,
val pressure: String,
val textDay: String,
val textNight: String,
)
package com.base.scanqrclear.luma
import android.graphics.drawable.Drawable
data class AppInfoBean(
val appName: String,
val icon: Drawable,
val packageName: String,
var isSelected: Boolean = false
) {
}
package com.tool.luma.smart.cleaner.ui.app.process
import android.content.Context
import android.content.Intent
import android.content.pm.ApplicationInfo
import android.net.Uri
import android.os.Bundle
import android.provider.Settings
import android.text.Spannable
import android.text.SpannableString
import android.text.style.ForegroundColorSpan
import android.view.View
import androidx.activity.addCallback
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import com.base.scanqrclear.R
import com.base.scanqrclear.databinding.ActivityAppProcessBinding
import com.base.scanqrclear.luma.AppHelps
import com.base.scanqrclear.luma.AppInfoBean
import com.base.scanqrclear.luma.AppProcessAdapter
import com.base.scanqrclear.luma.BaseActivity2
import com.base.scanqrclear.luma.BaseAdapter
import com.base.scanqrclear.luma.LottieType
import com.base.scanqrclear.luma.Utils
import com.base.scanqrclear.utils.AnimationHelps
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
class AppProcessActivity : BaseActivity2() {
companion object {
fun start(context: Context) {
val intent = Intent(context, AppProcessActivity::class.java)
context.startActivity(intent)
}
}
private val binding by lazy {
ActivityAppProcessBinding.inflate(layoutInflater)
}
private lateinit var adapter: AppProcessAdapter
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)
initView()
initData()
showAnimationAd(LottieType.APP_PROCESS) {
AnimationHelps.progress(binding.pbProcess, end = binding.pbProcess.progress)
}
onBackPressedDispatcher.addCallback {
val title = getString(R.string.exit_app_process)
val content1 = getString(R.string.exit_app_process_content1)
val content2 = getString(R.string.exit_app_process_content2)
val size = adapter.itemCount
val text = "$content1 $size $content2"
val colorStartIndex = text.indexOf(size.toString())
val colorEndIndex = colorStartIndex + size.toString().length
val spannableString = SpannableString(text)
spannableString.setSpan(
ForegroundColorSpan(getColor(R.color.color_ff881d)),
colorStartIndex,
colorEndIndex,
Spannable.SPAN_INCLUSIVE_INCLUSIVE
)
showExitDialog(title, spannableString)
}
}
private fun initView() {
adapter = AppProcessAdapter()
adapter.callback = object : BaseAdapter.OnClickCallback<AppInfoBean> {
override fun onClicked(view: View, position: Int, item: AppInfoBean) {
val intent = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:${item.packageName}"))
startActivity(intent)
}
}
binding.rvAppProcess.adapter = adapter
binding.rvAppProcess.layoutManager = LinearLayoutManager(this)
binding.flBack.setOnClickListener { backPressed() }
binding.tvSkip.setOnClickListener { backPressed() }
}
private fun initData() {
lifecycleScope.launch(Dispatchers.IO) {
launch { getApp() }
launch { getMemory() }
}
}
private suspend fun getApp() {
val installedApps = packageManager.getInstalledApplications(0)
val nonSystemApps =
installedApps.filterNot { it.flags and ApplicationInfo.FLAG_SYSTEM != 0 }.filter { packageName != it.packageName }
val apps = nonSystemApps.map { packageInfo ->
val appName = packageManager.getApplicationLabel(packageInfo) as String
val appIcon = packageInfo.loadIcon(packageManager)
AppInfoBean(appName, appIcon, packageInfo.packageName)
}.toMutableList()
withContext(Dispatchers.Main) {
binding.tvProcessSize.text = "${apps.size}"
binding.tvTotalSize.text = "${installedApps.size}"
adapter.submitList(apps)
}
}
private suspend fun getMemory() {
val totalMemory = AppHelps.getMemTotal(this)
val availableMemory = AppHelps.getMemAvailable(this)
val usedMemory = totalMemory - availableMemory
val use: Long = usedMemory * 100 / totalMemory
val memory = Utils.getSize(usedMemory) + "/" + Utils.getSize(totalMemory)
withContext(Dispatchers.Main) {
binding.tvSize.text = memory
binding.tvProcess.text = "${use}%"
binding.pbProcess.progress = use.toInt()
}
}
}
\ No newline at end of file
package com.base.scanqrclear.luma
import android.view.LayoutInflater
import android.view.ViewGroup
import com.base.scanqrclear.databinding.ItemAppProcessBinding
class AppProcessAdapter : BaseAdapter<AppInfoBean, ItemAppProcessBinding>() {
override fun getViewBinding(
layoutInflater: LayoutInflater,
parent: ViewGroup
): ItemAppProcessBinding {
return ItemAppProcessBinding.inflate(layoutInflater, parent, false)
}
override fun bind(
holder: BaseViewHolder<ItemAppProcessBinding>,
position: Int,
item: AppInfoBean
) {
holder.binding.tvName.text = item.appName
holder.binding.ivIcon.setImageDrawable(item.icon)
holder.binding.tvStop.setOnClickListener { callback?.onClicked(it, position, item) }
}
}
\ No newline at end of file
package com.base.scanqrclear.luma
import android.annotation.SuppressLint
import android.graphics.Color
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.activity.OnBackPressedCallback
import androidx.core.view.isVisible
import androidx.core.view.updatePadding
import androidx.recyclerview.widget.RecyclerView
import com.base.scanqrclear.R
import com.base.scanqrclear.ads.AdsMgr
import com.base.scanqrclear.ads.AdsShowCallBack
import com.base.scanqrclear.bean.ListBean
import com.base.scanqrclear.bean.WeatherBean
import com.base.scanqrclear.databinding.ActivityWeatherBinding
import com.base.scanqrclear.utils.BarUtils
import kotlin.random.Random
@SuppressLint("SimpleDateFormat")
class WeatherInterface : BaseActivity2() {
val binding: ActivityWeatherBinding by lazy {
ActivityWeatherBinding.inflate(layoutInflater)
}
var wBean: WeatherBean? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
getData()
initListener()
// AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlAd)
}
fun initListener() {
binding.idBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
finish()
}
})
}
private fun getData() {
wBean = WeatherUtils.getWeatherEntity()
if (wBean != null) {
setViews()
} else {
WeatherUtils.requestWeatherData()
}
binding.root.postDelayed({
AdsMgr.showInsert(this,false,object :AdsShowCallBack(){
override fun close(where: Int) {
binding.idFlLoading.isVisible = false
}
override fun failed(where: Int) {
binding.idFlLoading.isVisible = false
}
override fun googleFailed(where: Int) {
binding.idFlLoading.isVisible = false
}
})
}, Random.nextLong(800, 2000))
}
@SuppressLint("SetTextI18n")
private var wertherList = mutableListOf<ListBean>()
private fun setViews() {
binding.idTvCity.text = wBean?.city
binding.idTvDate.text = wBean?.list?.get(0)?.fxDate
binding.idTvTmp.text = "${wBean?.list?.get(0)?.tempMax}°"
binding.idTvHumidity.text = "${wBean?.list?.get(0)?.humidity}%"
binding.idTvWind.text = "${wBean?.list?.get(0)?.windScaleDay}"
binding.idTvPressure.text = "${wBean?.list?.get(0)?.pressure}hPa"
when (WeatherUtils.getWeatherType((wBean?.list?.get(0)?.iconDay)!!.toInt())) {
"Sunny day" -> {
binding.idImgW.setImageResource(R.mipmap.d_qing)
}
"Cloudy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_yin)
}
"Rainy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_dayu)
}
"Snowy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_xiaxue)
}
"Greasy day" -> {
binding.idImgW.setImageResource(R.mipmap.d_wumaishachengbao)
}
"Unknown" -> {
binding.idImgW.setImageResource(R.mipmap.d_qing)
}
}
wertherList.clear()
wBean?.list?.let { wertherList.addAll(it) }
binding.idRlWeather.run {
adapter = object : RecyclerView.Adapter<ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = LayoutInflater.from(this@WeatherInterface)
.inflate(R.layout.item_layout_wheather, parent, false)
return ViewHolder(view)
}
override fun getItemCount(): Int {
return wertherList.size
}
@SuppressLint("SetTextI18n")
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val item = wertherList[position]
when (WeatherUtils.getWeatherType(item.iconDay.toInt())) {
"Sunny day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_qing)
}
"Cloudy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_yin)
}
"Rainy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_dayu)
}
"Snowy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_xiaxue)
}
"Greasy day" -> {
holder.ivIcon.setImageResource(R.mipmap.x_wumaishachengbao)
}
"Unknown" -> {
holder.ivIcon.setImageResource(R.mipmap.x_qing)
}
}
holder.tvTime.text = item.fxDate
holder.tvMaxTmp.text = "${item.tempMax}°/"
holder.tvMinTmp.text = "${item.tempMin}°"
}
}
}
}
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val ivIcon: ImageView
val tvTime: TextView
val tvMaxTmp: TextView
val tvMinTmp: TextView
init {
ivIcon = view.findViewById(R.id.id_img_icon)
tvTime = view.findViewById(R.id.id_tv_time)
tvMaxTmp = view.findViewById(R.id.id_tv_max_tmp)
tvMinTmp = view.findViewById(R.id.id_tv_min_tmp)
}
}
}
package com.base.scanqrclear.luma
import android.text.TextUtils
import android.util.Log
import com.base.scanqrclear.BuildConfig
import com.base.scanqrclear.GlobalConfig
import com.base.scanqrclear.bean.WeatherBean
import com.base.scanqrclear.helper.AESHelper
import com.base.scanqrclear.utils.AppPreferences
import com.google.gson.Gson
import okhttp3.Call
import okhttp3.Callback
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.Calendar
import java.util.concurrent.TimeUnit
//object WeatherUtils {
//
// private const val TAG = "WeatherUtils"
//
// private val url by lazy {
// val pkg = ConfigHelper.packageName
// val pkgSubString = pkg.filter { it.isLowerCase() }.substring(4, 9)
// val url = StringBuilder("${ConfigHelper.apiUrl}/city/${pkgSubString}tq")
//// url.append("?pkg=$pkg")
// url.append("?data=${SimpleDateFormat("yyyyMMMdd").format(System.currentTimeMillis())}")
// url.toString()
// }
//
// fun getWeather(): WeatherCityBean? {
//
// val client = OkHttpClient.Builder()
// .apply {
// if (BuildConfig.DEBUG) {
// addInterceptor(HttpLoggingInterceptor().apply {
// level = HttpLoggingInterceptor.Level.BODY
// })
// }
// connectTimeout(10, TimeUnit.SECONDS)
// readTimeout(20, TimeUnit.SECONDS)
// writeTimeout(15, TimeUnit.SECONDS)
// }.build()
//
// LogEx.logDebug(TAG, "url=$url")
// val request = Request.Builder()
// .url(url)
// .build()
//
// val response = client.newCall(request).execute()
// response.body?.string()?.let {
// LogEx.logDebug(TAG, it)
// val dataJson = getDataJson(it)
// LogEx.logDebug(TAG, "dataJson=$dataJson")
// return parseWeather(dataJson)
// }
// return null
// }
//
// private fun parseWeather(dataJson: String): WeatherCityBean? {
// return try {
// Gson().fromJson(dataJson, WeatherCityBean::class.java)
// } catch (e: Exception) {
// LogEx.logDebug(TAG, "$e")
// null
// }
// }
//
// private fun getDataJson(jsonString: String): String {
// val jsonRootObject = JsonParser.parseString(jsonString).getAsJsonObject()
// return jsonRootObject["result"].getAsJsonObject()["data"].toString()
// }
//
//
//}
object WeatherUtils {
fun getWeatherType(param: Int): String {
val sunny_day: IntArray = intArrayOf(100, 101, 102, 103, 150, 151, 152, 153)
val cloudy_day: IntArray = intArrayOf(104)
val rainy_day: IntArray =
intArrayOf(300, 301, 302, 303, 304, 305, 306, 307, 307, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 350, 351, 399)
val snowy_day: IntArray = intArrayOf(400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 456, 457, 499)
val greasy_day: IntArray = intArrayOf(500, 501, 502, 503, 504, 505, 507, 508, 509, 510, 511, 512, 513, 514, 515)
when (param) {
in sunny_day -> return "Sunny day"
in cloudy_day -> return "Cloudy day"
in rainy_day -> return "Rainy day"
in snowy_day -> return "Snowy day"
in greasy_day -> return "Greasy day"
else -> return "Unknown"
}
}
fun hasWeatherDataToday(): Boolean {
return !TextUtils.isEmpty(getWeatherJsonStr())
}
fun getWeatherJsonStr(): String {
val data = AppPreferences.getInstance().getString(getTodayStr() + "_weather", "")
return data
}
fun getWeatherEntity(): WeatherBean? {
val str = getWeatherJsonStr()
Log.d("glc", str)
if (TextUtils.isEmpty(str)) {
} else {
try {
val gson = Gson()
val wBean = gson.fromJson(str, WeatherBean::class.java)
return wBean
} catch (e: Exception) {
e.printStackTrace()
}
}
return null
}
private val url by lazy {
val pkg = GlobalConfig.PACKAGE_NAME
val url = StringBuilder(
"${GlobalConfig.URL_API}/city/${
pkg.filter { it.isLowerCase() }.substring(4, 9)
}tq"
)
url.append("?pkg=$pkg")
val sdf = SimpleDateFormat("yyyyMMdd")
url.append("&date=${sdf.format(Calendar.getInstance().time)}")
url.toString()
}
fun requestWeatherData() {
val client = OkHttpClient.Builder().apply {
if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
})
}
}.build()
val request = Request.Builder()
.url(url)
.get()
.build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
}
override fun onResponse(call: Call, response: Response) {
response.body?.string()?.let {
val i = Regex("\"data\":\"(.*?)\"").find(it)
if (i.toString() != "null") {
i?.groupValues?.get(1).let {
if (!TextUtils.isEmpty(it)) {
val str = AESHelper.decrypt(it!!)
saveWeatherData(str)
}
}
}
}
}
})
}
/**
* 同步
*/
fun getWeatherData() = runCatching {
val client = OkHttpClient.Builder().apply {
if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY
})
}
}.connectTimeout(1, TimeUnit.SECONDS)
.readTimeout(1, TimeUnit.SECONDS)
.writeTimeout(1, TimeUnit.SECONDS)
.build()
val request = Request.Builder()
.url(url)
.get()
.build()
val response = client.newCall(request).execute()
response.body?.string()?.let {
val i = Regex("\"data\":\"(.*?)\"").find(it)
if (i.toString() != "null") {
i?.groupValues?.get(1).let {
if (!TextUtils.isEmpty(it)) {
val str = AESHelper.decrypt(it!!)
saveWeatherData(str)
}
}
}
}
}
private fun saveWeatherData(string: String) {
AppPreferences.getInstance().put(getTodayStr() + "_weather", string)
}
private fun getTodayStr(): String {
val calendar = Calendar.getInstance()
val year = calendar[Calendar.YEAR]
val month = calendar[Calendar.MONTH] + 1
val day = calendar[Calendar.DAY_OF_MONTH]
val today =
year.toString() + "-" + String.format("%02d", month) + "-" + String.format("%02d", day)
return today;
}
}
\ No newline at end of file
package com.base.scanqrclear.utils
import android.animation.ValueAnimator
import android.view.View
import android.view.animation.LinearInterpolator
import android.widget.ProgressBar
import androidx.core.animation.doOnEnd
import com.base.scanqrclear.luma.CircleProgressBar
import com.base.scanqrclear.luma.MyProgressBar
object AnimationHelps {
fun rotation(view: View, durationTime: Long) {
ValueAnimator.ofFloat(0f, 360f).apply {
duration = durationTime
interpolator = LinearInterpolator()
repeatCount = ValueAnimator.INFINITE
repeatMode = ValueAnimator.RESTART
addUpdateListener { animation ->
val animatedValue = animation.animatedValue as Float
view.rotation = animatedValue
}
}.start()
}
fun progress(progressBar: ProgressBar, start: Int = 0, end: Int = 100, durationTime: Long = 1500) {
ValueAnimator.ofInt(start, end).apply {
duration = durationTime
interpolator = LinearInterpolator()
addUpdateListener { animation ->
progressBar.progress = animation.animatedValue as Int
}
}.start()
}
fun progress(progressBar: CircleProgressBar, endProgress: Int, durationTime: Long = 1500): ValueAnimator {
val animator = ValueAnimator.ofInt(0, endProgress).apply {
duration = durationTime
interpolator = LinearInterpolator()
addUpdateListener { animation ->
val progress = animation.animatedValue as Int
progressBar.setProgress(progress / 100f)
}
}
animator.start()
return animator
}
fun progress(progressBar: MyProgressBar, endProgress: Int, durationTime: Long = 1500, complete: (() -> Unit?)? = null): ValueAnimator {
return progress(progressBar, 0, endProgress, durationTime, complete)
}
fun progress(
progressBar: MyProgressBar,
startProgress: Int,
endProgress: Int,
durationTime: Long = 1500,
complete: (() -> Unit?)? = null
): ValueAnimator {
val animator = ValueAnimator.ofInt(startProgress, endProgress).apply {
duration = durationTime
interpolator = LinearInterpolator()
addUpdateListener { animation ->
val progress = animation.animatedValue as Int
progressBar.setProgress(progress)
if (progress == endProgress) {
complete?.invoke()
}
}
}
animator.start()
return animator
}
}
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f7fafa">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/gradient_background"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dp"
android:paddingBottom="6dp"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent">
<FrameLayout
android:id="@+id/fl_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="11dp"
android:padding="4dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_return_bar_nor" />
</FrameLayout>
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_process"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@id/fl_back"
app:layout_constraintBottom_toBottomOf="@id/fl_back"
app:layout_constraintStart_toEndOf="@id/fl_back" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_already_occupied"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/already_occupied"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_title" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_process"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="58.6%"
android:textColor="@color/white"
android:textSize="32sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_already_occupied" />
<ProgressBar
android:id="@+id/pb_process"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="16dp"
android:layout_marginTop="32dp"
android:layout_marginBottom="22dp"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:progress="0"
android:max="100"
android:progressDrawable="@drawable/app_process_progress"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_process" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="40dp"
android:text="0B/0B"
android:textColor="@color/black"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/pb_process"
app:layout_constraintBottom_toBottomOf="@id/pb_process" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="24dp"
android:layout_marginBottom="16dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:paddingTop="20dp"
android:paddingBottom="14dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:background="@drawable/white_background"
app:layout_constraintBottom_toTopOf="@id/ll_bottom"
app:layout_constraintTop_toBottomOf="@id/cl_top">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_running_program"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/running_program"
android:textColor="@color/color_181b1f"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_running_program"
app:layout_constraintBottom_toBottomOf="@id/tv_running_program">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_process_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="121"
android:textColor="@color/colorPrimary"
android:textSize="14sp"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="2dp"
android:text="/"
android:textColor="@color/color_181b1f"
android:textSize="14sp"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_total_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="127"
android:textColor="@color/color_181b1f"
android:textSize="14sp"
android:textStyle="bold" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginTop="12dp"
android:background="@color/color_ebebeb"
app:layout_constraintTop_toBottomOf="@id/tv_running_program" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_app_process"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="13dp"
android:paddingTop="10dp"
android:scrollbars="none"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_running_program" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/ll_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="34dp"
app:layout_constraintBottom_toBottomOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_skip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:gravity="center"
android:background="@drawable/gradient"
android:text="@string/skip"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold" />
</androidx.appcompat.widget.LinearLayoutCompat>
<include
android:id="@+id/animation"
android:visibility="gone"
layout="@layout/custom_animation" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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:background="#4990FA">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginTop="14dp"
android:src="@mipmap/w_fanhui"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/id_tv_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawablePadding="2dp"
android:textColor="@color/white"
android:textSize="18sp"
android:textStyle="bold"
app:drawableStartCompat="@mipmap/dingwei"
app:layout_constraintBottom_toBottomOf="@+id/id_back"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/id_back"
tools:text="ChengDu" />
<TextView
android:id="@+id/id_tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="23dp"
android:layout_marginTop="40dp"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/id_back"
tools:text="Tue, 25 Jun" />
<TextView
android:id="@+id/id_tv_tmp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="@color/white"
android:textSize="52sp"
app:layout_constraintStart_toStartOf="@+id/id_tv_date"
app:layout_constraintTop_toBottomOf="@+id/id_tv_date"
tools:text="27°" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_img_w"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:src="@mipmap/d_qing"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/id_tv_date" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/id_tv_tmp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:id="@+id/id_ll_today_weather"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="24dp"
android:paddingVertical="22dp"
app:bl_corners_radius="10dp"
app:bl_solid_color="#26000000"
app:layout_constraintTop_toBottomOf="@+id/id_tv_tmp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Humidity"
android:textColor="#80FFFFFF" />
<TextView
android:id="@+id/id_tv_humidity"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="80%" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#66FFFFFF" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wind"
android:textColor="#80FFFFFF" />
<TextView
android:id="@+id/id_tv_wind"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="5m/s" />
</androidx.appcompat.widget.LinearLayoutCompat>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="#66FFFFFF" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Pressure"
android:textColor="#80FFFFFF" />
<TextView
android:id="@+id/id_tv_pressure"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="965hPa" />
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout>
<FrameLayout
android:id="@+id/id_fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/id_ll_today_weather" />
<LinearLayout
android:id="@+id/id_ll_weak"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="14dp"
android:layout_marginTop="24dp"
android:orientation="vertical"
android:paddingVertical="14dp"
app:bl_corners_radius="10dp"
app:bl_solid_color="#26000000"
app:layout_constraintTop_toBottomOf="@+id/id_fl_ad">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="11dp"
android:drawablePadding="5dp"
android:text="7 Day weather forecast"
android:textColor="@color/white"
android:textSize="12sp"
app:drawableStartCompat="@mipmap/rili" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rl_weather"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:itemCount="7"
tools:listitem="@layout/item_layout_wheather" />
</LinearLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
<FrameLayout
android:id="@+id/id_fl_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#4990FA">
<LinearLayout
android:id="@+id/id_ll_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="43dp"
android:gravity="center_vertical"
android:paddingLeft="38dp"
android:paddingRight="68dp">
<ProgressBar
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_marginVertical="20dp"
android:layout_marginStart="17dp"
android:layout_marginEnd="11dp"
android:indeterminateTint="#FF2F2F" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Wait a moment..."
android:textColor="#000000"
android:textSize="13sp" />
</LinearLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@mipmap/ic_launcher"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:text="dfsdjflsdajfsdfjsdafsdakfsadfsd"
android:textColor="@color/black"
android:textSize="16sp"
android:ellipsize="end"
android:maxLines="1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_icon"
app:layout_constraintEnd_toStartOf="@id/tv_stop" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/tv_stop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingStart="20dp"
android:paddingEnd="20dp"
android:text="@string/stop"
android:textColor="@color/colorPrimary"
android:textSize="14sp"
android:background="@drawable/gradient_not_clickable"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginVertical="16dp">
<TextView
android:id="@+id/id_tv_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="11dp"
android:textColor="@color/white"
android:textSize="14sp"
tools:text="Today, 25 Jun" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/id_img_icon"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginEnd="22dp"
android:src="@mipmap/x_qing" />
<TextView
android:id="@+id/id_tv_max_tmp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="17sp"
tools:text="32°/" />
<TextView
android:id="@+id/id_tv_min_tmp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:layout_marginEnd="14dp"
android:textSize="14sp"
tools:text="12°" />
</LinearLayout>
\ 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