Skip to content

Commit 841bdd7

Browse files
committed
Explicit type argument String, Object can be replaced with <>
1 parent e7fafc5 commit 841bdd7

24 files changed

+107
-89
lines changed

library/src/main/java/candybar/lib/activities/CandyBarWallpaperActivity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
148148

149149
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
150150
"wallpaper",
151-
new HashMap<String, Object>() {{
151+
new HashMap<>() {{
152152
put("url", mWallpaperName);
153153
put("action", "preview");
154154
}}
@@ -324,7 +324,7 @@ public void onClick(View view) {
324324
if (item.getType() == PopupItem.Type.LOCKSCREEN) {
325325
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
326326
"wallpaper",
327-
new HashMap<String, Object>() {{
327+
new HashMap<>() {{
328328
put("url", mWallpaperName);
329329
put("section", "lockscreen");
330330
put("action", "apply");
@@ -334,7 +334,7 @@ public void onClick(View view) {
334334
} else if (item.getType() == PopupItem.Type.HOMESCREEN) {
335335
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
336336
"wallpaper",
337-
new HashMap<String, Object>() {{
337+
new HashMap<>() {{
338338
put("url", mWallpaperName);
339339
put("section", "homescreen");
340340
put("action", "apply");
@@ -344,7 +344,7 @@ public void onClick(View view) {
344344
} else if (item.getType() == PopupItem.Type.HOMESCREEN_LOCKSCREEN) {
345345
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
346346
"wallpaper",
347-
new HashMap<String, Object>() {{
347+
new HashMap<>() {{
348348
put("url", mWallpaperName);
349349
put("section", "homescreen_and_lockscreen");
350350
put("action", "apply");
@@ -478,7 +478,7 @@ private void loadWallpaper() {
478478
.override(2000)
479479
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
480480
.timeout(10000)
481-
.listener(new RequestListener<Bitmap>() {
481+
.listener(new RequestListener<>() {
482482
@Override
483483
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
484484
if (mWallpaper.getColor() == 0) {

library/src/main/java/candybar/lib/adapters/AboutAdapter.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public void onClick(View view) {
335335
if (id == R.id.contributors_title) {
336336
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
337337
"click",
338-
new HashMap<String, Object>() {{
338+
new HashMap<>() {{
339339
put("section", "about");
340340
put("action", "open_dialog");
341341
put("item", "contributors");
@@ -346,7 +346,7 @@ public void onClick(View view) {
346346
} else if (id == R.id.privacy_policy_title) {
347347
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
348348
"click",
349-
new HashMap<String, Object>() {{
349+
new HashMap<>() {{
350350
put("section", "about");
351351
put("action", "open_dialog");
352352
put("item", "privacy_policy");
@@ -358,7 +358,7 @@ public void onClick(View view) {
358358
} else if (id == R.id.terms_title) {
359359
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
360360
"click",
361-
new HashMap<String, Object>() {{
361+
new HashMap<>() {{
362362
put("section", "about");
363363
put("action", "open_dialog");
364364
put("item", "terms_and_conditions");
@@ -431,7 +431,7 @@ public void onClick(View view) {
431431
if (id == R.id.about_dashboard_licenses) {
432432
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
433433
"click",
434-
new HashMap<String, Object>() {{
434+
new HashMap<>() {{
435435
put("section", "about");
436436
put("action", "open_dialog");
437437
put("item", "licenses");
@@ -444,7 +444,7 @@ public void onClick(View view) {
444444
if (id == R.id.about_dashboard_contributors) {
445445
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
446446
"click",
447-
new HashMap<String, Object>() {{
447+
new HashMap<>() {{
448448
put("section", "about");
449449
put("action", "open_dialog");
450450
put("item", "contributors");
@@ -458,7 +458,7 @@ public void onClick(View view) {
458458
if (id == R.id.about_dashboard_translator) {
459459
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
460460
"click",
461-
new HashMap<String, Object>() {{
461+
new HashMap<>() {{
462462
put("section", "about");
463463
put("action", "open_dialog");
464464
put("item", "translators");
@@ -473,7 +473,7 @@ public void onClick(View view) {
473473
if (id == R.id.about_dashboard_github) {
474474
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
475475
"click",
476-
new HashMap<String, Object>() {{
476+
new HashMap<>() {{
477477
put("section", "about");
478478
put("action", "open_dialog");
479479
put("item", "github");

library/src/main/java/candybar/lib/adapters/AboutSocialAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void onClick(View view) {
101101

102102
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
103103
"click",
104-
new HashMap<String, Object>() {{
104+
new HashMap<>() {{
105105
put("section", "about");
106106
put("action", "open_social");
107107
put("url", mUrls[position]);

library/src/main/java/candybar/lib/adapters/FAQsAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public void search(String string) {
145145
if (getFaqsCount() == 0) {
146146
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
147147
"type",
148-
new HashMap<String, Object>() {{
148+
new HashMap<>() {{
149149
put("section", "faq");
150150
put("action", "search");
151151
put("found", "no");
@@ -155,7 +155,7 @@ public void search(String string) {
155155
} else {
156156
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
157157
"type",
158-
new HashMap<String, Object>() {{
158+
new HashMap<>() {{
159159
put("section", "faq");
160160
put("action", "search");
161161
put("found", "yes");

library/src/main/java/candybar/lib/adapters/HomeAdapter.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int positi
250250
.load("drawable://" + mHomes.get(finalPosition).getIcon())
251251
.skipMemoryCache(true)
252252
.diskCacheStrategy(DiskCacheStrategy.NONE)
253-
.listener(new RequestListener<Bitmap>() {
253+
.listener(new RequestListener<>() {
254254
@Override
255255
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {
256256
return true;
@@ -335,7 +335,7 @@ public boolean onResourceReady(Bitmap bitmap, Object model, Target<Bitmap> targe
335335

336336
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
337337
"stats",
338-
new HashMap<String, Object>() {{
338+
new HashMap<>() {{
339339
put("section", "home");
340340
put("installed", installed);
341341
put("missed", missed);
@@ -462,7 +462,7 @@ public void onClick(View view) {
462462
if (id == R.id.rate) {
463463
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
464464
"click",
465-
new HashMap<String, Object>() {{
465+
new HashMap<>() {{
466466
put("section", "home");
467467
put("action", "open_dialog");
468468
put("item", "rate_and_review");
@@ -475,7 +475,7 @@ public void onClick(View view) {
475475
} else if (id == R.id.share) {
476476
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
477477
"click",
478-
new HashMap<String, Object>() {{
478+
new HashMap<>() {{
479479
put("section", "home");
480480
put("action", "open_dialog");
481481
put("item", "share");
@@ -495,7 +495,7 @@ public void onClick(View view) {
495495
} else if (id == R.id.update) {
496496
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
497497
"click",
498-
new HashMap<String, Object>() {{
498+
new HashMap<>() {{
499499
put("section", "home");
500500
put("action", "open_dialog");
501501
put("item", "update");
@@ -695,7 +695,7 @@ public void onClick(View view) {
695695
case APPLY:
696696
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
697697
"click",
698-
new HashMap<String, Object>() {{
698+
new HashMap<>() {{
699699
put("section", "home");
700700
put("action", "navigate");
701701
put("item", "icon_apply");
@@ -708,7 +708,7 @@ public void onClick(View view) {
708708
case DONATE:
709709
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
710710
"click",
711-
new HashMap<String, Object>() {{
711+
new HashMap<>() {{
712712
put("section", "home");
713713
put("action", "open_dialog");
714714
put("item", "donate");
@@ -727,7 +727,7 @@ public void onClick(View view) {
727727
case ICONS:
728728
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
729729
"click",
730-
new HashMap<String, Object>() {{
730+
new HashMap<>() {{
731731
put("section", "home");
732732
put("action", "navigate");
733733
put("item", "icons");
@@ -825,7 +825,7 @@ public void onClick(View view) {
825825
if (id == R.id.container) {
826826
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
827827
"click",
828-
new HashMap<String, Object>() {{
828+
new HashMap<>() {{
829829
put("section", "home");
830830
put("action", "navigate");
831831
put("item", "icon_request");
@@ -946,7 +946,7 @@ public void onClick(View view) {
946946
if (id == R.id.container) {
947947
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
948948
"click",
949-
new HashMap<String, Object>() {{
949+
new HashMap<>() {{
950950
put("section", "home");
951951
put("action", "open_dialog");
952952
put("item", "other_apps");

library/src/main/java/candybar/lib/adapters/IconsAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public void search(String string) {
397397
if (mIcons.size() == 0) {
398398
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
399399
"click",
400-
new HashMap<String, Object>() {{
400+
new HashMap<>() {{
401401
put("section", "icons");
402402
put("action", "search");
403403
put("item", query);
@@ -408,7 +408,7 @@ public void search(String string) {
408408
} else {
409409
CandyBarApplication.getConfiguration().getAnalyticsHandler().logEvent(
410410
"click",
411-
new HashMap<String, Object>() {{
411+
new HashMap<>() {{
412412
put("section", "icons");
413413
put("action", "search");
414414
put("item", query);

0 commit comments

Comments
 (0)