diff --git a/app/build.gradle b/app/build.gradle index 5aa4eeed..e565bc41 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -174,7 +174,6 @@ dependencies { implementation "net.gotev:uploadservice:4.5.1" implementation "net.gotev:uploadservice-okhttp:4.5.1" implementation 'androidx.media:media:1.6.0' - implementation 'com.github.ybq:Android-SpinKit:1.4.0' implementation 'com.github.mancj:MaterialSearchBar:0.8.5' implementation 'com.github.vkay94:DoubleTapPlayerView:1.0.0' diff --git a/app/src/fdroid/res/layout/min_controller.xml b/app/src/fdroid/res/layout/min_controller.xml index 1c226909..6e25342b 100644 --- a/app/src/fdroid/res/layout/min_controller.xml +++ b/app/src/fdroid/res/layout/min_controller.xml @@ -37,13 +37,12 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> - { + holder.binding.accountAction.setOnClickListener(v -> { PostActionsVM viewModel = new ViewModelProvider((ViewModelStoreOwner) context).get(PostActionsVM.class); viewModel.post(RetrofitPeertubeAPI.ActionType.UNMUTE, account.getAcct(), null).observe((LifecycleOwner) context, apiResponse -> manageVIewPostActions(RetrofitPeertubeAPI.ActionType.UNMUTE, apiResponse, account.getAcct())); }); } else { - holder.account_action.hide(); + holder.binding.accountAction.hide(); } - holder.account_dn.setText(account.getDisplayName()); - holder.account_ac.setText(String.format("@%s", account.getAcct())); + holder.binding.accountDn.setText(account.getDisplayName()); + holder.binding.accountAc.setText(String.format("@%s", account.getAcct())); if (account.getDescription() == null) { account.setDescription(""); } //Profile picture - Helper.loadAvatar(context, account, holder.account_pp); + Helper.loadAvatar(context, account, holder.binding.accountPp); //Follow button if (type == RetrofitPeertubeAPI.DataType.MUTED) { - holder.account_action.show(); - holder.account_action.setImageResource(R.drawable.ic_baseline_volume_mute_24); + holder.binding.accountAction.show(); + holder.binding.accountAction.setImageResource(R.drawable.ic_baseline_volume_mute_24); } - holder.account_pp.setOnClickListener(v -> { + holder.binding.accountPp.setOnClickListener(v -> { Intent intent = new Intent(context, ShowAccountActivity.class); Bundle b = new Bundle(); b.putSerializable("account", account); @@ -142,21 +137,12 @@ public class AccountsListAdapter extends RecyclerView.Adapter { - PopupMenu popup = new PopupMenu(context, holder.more_actions); + holder.binding.moreActions.setOnClickListener(view -> { + PopupMenu popup = new PopupMenu(context, holder.binding.moreActions); popup.getMenuInflater() .inflate(R.menu.playlist_menu_peertube, popup.getMenu()); if (channels.size() == 1) { @@ -100,18 +95,12 @@ public class ChannelListAdapter extends RecyclerView.Adapter { - new Thread(() -> { - new RetrofitPeertubeAPI(context).post(RetrofitPeertubeAPI.ActionType.DELETE_CHANNEL, channel.getName(), null); - Handler mainHandler = new Handler(Looper.getMainLooper()); - Runnable myRunnable = () -> { - channels.remove(channel); - notifyDataSetChanged(); - if (channels.size() == 0) { - allChannelRemoved.onAllChannelRemoved(); - } - }; - mainHandler.post(myRunnable); - }).start(); + new Thread(() -> new RetrofitPeertubeAPI(context).post(RetrofitPeertubeAPI.ActionType.DELETE_CHANNEL, channel.getName(), null)).start(); + channels.remove(channel); + notifyItemRemoved(position); + if (channels.size() == 0) { + allChannelRemoved.onAllChannelRemoved(); + } dialog.dismiss(); }) .setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss()) @@ -126,7 +115,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter { + holder.binding.accountPp.setOnClickListener(v -> { Intent intent = new Intent(context, ShowChannelActivity.class); Bundle b = new Bundle(); b.putSerializable("channel", channel); @@ -174,20 +163,12 @@ public class ChannelListAdapter extends RecyclerView.Adapter - - + android:layout_gravity="center" /> - + android:layout_gravity="center" /> diff --git a/app/src/main/res/layouts/peertube/layout/activity_instance_picker_peertube.xml b/app/src/main/res/layouts/peertube/layout/activity_instance_picker_peertube.xml index 1456a905..c41e34fb 100644 --- a/app/src/main/res/layouts/peertube/layout/activity_instance_picker_peertube.xml +++ b/app/src/main/res/layouts/peertube/layout/activity_instance_picker_peertube.xml @@ -118,11 +118,10 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/filters_container"> - + android:layout_gravity="center" /> - + android:layout_gravity="center" /> - diff --git a/app/src/main/res/layouts/peertube/layout/activity_sepia_search.xml b/app/src/main/res/layouts/peertube/layout/activity_sepia_search.xml index 59fd3163..2cba29f8 100644 --- a/app/src/main/res/layouts/peertube/layout/activity_sepia_search.xml +++ b/app/src/main/res/layouts/peertube/layout/activity_sepia_search.xml @@ -32,9 +32,7 @@ @@ -61,36 +59,33 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:mt_backIconTint="?attr/colorAccent" - app:mt_clearIconTint="?attr/colorAccent" app:mt_hint="@string/sepia_search_hint" app:mt_maxSuggestionsCount="10" - app:mt_menuIconTint="?attr/colorAccent" - app:mt_searchIconTint="?attr/colorAccent" app:mt_speechMode="false" /> - -