removed unused code

This commit is contained in:
Mariotaku Lee 2016-12-16 08:15:39 +08:00
parent 911498768f
commit e018e52049
2 changed files with 3 additions and 15 deletions

View File

@ -28,7 +28,6 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v4.util.SimpleArrayMap;
import android.text.TextUtils;
import org.apache.commons.lang3.ArrayUtils;
@ -53,21 +52,10 @@ import java.util.Collections;
import java.util.List;
public class CustomTabUtils implements Constants {
private static final SimpleArrayMap<String, Integer> CUSTOM_TABS_ICON_NAME_MAP = new SimpleArrayMap<>();
private CustomTabUtils() {
}
@Nullable
public static String findTabIconKey(final int iconRes) {
for (int i = 0, j = CUSTOM_TABS_ICON_NAME_MAP.size(); i < j; i++) {
if (CUSTOM_TABS_ICON_NAME_MAP.valueAt(i) == iconRes) {
return CUSTOM_TABS_ICON_NAME_MAP.keyAt(i);
}
}
return null;
}
public static List<Tab> getTabs(@NonNull final Context context) {
final ContentResolver resolver = context.getContentResolver();
@ -179,8 +167,8 @@ public class CustomTabUtils implements Constants {
return added;
}
public static boolean isTabTypeValid(final String tabType) {
return tabType != null && TabConfiguration.ofType(Tab.getTypeAlias(tabType)) != null;
public static boolean isTabTypeValid(@NonNull final String tabType) {
return TabConfiguration.ofType(Tab.getTypeAlias(tabType)) != null;
}
public static boolean hasAccountId(final Context context, @NonNull final Bundle args,

View File

@ -472,7 +472,7 @@ class CustomTabsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, Mult
val type = Tab.getTypeAlias(cursor.getString(indices.type))
val name = cursor.getString(indices.name)
val iconKey = cursor.getString(indices.icon)
if (CustomTabUtils.isTabTypeValid(type)) {
if (type != null && CustomTabUtils.isTabTypeValid(type)) {
val typeName = CustomTabUtils.getTabTypeName(context, type)
holder.text1.text = if (TextUtils.isEmpty(name)) typeName else name
holder.text1.paintFlags = holder.text1.paintFlags and Paint.STRIKE_THRU_TEXT_FLAG.inv()