Skip to content

Commit

Permalink
More bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SlideCI committed May 2, 2016
1 parent 3195554 commit ea924f0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Expand Up @@ -309,6 +309,7 @@ public void onAnimationEnd(Animator animation) {
}

builder.setView(dialoglayout);
builder.setCancelable(false);
final Dialog d = builder.show();
{
Button dialogButton = (Button) dialoglayout.findViewById(R.id.cancel);
Expand Down
Expand Up @@ -52,6 +52,7 @@
import me.ccrama.redditslide.Activities.GifView;
import me.ccrama.redditslide.Activities.MainActivity;
import me.ccrama.redditslide.Activities.MediaView;
import me.ccrama.redditslide.Activities.SubredditView;
import me.ccrama.redditslide.Adapters.CommentAdapter;
import me.ccrama.redditslide.Adapters.CommentItem;
import me.ccrama.redditslide.Adapters.CommentNavType;
Expand Down Expand Up @@ -651,6 +652,7 @@ public void onClick(View v) {
((LinearLayoutManager) rv.getLayoutManager()).scrollToPositionWithOffset(1, headerHeight);
}
});
addClickFunctionSubName(toolbar);

doTopBar();

Expand Down Expand Up @@ -682,7 +684,27 @@ public void onClick(DialogInterface dialog, int which) {
}

public CommentSort commentSorting;

private void addClickFunctionSubName(Toolbar toolbar) {
TextView titleTv = null;
for (int i = 0; i < toolbar.getChildCount(); i++) {
View view = toolbar.getChildAt(i);
CharSequence text = null;
if (view instanceof TextView && (text = ((TextView) view).getText()) != null) {
titleTv = (TextView) view;
}
}
if (titleTv != null) {
final String text = titleTv.getText().toString();
titleTv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(getActivity(), SubredditView.class);
i.putExtra(SubredditView.EXTRA_SUBREDDIT, text);
startActivity(i);
}
});
}
}
public void doAdapter(boolean load) {
commentSorting = SettingValues.getCommentSorting(subreddit);
if (load)
Expand Down
Expand Up @@ -1360,7 +1360,7 @@ public void onClick(View view) {

final int commentCount = submission.getCommentCount();
final int more = LastComments.commentsSince(submission);
holder.comments.setText(String.format(Locale.getDefault(), "%d %s", commentCount, ((more != 0 && SettingValues.commentLastVisit) ? "(" + ((more > 0) ? "+" : "") + more + ")" : "")));
holder.comments.setText(String.format(Locale.getDefault(), "%d %s", commentCount, ((more > 0 && SettingValues.commentLastVisit) ? "(" + more + ")" : "")));
String scoreRatio = (SettingValues.upvotePercentage && full && submission.getUpvoteRatio() != null) ? "(" + (int) (submission.getUpvoteRatio() * 100) + "%)" : "";
holder.score.setText(String.format(Locale.getDefault(), "%d", submissionScore));

Expand Down

0 comments on commit ea924f0

Please sign in to comment.