Search in sources :

Example 1 with TextMatch

use of com.meisolsson.githubsdk.model.TextMatch in project gh4a by slapperwan.

the class SearchFragment method openFileViewer.

private void openFileViewer(SearchCode result, int matchIndex) {
    Repository repo = result.repository();
    Uri uri = Uri.parse(result.url());
    String ref = uri.getQueryParameter("ref");
    TextMatch textMatch = matchIndex >= 0 ? result.textMatches().get(matchIndex) : null;
    startActivity(FileViewerActivity.makeIntentWithSearchMatch(getActivity(), repo.owner().login(), repo.name(), ref, result.path(), textMatch));
}
Also used : Repository(com.meisolsson.githubsdk.model.Repository) TextMatch(com.meisolsson.githubsdk.model.TextMatch) Uri(android.net.Uri)

Aggregations

Uri (android.net.Uri)1 Repository (com.meisolsson.githubsdk.model.Repository)1 TextMatch (com.meisolsson.githubsdk.model.TextMatch)1