Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void onCreate(Bundle savedInstanceState) {
updateRightNavigationDrawer();

ActionBar actionBar = getSupportActionBar();
actionBar.setTitle(R.string.user_pub_repos);
actionBar.setTitle(R.string.repositories);
actionBar.setSubtitle(mUserLogin);
actionBar.setDisplayHomeAsUpEnabled(true);
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/gh4a/activities/home/HomeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class HomeActivity extends BasePagerActivity implements
static {
START_PAGE_MAPPING.put(R.id.news_feed, "newsfeed");
START_PAGE_MAPPING.put(R.id.notifications, "notifications");
START_PAGE_MAPPING.put(R.id.my_repos, "repos");
START_PAGE_MAPPING.put(R.id.repositories, "repos");
START_PAGE_MAPPING.put(R.id.my_issues, "issues");
START_PAGE_MAPPING.put(R.id.my_prs, "prs");
START_PAGE_MAPPING.put(R.id.my_gists, "gists");
Expand Down Expand Up @@ -298,7 +298,7 @@ private FragmentFactory getFactoryForItem(int id) {
return new NewsFeedFactory(this, mUserLogin);
case R.id.notifications:
return new NotificationListFactory(this);
case R.id.my_repos:
case R.id.repositories:
return new RepositoryFactory(this, mUserLogin, getPrefs());
case R.id.my_issues:
return new IssueListFactory(this, mUserLogin, false);
Expand Down
21 changes: 18 additions & 3 deletions app/src/main/java/com/gh4a/activities/home/RepositoryFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

public class RepositoryFactory extends FragmentFactory {
private static final int[] TAB_TITLES = new int[] {
R.string.my_repositories
R.string.my,
R.string.starred,
R.string.repo_type_watched
};

private final String mUserLogin;
Expand All @@ -37,7 +39,7 @@ public RepositoryFactory(HomeActivity activity, String userLogin, SharedPreferen

@Override
protected @StringRes int getTitleResId() {
return R.string.my_repositories;
return R.string.repositories;
}

@Override
Expand Down Expand Up @@ -116,9 +118,22 @@ protected void onRestoreInstanceState(Bundle state) {
}
}

@Override
protected boolean onCreateOptionsMenu(Menu menu) {
boolean result = super.onCreateOptionsMenu(menu);
// TODO
return result;
}

@Override
protected Fragment makeFragment(int position) {
return RepositoryListContainerFragment.newInstance(mUserLogin, false);
String filterType = "all";
if (position == 1) {
filterType = "starred";
} else if (position == 2) {
filterType = "watched";
}
return RepositoryListContainerFragment.newInstance(mUserLogin, false, filterType);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,6 @@ public static class FilterDrawerHelper {
FILTER_LOOKUP.put(R.id.filter_type_private, "private");
FILTER_LOOKUP.put(R.id.filter_type_sources, "sources");
FILTER_LOOKUP.put(R.id.filter_type_forks, "forks");
FILTER_LOOKUP.put(R.id.filter_type_watched, "watched");
FILTER_LOOKUP.put(R.id.filter_type_starred, "starred");
}

public static FilterDrawerHelper create(String userLogin, boolean isOrg) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
style="@style/HeaderLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/user_pub_repos" />
android:text="@string/repositories" />

<ProgressBar
android:id="@+id/pb_top_repos"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/menu/home_nav_drawer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
android:title="@string/notifications"
app:actionLayout="@layout/notifications_indicator" />
<item
android:id="@+id/my_repos"
android:title="@string/my_repositories"
android:id="@+id/repositories"
android:title="@string/repositories"
android:icon="@drawable/icon_repositories"/>
<item
android:id="@+id/my_issues"
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/menu/repo_filter_logged_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
<item
android:id="@+id/filter_type_forks"
android:title="@string/repo_type_forks" />
<item
android:id="@+id/filter_type_watched"
android:title="@string/repo_type_watched" />
<item
android:id="@+id/filter_type_starred"
android:title="@string/repo_type_starred" />
</group>
</menu>
</item>
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/menu/repo_filter_org.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@
<item
android:id="@+id/filter_type_forks"
android:title="@string/repo_type_forks" />
<item
android:id="@+id/filter_type_watched"
android:title="@string/repo_type_watched" />
<item
android:id="@+id/filter_type_starred"
android:title="@string/repo_type_starred" />
</group>
</menu>
</item>
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/menu/repo_filter_user.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@
<item
android:id="@+id/filter_type_forks"
android:title="@string/repo_type_forks" />
<item
android:id="@+id/filter_type_watched"
android:title="@string/repo_type_watched" />
<item
android:id="@+id/filter_type_starred"
android:title="@string/repo_type_starred" />
</group>
</menu>
</item>
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
<string name="my_issues">My issues</string>
<string name="my_pull_requests">My pull requests</string>
<string name="my_gists">My gists</string>
<string name="my">My</string>
<string name="repositories">Repositories</string>
<string name="start_page">Start page</string>
<string name="start_page_last_selected">Last selected</string>
<string name="comment_editor_locked_hint">Comments are only available to collaborators</string>
Expand Down Expand Up @@ -224,7 +226,6 @@
<string name="user_followers">Followers</string><!-- For type organization -->
<string name="user_members">Members</string><!-- For type organization -->
<string name="user_created_at">Member since %1$s</string>
<string name="user_pub_repos">Repositories</string>
<string name="user_extra_data">%1$d followers\u00a0\u00a0\u00a0%2$d repos</string>
<string name="user_news_feed">News Feed</string>
<string name="user_public_activity">Public Activity</string>
Expand Down