diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index b771ce8..23f17bd 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -12,8 +12,8 @@
-
-
+
+
@@ -38,27 +38,58 @@
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -69,6 +100,7 @@
Looper.prepare()
setData
+ logout
@@ -2212,8 +2244,10 @@
-
+
+
+
@@ -2238,9 +2272,10 @@
-
-
+
+
+
@@ -2264,6 +2299,12 @@
+
+
+
+
+
+
@@ -2272,12 +2313,11 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2624,26 +2675,51 @@
-
-
-
-
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/org/libre/agosto/p2play/MainActivity.kt b/app/src/main/java/org/libre/agosto/p2play/MainActivity.kt
index 70b809d..f36a696 100644
--- a/app/src/main/java/org/libre/agosto/p2play/MainActivity.kt
+++ b/app/src/main/java/org/libre/agosto/p2play/MainActivity.kt
@@ -31,6 +31,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
private lateinit var lastItem: MenuItem
lateinit var myMenu: Menu
val _db = Database(this)
+ var section: String = ""
override fun onCreate(savedInstanceState: Bundle?) {
@@ -60,8 +61,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
this.getLastVideos()
swipeContainer.setOnRefreshListener {
- ManagerSingleton.Toast(getText(R.string.comming).toString())
- swipeContainer.isRefreshing = false
+ this.refresh()
}
}
@@ -79,13 +79,28 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
// specify an viewAdapter (see also next example)
adapter = viewAdapter
-
}
+ swipeContainer.isRefreshing = false
+ }
+ fun refresh(){
+ swipeContainer.isRefreshing = true
+ when(section){
+ "local" -> this.getLocalVideos()
+ "popular" -> this.getPopularVideos()
+ "last" -> this.getLastVideos()
+ "my_videos" -> {
+ if(ManagerSingleton.token.token != "")
+ this.getMyVideos()
+ else
+ this.getLastVideos()
+ }
+ }
}
// Last videos
fun getLastVideos(){
+ section = "last"
setTitle(R.string.title_recent)
AsyncTask.execute {
val videos = client.getLastVideos()
@@ -97,6 +112,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
//
fun getPopularVideos(){
+ section = "popular"
setTitle(R.string.title_popular)
AsyncTask.execute {
val videos = client.getPopularVideos()
@@ -107,6 +123,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
}
fun getLocalVideos(){
+ section = "local"
setTitle(R.string.title_local)
AsyncTask.execute {
val videos = client.getLocalVideos()
@@ -117,6 +134,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
}
fun getMyVideos(){
+ section = "my_videos"
setTitle(R.string.title_myVideos)
AsyncTask.execute {
val videos = client.myVideos(ManagerSingleton.token.token)
diff --git a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt
index d24265d..47b2dc3 100644
--- a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt
+++ b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt
@@ -20,7 +20,7 @@ class ReproductorActivity : AppCompatActivity() {
try {
this.video = this.intent.extras.getSerializable("video") as VideoModel
tittleVideoTxt.text = this.video.name
- viewsTxt.text = this.video.views.toString() + getString(R.string.view_text)
+ viewsTxt.text = this.video.views.toString() + ' ' + getString(R.string.view_text)
userTxt.text = this.video.username
descriptionVideoTxt.text = this.video.description
diff --git a/app/src/main/res/layout/activity_reproductor.xml b/app/src/main/res/layout/activity_reproductor.xml
index b2f284e..21f44ad 100644
--- a/app/src/main/res/layout/activity_reproductor.xml
+++ b/app/src/main/res/layout/activity_reproductor.xml
@@ -8,7 +8,10 @@
+ android:layout_height="wrap_content"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent">
+ android:layout_height="220dp">
@@ -30,6 +33,7 @@
android:id="@+id/tittleVideoTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingLeft="5dp"
android:textAppearance="@android:style/TextAppearance.Material.Large"
android:textStyle="bold" />
@@ -37,13 +41,14 @@
android:id="@+id/viewsTxt"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingLeft="5dp"
android:textSize="12sp" />
+ android:visibility="gone">
+ android:text="@string/subscribeBtn"
+ android:visibility="invisible" />
@@ -135,7 +144,6 @@
android:background="?android:attr/listDivider" />
-
\ No newline at end of file
diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml
index c182e1d..249eb35 100644
--- a/app/src/main/res/layout/content_main.xml
+++ b/app/src/main/res/layout/content_main.xml
@@ -12,6 +12,8 @@
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:touchscreenBlocksFocus="false"
+ android:visibility="visible"
app:layout_constraintTop_toTopOf="parent">