Commit 4a65502b authored by wanglei's avatar wanglei

...

parent acf8af8f
...@@ -101,6 +101,7 @@ dependencies { ...@@ -101,6 +101,7 @@ dependencies {
implementation("io.github.cymchad:BaseRecyclerViewAdapterHelper4:4.1.4") implementation("io.github.cymchad:BaseRecyclerViewAdapterHelper4:4.1.4")
implementation("com.mikhaellopez:circularprogressbar:3.1.0") implementation("com.mikhaellopez:circularprogressbar:3.1.0")
implementation("com.github.zhpanvip:viewpagerindicator:1.2.3") implementation("com.github.zhpanvip:viewpagerindicator:1.2.3")
implementation("com.github.JavaNoober.BackgroundLibrary:libraryx:1.7.6")
//相机 //相机
val cameraxVersion = "1.2.2" val cameraxVersion = "1.2.2"
......
...@@ -37,12 +37,7 @@ ...@@ -37,12 +37,7 @@
android:theme="@style/Theme.BrowserWhite" android:theme="@style/Theme.BrowserWhite"
android:usesCleartextTraffic="true" android:usesCleartextTraffic="true"
tools:targetApi="34"> tools:targetApi="34">
<activity
android:name=".ui.activity.scanqrc.QrcResultActivity"
android:exported="false" />
<activity
android:name=".ui.activity.appprocess.AppProcessActivity"
android:exported="false" />
<activity <activity
android:name=".ui.activity.splash.Splash2Activity" android:name=".ui.activity.splash.Splash2Activity"
android:exported="true" android:exported="true"
...@@ -53,6 +48,25 @@ ...@@ -53,6 +48,25 @@
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".ui.activity.weather.WeatherInterface"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".ui.activity.appprocess.AppProcessActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity
android:name=".ui.activity.scanqrc.QrcResultActivity"
android:exported="false"
android:launchMode="singleTop"
android:screenOrientation="portrait"
tools:ignore="DiscouragedApi,LockedOrientationActivity" />
<activity <activity
android:name=".ui.activity.MainActivity" android:name=".ui.activity.MainActivity"
android:exported="false" android:exported="false"
......
...@@ -9,6 +9,7 @@ import com.base.browserwhite.fcm.ScreenStatusReceiver ...@@ -9,6 +9,7 @@ import com.base.browserwhite.fcm.ScreenStatusReceiver
import com.base.browserwhite.help.BlackUtils import com.base.browserwhite.help.BlackUtils
import com.base.browserwhite.help.ConfigHelper import com.base.browserwhite.help.ConfigHelper
import com.base.browserwhite.help.InstallHelps import com.base.browserwhite.help.InstallHelps
import com.base.browserwhite.help.WeatherUtils
import com.base.browserwhite.ui.activity.splash.Splash2Activity import com.base.browserwhite.ui.activity.splash.Splash2Activity
import com.base.browserwhite.utils.ActivityManagerUtils import com.base.browserwhite.utils.ActivityManagerUtils
import com.base.browserwhite.utils.LogEx import com.base.browserwhite.utils.LogEx
...@@ -45,6 +46,10 @@ class MyApplication : Application() { ...@@ -45,6 +46,10 @@ class MyApplication : Application() {
BlackUtils.requestBlack() BlackUtils.requestBlack()
initLifeListener() initLifeListener()
initFileDownloader() initFileDownloader()
if (!WeatherUtils.hasWeatherDataToday()) {
WeatherUtils.requestWeatherData()
}
} }
......
package com.base.browserwhite.bean package com.base.browserwhite.bean
data class WeatherCityBean( //data class WeatherCityBean(
val city: String, // val city: String,
val list: List<WeatherBean> // 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( data class WeatherBean(val city: String, val list: List<ListBean>)
val fxDate: String,
val tempMin: String, data class ListBean(
val tempMax: String, val tempMax: String,
val textDay: String, val tempMin: String,
val textNight: String val humidity: String,
val fxDate: String,
val iconDay: String,
val windScaleDay: String,
val pressure: String
) )
package com.base.browserwhite.help package com.base.browserwhite.help
import android.annotation.SuppressLint import android.text.TextUtils
import android.util.Log
import com.base.browserwhite.BuildConfig import com.base.browserwhite.BuildConfig
import com.base.browserwhite.bean.WeatherBean import com.base.browserwhite.bean.WeatherBean
import com.base.browserwhite.bean.WeatherCityBean import com.base.browserwhite.utils.AppPreferences
import com.base.browserwhite.utils.LogEx
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.JsonParser import okhttp3.Call
import com.google.gson.reflect.TypeToken import okhttp3.Callback
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor import okhttp3.logging.HttpLoggingInterceptor
import java.lang.reflect.Type import java.io.IOException
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.concurrent.TimeUnit import java.util.Calendar
//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()
// }
//
//
//}
@SuppressLint("SimpleDateFormat")
object WeatherUtils { 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 const val TAG = "WeatherUtils"
private val url by lazy { private val url by lazy {
val pkg = ConfigHelper.packageName val pkg = ConfigHelper.packageName
val pkgSubString = pkg.filter { it.isLowerCase() }.substring(4, 9) val url = StringBuilder(
val url = StringBuilder("${ConfigHelper.apiUrl}/city/${pkgSubString}tq") "${ConfigHelper.apiUrl}/city/${
// url.append("?pkg=$pkg") pkg.filter { it.isLowerCase() }.substring(4, 9)
url.append("?data=${SimpleDateFormat("yyyyMMMdd").format(System.currentTimeMillis())}") }tq"
)
url.append("?pkg=$pkg")
val sdf = SimpleDateFormat("yyyyMMdd")
url.append("&date=${sdf.format(Calendar.getInstance().time)}")
url.toString() url.toString()
} }
fun getWeather(): WeatherCityBean? { fun requestWeatherData() {
val client = OkHttpClient.Builder().apply {
val client = OkHttpClient.Builder()
.apply {
if (BuildConfig.DEBUG) { if (BuildConfig.DEBUG) {
addInterceptor(HttpLoggingInterceptor().apply { addInterceptor(HttpLoggingInterceptor().apply {
level = HttpLoggingInterceptor.Level.BODY level = HttpLoggingInterceptor.Level.BODY
}) })
} }
connectTimeout(10, TimeUnit.SECONDS)
readTimeout(20, TimeUnit.SECONDS)
writeTimeout(15, TimeUnit.SECONDS)
}.build() }.build()
LogEx.logDebug(TAG, "url=$url")
val request = Request.Builder() val request = Request.Builder()
.url(url) .url(url)
.get()
.build() .build()
client.newCall(request).enqueue(object : Callback {
override fun onFailure(call: Call, e: IOException) {
val response = client.newCall(request).execute() }
override fun onResponse(call: Call, response: Response) {
response.body?.string()?.let { response.body?.string()?.let {
LogEx.logDebug(TAG, it) val i = Regex("\"data\":\"(.*?)\"").find(it)
val dataJson = getDataJson(it) if (i.toString() != "null") {
LogEx.logDebug(TAG, "dataJson=$dataJson") i?.groupValues?.get(1).let {
return parseWeather(dataJson) if (!TextUtils.isEmpty(it)) {
val str = AESHelper.decrypt(it!!)
saveWeatherData(str)
}
}
} }
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 { private fun saveWeatherData(string: String) {
val jsonRootObject = JsonParser.parseString(jsonString).getAsJsonObject() AppPreferences.getInstance().put(getTodayStr() + "_weather", string)
return jsonRootObject["result"].getAsJsonObject()["data"].toString()
} }
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
...@@ -66,7 +66,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(), ...@@ -66,7 +66,7 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
} }
Thread { Thread {
val weatherCityBean = WeatherUtils.getWeather() val weatherCityBean = WeatherUtils.getWeatherEntity()
val weather = weatherCityBean?.list?.random() val weather = weatherCityBean?.list?.random()
if (weather != null) { if (weather != null) {
binding.root.post { binding.root.post {
......
package com.base.browserwhite.ui.activity.weather
import android.annotation.SuppressLint
import android.graphics.Color
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.browserwhite.R
import com.base.browserwhite.ads.AdmobMaxHelper
import com.base.browserwhite.bean.ListBean
import com.base.browserwhite.bean.WeatherBean
import com.base.browserwhite.databinding.ActivityWeatherBinding
import com.base.browserwhite.help.WeatherUtils
import com.base.browserwhite.ui.activity.BaseActivity
import com.base.browserwhite.utils.BarUtils
import kotlin.random.Random
@SuppressLint("SimpleDateFormat")
class WeatherInterface : BaseActivity<ActivityWeatherBinding>() {
override val binding: ActivityWeatherBinding by lazy {
ActivityWeatherBinding.inflate(layoutInflater)
}
var wBean: WeatherBean? = null
override fun initView() {
BarUtils.setStatusBarColor(this, Color.TRANSPARENT)
binding.root.updatePadding(top = BarUtils.getStatusBarHeight())
getData()
AdmobMaxHelper.admobMaxShowNativeAd(this, binding.idFlAd)
}
override fun initListener() {
binding.idBack.setOnClickListener {
onBackPressedDispatcher.onBackPressed()
}
onBackPressedDispatcher.addCallback(object : OnBackPressedCallback(true) {
override fun handleOnBackPressed() {
finishToMain()
}
})
}
private fun getData() {
wBean = WeatherUtils.getWeatherEntity()
if (wBean != null) {
setViews()
} else {
WeatherUtils.requestWeatherData()
}
binding.root.postDelayed({
AdmobMaxHelper.admobMaxShowInterstitialAd(this, false) {
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)
}
}
}
...@@ -32,6 +32,7 @@ import com.base.browserwhite.ui.activity.cleanjunk.ScanJunkActivity ...@@ -32,6 +32,7 @@ import com.base.browserwhite.ui.activity.cleanjunk.ScanJunkActivity
import com.base.browserwhite.ui.activity.news.NewsActivity import com.base.browserwhite.ui.activity.news.NewsActivity
import com.base.browserwhite.ui.activity.news.NewsDetailActivity import com.base.browserwhite.ui.activity.news.NewsDetailActivity
import com.base.browserwhite.ui.activity.scanqrc.ScanQRCActivity import com.base.browserwhite.ui.activity.scanqrc.ScanQRCActivity
import com.base.browserwhite.ui.activity.weather.WeatherInterface
import com.base.browserwhite.ui.activity.webbrowser.WebBrowserActivity import com.base.browserwhite.ui.activity.webbrowser.WebBrowserActivity
import com.base.browserwhite.ui.adapter.HeadWebsiteAdapter import com.base.browserwhite.ui.adapter.HeadWebsiteAdapter
import com.base.browserwhite.ui.adapter.HeaderAdapter import com.base.browserwhite.ui.adapter.HeaderAdapter
...@@ -195,7 +196,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() { ...@@ -195,7 +196,7 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
override fun setListener() { override fun setListener() {
super.setListener() super.setListener()
binding.llWeather.setOnClickListener { binding.llWeather.setOnClickListener {
requireContext().restartStartStayNotification() startActivity(Intent(requireContext(), WeatherInterface::class.java))
} }
binding.flSearchEngine.setOnClickListener { binding.flSearchEngine.setOnClickListener {
...@@ -301,5 +302,4 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() { ...@@ -301,5 +302,4 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
} }
} }
\ 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">
<com.noober.background.view.BLLinearLayout
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>
</com.noober.background.view.BLLinearLayout>
<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" />
<com.noober.background.view.BLLinearLayout
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" />
</com.noober.background.view.BLLinearLayout>
</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">
<com.noober.background.view.BLLinearLayout
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"
app:bl_corners_radius="10dp"
app:bl_solid_color="@color/white">
<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" />
</com.noober.background.view.BLLinearLayout>
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
android:layout_height="36dp" android:layout_height="36dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:background="@drawable/bg_e7eef6_18" android:background="@drawable/bg_e7eef6_18"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@id/tv_name" app:layout_constraintBottom_toBottomOf="@id/tv_name"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_name"> app:layout_constraintTop_toTopOf="@id/tv_name">
......
<?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