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

Commit

Permalink
Ui improvements for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
alorma committed Nov 12, 2016
1 parent b84c6db commit f619d0b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ dependencies {

play {
jsonFile = file('../gplay-secret.json')
track = 'alpha'
track = 'beta'
}

def (releaseKeystorePassword, releaseKeyAlias, releaseKeyPassword) = signingConfigFromFile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ private void fillTagDetailsView(Release release) {

private void fillToolbar(Release release) {
toolbar.setNavigationIcon(R.drawable.ic_close_black_24dp);
toolbar.setSubtitle(release.getTargetCommitish() + (release.getName() == null ? " - " + release.getTagName() : ""));
toolbar.setNavigationOnClickListener(view -> dismiss());
toolbar.setTitle(release.getName() != null ? release.getName() : release.getTagName());

toolbar.setTitle(TextUtils.isEmpty(release.getName()) ? release.getTagName() : release.getName());
toolbar.setSubtitle(release.getTargetCommitish() + (!TextUtils.isEmpty(release.getName()) ? " - " + release.getTagName() : ""));

if (!TextUtils.isEmpty(release.getBody())) {
toolbar.inflateMenu(R.menu.release_dialog_bottom);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomSheetDialogFragment;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -46,6 +46,7 @@ public class TagBottomSheetDialogFragment extends BaseBottomSheetDialogFragment
@BindView(R.id.downloadZip) View downloadZip;
@BindView(R.id.downloadTar) View downloadTar;
@BindView(R.id.loading) View loadingView;
@BindView(R.id.toolbar) Toolbar toolbar;

private Tag tag;
private RepoInfo repoInfo;
Expand Down Expand Up @@ -91,6 +92,8 @@ public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {

if (getArguments() != null) {
tag = getArguments().getParcelable(TAG);
fillToolbar(tag);

repoInfo = getArguments().getParcelable(REPOINFO);
CommitInfo commitInfo = new CommitInfo();
commitInfo.repoInfo = repoInfo;
Expand Down Expand Up @@ -147,6 +150,13 @@ private void fillTagDetailsView(Tag tag, Commit commit) {
configButton(downloadTar, R.string.download_tar_archive, tag.getTarballUrl(), tag);
}

private void fillToolbar(Tag tag) {
toolbar.setNavigationIcon(R.drawable.ic_close_black_24dp);
toolbar.setNavigationOnClickListener(view -> dismiss());

toolbar.setTitle(tag.getName());
}

private void configButton(View button, int title, String url, Tag tag) {
button.setOnClickListener(view -> {
String downloadText = getString(title) + " file for tag " + tag.getName();
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/layout/dialog_tag_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
>

<android.support.v7.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:id="@+id/toolbar"
/>

<LinearLayout
android:id="@+id/author"
style="@style/repo_overview_item"
Expand Down Expand Up @@ -118,6 +125,7 @@
android:visibility="gone"
tools:visibility="visible"
android:background="@color/white"
android:layout_marginTop="?actionBarSize"
>

<ProgressBar
Expand Down

0 comments on commit f619d0b

Please sign in to comment.