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

Commit

Permalink
removed the progressbar for avatars and replaced it with an oval grey…
Browse files Browse the repository at this point in the history
… to close #43. ready to release 1.0.5
  • Loading branch information
Kosh committed Mar 5, 2017
1 parent 837b265 commit 4c716dd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ android {
applicationId "com.fastaccess.github"
minSdkVersion 21
targetSdkVersion 25
versionCode 104
versionName "1.0.4"
versionCode 105
versionName "1.0.5"
signingConfig signingConfigs.signing
buildConfigField "String", "GITHUB_CLIENT_ID", "\"${GITHUB_CLIENT_ID}\""
buildConfigField "String", "GITHUB_SECRET", "\"${GITHUB_SECRET}\""
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/com/fastaccess/ui/widgets/AvatarLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.support.annotation.AttrRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
Expand Down Expand Up @@ -79,16 +80,15 @@ public AvatarLayout(@NonNull Context context, @Nullable AttributeSet attrs, @Att
}

@Override public void onLoadingStarted(String imageUri, View view) {
avatarProgress.setVisibility(VISIBLE);
setBackgroundResource(R.drawable.circle_shape);
}

@Override public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
avatarProgress.setVisibility(GONE);
avatar.setImageResource(R.drawable.ic_github_black);
}

@Override public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
avatarProgress.setVisibility(GONE);
setBackgroundColor(Color.TRANSPARENT);
}

@Override public void onLoadingCancelled(String imageUri, View view) {}
Expand All @@ -100,7 +100,6 @@ public void setUrl(@Nullable String url, @Nullable String login) {
ImageLoader.getInstance().displayImage(url, avatar, this);
} else {
ImageLoader.getInstance().displayImage(null, avatar);
avatarProgress.setVisibility(GONE);
}
}
}
7 changes: 7 additions & 0 deletions app/src/main/res/drawable/circle_shape.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<solid android:color="@color/universal_primary_dark_color"/>

</shape>
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:foreground="?selectableItemBackgroundBorderless">

<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/avatar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/ic_github"/>
android:src="@color/primary"/>

<ProgressBar
android:id="@+id/avatarProgress"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible"/>
android:visibility="gone"/>
</merge>
13 changes: 6 additions & 7 deletions app/src/main/res/menu/pull_request_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@
android:icon="@drawable/ic_profile"
android:title="@string/assignees"/>
</menu>
<item
android:id="@+id/merge"
android:icon="@drawable/ic_merge"
android:title="@string/merge"
app:showAsAction="ifRoom"/>
</item>

<item
android:id="@+id/merge"
android:icon="@drawable/ic_merge"
android:title="@string/merge"
app:showAsAction="ifRoom"/>

<item
android:id="@+id/share"
android:icon="@drawable/ic_share"
android:title="@string/share"
app:showAsAction="never"/>
app:showAsAction="ifRoom"/>

</menu>

0 comments on commit 4c716dd

Please sign in to comment.