From 06b01e5a37a18ad25c77ffa6513663e47454df6c Mon Sep 17 00:00:00 2001 From: Adolfo Santiago Date: Wed, 6 Jul 2022 22:31:30 +0200 Subject: [PATCH] Modify license headers --- .../keylesspalace/tusky/AccountActivity.kt | 25 ++++++---- .../tusky/EditProfileActivity.kt | 25 ++++++---- .../keylesspalace/tusky/ViewMediaActivity.kt | 25 ++++++---- .../tusky/adapter/EmojiReactionsAdapter.java | 50 +++++++++---------- .../tusky/adapter/NotificationsAdapter.java | 35 +++++++------ .../tusky/adapter/StickerAdapater.kt | 20 ++++++++ .../tusky/entity/Notification.kt | 25 ++++++---- .../tusky/fragment/ChatsFragment.kt | 20 ++++++++ .../tusky/fragment/NotificationsFragment.java | 45 +++++++++-------- .../tusky/util/ViewDataUtils.java | 29 +++++------ .../tusky/viewdata/NotificationViewData.java | 27 +++++----- 11 files changed, 200 insertions(+), 126 deletions(-) diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt b/husky/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt index 22ae7c9..6e8d621 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt +++ b/husky/app/src/main/java/com/keylesspalace/tusky/AccountActivity.kt @@ -1,17 +1,22 @@ -/* Copyright 2018 Conny Duck +/* + * Husky -- A Pleroma client for Android * - * This file is a part of Tusky. + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2018 Conny Duck * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.kt b/husky/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.kt index 94d5b60..0cd2aa8 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.kt +++ b/husky/app/src/main/java/com/keylesspalace/tusky/EditProfileActivity.kt @@ -1,17 +1,22 @@ -/* Copyright 2017 Andrew Dawson +/* + * Husky -- A Pleroma client for Android * - * This file is a part of Tusky. + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2017 Andrew Dawson * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt b/husky/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt index 1e68576..0b23173 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt +++ b/husky/app/src/main/java/com/keylesspalace/tusky/ViewMediaActivity.kt @@ -1,17 +1,22 @@ -/* Copyright 2017 Andrew Dawson +/* + * Husky -- A Pleroma client for Android * - * This file is a part of Tusky. + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2017 Andrew Dawson * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiReactionsAdapter.java b/husky/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiReactionsAdapter.java index ffe3520..658c28d 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiReactionsAdapter.java +++ b/husky/app/src/main/java/com/keylesspalace/tusky/adapter/EmojiReactionsAdapter.java @@ -1,39 +1,39 @@ +/* + * Husky -- A Pleroma client for Android + * + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2020 Alibek Omarov + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.keylesspalace.tusky.adapter; -import android.content.ClipData; -import android.content.ClipboardManager; -import android.content.Context; -import android.graphics.drawable.Drawable; import android.text.SpannableStringBuilder; import android.text.Spanned; -import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.TextView; import android.widget.TextView.BufferType; -import android.widget.Toast; -import android.util.Log; - -import androidx.annotation.Nullable; import androidx.emoji.widget.EmojiAppCompatButton; import androidx.recyclerview.widget.RecyclerView; - import com.keylesspalace.tusky.R; -import com.keylesspalace.tusky.entity.Status; import com.keylesspalace.tusky.entity.EmojiReaction; import com.keylesspalace.tusky.interfaces.StatusActionListener; -import com.keylesspalace.tusky.util.CardViewMode; import com.keylesspalace.tusky.util.CustomEmojiHelper; -import com.keylesspalace.tusky.util.LinkHelper; -import com.keylesspalace.tusky.util.StatusDisplayOptions; -import com.keylesspalace.tusky.viewdata.StatusViewData; - -import java.text.DateFormat; import java.util.List; -import java.util.Date; - public class EmojiReactionsAdapter extends RecyclerView.Adapter { private final List reactions; private final StatusActionListener listener; @@ -41,14 +41,14 @@ public class EmojiReactionsAdapter extends RecyclerView.Adapter reactions, final StatusActionListener listener, final String statusId) { this.reactions = reactions; - this.listener = listener; + this.listener = listener; this.statusId = statusId; } - + @Override public SingleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.item_emoji_reaction, parent, false); + .inflate(R.layout.item_emoji_reaction, parent, false); return new SingleViewHolder(view); } @@ -58,10 +58,10 @@ public class EmojiReactionsAdapter extends RecyclerView.Adapter. */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky.adapter; @@ -416,8 +421,8 @@ public class NotificationsAdapter extends RecyclerView.Adapter { itemView.setOnClickListener(v -> listener.onViewAccount(accountId)); } } - - + + private static class StatusNotificationViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener { private final TextView message; @@ -433,7 +438,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter { private final Button contentWarningButton; private final Button contentCollapseButton; // TODO: This code SHOULD be based on StatusBaseViewHolder private StatusDisplayOptions statusDisplayOptions; - + private String accountId; private String notificationId; private NotificationActionListener notificationActionListener; @@ -691,7 +696,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter { } else { statusContent.setVisibility(View.VISIBLE); } - + Spanned content = statusViewData.getContent(); List emojis = statusViewData.getStatusEmojis(); @@ -702,7 +707,7 @@ public class NotificationsAdapter extends RecyclerView.Adapter { notificationActionListener.onNotificationContentCollapsedChange(!statusViewData.isCollapsed(), position); } }); - + contentCollapseButton.setVisibility(View.VISIBLE); if (statusViewData.isCollapsed()) { contentCollapseButton.setText(R.string.status_content_warning_show_more); diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/adapter/StickerAdapater.kt b/husky/app/src/main/java/com/keylesspalace/tusky/adapter/StickerAdapater.kt index db43876..c269695 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/adapter/StickerAdapater.kt +++ b/husky/app/src/main/java/com/keylesspalace/tusky/adapter/StickerAdapater.kt @@ -1,3 +1,23 @@ +/* + * Husky -- A Pleroma client for Android + * + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2020 Alibek Omarov + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.keylesspalace.tusky.adapter import android.graphics.drawable.Drawable diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/entity/Notification.kt b/husky/app/src/main/java/com/keylesspalace/tusky/entity/Notification.kt index 2b3556e..4529bc8 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/entity/Notification.kt +++ b/husky/app/src/main/java/com/keylesspalace/tusky/entity/Notification.kt @@ -1,17 +1,22 @@ -/* Copyright 2017 Andrew Dawson +/* + * Husky -- A Pleroma client for Android * - * This file is a part of Tusky. + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2017 Andrew Dawson * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky.entity diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ChatsFragment.kt b/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ChatsFragment.kt index 7c8e41c..29a73b2 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ChatsFragment.kt +++ b/husky/app/src/main/java/com/keylesspalace/tusky/fragment/ChatsFragment.kt @@ -1,3 +1,23 @@ +/* + * Husky -- A Pleroma client for Android + * + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2020 Alibek Omarov + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package com.keylesspalace.tusky.fragment import android.content.Context diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java b/husky/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java index e9354d2..59059b0 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java +++ b/husky/app/src/main/java/com/keylesspalace/tusky/fragment/NotificationsFragment.java @@ -1,17 +1,22 @@ -/* Copyright 2017 Andrew Dawson +/* + * Husky -- A Pleroma client for Android * - * This file is a part of Tusky. + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2017 Andrew Dawson * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky.fragment; @@ -339,14 +344,14 @@ public class NotificationsFragment extends SFragment implements posAndNotification.second.getStatus(), event.getReblog()); } - + private void handleMuteStatusEvent(MuteConversationEvent event) { Pair posAndNotification = findReplyPosition(event.getStatusId()); if (posAndNotification == null) return; - + int conversationId = posAndNotification.second.getStatus().getConversationId(); - + if(conversationId == -1) { // invalid conversation ID if(withMuted) { setMutedStatusForStatus(posAndNotification.first, posAndNotification.second.getStatus(), event.getMute(), event.getMute()); @@ -510,7 +515,7 @@ public class NotificationsFragment extends SFragment implements notifications.setPairedItem(position, newViewData); updateAdapter(); } - + @Override public void onFavourite(final boolean favourite, final int position) { final Notification notification = notifications.get(position).asRight(); @@ -674,7 +679,7 @@ public class NotificationsFragment extends SFragment implements notifications.setPairedItem(position, notificationViewData); updateAdapter(); } - + @Override public void onMute(int position, boolean isMuted) { NotificationViewData.Concrete old = @@ -689,10 +694,10 @@ public class NotificationsFragment extends SFragment implements notifications.setPairedItem(position, notificationViewData); updateAdapter(); } - + private void setMutedStatusForStatus(int position, Status status, boolean muted, boolean threadMuted) { status.setThreadMuted(threadMuted); - + NotificationViewData.Concrete viewdata = (NotificationViewData.Concrete) notifications.getPairedItem(position); StatusViewData.Builder viewDataBuilder = new StatusViewData.Builder(viewdata.getStatusViewData()); @@ -1447,7 +1452,7 @@ public class NotificationsFragment extends SFragment implements public void onReselect() { jumpToTop(); } - + private void setEmojiReactForStatus(int position, Status newStatus) { NotificationViewData.Concrete viewdata = (NotificationViewData.Concrete) notifications.getPairedItem(position); @@ -1474,7 +1479,7 @@ public class NotificationsFragment extends SFragment implements Pair posAndNotification = findReplyPosition(statusId); if (posAndNotification == null) return; - + timelineCases.react(emoji, statusId, react) .observeOn(AndroidSchedulers.mainThread()) .as(autoDisposable(from(this))) @@ -1485,7 +1490,7 @@ public class NotificationsFragment extends SFragment implements ); } - + @Override public void onEmojiReactMenu(@NonNull View view, final EmojiReaction emoji, final String statusId) { super.emojiReactMenu(statusId, emoji, view, this); diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java b/husky/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java index 229befb..be21cd1 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java +++ b/husky/app/src/main/java/com/keylesspalace/tusky/util/ViewDataUtils.java @@ -1,17 +1,22 @@ -/* Copyright 2017 Andrew Dawson +/* + * Husky -- A Pleroma client for Android * - * This file is a part of Tusky. + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2017 Andrew Dawson * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky.util; @@ -27,10 +32,6 @@ import com.keylesspalace.tusky.viewdata.StatusViewData; import com.keylesspalace.tusky.viewdata.ChatViewData; import com.keylesspalace.tusky.viewdata.ChatMessageViewData; -/** - * Created by charlag on 12/07/2017. - */ - public final class ViewDataUtils { @Nullable public static StatusViewData.Concrete statusToViewData(@Nullable Status status, diff --git a/husky/app/src/main/java/com/keylesspalace/tusky/viewdata/NotificationViewData.java b/husky/app/src/main/java/com/keylesspalace/tusky/viewdata/NotificationViewData.java index 52a9bf1..485d7f7 100644 --- a/husky/app/src/main/java/com/keylesspalace/tusky/viewdata/NotificationViewData.java +++ b/husky/app/src/main/java/com/keylesspalace/tusky/viewdata/NotificationViewData.java @@ -1,17 +1,22 @@ -/* Copyright 2017 Andrew Dawson +/* + * Husky -- A Pleroma client for Android * - * This file is a part of Tusky. + * Copyright (C) 2022 The Husky Developers + * Copyright (C) 2017 Andrew Dawson * - * This program is free software; you can redistribute it and/or modify it under the terms of the - * GNU General Public License as published by the Free Software Foundation; either version 3 of the - * License, or (at your option) any later version. + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. * - * Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even - * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General - * Public License for more details. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Tusky; if not, - * see . */ + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package com.keylesspalace.tusky.viewdata; @@ -23,8 +28,6 @@ import java.util.Objects; import io.reactivex.annotations.Nullable; /** - * Created by charlag on 12/07/2017. - *

* Class to represent data required to display either a notification or a placeholder. * It is either a {@link Placeholder} or a {@link Concrete}. * It is modelled this way because close relationship between placeholder and concrete notification