mirror of
https://codeberg.org/tom79/Fedilab.git
synced 2024-12-22 08:40:03 +02:00
clean code
This commit is contained in:
parent
d0fb1b09dc
commit
70405221ea
7 changed files with 31 additions and 21 deletions
|
@ -464,7 +464,8 @@ public class MediaActivity extends BaseTransparentActivity implements OnDownload
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onDownloaded(String saveFilePath, String downloadUrl, Error error) {}
|
||||
public void onDownloaded(String saveFilePath, String downloadUrl, Error error) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateProgress(int progress) {
|
||||
|
|
|
@ -22,8 +22,6 @@ import android.widget.RadioButton;
|
|||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.LinearLayoutCompat;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
|
|
|
@ -45,7 +45,8 @@ public class Tag implements Serializable {
|
|||
for (History h : history) {
|
||||
try {
|
||||
weight += Integer.parseInt(h.accounts);
|
||||
} catch (Exception ignored) {}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return weight;
|
||||
|
|
|
@ -140,51 +140,61 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
String type = notificationList.get(position).type;
|
||||
if (type != null) {
|
||||
switch (type) {
|
||||
case "follow":
|
||||
case "follow" -> {
|
||||
return TYPE_FOLLOW;
|
||||
case "follow_request":
|
||||
}
|
||||
case "follow_request" -> {
|
||||
return TYPE_FOLLOW_REQUEST;
|
||||
case "mention":
|
||||
}
|
||||
case "mention" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_MENTION;
|
||||
} else {
|
||||
return TYPE_HIDDEN;
|
||||
}
|
||||
case "reblog":
|
||||
}
|
||||
case "reblog" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_REBLOG;
|
||||
} else {
|
||||
return TYPE_HIDDEN;
|
||||
}
|
||||
case "update":
|
||||
}
|
||||
case "update" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_UPDATE;
|
||||
} else {
|
||||
return TYPE_HIDDEN;
|
||||
}
|
||||
case "favourite":
|
||||
}
|
||||
case "favourite" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_FAVOURITE;
|
||||
} else {
|
||||
return TYPE_HIDDEN;
|
||||
}
|
||||
case "poll":
|
||||
}
|
||||
case "poll" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_POLL;
|
||||
} else {
|
||||
return TYPE_HIDDEN;
|
||||
}
|
||||
case "status":
|
||||
}
|
||||
case "status" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_STATUS;
|
||||
} else {
|
||||
return TYPE_HIDDEN;
|
||||
}
|
||||
case "admin.sign_up":
|
||||
}
|
||||
case "admin.sign_up" -> {
|
||||
return TYPE_ADMIN_SIGNUP;
|
||||
case "admin.report":
|
||||
}
|
||||
case "admin.report" -> {
|
||||
return TYPE_ADMIN_REPORT;
|
||||
case "pleroma:emoji_reaction":
|
||||
}
|
||||
case "pleroma:emoji_reaction" -> {
|
||||
if (notificationList.get(position).status != null) {
|
||||
return TYPE_REACTION;
|
||||
} else {
|
||||
|
@ -192,6 +202,7 @@ public class NotificationAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.getItemViewType(position);
|
||||
}
|
||||
|
||||
|
|
|
@ -212,7 +212,6 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
|||
private String publicTrendsDomain;
|
||||
|
||||
|
||||
|
||||
//Allow to recreate data when detaching/attaching fragment
|
||||
public void recreate() {
|
||||
initialStatuses = null;
|
||||
|
|
Loading…
Reference in a new issue