Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Commit

Permalink
replaced splash screen with FastHub identity fixing the scaling issue…
Browse files Browse the repository at this point in the history
… on larger screens, added last updated label to make sense of the update date showing, fixed Issue labeling where only the repo owner could label an issue. fixing some of what reported in #19, made NavigationView consume clicks to prevent touching behind it closing #18
  • Loading branch information
Kosh committed Feb 27, 2017
1 parent 48644d4 commit badae3d
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class ReposViewHolder extends BaseViewHolder<RepoModel> {
@BindView(R.id.forks) FontTextView forks;
@BindView(R.id.avatarLayout) AvatarLayout avatarLayout;
@BindString(R.string.forked) String forked;
@BindString(R.string.last_updated) String lastUpdated;

private ReposViewHolder(@NonNull View itemView, @Nullable BaseRecyclerAdapter adapter) {
super(itemView, adapter);
Expand All @@ -55,7 +56,9 @@ public void bind(@NonNull RepoModel repo, boolean isStarred, boolean withImage)
NumberFormat numberFormat = NumberFormat.getNumberInstance();
stars.setText(numberFormat.format(repo.getStargazersCount()));
forks.setText(numberFormat.format(repo.getForks()));
date.setText(ParseDateFormat.getTimeAgo(repo.getUpdatedAt()));
date.setText(SpannableBuilder.builder().append(lastUpdated)
.append(" ")
.append(ParseDateFormat.getTimeAgo(repo.getUpdatedAt())));
}

@Override public void bind(@NonNull RepoModel repo) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.annimon.stream.Collectors;
import com.annimon.stream.Stream;
Expand Down Expand Up @@ -95,11 +96,8 @@ class IssuePagerPresenter extends BasePresenter<IssuePagerMvp.View> implements I

@Override public boolean isRepoOwner() {
if (getIssue() == null) return false;
UserModel userModel = getIssue() != null ? getIssue().getUser() : null;
LoginModel me = LoginModel.getUser();
PullsIssuesParser parser = PullsIssuesParser.getForPullRequest(getIssue().getHtmlUrl());
return userModel != null && userModel.getLogin().equalsIgnoreCase(me.getLogin())
|| (parser != null && parser.getLogin().equalsIgnoreCase(me.getLogin()));
return TextUtils.equals(login, me.getLogin());
}

@Override public boolean isLocked() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.annimon.stream.Collectors;
import com.annimon.stream.Stream;
Expand All @@ -13,8 +14,6 @@
import com.fastaccess.data.dao.LoginModel;
import com.fastaccess.data.dao.MergeRequestModel;
import com.fastaccess.data.dao.PullRequestModel;
import com.fastaccess.data.dao.PullsIssuesParser;
import com.fastaccess.data.dao.UserModel;
import com.fastaccess.data.service.IssueService;
import com.fastaccess.helper.BundleConstant;
import com.fastaccess.helper.InputHelper;
Expand Down Expand Up @@ -97,11 +96,8 @@ class PullRequestPagerPresenter extends BasePresenter<PullRequestPagerMvp.View>

@Override public boolean isRepoOwner() {
if (getPullRequest() == null) return false;
UserModel userModel = getPullRequest() != null ? getPullRequest().getUser() : null;
LoginModel me = LoginModel.getUser();
PullsIssuesParser parser = PullsIssuesParser.getForPullRequest(getPullRequest().getHtmlUrl());
return userModel != null && userModel.getLogin().equalsIgnoreCase(me.getLogin())
|| (parser != null && parser.getLogin().equalsIgnoreCase(me.getLogin()));
return TextUtils.equals(login, me.getLogin());
}

@Override public boolean isLocked() {
Expand Down
Binary file removed app/src/main/res/drawable-nodpi/fasthub_splash.jpg
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions app/src/main/res/drawable/splash_screen_drawable.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true">
<shape>
<solid android:color="@color/accent"/>
<solid android:color="@color/primary"/>
</shape>
</item>
<item>
<bitmap
android:gravity="fill_horizontal"
android:src="@drawable/fasthub_splash"/>
android:gravity="center"
android:src="@drawable/web_hi_res_512"/>
</item>
</layer-list>
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:clickable="true"
android:clipToPadding="false"
android:fitsSystemWindows="true"
android:paddingBottom="76dp"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,5 @@
<string name="watch_hint">Click here to watch/unwatch repo.</string>
<string name="fork_repo_hint">Click here to fork repo.</string>
<string name="no_url">No url found.</string>
<string name="last_updated">Last Updated</string>
</resources>
1 change: 0 additions & 1 deletion app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
</style>

<style name="SplashTheme" parent="AppTheme">
<item name="colorPrimaryDark">@color/transparent</item>
<item name="android:windowBackground">@drawable/splash_screen_drawable</item>
</style>

Expand Down

0 comments on commit badae3d

Please sign in to comment.