mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Merge branch 'master' into settings
This commit is contained in:
commit
3cb878acd7
@ -5,8 +5,9 @@
|
||||
|
||||
<a href="https://hosted.weblate.org/projects/libretube/#languages" alt="Translation Status"><img src="https://hosted.weblate.org/widgets/libretube/-/svg-badge.svg"></a>
|
||||
[![GPL-v3](https://shields.io/badge/License-GPL%20v3-red.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)
|
||||
[![Matrix](https://badges.alefvanoon.xyz/matrix/LibreTube:matrix.org)](https://matrix.to/#/#LibreTube:matrix.org)
|
||||
[![Twitter](https://badges.alefvanoon.xyz/twitter/follow/libretube?style=social)](https://twitter.com/libretube)
|
||||
[![Matrix](https://img.shields.io/matrix/LibreTube:matrix.org)](https://matrix.to/#/#LibreTube:matrix.org)
|
||||
[![Telegram](https://img.shields.io/endpoint?color=neon&style=flat-square&url=https://tg.sumanjay.workers.dev/libretube)](https://t.me/libretube)
|
||||
[![Twitter](https://img.shields.io/twitter/follow/libretube?style=social)](https://twitter.com/libretube)
|
||||
|
||||
|
||||
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" alt="Get it on F-Droid" height="80">](https://f-droid.org/en/packages/com.github.libretube/)
|
||||
|
@ -48,8 +48,8 @@ class Library : Fragment() {
|
||||
playlistRecyclerView.layoutManager = LinearLayoutManager(view.context)
|
||||
val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE)
|
||||
token = sharedPref?.getString("token","")!!
|
||||
refreshLayout = view.findViewById(R.id.playlist_refresh)
|
||||
if(token!="") {
|
||||
refreshLayout = view.findViewById(R.id.playlist_refresh)
|
||||
view.findViewById<ImageView>(R.id.boogh2).visibility=View.GONE
|
||||
view.findViewById<TextView>(R.id.textLike2).visibility=View.GONE
|
||||
fetchPlaylists(view)
|
||||
@ -67,6 +67,8 @@ class Library : Fragment() {
|
||||
createPlaylist("$playlistName", view);
|
||||
}
|
||||
} else{
|
||||
refreshLayout?.isEnabled = false
|
||||
view.findViewById<Button>(R.id.create_playlist).visibility = View.GONE
|
||||
with(view.findViewById<ImageView>(R.id.boogh2)){
|
||||
visibility=View.VISIBLE
|
||||
setImageResource(R.drawable.ic_login)
|
||||
|
@ -6,6 +6,8 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.content.res.Configuration
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.NetworkInfo
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
@ -14,6 +16,7 @@ import android.os.Handler
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Button
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.app.AppCompatDelegate
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
@ -58,46 +61,59 @@ class MainActivity : AppCompatActivity() {
|
||||
Locale.setDefault(locale)
|
||||
res.updateConfiguration(conf, dm)
|
||||
}
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
when (sharedPreferences.getString("theme_togglee", "A")!!) {
|
||||
"A" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||
"L" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
|
||||
"D" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||
}
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
|
||||
bottomNavigationView = findViewById(R.id.bottomNav)
|
||||
navController = findNavController(R.id.fragment)
|
||||
bottomNavigationView.setupWithNavController(navController)
|
||||
val connectivityManager = this.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
val networkInfo=connectivityManager.activeNetworkInfo
|
||||
val isConnected = networkInfo != null && networkInfo.isConnected
|
||||
|
||||
bottomNavigationView.setOnItemSelectedListener {
|
||||
when(it.itemId){
|
||||
R.id.home2 -> {
|
||||
navController.backQueue.clear()
|
||||
navController.navigate(R.id.home2)
|
||||
true
|
||||
}
|
||||
R.id.subscriptions -> {
|
||||
//navController.backQueue.clear()
|
||||
navController.navigate(R.id.subscriptions)
|
||||
true
|
||||
}
|
||||
R.id.library -> {
|
||||
//navController.backQueue.clear()
|
||||
navController.navigate(R.id.library)
|
||||
true
|
||||
}
|
||||
if (isConnected == false) {
|
||||
setContentView(R.layout.activity_nointernet)
|
||||
findViewById<Button>(R.id.retry_button).setOnClickListener() {
|
||||
recreate()
|
||||
}
|
||||
false
|
||||
}
|
||||
} else {
|
||||
setContentView(R.layout.activity_main)
|
||||
|
||||
toolbar = findViewById(R.id.toolbar)
|
||||
val hexColor = String.format("#%06X", 0xFFFFFF and 0xcc322d)
|
||||
val appName = HtmlCompat.fromHtml(
|
||||
"Libre<span style='color:$hexColor';>Tube</span>",
|
||||
HtmlCompat.FROM_HTML_MODE_COMPACT
|
||||
)
|
||||
toolbar.title= appName
|
||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
|
||||
|
||||
bottomNavigationView = findViewById(R.id.bottomNav)
|
||||
navController = findNavController(R.id.fragment)
|
||||
bottomNavigationView.setupWithNavController(navController)
|
||||
|
||||
bottomNavigationView.setOnItemSelectedListener {
|
||||
when (it.itemId) {
|
||||
R.id.home2 -> {
|
||||
navController.backQueue.clear()
|
||||
navController.navigate(R.id.home2)
|
||||
true
|
||||
}
|
||||
R.id.subscriptions -> {
|
||||
//navController.backQueue.clear()
|
||||
navController.navigate(R.id.subscriptions)
|
||||
true
|
||||
}
|
||||
R.id.library -> {
|
||||
//navController.backQueue.clear()
|
||||
navController.navigate(R.id.library)
|
||||
true
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
toolbar = findViewById(R.id.toolbar)
|
||||
val hexColor = String.format("#%06X", 0xFFFFFF and 0xcc322d)
|
||||
val appName = HtmlCompat.fromHtml(
|
||||
"Libre<span style='color:$hexColor';>Tube</span>",
|
||||
HtmlCompat.FROM_HTML_MODE_COMPACT
|
||||
)
|
||||
toolbar.title = appName
|
||||
|
||||
toolbar.setNavigationOnClickListener{
|
||||
//settings activity stuff
|
||||
@ -106,17 +122,17 @@ class MainActivity : AppCompatActivity() {
|
||||
true
|
||||
}
|
||||
|
||||
toolbar.setOnMenuItemClickListener{
|
||||
when (it.itemId){
|
||||
R.id.action_search -> {
|
||||
navController.navigate(R.id.searchFragment)
|
||||
true
|
||||
toolbar.setOnMenuItemClickListener {
|
||||
when (it.itemId) {
|
||||
R.id.action_search -> {
|
||||
navController.navigate(R.id.searchFragment)
|
||||
true
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
|
@ -11,15 +11,17 @@ import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.AutoCompleteTextView
|
||||
import android.widget.TextView.OnEditorActionListener
|
||||
import android.widget.TextView.*
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.adapters.SearchAdapter
|
||||
import com.github.libretube.adapters.SearchHistoryAdapter
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
@ -48,36 +50,70 @@ class SearchFragment : Fragment() {
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val recyclerView = view.findViewById<RecyclerView>(R.id.search_recycler)
|
||||
recyclerView.layoutManager = GridLayoutManager(view.context, 1)
|
||||
|
||||
val autoTextView = view.findViewById<AutoCompleteTextView>(R.id.autoCompleteTextView)
|
||||
|
||||
val historyRecycler = view.findViewById<RecyclerView>(R.id.history_recycler)
|
||||
|
||||
|
||||
//show search history
|
||||
|
||||
recyclerView.visibility = GONE
|
||||
historyRecycler.visibility = VISIBLE
|
||||
|
||||
historyRecycler.layoutManager = LinearLayoutManager(view.context)
|
||||
|
||||
var historylist = getHistory()
|
||||
if (historylist.size != 0) {
|
||||
historyRecycler.adapter =
|
||||
SearchHistoryAdapter(requireContext(), historylist, autoTextView)
|
||||
}
|
||||
|
||||
recyclerView.layoutManager = GridLayoutManager(view.context, 1)
|
||||
autoTextView.requestFocus()
|
||||
val imm = requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
val imm =
|
||||
requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
||||
imm!!.showSoftInput(autoTextView, InputMethodManager.SHOW_IMPLICIT)
|
||||
autoTextView.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
count: Int,
|
||||
after: Int
|
||||
) {
|
||||
autoTextView.addTextChangedListener(object : TextWatcher {
|
||||
override fun beforeTextChanged(
|
||||
s: CharSequence?,
|
||||
start: Int,
|
||||
count: Int,
|
||||
after: Int
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if (s!! != "") {
|
||||
recyclerView.visibility = VISIBLE
|
||||
historyRecycler.visibility = GONE
|
||||
recyclerView.adapter = null
|
||||
|
||||
GlobalScope.launch {
|
||||
fetchSuggestions(s.toString(), autoTextView)
|
||||
delay(3000)
|
||||
addtohistory(s.toString())
|
||||
fetchSearch(s.toString(), recyclerView)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||
if(s!! != ""){
|
||||
GlobalScope.launch {
|
||||
fetchSuggestions(s.toString(), autoTextView)
|
||||
delay(3000)
|
||||
fetchSearch(s.toString(),recyclerView)
|
||||
}
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
if (s!!.isEmpty()) {
|
||||
recyclerView.visibility = GONE
|
||||
historyRecycler.visibility = VISIBLE
|
||||
var historylist = getHistory()
|
||||
if (historylist.size != 0) {
|
||||
historyRecycler.adapter =
|
||||
SearchHistoryAdapter(requireContext(), historylist, autoTextView)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun afterTextChanged(s: Editable?) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
autoTextView.setOnEditorActionListener(OnEditorActionListener { _, actionId, _ ->
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
hideKeyboard();
|
||||
@ -143,4 +179,43 @@ class SearchFragment : Fragment() {
|
||||
super.onStop()
|
||||
hideKeyboard()
|
||||
}
|
||||
|
||||
private fun addtohistory(query: String) {
|
||||
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
|
||||
var historyList = getHistory()
|
||||
|
||||
|
||||
if (historyList.size != 0 && query == historyList.get(historyList.size - 1)) {
|
||||
return
|
||||
} else if (query == "") {
|
||||
return
|
||||
} else {
|
||||
historyList = historyList + query
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (historyList.size > 10) {
|
||||
historyList = historyList.takeLast(10)
|
||||
}
|
||||
|
||||
var set: Set<String> = HashSet(historyList)
|
||||
|
||||
sharedPreferences.edit().putStringSet("search_history", set)
|
||||
.apply()
|
||||
}
|
||||
|
||||
private fun getHistory(): List<String> {
|
||||
try {
|
||||
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||
val set: Set<String> = sharedPreferences.getStringSet("search_history", HashSet())!!
|
||||
return set.toList()
|
||||
} catch (e: Exception) {
|
||||
return emptyList()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,11 +9,11 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.squareup.picasso.Picasso
|
||||
import com.github.libretube.PlayerFragment
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.github.libretube.formatShort
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.squareup.picasso.Picasso
|
||||
|
||||
class ChannelAdapter(private val videoFeed: MutableList<StreamItem>): RecyclerView.Adapter<ChannelViewHolder>() {
|
||||
override fun getItemCount(): Int {
|
||||
|
@ -12,12 +12,12 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.squareup.picasso.Picasso
|
||||
import com.github.libretube.PlayerFragment
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.RetrofitInstance
|
||||
import com.github.libretube.obj.PlaylistId
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.squareup.picasso.Picasso
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import retrofit2.HttpException
|
||||
|
@ -2,16 +2,18 @@ package com.github.libretube.adapters
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.*
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.*
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.RetrofitInstance
|
||||
import com.github.libretube.obj.PlaylistId
|
||||
import com.github.libretube.obj.Playlists
|
||||
import com.squareup.picasso.Picasso
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.github.libretube.adapters
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.format.DateUtils
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@ -10,11 +11,11 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.squareup.picasso.Picasso
|
||||
import com.github.libretube.PlayerFragment
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.obj.SearchItem
|
||||
import com.github.libretube.formatShort
|
||||
import com.github.libretube.obj.SearchItem
|
||||
import com.squareup.picasso.Picasso
|
||||
|
||||
|
||||
class SearchAdapter(private val searchItems: List<SearchItem>): RecyclerView.Adapter<CustomViewHolder1>() {
|
||||
@ -52,6 +53,8 @@ class CustomViewHolder1(private val v: View): RecyclerView.ViewHolder(v){
|
||||
private fun bindWatch(item: SearchItem) {
|
||||
val thumbnailImage = v.findViewById<ImageView>(R.id.search_thumbnail)
|
||||
Picasso.get().load(item.thumbnail).into(thumbnailImage)
|
||||
val thumbnailDuration = v.findViewById<TextView>(R.id.search_thumbnail_duration)
|
||||
thumbnailDuration.text = DateUtils.formatElapsedTime(item.duration!!)
|
||||
val channelImage = v.findViewById<ImageView>(R.id.search_channel_image)
|
||||
Picasso.get().load(item.uploaderAvatar).into(channelImage)
|
||||
val title = v.findViewById<TextView>(R.id.search_description)
|
||||
@ -89,7 +92,7 @@ class CustomViewHolder1(private val v: View): RecyclerView.ViewHolder(v){
|
||||
val channelName = v.findViewById<TextView>(R.id.search_channel_name)
|
||||
channelName.text = item.name
|
||||
val channelViews = v.findViewById<TextView>(R.id.search_views)
|
||||
channelViews.text = item.subscribers.formatShort() + " subscribers • "+ item.videos + " videos"
|
||||
channelViews.text = v.context.getString(R.string.subscribers, item.subscribers.formatShort()) + " • " + v.context.getString(R.string.videoCount, item.videos.toString())
|
||||
v.setOnClickListener {
|
||||
val activity = v.context as MainActivity
|
||||
val bundle = bundleOf("channel_id" to item.url)
|
||||
|
@ -0,0 +1,55 @@
|
||||
package com.github.libretube.adapters
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AutoCompleteTextView
|
||||
import android.widget.TextView
|
||||
import androidx.preference.PreferenceManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.R
|
||||
import com.google.android.material.imageview.ShapeableImageView
|
||||
|
||||
|
||||
class SearchHistoryAdapter(private val context: Context, private var historyList: List<String> , private val editText : AutoCompleteTextView) :
|
||||
RecyclerView.Adapter<SearchHistoryViewHolder>() {
|
||||
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return historyList.size
|
||||
}
|
||||
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): SearchHistoryViewHolder {
|
||||
val layoutInflater = LayoutInflater.from(parent.context)
|
||||
val cell = layoutInflater.inflate(R.layout.searchhistory_row, parent, false)
|
||||
return SearchHistoryViewHolder(cell)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: SearchHistoryViewHolder, position: Int) {
|
||||
val history = historyList[position]
|
||||
holder.v.findViewById<TextView>(R.id.history_text).text = history
|
||||
|
||||
|
||||
holder.v.findViewById<ShapeableImageView>(R.id.delete_history).setOnClickListener {
|
||||
val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
|
||||
historyList = historyList - history
|
||||
|
||||
sharedPreferences.edit().putStringSet("search_history", HashSet(historyList))
|
||||
.apply()
|
||||
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
|
||||
holder.v.setOnClickListener {
|
||||
editText.setText(history)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SearchHistoryViewHolder(val v: View) : RecyclerView.ViewHolder(v) {
|
||||
init {
|
||||
}
|
||||
}
|
@ -12,11 +12,11 @@ import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.squareup.picasso.Picasso
|
||||
import com.github.libretube.PlayerFragment
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.github.libretube.formatShort
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.squareup.picasso.Picasso
|
||||
|
||||
class SubscriptionAdapter(private val videoFeed: List<StreamItem>): RecyclerView.Adapter<SubscriptionViewHolder>() {
|
||||
//private var limitedVideoFeed: MutableList<String> = [""].toMutableList()
|
||||
|
@ -1,20 +1,16 @@
|
||||
package com.github.libretube.adapters
|
||||
|
||||
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.appcompat.app.AppCompatActivity
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.github.libretube.PlayerFragment
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.obj.Subscription
|
||||
import com.squareup.picasso.Picasso
|
||||
import org.w3c.dom.Text
|
||||
|
||||
class SubscriptionChannelAdapter(private val subscriptions: MutableList<Subscription>): RecyclerView.Adapter<SubscriptionChannelViewHolder>() {
|
||||
override fun getItemCount(): Int {
|
||||
|
@ -12,11 +12,11 @@ import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.github.libretube.MainActivity
|
||||
import com.squareup.picasso.Picasso
|
||||
import com.github.libretube.PlayerFragment
|
||||
import com.github.libretube.R
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.github.libretube.formatShort
|
||||
import com.github.libretube.obj.StreamItem
|
||||
import com.squareup.picasso.Picasso
|
||||
|
||||
class TrendingAdapter(private val videoFeed: List<StreamItem>): RecyclerView.Adapter<CustomViewHolder>() {
|
||||
override fun getItemCount(): Int {
|
||||
|
@ -1,5 +1,11 @@
|
||||
<vector android:height="24dp" android:tint="#FFFFFF"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z" />
|
||||
</vector>
|
||||
|
11
app/src/main/res/drawable/ic_history.xml
Normal file
11
app/src/main/res/drawable/ic_history.xml
Normal file
@ -0,0 +1,11 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="?attr/colorControlNormal"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.25,2.52 0.77,-1.28 -3.52,-2.09L13.5,8z" />
|
||||
</vector>
|
10
app/src/main/res/drawable/ic_wifi_off.xml
Normal file
10
app/src/main/res/drawable/ic_wifi_off.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M22.99,9C19.15,5.16 13.8,3.76 8.84,4.78l2.52,2.52c3.47,-0.17 6.99,1.05 9.63,3.7l2,-2zM18.99,13c-1.29,-1.29 -2.84,-2.13 -4.49,-2.56l3.53,3.53 0.96,-0.97zM2,3.05L5.07,6.1C3.6,6.82 2.22,7.78 1,9l1.99,2c1.24,-1.24 2.67,-2.16 4.2,-2.77l2.24,2.24C7.81,10.89 6.27,11.73 5,13v0.01L6.99,15c1.36,-1.36 3.14,-2.04 4.92,-2.06L18.98,20l1.27,-1.26L3.29,1.79 2,3.05zM9,17l3,3 3,-3c-1.65,-1.66 -4.34,-1.66 -6,0z"/>
|
||||
</vector>
|
37
app/src/main/res/layout/activity_nointernet.xml
Normal file
37
app/src/main/res/layout/activity_nointernet.xml
Normal file
@ -0,0 +1,37 @@
|
||||
<?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">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/noInternet_imageView"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_marginTop="-50dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_wifi_off" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/noInternet"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/noInternet_imageView" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/retry_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/retry"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -56,7 +56,7 @@
|
||||
android:text="@string/createPlaylist"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="8dp"
|
||||
android:drawableLeft="@drawable/ic_add"/>
|
||||
android:drawableLeft="@drawable/ic_add" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -305,257 +305,6 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/linLayout"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- >-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/player_info_layout"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content">-->
|
||||
|
||||
<!-- <androidx.constraintlayout.widget.ConstraintLayout-->
|
||||
<!-- android:id="@+id/player_title_layout"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent">-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/player_title"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:padding="8dp"-->
|
||||
<!-- android:paddingLeft="8dp"-->
|
||||
<!-- android:paddingRight="8dp"-->
|
||||
<!-- android:text="Loading..."-->
|
||||
<!-- android:textSize="18sp"-->
|
||||
<!-- android:textStyle="bold"-->
|
||||
<!-- app:layout_constraintEnd_toStartOf="@id/player_description_arrow"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/player_views_info"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:paddingLeft="8dp"-->
|
||||
<!-- android:paddingRight="8dp"-->
|
||||
<!-- android:text=""-->
|
||||
<!-- android:textSize="12sp"-->
|
||||
<!-- app:layout_constraintEnd_toStartOf="@id/player_description_arrow"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/player_title" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/player_description_arrow"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginEnd="8dp"-->
|
||||
<!-- android:paddingLeft="16dp"-->
|
||||
<!-- android:src="@drawable/ic_arrow_down"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/player_description"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:padding="8dp"-->
|
||||
<!-- android:textSize="14sp"-->
|
||||
<!-- android:visibility="gone"-->
|
||||
<!-- android:autoLink="web"-->
|
||||
<!-- android:textIsSelectable="true"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/player_title_layout" />-->
|
||||
<!-- </androidx.constraintlayout.widget.ConstraintLayout>-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- android:weightSum="5"-->
|
||||
<!-- android:baselineAligned="false">-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/player_like"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerInParent="true"-->
|
||||
<!-- android:layout_marginBottom="16dp"-->
|
||||
<!-- android:src="@drawable/ic_like"-->
|
||||
<!-- android:contentDescription="like"/>-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textLike"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_below="@id/player_like"-->
|
||||
<!-- android:layout_centerHorizontal="true"-->
|
||||
<!-- android:text="1K" />-->
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:id="@+id/relPlayer_share"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="?android:attr/selectableItemBackground">-->
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/player_share"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerInParent="true"-->
|
||||
<!-- android:layout_marginBottom="16dp"-->
|
||||
<!-- android:src="@drawable/ic_share" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textShare"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_below="@id/player_share"-->
|
||||
<!-- android:layout_centerHorizontal="true"-->
|
||||
<!-- android:text="@string/share" />-->
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:id="@+id/relPlayer_download"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="?android:attr/selectableItemBackground">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/player_download"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerInParent="true"-->
|
||||
<!-- android:layout_marginBottom="16dp"-->
|
||||
<!-- android:src="@drawable/ic_download" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textDownload"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_below="@id/player_download"-->
|
||||
<!-- android:layout_centerHorizontal="true"-->
|
||||
<!-- android:text="@string/download" />-->
|
||||
<!-- </RelativeLayout>-->
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:id="@+id/relPlayer_vlc"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="?android:attr/selectableItemBackground">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/player_vlc"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerInParent="true"-->
|
||||
<!-- android:layout_marginBottom="16dp"-->
|
||||
<!-- android:src="@drawable/ic_vlc" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textVlc"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_below="@id/player_vlc"-->
|
||||
<!-- android:layout_centerHorizontal="true"-->
|
||||
<!-- android:text="@string/vlc" />-->
|
||||
<!-- </RelativeLayout>-->
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:id="@+id/save"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_weight="1"-->
|
||||
<!-- android:background="?android:attr/selectableItemBackground">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/player_save"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerInParent="true"-->
|
||||
<!-- android:layout_marginBottom="16dp"-->
|
||||
<!-- android:src="@drawable/ic_save" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/textSave"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_below="@id/player_save"-->
|
||||
<!-- android:layout_centerHorizontal="true"-->
|
||||
<!-- android:text="@string/save" />-->
|
||||
<!-- </RelativeLayout>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:id="@+id/player_channel"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginTop="8dp"-->
|
||||
<!-- android:paddingLeft="8dp"-->
|
||||
<!-- android:paddingRight="8dp"-->
|
||||
<!-- android:layout_marginStart="8dp"-->
|
||||
<!-- android:background="?android:attr/selectableItemBackground">-->
|
||||
|
||||
<!-- <de.hdodenhof.circleimageview.CircleImageView-->
|
||||
<!-- android:id="@+id/player_channelImage"-->
|
||||
<!-- android:layout_width="40dp"-->
|
||||
<!-- android:layout_height="40dp"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginEnd="4dp" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/player_channelName"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_toStartOf="@+id/player_subscribe"-->
|
||||
<!-- android:layout_toEndOf="@+id/player_channelImage"-->
|
||||
<!-- android:ellipsize="end"-->
|
||||
<!-- android:maxLines="1"-->
|
||||
<!-- android:text=""-->
|
||||
<!-- android:textStyle="bold" />-->
|
||||
|
||||
|
||||
<!-- <com.google.android.material.button.MaterialButton-->
|
||||
<!-- android:id="@+id/player_subscribe"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_alignParentEnd="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:background="?android:attr/selectableItemBackground"-->
|
||||
<!-- android:text="@string/subscribe"-->
|
||||
<!-- android:textColor="@color/colorPrimary" />-->
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:descendantFocusability="blocksDescendants">-->
|
||||
|
||||
<!-- <androidx.recyclerview.widget.RecyclerView-->
|
||||
<!-- android:id="@+id/player_recView"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:nestedScrollingEnabled="false" />-->
|
||||
<!-- </RelativeLayout>-->
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
@ -4,38 +4,37 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".SearchFragment"
|
||||
>
|
||||
tools:context=".SearchFragment">
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/outlinedTextField"
|
||||
style="@style/Widget.Material3.CardView.Filled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="16dp"
|
||||
app:cardCornerRadius="27dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_margin="5dp"
|
||||
>
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:hintEnabled="false"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:background="@android:color/transparent"
|
||||
>
|
||||
android:layout_marginRight="20dp"
|
||||
android:background="@android:color/transparent"
|
||||
app:hintEnabled="false">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/autoCompleteTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/transparent"
|
||||
android:hint="Search"
|
||||
android:imeOptions="actionSearch"
|
||||
android:inputType="text"
|
||||
android:maxLines="1"
|
||||
android:background="@android:color/transparent"
|
||||
android:padding="12dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
@ -43,6 +42,263 @@
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_genres"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_margin="25dp"-->
|
||||
<!-- android:text="Explore different genres"-->
|
||||
<!-- android:textSize="16sp"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/outlinedTextField" />-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/genres"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="10dp"-->
|
||||
<!-- android:layout_marginTop="30dp"-->
|
||||
<!-- android:layout_marginRight="10dp"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/tv_genres">-->
|
||||
|
||||
<!-- <com.google.android.material.card.MaterialCardView-->
|
||||
<!-- android:id="@+id/btn_trending"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="20dp"-->
|
||||
<!-- android:layout_marginRight="20dp"-->
|
||||
<!-- android:layout_weight=".5"-->
|
||||
<!-- android:background="@android:color/transparent"-->
|
||||
<!-- app:cardBackgroundColor="@android:color/transparent"-->
|
||||
<!-- app:strokeWidth="0dp">-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_ic"-->
|
||||
<!-- android:layout_width="25dp"-->
|
||||
<!-- android:layout_height="25dp"-->
|
||||
<!-- android:layout_alignParentLeft="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginStart="5dp"-->
|
||||
<!-- android:layout_marginTop="5dp"-->
|
||||
<!-- android:layout_marginEnd="5dp"-->
|
||||
<!-- android:layout_marginBottom="5dp"-->
|
||||
<!-- android:src="@drawable/ic_hot" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginLeft="7dp"-->
|
||||
<!-- android:layout_toRightOf="@id/iv_ic"-->
|
||||
<!-- android:text="@string/trending"-->
|
||||
<!-- android:textSize="16sp" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="10dp"-->
|
||||
<!-- android:layout_height="10dp"-->
|
||||
<!-- android:layout_alignParentRight="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:src="@drawable/ic_arrow" />-->
|
||||
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
|
||||
<!-- </com.google.android.material.card.MaterialCardView>-->
|
||||
|
||||
<!-- <com.google.android.material.card.MaterialCardView-->
|
||||
<!-- android:id="@+id/btn_live"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="30dp"-->
|
||||
<!-- android:layout_marginRight="20dp"-->
|
||||
<!-- android:layout_weight=".5"-->
|
||||
<!-- android:background="@android:color/transparent"-->
|
||||
<!-- app:cardBackgroundColor="@android:color/transparent"-->
|
||||
<!-- app:strokeWidth="0dp">-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_ic2"-->
|
||||
<!-- android:layout_width="25dp"-->
|
||||
<!-- android:layout_height="25dp"-->
|
||||
<!-- android:layout_alignParentLeft="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginStart="5dp"-->
|
||||
<!-- android:layout_marginTop="5dp"-->
|
||||
<!-- android:layout_marginEnd="5dp"-->
|
||||
<!-- android:layout_marginBottom="5dp"-->
|
||||
<!-- android:src="@drawable/ic_live" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginLeft="7dp"-->
|
||||
<!-- android:layout_toRightOf="@id/iv_ic2"-->
|
||||
<!-- android:text="@string/live"-->
|
||||
<!-- android:textSize="16sp" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="10dp"-->
|
||||
<!-- android:layout_height="10dp"-->
|
||||
<!-- android:layout_alignParentRight="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:src="@drawable/ic_arrow" />-->
|
||||
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
|
||||
<!-- </com.google.android.material.card.MaterialCardView>-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:id="@+id/genres2"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="10dp"-->
|
||||
<!-- android:layout_marginTop="20dp"-->
|
||||
<!-- android:layout_marginRight="10dp"-->
|
||||
<!-- android:orientation="horizontal"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@id/genres">-->
|
||||
|
||||
<!-- <com.google.android.material.card.MaterialCardView-->
|
||||
<!-- android:id="@+id/btn_music"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="20dp"-->
|
||||
<!-- android:layout_marginRight="20dp"-->
|
||||
<!-- android:layout_weight=".5"-->
|
||||
<!-- android:background="@android:color/transparent"-->
|
||||
<!-- app:cardBackgroundColor="@android:color/transparent"-->
|
||||
<!-- app:strokeWidth="0dp">-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_ic3"-->
|
||||
<!-- android:layout_width="25dp"-->
|
||||
<!-- android:layout_height="25dp"-->
|
||||
<!-- android:layout_alignParentLeft="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginStart="5dp"-->
|
||||
<!-- android:layout_marginTop="5dp"-->
|
||||
<!-- android:layout_marginEnd="5dp"-->
|
||||
<!-- android:layout_marginBottom="5dp"-->
|
||||
<!-- android:src="@drawable/ic_music" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginLeft="7dp"-->
|
||||
<!-- android:layout_toRightOf="@id/iv_ic3"-->
|
||||
<!-- android:text="@string/music"-->
|
||||
<!-- android:textSize="16sp" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="10dp"-->
|
||||
<!-- android:layout_height="10dp"-->
|
||||
<!-- android:layout_alignParentRight="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:src="@drawable/ic_arrow" />-->
|
||||
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
|
||||
<!-- </com.google.android.material.card.MaterialCardView>-->
|
||||
|
||||
<!-- <com.google.android.material.card.MaterialCardView-->
|
||||
<!-- android:id="@+id/btn_films"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginLeft="30dp"-->
|
||||
<!-- android:layout_marginRight="20dp"-->
|
||||
<!-- android:layout_weight=".5"-->
|
||||
<!-- android:background="@android:color/transparent"-->
|
||||
<!-- app:cardBackgroundColor="@android:color/transparent"-->
|
||||
<!-- app:strokeWidth="0dp">-->
|
||||
|
||||
<!-- <RelativeLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="match_parent"-->
|
||||
<!-- android:orientation="horizontal">-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:id="@+id/iv_ic4"-->
|
||||
<!-- android:layout_width="25dp"-->
|
||||
<!-- android:layout_height="25dp"-->
|
||||
<!-- android:layout_alignParentLeft="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginStart="5dp"-->
|
||||
<!-- android:layout_marginTop="5dp"-->
|
||||
<!-- android:layout_marginEnd="5dp"-->
|
||||
<!-- android:layout_marginBottom="5dp"-->
|
||||
<!-- android:src="@drawable/ic_film" />-->
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:layout_marginLeft="7dp"-->
|
||||
<!-- android:layout_toRightOf="@id/iv_ic4"-->
|
||||
<!-- android:text="@string/film"-->
|
||||
<!-- android:textSize="16sp" />-->
|
||||
|
||||
<!-- <ImageView-->
|
||||
<!-- android:layout_width="10dp"-->
|
||||
<!-- android:layout_height="10dp"-->
|
||||
<!-- android:layout_alignParentRight="true"-->
|
||||
<!-- android:layout_centerVertical="true"-->
|
||||
<!-- android:src="@drawable/ic_arrow" />-->
|
||||
|
||||
<!-- </RelativeLayout>-->
|
||||
|
||||
|
||||
<!-- </com.google.android.material.card.MaterialCardView>-->
|
||||
|
||||
<!-- </LinearLayout>-->
|
||||
|
||||
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_history"-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_margin="25dp"-->
|
||||
<!-- android:text="@string/history"-->
|
||||
<!-- android:textSize="14sp"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/outlinedTextField"-->
|
||||
<!-- android:visibility="gone"/>-->
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/history_recycler"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="10dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/outlinedTextField"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/search_recycler"
|
||||
|
42
app/src/main/res/layout/searchhistory_row.xml
Normal file
42
app/src/main/res/layout/searchhistory_row.xml
Normal file
@ -0,0 +1,42 @@
|
||||
<?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:layout_margin="8dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/history_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_history"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_margin="5dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/history_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:text=""
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/delete_history"
|
||||
app:layout_constraintStart_toEndOf="@id/history_icon"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/delete_history"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/selectableItemBackground"
|
||||
android:padding="5dp"
|
||||
android:src="@drawable/ic_close2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:shapeAppearanceOverlay="@style/roundedImageViewRounded" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
@ -34,6 +34,18 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:srcCompat="@tools:sample/backgrounds/scenic" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/search_thumbnail_duration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:textSize="11dp"
|
||||
android:textColor="@color/duration_text_color"
|
||||
android:background="@color/duration_background_color"
|
||||
android:padding="0.5dp"/>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<TextView
|
||||
|
@ -68,5 +68,8 @@
|
||||
<string name="instance">Instance</string>
|
||||
<string name="customization">Customization</string>
|
||||
<string name="website">Website</string>
|
||||
<string name="videoCount">%1$s videos</string>
|
||||
<string name="noInternet">No Internet Connection</string>
|
||||
<string name="retry">Retry</string>
|
||||
<string name="comments">Comments</string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user