mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-08-12 11:09:27 +00:00
Fixed buttons in subscription groups and made select button click only work when there are things selected.
This commit is contained in:
parent
3fc92e4065
commit
75f81d20db
5 changed files with 41 additions and 49 deletions
|
@ -7,7 +7,6 @@ import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.Button
|
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import android.widget.ImageButton
|
import android.widget.ImageButton
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
@ -87,7 +86,7 @@ class SubscriptionGroupFragment : MainFragment() {
|
||||||
private val _buttonSettings: ImageButton;
|
private val _buttonSettings: ImageButton;
|
||||||
private val _buttonDelete: ImageButton;
|
private val _buttonDelete: ImageButton;
|
||||||
|
|
||||||
private val _buttonAddCreator: Button;
|
private val _buttonAddCreator: FrameLayout;
|
||||||
|
|
||||||
private val _enabledCreators: ArrayList<IPlatformChannel> = arrayListOf();
|
private val _enabledCreators: ArrayList<IPlatformChannel> = arrayListOf();
|
||||||
private val _enabledCreatorsFiltered: ArrayList<IPlatformChannel> = arrayListOf();
|
private val _enabledCreatorsFiltered: ArrayList<IPlatformChannel> = arrayListOf();
|
||||||
|
|
|
@ -1,52 +1,25 @@
|
||||||
package com.futo.platformplayer.views.overlays
|
package com.futo.platformplayer.views.overlays
|
||||||
|
|
||||||
import android.app.Activity
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.shapes.Shape
|
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.widget.FrameLayout
|
||||||
import android.view.ViewGroup
|
|
||||||
import android.widget.Button
|
|
||||||
import android.widget.ImageView
|
|
||||||
import android.widget.LinearLayout
|
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.core.net.toFile
|
|
||||||
import androidx.core.net.toUri
|
|
||||||
import androidx.recyclerview.widget.GridLayoutManager
|
import androidx.recyclerview.widget.GridLayoutManager
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
import com.bumptech.glide.Glide
|
|
||||||
import com.futo.platformplayer.PresetImages
|
|
||||||
import com.futo.platformplayer.R
|
import com.futo.platformplayer.R
|
||||||
import com.futo.platformplayer.UIDialogs
|
import com.futo.platformplayer.UIDialogs
|
||||||
import com.futo.platformplayer.activities.IWithResultLauncher
|
|
||||||
import com.futo.platformplayer.activities.MainActivity
|
|
||||||
import com.futo.platformplayer.api.media.models.channels.IPlatformChannel
|
|
||||||
import com.futo.platformplayer.constructs.Event0
|
import com.futo.platformplayer.constructs.Event0
|
||||||
import com.futo.platformplayer.constructs.Event1
|
import com.futo.platformplayer.constructs.Event1
|
||||||
import com.futo.platformplayer.dp
|
import com.futo.platformplayer.dp
|
||||||
import com.futo.platformplayer.models.ImageVariable
|
|
||||||
import com.futo.platformplayer.states.StateApp
|
|
||||||
import com.futo.platformplayer.states.StateSubscriptions
|
import com.futo.platformplayer.states.StateSubscriptions
|
||||||
import com.futo.platformplayer.views.AnyAdapterView
|
import com.futo.platformplayer.views.AnyAdapterView
|
||||||
import com.futo.platformplayer.views.AnyAdapterView.Companion.asAny
|
import com.futo.platformplayer.views.AnyAdapterView.Companion.asAny
|
||||||
import com.futo.platformplayer.views.SearchView
|
import com.futo.platformplayer.views.SearchView
|
||||||
import com.futo.platformplayer.views.adapters.AnyAdapter
|
|
||||||
import com.futo.platformplayer.views.adapters.viewholders.CreatorBarViewHolder
|
|
||||||
import com.futo.platformplayer.views.adapters.viewholders.SelectableCreatorBarViewHolder
|
import com.futo.platformplayer.views.adapters.viewholders.SelectableCreatorBarViewHolder
|
||||||
import com.futo.platformplayer.views.buttons.BigButton
|
|
||||||
import com.github.dhaval2404.imagepicker.ImagePicker
|
|
||||||
import com.google.android.flexbox.FlexboxLayout
|
|
||||||
import com.google.android.material.imageview.ShapeableImageView
|
|
||||||
import com.google.android.material.shape.CornerFamily
|
|
||||||
import com.google.android.material.shape.ShapeAppearanceModel
|
|
||||||
import java.io.File
|
|
||||||
|
|
||||||
class CreatorSelectOverlay: ConstraintLayout {
|
class CreatorSelectOverlay: ConstraintLayout {
|
||||||
private val _buttonSelect: Button;
|
private val _buttonSelect: FrameLayout;
|
||||||
private val _topbar: OverlayTopbar;
|
private val _topbar: OverlayTopbar;
|
||||||
|
|
||||||
private val _searchBar: SearchView;
|
private val _searchBar: SearchView;
|
||||||
|
@ -97,7 +70,7 @@ class CreatorSelectOverlay: ConstraintLayout {
|
||||||
this.orientation = LinearLayoutManager.VERTICAL;
|
this.orientation = LinearLayoutManager.VERTICAL;
|
||||||
};
|
};
|
||||||
_buttonSelect.setOnClickListener {
|
_buttonSelect.setOnClickListener {
|
||||||
_selected?.let {
|
if (_selected.isNotEmpty()) {
|
||||||
select();
|
select();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -134,7 +107,7 @@ class CreatorSelectOverlay: ConstraintLayout {
|
||||||
|
|
||||||
private fun filterCreators(withUpdate: Boolean = true) {
|
private fun filterCreators(withUpdate: Boolean = true) {
|
||||||
val query = _searchBar.textSearch.text.toString().lowercase();
|
val query = _searchBar.textSearch.text.toString().lowercase();
|
||||||
val filteredEnabled = _creators.filter { query.isNullOrEmpty() || it.channel.name.lowercase().contains(query) };
|
val filteredEnabled = _creators.filter { query.isEmpty() || it.channel.name.lowercase().contains(query) };
|
||||||
|
|
||||||
//Optimize
|
//Optimize
|
||||||
_creatorsFiltered.clear();
|
_creatorsFiltered.clear();
|
||||||
|
|
|
@ -182,14 +182,26 @@
|
||||||
app:layout_constraintBottom_toTopOf="@id/button_creator_add"
|
app:layout_constraintBottom_toTopOf="@id/button_creator_add"
|
||||||
android:paddingBottom="10dp" />
|
android:paddingBottom="10dp" />
|
||||||
|
|
||||||
<Button
|
<FrameLayout
|
||||||
android:id="@+id/button_creator_add"
|
android:id="@+id/button_creator_add"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="@drawable/background_button_primary"
|
android:background="@drawable/background_button_primary"
|
||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_margin="10dp"
|
android:layout_marginStart="5dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
android:layout_marginEnd="5dp"
|
||||||
android:text="@string/add_creator" />
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fontFamily="@font/inter_regular"
|
||||||
|
android:text="@string/add_creator"
|
||||||
|
android:textSize="16dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/overlay"
|
android:id="@+id/overlay"
|
||||||
|
|
|
@ -28,25 +28,32 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
app:layout_constraintTop_toBottomOf="@id/search_bar"
|
||||||
app:layout_constraintBottom_toTopOf="@id/container_select"
|
app:layout_constraintBottom_toTopOf="@id/button_select"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent">
|
app:layout_constraintRight_toRightOf="parent">
|
||||||
</androidx.recyclerview.widget.RecyclerView>
|
</androidx.recyclerview.widget.RecyclerView>
|
||||||
|
|
||||||
<LinearLayout
|
<FrameLayout
|
||||||
android:id="@+id/container_select"
|
android:id="@+id/button_select"
|
||||||
|
android:layout_marginStart="5dp"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="50dp"
|
||||||
|
android:background="@drawable/background_button_primary"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
app:layout_constraintRight_toRightOf="parent">
|
app:layout_constraintRight_toRightOf="parent">
|
||||||
<Button
|
|
||||||
android:id="@+id/button_select"
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="10dp"
|
android:fontFamily="@font/inter_regular"
|
||||||
android:background="@drawable/background_button_primary"
|
android:text="@string/select"
|
||||||
android:text="Select" />
|
android:textSize="16dp"
|
||||||
</LinearLayout>
|
android:gravity="center"
|
||||||
|
android:layout_gravity="center" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -724,7 +724,8 @@
|
||||||
<string name="position">Position</string>
|
<string name="position">Position</string>
|
||||||
<string name="tutorials">Tutorials</string>
|
<string name="tutorials">Tutorials</string>
|
||||||
<string name="do_you_want_to_see_the_tutorials_you_can_find_them_at_any_time_through_the_more_button">Do you want to see the tutorials? You can find them at any time through the more button.</string>
|
<string name="do_you_want_to_see_the_tutorials_you_can_find_them_at_any_time_through_the_more_button">Do you want to see the tutorials? You can find them at any time through the more button.</string>
|
||||||
<string name="add_creator">Add Creator</string>
|
<string name="add_creator">Add More</string>
|
||||||
|
<string name="select">Select</string>
|
||||||
<string-array name="home_screen_array">
|
<string-array name="home_screen_array">
|
||||||
<item>Recommendations</item>
|
<item>Recommendations</item>
|
||||||
<item>Subscriptions</item>
|
<item>Subscriptions</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue