|
1 | 1 | /*
|
2 |
| - * Copyright 2018-2022 Pranav Pandey |
| 2 | + * Copyright 2018-2024 Pranav Pandey |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -74,23 +74,23 @@ protected void onPreExecute() {
|
74 | 74 | return null;
|
75 | 75 | }
|
76 | 76 |
|
| 77 | + Uri uri; |
77 | 78 | if (getThemeListener().getThemeSource() instanceof Intent) {
|
78 |
| - return DynamicThemeUtils.getThemeData(getContext(), |
79 |
| - (Intent) getThemeListener().getThemeSource()); |
| 79 | + uri = DynamicThemeUtils.getThemeUri((Intent) getThemeListener().getThemeSource()); |
80 | 80 | } else if (getThemeListener().getThemeSource() instanceof Uri) {
|
81 |
| - String data; |
82 |
| - if ((data = DynamicThemeUtils.getThemeData(getContext(), |
83 |
| - (Uri) getThemeListener().getThemeSource())) != null) { |
84 |
| - return data; |
85 |
| - } else { |
86 |
| - return DynamicThemeUtils.getThemeUrl(DynamicThemeUtils.mapTheme( |
87 |
| - new DynamicAppTheme(), DynamicThemeUtils.getBitmapColors( |
88 |
| - DynamicBitmapUtils.getBitmap(getContext(), |
89 |
| - (Uri) getThemeListener().getThemeSource())))); |
90 |
| - } |
| 81 | + uri = (Uri) getThemeListener().getThemeSource(); |
| 82 | + } else { |
| 83 | + uri = null; |
91 | 84 | }
|
92 | 85 |
|
93 |
| - return null; |
| 86 | + String data; |
| 87 | + if ((data = DynamicThemeUtils.getThemeData(getContext(), uri)) != null) { |
| 88 | + return data; |
| 89 | + } else { |
| 90 | + return DynamicThemeUtils.getThemeUrl(DynamicThemeUtils.mapTheme( |
| 91 | + new DynamicAppTheme(), DynamicThemeUtils.getBitmapColors( |
| 92 | + DynamicBitmapUtils.getBitmap(getContext(), uri)))); |
| 93 | + } |
94 | 94 | }
|
95 | 95 |
|
96 | 96 | @Override
|
|
0 commit comments