Loading app/build.gradle +0 −1 Original line number Diff line number Diff line Loading @@ -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' Loading app/src/fdroid/res/layout/min_controller.xml +1 −2 Original line number Diff line number Diff line Loading @@ -37,13 +37,12 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <com.github.ybq.android.spinkit.SpinKitView <ProgressBar android:id="@+id/cast_loader_small" android:layout_width="wrap_content" android:layout_height="18dp" android:layout_gravity="center" android:layout_marginStart="5dp" app:SpinKit_Color="?colorAccent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/cast_loader_text" Loading app/src/main/java/app/fedilab/android/peertube/drawer/AccountsListAdapter.java +18 −32 Original line number Diff line number Diff line Loading @@ -18,11 +18,7 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; Loading @@ -31,11 +27,10 @@ import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.floatingactionbutton.FloatingActionButton; import java.util.List; import app.fedilab.android.R; import app.fedilab.android.databinding.DrawerAccountPeertubeBinding; import app.fedilab.android.peertube.activities.ShowAccountActivity; import app.fedilab.android.peertube.client.APIResponse; import app.fedilab.android.peertube.client.RetrofitPeertubeAPI; Loading Loading @@ -63,37 +58,37 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { context = parent.getContext(); LayoutInflater layoutInflater = LayoutInflater.from(context); return new ViewHolder(layoutInflater.inflate(R.layout.drawer_account, parent, false)); DrawerAccountPeertubeBinding itemBinding = DrawerAccountPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false); return new AccountViewHolder(itemBinding); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) { final ViewHolder holder = (ViewHolder) viewHolder; final AccountViewHolder holder = (AccountViewHolder) viewHolder; final AccountData.PeertubeAccount account = accounts.get(position); if (type == RetrofitPeertubeAPI.DataType.MUTED) { holder.account_action.setOnClickListener(v -> { 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); Loading Loading @@ -142,21 +137,12 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH } private static class ViewHolder extends RecyclerView.ViewHolder { ImageView account_pp; TextView account_ac; TextView account_dn; FloatingActionButton account_action; LinearLayout account_container; public static class AccountViewHolder extends RecyclerView.ViewHolder { DrawerAccountPeertubeBinding binding; ViewHolder(View itemView) { super(itemView); account_pp = itemView.findViewById(R.id.account_pp); account_dn = itemView.findViewById(R.id.account_dn); account_ac = itemView.findViewById(R.id.account_ac); account_action = itemView.findViewById(R.id.account_action); account_container = itemView.findViewById(R.id.account_container); AccountViewHolder(DrawerAccountPeertubeBinding itemView) { super(itemView.getRoot()); binding = itemView; } } } No newline at end of file app/src/main/java/app/fedilab/android/peertube/drawer/ChannelListAdapter.java +23 −42 Original line number Diff line number Diff line Loading @@ -22,15 +22,9 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.widget.PopupMenu; Loading @@ -42,6 +36,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.util.List; import app.fedilab.android.R; import app.fedilab.android.databinding.DrawerChannelPeertubeBinding; import app.fedilab.android.peertube.activities.AccountActivity; import app.fedilab.android.peertube.activities.ShowChannelActivity; import app.fedilab.android.peertube.client.RetrofitPeertubeAPI; Loading @@ -65,28 +60,28 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { context = parent.getContext(); LayoutInflater layoutInflater = LayoutInflater.from(context); return new ViewHolder(layoutInflater.inflate(R.layout.drawer_channel_peertube, parent, false)); DrawerChannelPeertubeBinding itemBinding = DrawerChannelPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false); return new ChannelViewHolder(itemBinding); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) { final ViewHolder holder = (ViewHolder) viewHolder; ChannelViewHolder holder = (ChannelViewHolder) viewHolder; final Channel channel = channels.get(position); holder.account_dn.setText(channel.getDisplayName()); holder.account_ac.setText(String.format("@%s", channel.getAcct())); holder.binding.accountDn.setText(channel.getDisplayName()); holder.binding.accountAc.setText(String.format("@%s", channel.getAcct())); if (channel.getDescription() == null) { channel.setDescription(""); } //Profile picture Helper.loadAvatar(context, channel, holder.account_pp); Helper.loadAvatar(context, channel, holder.binding.accountPp); if (!isMyChannel(channel)) { holder.more_actions.setVisibility(View.GONE); holder.binding.moreActions.setVisibility(View.GONE); } holder.more_actions.setOnClickListener(view -> { 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) { Loading @@ -100,18 +95,12 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo builder.setMessage(context.getString(R.string.action_channel_confirm_delete)); builder.setIcon(android.R.drawable.ic_dialog_alert) .setPositiveButton(R.string.yes, (dialog, which) -> { new Thread(() -> { new RetrofitPeertubeAPI(context).post(RetrofitPeertubeAPI.ActionType.DELETE_CHANNEL, channel.getName(), null); Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { new Thread(() -> new RetrofitPeertubeAPI(context).post(RetrofitPeertubeAPI.ActionType.DELETE_CHANNEL, channel.getName(), null)).start(); channels.remove(channel); notifyDataSetChanged(); notifyItemRemoved(position); if (channels.size() == 0) { allChannelRemoved.onAllChannelRemoved(); } }; mainHandler.post(myRunnable); }).start(); dialog.dismiss(); }) .setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss()) Loading @@ -126,7 +115,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo popup.show(); }); holder.account_pp.setOnClickListener(v -> { holder.binding.accountPp.setOnClickListener(v -> { Intent intent = new Intent(context, ShowChannelActivity.class); Bundle b = new Bundle(); b.putSerializable("channel", channel); Loading Loading @@ -174,20 +163,12 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo void show(Channel channel); } private static class ViewHolder extends RecyclerView.ViewHolder { ImageView account_pp; TextView account_ac; TextView account_dn; ImageButton more_actions; LinearLayout account_container; ViewHolder(View itemView) { super(itemView); account_pp = itemView.findViewById(R.id.account_pp); account_dn = itemView.findViewById(R.id.account_dn); account_ac = itemView.findViewById(R.id.account_ac); more_actions = itemView.findViewById(R.id.more_actions); account_container = itemView.findViewById(R.id.account_container); public static class ChannelViewHolder extends RecyclerView.ViewHolder { DrawerChannelPeertubeBinding binding; ChannelViewHolder(DrawerChannelPeertubeBinding itemView) { super(itemView.getRoot()); binding = itemView; } } Loading app/src/main/res/layouts/peertube/layout/activity_all_playlist_peertube.xml +4 −7 Original line number Diff line number Diff line Loading @@ -61,12 +61,10 @@ android:layout_height="match_parent" android:gravity="center" android:visibility="gone"> <com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto" <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" app:SpinKit_Color="?colorAccent" /> android:layout_gravity="center" /> </RelativeLayout> <!-- Loader for next items --> <RelativeLayout Loading @@ -78,11 +76,10 @@ android:gravity="bottom|center_horizontal" android:visibility="gone"> <com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto" <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" app:SpinKit_Color="?colorAccent" /> android:layout_gravity="center" /> </RelativeLayout> </RelativeLayout> Loading Loading
app/build.gradle +0 −1 Original line number Diff line number Diff line Loading @@ -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' Loading
app/src/fdroid/res/layout/min_controller.xml +1 −2 Original line number Diff line number Diff line Loading @@ -37,13 +37,12 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> <com.github.ybq.android.spinkit.SpinKitView <ProgressBar android:id="@+id/cast_loader_small" android:layout_width="wrap_content" android:layout_height="18dp" android:layout_gravity="center" android:layout_marginStart="5dp" app:SpinKit_Color="?colorAccent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@+id/cast_loader_text" Loading
app/src/main/java/app/fedilab/android/peertube/drawer/AccountsListAdapter.java +18 −32 Original line number Diff line number Diff line Loading @@ -18,11 +18,7 @@ import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; import androidx.annotation.NonNull; Loading @@ -31,11 +27,10 @@ import androidx.lifecycle.ViewModelProvider; import androidx.lifecycle.ViewModelStoreOwner; import androidx.recyclerview.widget.RecyclerView; import com.google.android.material.floatingactionbutton.FloatingActionButton; import java.util.List; import app.fedilab.android.R; import app.fedilab.android.databinding.DrawerAccountPeertubeBinding; import app.fedilab.android.peertube.activities.ShowAccountActivity; import app.fedilab.android.peertube.client.APIResponse; import app.fedilab.android.peertube.client.RetrofitPeertubeAPI; Loading Loading @@ -63,37 +58,37 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { context = parent.getContext(); LayoutInflater layoutInflater = LayoutInflater.from(context); return new ViewHolder(layoutInflater.inflate(R.layout.drawer_account, parent, false)); DrawerAccountPeertubeBinding itemBinding = DrawerAccountPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false); return new AccountViewHolder(itemBinding); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) { final ViewHolder holder = (ViewHolder) viewHolder; final AccountViewHolder holder = (AccountViewHolder) viewHolder; final AccountData.PeertubeAccount account = accounts.get(position); if (type == RetrofitPeertubeAPI.DataType.MUTED) { holder.account_action.setOnClickListener(v -> { 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); Loading Loading @@ -142,21 +137,12 @@ public class AccountsListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH } private static class ViewHolder extends RecyclerView.ViewHolder { ImageView account_pp; TextView account_ac; TextView account_dn; FloatingActionButton account_action; LinearLayout account_container; public static class AccountViewHolder extends RecyclerView.ViewHolder { DrawerAccountPeertubeBinding binding; ViewHolder(View itemView) { super(itemView); account_pp = itemView.findViewById(R.id.account_pp); account_dn = itemView.findViewById(R.id.account_dn); account_ac = itemView.findViewById(R.id.account_ac); account_action = itemView.findViewById(R.id.account_action); account_container = itemView.findViewById(R.id.account_container); AccountViewHolder(DrawerAccountPeertubeBinding itemView) { super(itemView.getRoot()); binding = itemView; } } } No newline at end of file
app/src/main/java/app/fedilab/android/peertube/drawer/ChannelListAdapter.java +23 −42 Original line number Diff line number Diff line Loading @@ -22,15 +22,9 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.widget.PopupMenu; Loading @@ -42,6 +36,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import java.util.List; import app.fedilab.android.R; import app.fedilab.android.databinding.DrawerChannelPeertubeBinding; import app.fedilab.android.peertube.activities.AccountActivity; import app.fedilab.android.peertube.activities.ShowChannelActivity; import app.fedilab.android.peertube.client.RetrofitPeertubeAPI; Loading @@ -65,28 +60,28 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { context = parent.getContext(); LayoutInflater layoutInflater = LayoutInflater.from(context); return new ViewHolder(layoutInflater.inflate(R.layout.drawer_channel_peertube, parent, false)); DrawerChannelPeertubeBinding itemBinding = DrawerChannelPeertubeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false); return new ChannelViewHolder(itemBinding); } @Override public void onBindViewHolder(@NonNull RecyclerView.ViewHolder viewHolder, int position) { final ViewHolder holder = (ViewHolder) viewHolder; ChannelViewHolder holder = (ChannelViewHolder) viewHolder; final Channel channel = channels.get(position); holder.account_dn.setText(channel.getDisplayName()); holder.account_ac.setText(String.format("@%s", channel.getAcct())); holder.binding.accountDn.setText(channel.getDisplayName()); holder.binding.accountAc.setText(String.format("@%s", channel.getAcct())); if (channel.getDescription() == null) { channel.setDescription(""); } //Profile picture Helper.loadAvatar(context, channel, holder.account_pp); Helper.loadAvatar(context, channel, holder.binding.accountPp); if (!isMyChannel(channel)) { holder.more_actions.setVisibility(View.GONE); holder.binding.moreActions.setVisibility(View.GONE); } holder.more_actions.setOnClickListener(view -> { 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) { Loading @@ -100,18 +95,12 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo builder.setMessage(context.getString(R.string.action_channel_confirm_delete)); builder.setIcon(android.R.drawable.ic_dialog_alert) .setPositiveButton(R.string.yes, (dialog, which) -> { new Thread(() -> { new RetrofitPeertubeAPI(context).post(RetrofitPeertubeAPI.ActionType.DELETE_CHANNEL, channel.getName(), null); Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { new Thread(() -> new RetrofitPeertubeAPI(context).post(RetrofitPeertubeAPI.ActionType.DELETE_CHANNEL, channel.getName(), null)).start(); channels.remove(channel); notifyDataSetChanged(); notifyItemRemoved(position); if (channels.size() == 0) { allChannelRemoved.onAllChannelRemoved(); } }; mainHandler.post(myRunnable); }).start(); dialog.dismiss(); }) .setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss()) Loading @@ -126,7 +115,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo popup.show(); }); holder.account_pp.setOnClickListener(v -> { holder.binding.accountPp.setOnClickListener(v -> { Intent intent = new Intent(context, ShowChannelActivity.class); Bundle b = new Bundle(); b.putSerializable("channel", channel); Loading Loading @@ -174,20 +163,12 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo void show(Channel channel); } private static class ViewHolder extends RecyclerView.ViewHolder { ImageView account_pp; TextView account_ac; TextView account_dn; ImageButton more_actions; LinearLayout account_container; ViewHolder(View itemView) { super(itemView); account_pp = itemView.findViewById(R.id.account_pp); account_dn = itemView.findViewById(R.id.account_dn); account_ac = itemView.findViewById(R.id.account_ac); more_actions = itemView.findViewById(R.id.more_actions); account_container = itemView.findViewById(R.id.account_container); public static class ChannelViewHolder extends RecyclerView.ViewHolder { DrawerChannelPeertubeBinding binding; ChannelViewHolder(DrawerChannelPeertubeBinding itemView) { super(itemView.getRoot()); binding = itemView; } } Loading
app/src/main/res/layouts/peertube/layout/activity_all_playlist_peertube.xml +4 −7 Original line number Diff line number Diff line Loading @@ -61,12 +61,10 @@ android:layout_height="match_parent" android:gravity="center" android:visibility="gone"> <com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto" <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" app:SpinKit_Color="?colorAccent" /> android:layout_gravity="center" /> </RelativeLayout> <!-- Loader for next items --> <RelativeLayout Loading @@ -78,11 +76,10 @@ android:gravity="bottom|center_horizontal" android:visibility="gone"> <com.github.ybq.android.spinkit.SpinKitView xmlns:app="http://schemas.android.com/apk/res-auto" <ProgressBar android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" app:SpinKit_Color="?colorAccent" /> android:layout_gravity="center" /> </RelativeLayout> </RelativeLayout> Loading