99 lines
3.7 KiB
Java
99 lines
3.7 KiB
Java
package com.discord.models.hubs;
|
|
|
|
import android.content.Context;
|
|
import androidx.annotation.StringRes;
|
|
import com.discord.R;
|
|
import com.discord.utilities.features.GrowthTeamFeatures;
|
|
import d0.z.d.m;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
|
/* compiled from: DirectoryEntryCategory.kt */
|
|
public enum DirectoryEntryCategory {
|
|
Home(-1, R.string.directory_category_all, 70),
|
|
Uncategorized(0, R.string.uncategorized, 0, 4, null),
|
|
SchoolClub(1, R.string.directory_category_school_club, 100),
|
|
Class(2, R.string.directory_category_class, 0, 4, null),
|
|
StudySocial(3, R.string.directory_category_study_social, 50),
|
|
SubjectMajor(4, R.string.directory_category_subject_major, 0, 4, null),
|
|
Misc(5, R.string.directory_category_miscellaneous, 0, 4, null),
|
|
HQSocial(1, R.string.directory_category_internal_1, 0, 4, null),
|
|
HQErgs(2, R.string.directory_category_internal_2, 0, 4, null),
|
|
HQMisc(3, R.string.directory_category_internal_3, 0, 4, null),
|
|
HQArchives(5, R.string.directory_category_internal_5, 0, 4, null);
|
|
|
|
public static final Companion Companion = new Companion(null);
|
|
private final int idealSize;
|
|
private final int key;
|
|
private final int titleRes;
|
|
|
|
/* compiled from: DirectoryEntryCategory.kt */
|
|
public static final class Companion {
|
|
private Companion() {
|
|
}
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
this();
|
|
}
|
|
|
|
public final DirectoryEntryCategory findByKey(int i, boolean z2) {
|
|
Object obj;
|
|
boolean z3;
|
|
Iterator<T> it = getCategories(z2).iterator();
|
|
while (true) {
|
|
if (!it.hasNext()) {
|
|
obj = null;
|
|
break;
|
|
}
|
|
obj = it.next();
|
|
if (((DirectoryEntryCategory) obj).getKey() == i) {
|
|
z3 = true;
|
|
continue;
|
|
} else {
|
|
z3 = false;
|
|
continue;
|
|
}
|
|
if (z3) {
|
|
break;
|
|
}
|
|
}
|
|
DirectoryEntryCategory directoryEntryCategory = (DirectoryEntryCategory) obj;
|
|
return directoryEntryCategory != null ? directoryEntryCategory : DirectoryEntryCategory.Uncategorized;
|
|
}
|
|
|
|
public final List<DirectoryEntryCategory> getCategories(boolean z2) {
|
|
return z2 ? DirectoryEntryCategoryKt.access$getHQ_DIRECTORY_CATEGORIES$p() : DirectoryEntryCategoryKt.access$getHUB_CATEGORIES$p();
|
|
}
|
|
}
|
|
|
|
private DirectoryEntryCategory(int i, @StringRes int i2, int i3) {
|
|
this.key = i;
|
|
this.titleRes = i2;
|
|
this.idealSize = i3;
|
|
}
|
|
|
|
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
|
|
public /* synthetic */ DirectoryEntryCategory(int i, int i2, int i3, int i4, DefaultConstructorMarker defaultConstructorMarker) {
|
|
this(i, i2, (i4 & 4) != 0 ? Integer.MAX_VALUE : i3);
|
|
}
|
|
|
|
public final int getIdealSize() {
|
|
return this.idealSize;
|
|
}
|
|
|
|
public final int getKey() {
|
|
return this.key;
|
|
}
|
|
|
|
public final String getTitle(Context context) {
|
|
m.checkNotNullParameter(context, "context");
|
|
String string = context.getString((this != Home || !GrowthTeamFeatures.INSTANCE.hubRecommendationsEnabled()) ? this.titleRes : R.string.directory_category_recommended);
|
|
m.checkNotNullExpressionValue(string, "context.getString(\n … titleRes\n }\n )");
|
|
return string;
|
|
}
|
|
|
|
public final int getTitleRes() {
|
|
return this.titleRes;
|
|
}
|
|
}
|