Loading app/src/main/java/app/fedilab/android/BaseMainActivity.java +4 −1 Original line number Diff line number Diff line Loading @@ -586,7 +586,10 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt } Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { if (currentAccount == null || currentAccount.mastodon_account == null) { if (currentToken == null) { currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null); } if (currentAccount == null) { //It is not, the user is redirected to the login page Intent myIntent = new Intent(BaseMainActivity.this, LoginActivity.class); startActivity(myIntent); Loading app/src/main/java/app/fedilab/android/ui/drawer/AccountFollowRequestAdapter.java +9 −4 Original line number Diff line number Diff line Loading @@ -78,13 +78,18 @@ public class AccountFollowRequestAdapter extends RecyclerView.Adapter<RecyclerVi AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class); holderFollow.binding.acceptButton.setOnClickListener(v -> accountsVM.acceptFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) .observe((LifecycleOwner) context, relationShip -> { if (accountList.size() > position) { accountList.remove(position); notifyItemRemoved(position); } })); holderFollow.binding.rejectButton.setOnClickListener(v -> accountsVM.rejectFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) .observe((LifecycleOwner) context, relationShip -> { if (accountList.size() > position) { accountList.remove(position); notifyItemRemoved(position); } })); holderFollow.binding.avatar.setOnClickListener(v -> { Intent intent = new Intent(context, ProfileActivity.class); Loading app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +5 −0 Original line number Diff line number Diff line Loading @@ -941,6 +941,11 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder composeAttachmentItemBinding.buttonOrderDown.setVisibility(View.INVISIBLE); } int finalMediaPosition = mediaPosition; if (attachment.local_path.endsWith("png") || attachment.local_path.endsWith("jpg") || attachment.local_path.endsWith("jpeg")) { composeAttachmentItemBinding.editPreview.setVisibility(View.VISIBLE); } else { composeAttachmentItemBinding.editPreview.setVisibility(View.GONE); } composeAttachmentItemBinding.editPreview.setOnClickListener(v -> { Intent intent = new Intent(context, EditImageActivity.class); Bundle b = new Bundle(); Loading app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +2 −2 Original line number Diff line number Diff line Loading @@ -2341,7 +2341,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> @Override public void onGlobalLayout() { holder.bindingArt.artMedia.getViewTreeObserver().removeOnGlobalLayoutListener(this); if (status.art_attachment.meta != null) { if (status.art_attachment.meta != null && status.art_attachment.meta.small != null) { float viewWidth = holder.bindingArt.artMedia.getWidth(); ConstraintLayout.LayoutParams lp; float mediaH = status.art_attachment.meta.small.height; Loading @@ -2357,7 +2357,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> } }); if (status.art_attachment.meta != null) { if (status.art_attachment.meta != null && status.art_attachment.meta.small != null) { float viewWidth = holder.bindingArt.artMedia.getWidth(); ConstraintLayout.LayoutParams lp; float mediaH = status.art_attachment.meta.small.height; Loading Loading
app/src/main/java/app/fedilab/android/BaseMainActivity.java +4 −1 Original line number Diff line number Diff line Loading @@ -586,7 +586,10 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt } Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { if (currentAccount == null || currentAccount.mastodon_account == null) { if (currentToken == null) { currentToken = sharedpreferences.getString(Helper.PREF_USER_TOKEN, null); } if (currentAccount == null) { //It is not, the user is redirected to the login page Intent myIntent = new Intent(BaseMainActivity.this, LoginActivity.class); startActivity(myIntent); Loading
app/src/main/java/app/fedilab/android/ui/drawer/AccountFollowRequestAdapter.java +9 −4 Original line number Diff line number Diff line Loading @@ -78,13 +78,18 @@ public class AccountFollowRequestAdapter extends RecyclerView.Adapter<RecyclerVi AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class); holderFollow.binding.acceptButton.setOnClickListener(v -> accountsVM.acceptFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) .observe((LifecycleOwner) context, relationShip -> { if (accountList.size() > position) { accountList.remove(position); notifyItemRemoved(position); } })); holderFollow.binding.rejectButton.setOnClickListener(v -> accountsVM.rejectFollow(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) .observe((LifecycleOwner) context, relationShip -> { if (accountList.size() > position) { accountList.remove(position); notifyItemRemoved(position); } })); holderFollow.binding.avatar.setOnClickListener(v -> { Intent intent = new Intent(context, ProfileActivity.class); Loading
app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +5 −0 Original line number Diff line number Diff line Loading @@ -941,6 +941,11 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder composeAttachmentItemBinding.buttonOrderDown.setVisibility(View.INVISIBLE); } int finalMediaPosition = mediaPosition; if (attachment.local_path.endsWith("png") || attachment.local_path.endsWith("jpg") || attachment.local_path.endsWith("jpeg")) { composeAttachmentItemBinding.editPreview.setVisibility(View.VISIBLE); } else { composeAttachmentItemBinding.editPreview.setVisibility(View.GONE); } composeAttachmentItemBinding.editPreview.setOnClickListener(v -> { Intent intent = new Intent(context, EditImageActivity.class); Bundle b = new Bundle(); Loading
app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +2 −2 Original line number Diff line number Diff line Loading @@ -2341,7 +2341,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> @Override public void onGlobalLayout() { holder.bindingArt.artMedia.getViewTreeObserver().removeOnGlobalLayoutListener(this); if (status.art_attachment.meta != null) { if (status.art_attachment.meta != null && status.art_attachment.meta.small != null) { float viewWidth = holder.bindingArt.artMedia.getWidth(); ConstraintLayout.LayoutParams lp; float mediaH = status.art_attachment.meta.small.height; Loading @@ -2357,7 +2357,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> } }); if (status.art_attachment.meta != null) { if (status.art_attachment.meta != null && status.art_attachment.meta.small != null) { float viewWidth = holder.bindingArt.artMedia.getWidth(); ConstraintLayout.LayoutParams lp; float mediaH = status.art_attachment.meta.small.height; Loading