Skip to content

Commit

Permalink
IDE-271 Fix copyright and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Frajhamster committed Nov 27, 2024
1 parent c189660 commit d19cd6a
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
11 changes: 6 additions & 5 deletions catroid/src/main/java/org/catrobat/catroid/ui/UiUtils.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2022 The Catrobat Team
* Copyright (C) 2010-2024 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -166,7 +166,7 @@ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup
};
}

public static ArrayAdapter getAlertDialogAdapterForTextWithIcons(Activity activity, Context context, Pair<String, Integer>[] items) {
public static ArrayAdapter getAlertDialogAdapterForTextWithIcons(Activity activity, Context context, List<Pair<String, Integer>> items) {
return new ArrayAdapter<Pair<String, Integer>>(context, android.R.layout.simple_list_item_1, items) {
TextView item;

Expand All @@ -183,12 +183,13 @@ public View getView(int position, @Nullable View convertView, @NonNull ViewGroup
item = (TextView) convertView.getTag();
}

item.setText(items[position].first);
item.setText(items.get(position).first);

if (activity.getWindow().getDecorView().getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) {
item.setCompoundDrawablesWithIntrinsicBounds(items[position].second, 0, 0, 0);
item.setCompoundDrawablesWithIntrinsicBounds(items.get(position).second, 0, 0,
0);
} else {
item.setCompoundDrawablesWithIntrinsicBounds(0, 0, items[position].second, 0);
item.setCompoundDrawablesWithIntrinsicBounds(0, 0, items.get(position).second, 0);
}

return convertView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2022 The Catrobat Team
* Copyright (C) 2010-2024 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -50,6 +50,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -298,9 +299,10 @@ public void onItemClick(final T item, MultiSelectionManager selectionManager) {
return;
}

Pair[] items = new Pair[] {
new Pair<String, Integer>(getString(R.string.unpack), R.drawable.ic_logout),
new Pair<String, Integer>(getString(R.string.delete), R.drawable.ic_delete)};
List<Pair<String, Integer>> items = Arrays.asList(
new Pair<>(getString(R.string.unpack), R.drawable.ic_logout),
new Pair<>(getString(R.string.delete), R.drawable.ic_delete)
);

LayoutInflater inflater = LayoutInflater.from(requireContext());
View customDialogView = inflater.inflate(R.layout.dialog_backpack_custom_alert, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2022 The Catrobat Team
* Copyright (C) 2010-2024 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -57,6 +57,7 @@

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

Expand Down Expand Up @@ -482,9 +483,10 @@ public void notifyDataSetChanged() {
}

protected void showBackpackModeChooser() {
Pair[] items = new Pair[] {
new Pair<String, Integer>(getString(R.string.pack), R.drawable.ic_login),
new Pair<String, Integer>(getString(R.string.unpack), R.drawable.ic_logout)};
List<Pair<String, Integer>> items = Arrays.asList(
new Pair<>(getString(R.string.pack), R.drawable.ic_login),
new Pair<>(getString(R.string.unpack), R.drawable.ic_logout)
);

LayoutInflater inflater = LayoutInflater.from(requireContext());
View customDialogView = inflater.inflate(R.layout.dialog_backpack_custom_alert, null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Catroid: An on-device visual programming system for Android devices
* Copyright (C) 2010-2023 The Catrobat Team
* Copyright (C) 2010-2024 The Catrobat Team
* (<http://developer.catrobat.org/credits>)
*
* This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -96,6 +96,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
Expand Down Expand Up @@ -853,9 +854,10 @@ public boolean onBrickLongClick(Brick brick, int position) {
}

private void showBackpackModeChooser() {
Pair[] items = new Pair[] {
new Pair<String, Integer>(getString(R.string.pack), R.drawable.ic_login),
new Pair<String, Integer>(getString(R.string.unpack), R.drawable.ic_logout)};
List<Pair<String, Integer>> items = Arrays.asList(
new Pair<>(getString(R.string.pack), R.drawable.ic_login),
new Pair<>(getString(R.string.unpack), R.drawable.ic_logout)
);

LayoutInflater inflater = LayoutInflater.from(requireContext());
View customDialogView = inflater.inflate(R.layout.dialog_backpack_custom_alert, null);
Expand Down
2 changes: 1 addition & 1 deletion catroid/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Catroid: An on-device visual programming system for Android devices
~ Copyright (C) 2010-2023 The Catrobat Team
~ Copyright (C) 2010-2024 The Catrobat Team
~ (<http://developer.catrobat.org/credits>)
~
~ This program is free software: you can redistribute it and/or modify
Expand Down

0 comments on commit d19cd6a

Please sign in to comment.