Cleanup after review

This commit is contained in:
str4d
2016-07-13 03:08:37 +00:00
parent d8b5710a42
commit dd1eed5aa7
7 changed files with 13 additions and 6 deletions

View File

@@ -277,6 +277,7 @@
<string name="blogs_delete_blog_dialog_message">Are you sure that you want to delete this Blog and all posts?\nNote that this will not delete the blog from other people\'s devices.</string>
<string name="blogs_delete_blog_ok">Delete Blog</string>
<string name="blogs_delete_blog_cancel">Keep</string>
<string name="blogs_blog_deleted">Blog Deleted</string>
<string name="blogs_remove_blog">Remove Blog</string>
<string name="blogs_blog_list">Blog List</string>

View File

@@ -181,6 +181,7 @@ public class BlogControllerImpl extends DbControllerImpl
try {
Blog b = blogManager.getBlog(data.getGroupId());
blogManager.removeBlog(b);
resultHandler.onResult(true);
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
LOG.log(WARNING, e.toString(), e);

View File

@@ -53,7 +53,7 @@ public class BlogFragment extends BaseFragment implements BlogPostListener {
private BriarRecyclerView list;
static BlogFragment newInstance(GroupId groupId, String name,
boolean myBlog, boolean isNew) {
boolean myBlog, boolean isNew) {
BlogFragment f = new BlogFragment();
@@ -204,7 +204,8 @@ public class BlogFragment extends BaseFragment implements BlogPostListener {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(),
R.style.BriarDialogTheme);
builder.setTitle(getString(R.string.blogs_delete_blog));
builder.setMessage(getString(R.string.blogs_delete_blog_dialog_message));
builder.setMessage(
getString(R.string.blogs_delete_blog_dialog_message));
builder.setPositiveButton(R.string.blogs_delete_blog_cancel, null);
builder.setNegativeButton(R.string.blogs_delete_blog_ok, okListener);
builder.show();
@@ -216,8 +217,9 @@ public class BlogFragment extends BaseFragment implements BlogPostListener {
@Override
public void onResultUi(Boolean result) {
if (!result) return;
Toast.makeText(getActivity(), R.string.forum_left_toast,
LENGTH_SHORT).show();
Toast.makeText(getActivity(),
R.string.blogs_blog_deleted, LENGTH_SHORT)
.show();
getActivity().supportFinishAfterTransition();
}
});

View File

@@ -124,6 +124,7 @@ class BlogListAdapter extends
ui.date.setText(
DateUtils.getRelativeTimeSpanString(ctx, timestamp));
ui.date.setVisibility(VISIBLE);
ui.avatar.setProblem(false);
ui.status.setVisibility(GONE);
}

View File

@@ -100,7 +100,7 @@ public class WriteBlogPostActivity extends BriarActivity
@Override
public void afterTextChanged(Editable s) {
showOrHidePublishButton();
enableOrDisablePublishButton();
}
});
@@ -126,7 +126,7 @@ public class WriteBlogPostActivity extends BriarActivity
return true;
}
private void showOrHidePublishButton() {
private void enableOrDisablePublishButton() {
int bodyLength =
StringUtils.toUtf8(bodyInput.getText().toString()).length;
if (bodyLength > 0 && bodyLength <= MAX_BLOG_POST_BODY_LENGTH &&

View File

@@ -104,6 +104,7 @@ class ForumListAdapter extends
// Post Count
int postCount = item.getPostCount();
if (postCount > 0) {
ui.avatar.setProblem(false);
ui.postCount.setText(ctx.getResources()
.getQuantityString(R.plurals.posts, postCount,
postCount));

View File

@@ -46,6 +46,7 @@ public class TrustIndicatorView extends ImageView {
res = R.drawable.trust_indicator_unknown;
}
setImageDrawable(ContextCompat.getDrawable(getContext(), res));
setVisibility(VISIBLE);
}
}