| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app.smartspace; |
| 18 |
|
| 19 |
import android.annotation.Nullable; |
| 20 |
import android.app.smartspace.uitemplatedata.Text; |
| 21 |
import android.text.TextUtils; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public final class SmartspaceUtils { |
| 29 |
|
| 30 |
private SmartspaceUtils() { |
| 31 |
} |
| 32 |
|
| 33 |
|
| 34 |
public static boolean isEmpty(@Nullable Text text) { |
| 35 |
return text == null || TextUtils.isEmpty(text.getText()); |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
public static boolean isEqual(@Nullable Text text1, @Nullable Text text2) { |
| 40 |
if (text1 == null && text2 == null) return true; |
| 41 |
if (text1 == null || text2 == null) return false; |
| 42 |
return text1.equals(text2); |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
public static boolean isEqual(@Nullable CharSequence cs1, @Nullable CharSequence cs2) { |
| 47 |
if (cs1 == null && cs2 == null) return true; |
| 48 |
if (cs1 == null || cs2 == null) return false; |
| 49 |
return cs1.toString().contentEquals(cs2); |
| 50 |
} |
| 51 |
} |