Commit 5a2da363 authored by wanglei's avatar wanglei

...

parent 9c9733aa
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
android:theme="@style/Theme.BrowserWhite" android:theme="@style/Theme.BrowserWhite"
tools:targetApi="34"> tools:targetApi="34">
<activity <activity
android:name=".ui.activity.SplashActivity" android:name=".ui.activity.MainActivity"
android:exported="true" android:exported="true"
android:launchMode="singleTask"> android:launchMode="singleTask">
<intent-filter> <intent-filter>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".ui.activity.MainActivity" android:name=".ui.activity.SplashActivity"
android:exported="false" android:exported="false"
android:launchMode="singleTop" android:launchMode="singleTop"
android:screenOrientation="portrait" android:screenOrientation="portrait"
......
...@@ -11,5 +11,4 @@ class NewsBean( ...@@ -11,5 +11,4 @@ class NewsBean(
val type: Int = 0, val type: Int = 0,
val linkPath: String = "",//网站链接 val linkPath: String = "",//网站链接
) { ) {
var isBind: Boolean = false
} }
\ No newline at end of file
package com.base.browserwhite.ui.adapter
import android.content.Context
import android.content.Intent
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.base.browserwhite.R
import com.base.browserwhite.bean.WebSiteBean
import com.base.browserwhite.databinding.ItemWebsiteHeadBinding
import com.base.browserwhite.ui.activity.webbrowser.WebBrowserActivity
import com.base.browserwhite.ui.activity.webstore.WevStoreActivity
import com.base.browserwhite.ui.views.itemtouch.MyItemTouchHelperCallBack
import com.base.browserwhite.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseSingleItemAdapter
class HeadWebsiteAdapter : BaseSingleItemAdapter<List<WebSiteBean>, HeadWebsiteAdapter.VH>() {
inner class VH(view: View) : RecyclerView.ViewHolder(view)
var flag = false
override fun onBindViewHolder(holder: VH, item: List<WebSiteBean>?) {
if (flag) {
return
}
flag = true
val binding = ItemWebsiteHeadBinding.bind(holder.itemView)
val context = holder.itemView.context
binding.rvWebsite.layoutManager = GridLayoutManager(context, 4, LinearLayoutManager.VERTICAL, false)
val websiteAdapter = WebsiteAdapter(0) { bean ->
if (bean.name == "Increase") {
context.startActivity(Intent(context, WevStoreActivity::class.java))
} else {
context.startActivity(Intent(context, WebBrowserActivity::class.java).apply {
putExtra("uri", bean.url)
})
}
}
binding.rvWebsite.adapter = websiteAdapter
val itemTouchHelper = ItemTouchHelper(MyItemTouchHelperCallBack())
itemTouchHelper.attachToRecyclerView(binding.rvWebsite)
websiteAdapter.setData(item)
}
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): VH {
return VH(R.layout.item_website_head.inflate(parent))
}
}
\ No newline at end of file
package com.base.browserwhite.ui.adapter
import android.content.Context
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.base.browserwhite.R
import com.base.browserwhite.utils.XmlEx.inflate
import com.chad.library.adapter4.BaseSingleItemAdapter
class HeaderAdapter: BaseSingleItemAdapter<Any, HeaderAdapter.VH>() {
class VH(view: View): RecyclerView.ViewHolder(view)
override fun onBindViewHolder(holder: VH, item: Any?) {
}
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): VH {
return VH(R.layout.item_head_1.inflate(parent))
}
}
\ No newline at end of file
package com.base.browserwhite.ui.adapter package com.base.browserwhite.ui.adapter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.content.Context
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.lifecycle.LifecycleCoroutineScope
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.ViewHolder import androidx.recyclerview.widget.RecyclerView.ViewHolder
import com.base.browserwhite.R import com.base.browserwhite.R
import com.base.browserwhite.bean.MediaBean
import com.base.browserwhite.bean.NewsBean import com.base.browserwhite.bean.NewsBean
import com.base.browserwhite.databinding.ItemNewsBinding import com.base.browserwhite.databinding.ItemNewsBinding
import com.base.browserwhite.utils.KotlinExt.toFormatTime import com.base.browserwhite.utils.KotlinExt.toFormatTime
import com.base.browserwhite.utils.LogEx import com.base.browserwhite.utils.LogEx
import com.base.browserwhite.utils.NewsUtils
import com.base.browserwhite.utils.XmlEx.inflate import com.base.browserwhite.utils.XmlEx.inflate
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.bumptech.glide.load.DataSource import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target import com.bumptech.glide.request.target.Target
import kotlinx.coroutines.Dispatchers import com.chad.library.adapter4.BaseQuickAdapter
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
class NewsAdapter( class NewsAdapter : BaseQuickAdapter<NewsBean, NewsAdapter.NewsViewHolder>() {
private val lifecycleScope: LifecycleCoroutineScope
) : RecyclerView.Adapter<NewsAdapter.NewsViewHolder>() {
private val TAG = "NewsAdapter" private val TAG = "NewsAdapter"
private val beanList = arrayListOf<NewsBean>()
inner class NewsViewHolder(view: View) : ViewHolder(view) inner class NewsViewHolder(view: View) : ViewHolder(view)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NewsViewHolder {
override fun onCreateViewHolder(context: Context, parent: ViewGroup, viewType: Int): NewsViewHolder {
return NewsViewHolder(R.layout.item_news.inflate(parent)) return NewsViewHolder(R.layout.item_news.inflate(parent))
} }
override fun getItemCount(): Int { override fun onBindViewHolder(holder: NewsViewHolder, position: Int, bean: NewsBean?) {
return beanList.size LogEx.logDebug(TAG,"onBindViewHolder")
if (bean == null) {
return
} }
override fun onBindViewHolder(holder: NewsViewHolder, position: Int) {
val log = "position=${holder.position} " +
"position=${holder.bindingAdapterPosition} " +
"position=${holder.absoluteAdapterPosition} " +
"position=${holder.layoutPosition}"
LogEx.logDebug(
TAG, log
)
val binding = ItemNewsBinding.bind(holder.itemView) val binding = ItemNewsBinding.bind(holder.itemView)
val bean = beanList[holder.position]
// val bean = beanList[position]
val context = holder.itemView.context val context = holder.itemView.context
Glide.with(context).load(bean.orgImgPath).listener(object : RequestListener<Drawable> { Glide.with(context).load(bean.orgImgPath).listener(object : RequestListener<Drawable> {
override fun onLoadFailed( override fun onLoadFailed(
...@@ -59,8 +47,6 @@ class NewsAdapter( ...@@ -59,8 +47,6 @@ class NewsAdapter(
target: Target<Drawable>, target: Target<Drawable>,
isFirstResource: Boolean isFirstResource: Boolean
): Boolean { ): Boolean {
LogEx.logDebug(TAG, "onLoadFailed $log")
// beanList.remove(bean)
return true return true
} }
...@@ -81,35 +67,13 @@ class NewsAdapter( ...@@ -81,35 +67,13 @@ class NewsAdapter(
} }
binding.tvMediaName.text = bean.mediaName binding.tvMediaName.text = bean.mediaName
binding.tvPublishTime.text = bean.publishTime.toFormatTime() binding.tvPublishTime.text = bean.publishTime.toFormatTime()
bean.isBind = true
} }
@SuppressLint("NotifyDataSetChanged") fun getLastPageNumber(): Long? {
fun loadMore( return if (items.isEmpty()) {
categoryId: Int = 0, null
errorCallBack: (() -> Unit)? = null, } else {
callBack: (() -> Unit)? = null items.last().newsId
) {
val position = beanList.size
val last = if (beanList.isEmpty()) null else beanList.last()
LogEx.logDebug(TAG, "newsId=${last?.newsId}")
NewsUtils.requestNews(categoryId, last?.newsId,
errorCallBack = {
errorCallBack?.invoke()
})
{
beanList.addAll(it)
if (beanList.size > 150) {
val item100 = beanList.subList(0, 100)
beanList.removeAll(item100.toSet())
} }
lifecycleScope.launch(Dispatchers.Main) {
this@NewsAdapter.notifyItemInserted(position)
delay(2000)
callBack?.invoke()
} }
}
}
} }
\ No newline at end of file
package com.base.browserwhite.ui.adapter
import android.graphics.drawable.Drawable
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.base.browserwhite.databinding.ItemNewsBinding
import com.base.browserwhite.utils.KotlinExt.toFormatTime
import com.base.browserwhite.utils.LogEx
import com.bumptech.glide.Glide
import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.chad.library.adapter4.loadState.LoadState
import com.chad.library.adapter4.loadState.LoadStateAdapter
//class NewsAdapter2: LoadStateAdapter<NewsAdapter2.NewsViewHolder>() {
// inner class NewsViewHolder(view: View) : RecyclerView.ViewHolder(view)
//
// override fun onBindViewHolder(holder: NewsViewHolder, loadState: LoadState) {
// val binding = ItemNewsBinding.bind(holder.itemView)
// val bean = beanList[holder.position]
// val context = holder.itemView.context
// Glide.with(context).load(bean.orgImgPath).listener(object : RequestListener<Drawable> {
// override fun onLoadFailed(
// e: GlideException?,
// model: Any?,
// target: Target<Drawable>,
// isFirstResource: Boolean
// ): Boolean {
// LogEx.logDebug(TAG, "onLoadFailed $log")
//// beanList.remove(bean)
// return true
// }
//
// override fun onResourceReady(
// resource: Drawable,
// model: Any,
// target: Target<Drawable>?,
// dataSource: DataSource,
// isFirstResource: Boolean
// ): Boolean {
// return false
// }
//
// }).centerCrop().into(binding.ivMedia)
// binding.tvTittle.text = bean.headline
// runCatching {
// Glide.with(context).load(bean.mediaIcon).into(binding.ivIcon)
// }
// binding.tvMediaName.text = bean.mediaName
// binding.tvPublishTime.text = bean.publishTime.toFormatTime()
// bean.isBind = true
// }
//
// override fun onCreateViewHolder(parent: ViewGroup, loadState: LoadState): NewsViewHolder {
// TODO("Not yet implemented")
// }
//}
\ No newline at end of file
...@@ -93,10 +93,10 @@ class WebsiteAdapter(val uiType: Int = 0, val click: (bean: WebSiteBean) -> Unit ...@@ -93,10 +93,10 @@ class WebsiteAdapter(val uiType: Int = 0, val click: (bean: WebSiteBean) -> Unit
} }
@SuppressLint("NotifyDataSetChanged") @SuppressLint("NotifyDataSetChanged")
fun setData(webSiteList: List<WebSiteBean>, addBean: WebSiteBean? = null) { fun setData(webSiteList: List<WebSiteBean>?) {
if (webSiteList.isNullOrEmpty()) return
beanList.clear() beanList.clear()
beanList.addAll(webSiteList) beanList.addAll(webSiteList)
addBean?.let { beanList.add(it) }
notifyDataSetChanged() notifyDataSetChanged()
} }
......
...@@ -4,20 +4,7 @@ import android.content.Intent ...@@ -4,20 +4,7 @@ import android.content.Intent
import android.view.KeyEvent import android.view.KeyEvent
import android.view.inputmethod.EditorInfo.IME_ACTION_DONE import android.view.inputmethod.EditorInfo.IME_ACTION_DONE
import android.widget.TextView import android.widget.TextView
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.OnScrollListener
import androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE
import com.base.browserwhite.R import com.base.browserwhite.R
import com.base.browserwhite.bean.ConstObject.BAIDU
import com.base.browserwhite.bean.ConstObject.BING
import com.base.browserwhite.bean.ConstObject.DUCKDUCKGO
import com.base.browserwhite.bean.ConstObject.GOOGLE
import com.base.browserwhite.bean.ConstObject.YAHOO
import com.base.browserwhite.bean.ConstObject.YANDEX
import com.base.browserwhite.bean.WebSiteBean import com.base.browserwhite.bean.WebSiteBean
import com.base.browserwhite.bean.defaultValue import com.base.browserwhite.bean.defaultValue
import com.base.browserwhite.bean.webSiteGroupBeanList import com.base.browserwhite.bean.webSiteGroupBeanList
...@@ -25,14 +12,15 @@ import com.base.browserwhite.databinding.FragmentHomeBinding ...@@ -25,14 +12,15 @@ import com.base.browserwhite.databinding.FragmentHomeBinding
import com.base.browserwhite.service.StayNotificationService.Companion.restartStartStayNotification import com.base.browserwhite.service.StayNotificationService.Companion.restartStartStayNotification
import com.base.browserwhite.ui.activity.scanqrc.ScanQRCActivity import com.base.browserwhite.ui.activity.scanqrc.ScanQRCActivity
import com.base.browserwhite.ui.activity.webbrowser.WebBrowserActivity import com.base.browserwhite.ui.activity.webbrowser.WebBrowserActivity
import com.base.browserwhite.ui.activity.webstore.WevStoreActivity import com.base.browserwhite.ui.adapter.HeadWebsiteAdapter
import com.base.browserwhite.ui.adapter.HeaderAdapter
import com.base.browserwhite.ui.adapter.NewsAdapter import com.base.browserwhite.ui.adapter.NewsAdapter
import com.base.browserwhite.ui.adapter.WebsiteAdapter
import com.base.browserwhite.ui.views.DialogViews.showSearchEngineDialog
import com.base.browserwhite.ui.views.itemtouch.MyItemTouchHelperCallBack
import com.base.browserwhite.utils.AppPreferences import com.base.browserwhite.utils.AppPreferences
import com.base.browserwhite.utils.LogEx import com.base.browserwhite.utils.LogEx
import java.util.concurrent.atomic.AtomicBoolean import com.base.browserwhite.utils.NewsUtils.requestNews
import com.chad.library.adapter4.QuickAdapterHelper
import com.chad.library.adapter4.loadState.LoadState
import com.chad.library.adapter4.loadState.trailing.TrailingLoadStateAdapter
class HomeFragment : BaseFragment<FragmentHomeBinding>() { class HomeFragment : BaseFragment<FragmentHomeBinding>() {
...@@ -42,62 +30,66 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() { ...@@ -42,62 +30,66 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
FragmentHomeBinding.inflate(layoutInflater) FragmentHomeBinding.inflate(layoutInflater)
} }
private lateinit var websiteAdapter: WebsiteAdapter
private lateinit var itemTouchHelper: ItemTouchHelper
private lateinit var newsAdapter: NewsAdapter private lateinit var newsAdapter: NewsAdapter
private var isLoadingMore: AtomicBoolean = AtomicBoolean(false) private lateinit var helper: QuickAdapterHelper
private var isLoading = false
override fun setView() { override fun setView() {
binding.rvWeb.layoutManager = GridLayoutManager(requireContext(), 4, LinearLayoutManager.VERTICAL, false)
websiteAdapter = WebsiteAdapter(0) { bean -> newsAdapter = NewsAdapter()
if (bean.name == "Increase") { helper =
requireContext().startActivity(Intent(requireContext(), WevStoreActivity::class.java)) QuickAdapterHelper.Builder(newsAdapter).setTrailingLoadStateAdapter(object : TrailingLoadStateAdapter.OnTrailingListener {
} else { override fun onLoad() {
requireContext().startActivity(Intent(requireContext(), WebBrowserActivity::class.java).apply { LogEx.logDebug(TAG, "onLoad")
putExtra("uri", bean.url) requestMore()
}) }
override fun onFailRetry() {
LogEx.logDebug(TAG, "onFailRetry")
requestMore()
} }
override fun isAllowLoading(): Boolean {
LogEx.logDebug(TAG, "isLoading=$isLoading")
return !isLoading
} }
binding.rvWeb.adapter = websiteAdapter }).build()
itemTouchHelper = ItemTouchHelper(MyItemTouchHelperCallBack()) // 设置预加载,请调用以下方法
itemTouchHelper.attachToRecyclerView(binding.rvWeb) // helper.trailingLoadStateAdapter?.preloadSize = 1
helper.addBeforeAdapter(0, HeaderAdapter())
newsAdapter = NewsAdapter(lifecycleScope) binding.rv.adapter = helper.adapter
binding.rvNews.adapter = newsAdapter
binding.rvNews.addOnScrollListener(object : OnScrollListener() {
var i = 0
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy) requestMore()
} }
override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) { fun requestMore() {
super.onScrollStateChanged(recyclerView, newState) isLoading = true
i++ helper.trailingLoadState = LoadState.None
if (newState == SCROLL_STATE_IDLE && !binding.rvNews.canScrollVertically(1)) { val lastNewsId = newsAdapter.getLastPageNumber()
loadMoreData() LogEx.logDebug(TAG, "requestMore lastNewsId=$lastNewsId")
requestNews(pageNumber = lastNewsId, errorCallBack = {
isLoading = false
LogEx.logDebug(TAG, "errorCallBack")
}, beanCallBack = {
isLoading = false
binding.root.post {
LogEx.logDebug(TAG, "beanCallBack")
if (lastNewsId == null) {
newsAdapter.submitList(it)
} else {
newsAdapter.addAll(it)
} }
helper.trailingLoadState = LoadState.NotLoading(false)
} }
})
loadMoreData()
}
private fun loadMoreData() {
if (isLoadingMore.get()) return
isLoadingMore.set(true)
LogEx.logDebug(TAG, "load data")
newsAdapter.loadMore(
errorCallBack = {
isLoadingMore.set(false)
},
callBack = {
LogEx.logDebug(TAG, "loadMore BACK")
isLoadingMore.set(false)
}) })
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
setWebSiteData() setWebSiteData()
...@@ -108,10 +100,16 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() { ...@@ -108,10 +100,16 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>() {
val recommendWebSite = webSiteGroupBeanList.flatMap { it.items }.filter { bean -> val recommendWebSite = webSiteGroupBeanList.flatMap { it.items }.filter { bean ->
AppPreferences.getInstance().getBoolean("${bean.id}_${bean.name}", defaultValue(bean.name)) AppPreferences.getInstance().getBoolean("${bean.id}_${bean.name}", defaultValue(bean.name))
} }
websiteAdapter.setData(recommendWebSite, WebSiteBean(name = "Increase").apply { val list = arrayListOf<WebSiteBean>()
list.addAll(recommendWebSite)
list.add(WebSiteBean(name = "Increase").apply {
localIcon = R.mipmap.increase localIcon = R.mipmap.increase
increase = true increase = true
}) })
val headWebsiteAdapter = HeadWebsiteAdapter()
headWebsiteAdapter.setItem(list, null)
helper.addBeforeAdapter(1, headWebsiteAdapter)
} }
override fun setListener() { override fun setListener() {
......
...@@ -8,7 +8,7 @@ import javax.crypto.spec.SecretKeySpec ...@@ -8,7 +8,7 @@ import javax.crypto.spec.SecretKeySpec
object AESHelper { object AESHelper {
private const val aesKey = "g78bbcrtr4iaeekw" private const val aesKey = "ez9r013lcubfpepu"
private val cipher by lazy { private val cipher by lazy {
Cipher.getInstance("AES/GCM/NoPadding") Cipher.getInstance("AES/GCM/NoPadding")
......
...@@ -32,7 +32,7 @@ object ConfigHelper { ...@@ -32,7 +32,7 @@ object ConfigHelper {
var mustShowNativeAd: Boolean = false var mustShowNativeAd: Boolean = false
// 正式包名 // 正式包名
const val packageName = "com.pdfninja.pdfreaderandimagetopdf.bmw" const val packageName = "com.ok.ai.browser.jojo"
val noLoadingActivities = listOf( val noLoadingActivities = listOf(
"full", // 过滤全屏广告 "full", // 过滤全屏广告
......
...@@ -35,7 +35,7 @@ object NewsUtils { ...@@ -35,7 +35,7 @@ object NewsUtils {
fun requestNews( fun requestNews(
categoryId: Int = 0, categoryId: Int = 0,
pageNumber: Long? = null, pageNumber: Long? = null,
errorCallBack:()->Unit, errorCallBack: () -> Unit,
beanCallBack: (beanList: List<NewsBean>) -> Unit beanCallBack: (beanList: List<NewsBean>) -> Unit
) { ) {
val pkg = ConfigHelper.packageName val pkg = ConfigHelper.packageName
......
...@@ -169,149 +169,12 @@ ...@@ -169,149 +169,12 @@
</com.google.android.material.appbar.AppBarLayout> </com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FDFDFD"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal"
tools:ignore="UselessParent">
<LinearLayout
android:id="@+id/ll_news"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/news"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="News"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_clean"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/clean"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="Clean"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_process"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical" android:orientation="vertical"
android:visibility="invisible" app:layout_behavior="@string/appbar_scrolling_view_behavior">
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/process"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="Process"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_bookmark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:visibility="invisible"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/bookmark"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="Bookmark"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -321,47 +184,12 @@ ...@@ -321,47 +184,12 @@
android:background="#E5E6EB" /> android:background="#E5E6EB" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_web" android:id="@+id/rv"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="40dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
android:text="News"
android:textColor="@color/black"
android:textSize="18sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|end"
android:text="More"
android:textColor="#0571ED"
android:textSize="15sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_news"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/item_news" />
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ 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:baselineAligned="false"
android:orientation="horizontal"
tools:ignore="UselessParent">
<LinearLayout
android:id="@+id/ll_news"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/news"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="News"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_clean"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/clean"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="Clean"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_process"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:visibility="invisible"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/process"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="Process"
tools:ignore="HardcodedText" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_bookmark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:visibility="invisible"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:src="@mipmap/bookmark"
tools:ignore="ContentDescription" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="8.5dp"
android:layout_marginBottom="5dp"
android:text="Bookmark"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView 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:id="@+id/rv_website"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_span="3"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
tools:listitem="@layout/item_website_grid">
</androidx.recyclerview.widget.RecyclerView>
\ 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