Skip to content

Commit 6416f40

Browse files
committed
Code fixes and gradle 4.10.1
1 parent 7f34ec0 commit 6416f40

File tree

5 files changed

+27
-38
lines changed

5 files changed

+27
-38
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v2.3.2
2+
- Added a parameter with the instance of the IconHelper in `LoadCallback.onDataLoaded`.
3+
14
### v2.3.1
25
- Prevented ADB bug where category string references weren't changed to an ID.
36

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.1'
10+
classpath 'com.android.tools.build:gradle:3.3.2'
1111
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
1212
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
1313

icondialog/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ext {
1414
siteUrl = 'https://github.com/maltaisn/icondialoglib'
1515
gitUrl = 'https://github.com/maltaisn/icondialoglib.git'
1616

17-
libraryVersionCode = 12
18-
libraryVersion = '2.3.1'
17+
libraryVersionCode = 13
18+
libraryVersion = '2.3.2'
1919

2020
developerId = 'maltaisn'
2121

icondialog/src/main/java/com/maltaisn/icondialog/IconDialog.java

+14-31
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,11 @@ public class IconDialog extends DialogFragment {
7878

7979
@Retention(RetentionPolicy.SOURCE)
8080
@IntDef(value = {VISIBILITY_ALWAYS, VISIBILITY_NEVER, VISIBILITY_IF_LANG_AVAILABLE})
81-
public @interface SearchVisibility {
82-
}
81+
public @interface SearchVisibility {}
8382

8483
@Retention(RetentionPolicy.SOURCE)
8584
@IntDef(value = {VISIBILITY_ALWAYS, VISIBILITY_NEVER, VISIBILITY_IF_NO_SEARCH})
86-
public @interface TitleVisibility {
87-
}
85+
public @interface TitleVisibility {}
8886

8987
public static final int MAX_SELECTION_NONE = -1;
9088

@@ -103,29 +101,29 @@ public class IconDialog extends DialogFragment {
103101
private int iconSize;
104102
private int[] iconColors;
105103

106-
private @SearchVisibility
107-
int searchVisibility;
108-
private @Nullable
109-
Locale searchLanguage;
104+
@SearchVisibility
105+
private int searchVisibility;
106+
@Nullable
107+
private Locale searchLanguage;
110108
private boolean showHeaders;
111109
private boolean stickyHeaders;
112110
private boolean showSelectBtn;
113111
private int maxSelection;
114112
private boolean maxSelShowMessage;
115-
private @Nullable
116-
String maxSelMessage;
113+
@Nullable
114+
private String maxSelMessage;
117115
private boolean showClearBtn;
118-
private @TitleVisibility
119-
int dialogTitleVisibility;
120-
private @Nullable
121-
String dialogTitle;
116+
@TitleVisibility
117+
private int dialogTitleVisibility;
118+
@Nullable
119+
private String dialogTitle;
122120
private BaseIconFilter iconFilter;
123121
private boolean loadIconDrawables;
124122

125123
private List<Item> listItems;
126124
private List<Item> selectedItems;
127-
private @Nullable
128-
int[] selectedIconsId;
125+
@Nullable
126+
private int[] selectedIconsId;
129127
private String searchText;
130128

131129
private boolean searchIgnoreDelay;
@@ -517,7 +515,6 @@ private Object getCaller() {
517515

518516
/**
519517
* Get the list of icons matching search with category headers
520-
*
521518
* @param search null to get whole list, or text to search among icon labels to filter icons
522519
* @return the list of items
523520
*/
@@ -608,7 +605,6 @@ public int compare(Item i1, Item i2) {
608605

609606
/**
610607
* Get the position of items in the adapter
611-
*
612608
* @param items array of icon items (varargs)
613609
* @return the array of positions
614610
*/
@@ -634,7 +630,6 @@ private int[] getItemsPosition(Item... items) {
634630
/**
635631
* Depending on the setting set at {@link #setSearchEnabled(int, Locale)}, checks
636632
* whether search will be enabled or not
637-
*
638633
* @return true if search is enabled
639634
*/
640635
public boolean isSearchAvailable() {
@@ -671,7 +666,6 @@ public boolean isSearchAvailable() {
671666
* Set whether search is enabled or not
672667
* By default, search is only enabled if device's language is available
673668
* When search is not enabled, a title will be shown on the dialog instead of the search bar
674-
*
675669
* @param visibility {@link #VISIBILITY_ALWAYS} to always enable search.
676670
* {@link #VISIBILITY_NEVER} to always disable search.
677671
* {@link #VISIBILITY_IF_LANG_AVAILABLE} to enable search only if the language is available
@@ -690,7 +684,6 @@ public IconDialog setSearchEnabled(@SearchVisibility int visibility, @Nullable L
690684

691685
/**
692686
* Set the title of the dialog and when it is shown
693-
*
694687
* @param visibility {@link #VISIBILITY_ALWAYS} to always show the title
695688
* {@link #VISIBILITY_NEVER} to never show the title
696689
* {@link #VISIBILITY_IF_NO_SEARCH} to only show the title if search is not available
@@ -706,7 +699,6 @@ public IconDialog setTitle(@TitleVisibility int visibility, @Nullable String tit
706699
/**
707700
* Set list header options
708701
* By default, headers are shown and are sticky
709-
*
710702
* @param show whether to show the headers or not
711703
* @param sticky if headers are shown, whether they appear on top of the list when scrolling down
712704
* @return the dialog
@@ -721,7 +713,6 @@ public IconDialog setShowHeaders(boolean show, boolean sticky) {
721713
* Set whether the select button and the other dialog dialog buttons are shown
722714
* If not, dialog will be dismissed immediately after an icon is clicked.
723715
* By default, selection is shown. It is always shown if multiple selection is allowed
724-
*
725716
* @param show whether select button is shown or not
726717
* @return the dialog
727718
*/
@@ -732,7 +723,6 @@ public IconDialog setShowSelectButton(boolean show) {
732723

733724
/**
734725
* Set initial selected icons
735-
*
736726
* @param iconIds varargs of icons id, null or empty array for no initial selection
737727
* @return the dialog
738728
*/
@@ -747,7 +737,6 @@ public IconDialog setSelectedIcons(@Nullable int... iconIds) {
747737

748738
/**
749739
* Set initial selected icons
750-
*
751740
* @param icons varargs of icons, null or empty array for no initial selection
752741
* @return the dialog
753742
*/
@@ -769,7 +758,6 @@ public IconDialog setSelectedIcons(@Nullable Icon... icons) {
769758

770759
/**
771760
* Set maximum number of icons that can be selected
772-
*
773761
* @param max maximum number
774762
* @param showMessage If true, a message will be shown when maximum selection is reached
775763
* User will need to deselect icons to select others
@@ -794,7 +782,6 @@ public IconDialog setMaxSelection(int max, boolean showMessage) {
794782
/**
795783
* Set whether to show the neutral clear button to unselect all icons
796784
* By default, this button is not shown.
797-
*
798785
* @param show whether to show it or not
799786
* @return the dialog
800787
*/
@@ -809,7 +796,6 @@ public IconDialog setShowClearButton(boolean show) {
809796
* and will be sorted by category, then by labels and then by ID
810797
* in its value. Multiple search terms can be separated with either " ", "," or ";"
811798
* A custom icon searcher can be set by subclassing {@link IconFilter}
812-
*
813799
* @param filter icon filter
814800
* @return the dialog
815801
*/
@@ -824,7 +810,6 @@ public IconDialog setIconFilter(BaseIconFilter filter) {
824810
/**
825811
* Get the IconFilter used to search and sort icons.
826812
* You can set additionnal settings with it
827-
*
828813
* @return the icon searcher
829814
* @see IconFilter#setDisabledCategories(int...)
830815
* @see IconFilter#setDisabledIcons(int...)
@@ -837,7 +822,6 @@ public BaseIconFilter getIconFilter() {
837822
/**
838823
* Set whether all icon drawables will be preloaded when dialog is shown to allow a smoother
839824
* scrolling in the icon list. By default, drawables are preloaded.
840-
*
841825
* @param load whether to load them or not
842826
* @return the dialog
843827
* @see IconHelper#loadIconDrawables()
@@ -1077,7 +1061,6 @@ public interface Callback {
10771061
/**
10781062
* Called on the target fragment, parent fragment or parent activity when
10791063
* icons are selected and user confirms the selection.
1080-
*
10811064
* @param icons selected icons, never null.
10821065
*/
10831066
void onIconDialogIconsSelected(@NonNull Icon[] icons);

icondialog/src/main/java/com/maltaisn/icondialog/IconHelper.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ public class IconHelper {
8686
private List<Label> groupLabels;
8787
private SparseArray<Category> categories;
8888

89-
private @XmlRes
90-
int extraIconsXml;
91-
private @XmlRes
92-
int extraLabelsXml;
89+
@XmlRes
90+
private int extraIconsXml;
91+
92+
@XmlRes
93+
private int extraLabelsXml;
94+
9395
private boolean extraIconsSet;
9496
private boolean extraIconsLoadPending;
9597

@@ -711,6 +713,7 @@ public interface LoadCallback {
711713
/**
712714
* Called when icon data is done loading.
713715
* All calls to get icons, labels and categories will return null before this is called.
716+
* @param helper The icon helper instance.
714717
*/
715718
void onDataLoaded(IconHelper helper);
716719
}

0 commit comments

Comments
 (0)