-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
308 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
528 changes: 237 additions & 291 deletions
528
app/src/main/java/com/sevtinge/hyperceiler/utils/search/SearchHelper.java
Large diffs are not rendered by default.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
app/src/main/java/com/sevtinge/hyperceiler/utils/search/SearchResultItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.sevtinge.hyperceiler.utils.search; | ||
|
||
|
||
import android.text.TextUtils; | ||
|
||
import com.sevtinge.hyperceiler.data.ModData; | ||
|
||
public class SearchResultItem implements Comparable<SearchResultItem> { | ||
|
||
public static final int SEARCH_ITEM_NORMAL = 0; | ||
public static final int SEARCH_EMPTY = 1; | ||
public static final int SEARCH_SEPARATE_APP = 2; | ||
public static final int SEARCH_CATEGORY = 3; | ||
public static final int SEARCH_FOOTER = 4; | ||
|
||
public String group; | ||
|
||
public String title; | ||
public String breadcrumbs; | ||
public String key; | ||
public ModData.ModCat cat; | ||
public String sub; | ||
public int order; | ||
public String fragment; | ||
public int catTitleResId; | ||
|
||
public final int type; | ||
public static final SearchResultItem EMPTY = new SearchResultItem(SEARCH_EMPTY); | ||
public static final SearchResultItem CATEGORY = new SearchResultItem(SEARCH_CATEGORY); | ||
public static final SearchResultItem FOOTER = new SearchResultItem(SEARCH_FOOTER); | ||
|
||
public SearchResultItem(int type) { | ||
this.type = type; | ||
} | ||
|
||
public String getGroupInfo(String str, String str2) { | ||
String str3 = !TextUtils.isEmpty(str) ? str.split("/")[0] : null; | ||
if (!TextUtils.isEmpty(str3)) { | ||
return str3; | ||
} | ||
if (!TextUtils.isEmpty(str2)) { | ||
str3 = str2.split("/")[0]; | ||
} | ||
if (!TextUtils.isEmpty(str3)) { | ||
return str3; | ||
} | ||
throw new RuntimeException("group is null: " + title); | ||
} | ||
|
||
@Override | ||
public int compareTo(SearchResultItem o) { | ||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters