Skip to content

Commit

Permalink
fix more crash bugs reported in Play Store
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed May 27, 2020
1 parent 34ea4f2 commit e473981
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ protected List<Tag> doInBackground(Void... params) {
if (suggestedTagsAdapter != null && !clearPrevious) {
tags = new ArrayList<>(suggestedTagsAdapter.getTags());
}
while (tags.size() < limit) {
Tag randomTag = Lbry.knownTags.get(random.nextInt(Lbry.knownTags.size()));
if (excludeMature && randomTag.isMature()) {
continue;
}
if (!Lbry.followedTags.contains(randomTag) && (addedTagsAdapter == null || !addedTagsAdapter.getTags().contains(randomTag))) {
tags.add(randomTag);
if (Lbry.knownTags.size() > 0) {
while (tags.size() < limit) {
Tag randomTag = Lbry.knownTags.get(random.nextInt(Lbry.knownTags.size()));
if (excludeMature && randomTag.isMature()) {
continue;
}
if (!Lbry.followedTags.contains(randomTag) && (addedTagsAdapter == null || !addedTagsAdapter.getTags().contains(randomTag))) {
tags.add(randomTag);
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ protected Boolean doInBackground(Void... params) {

if (tags != null) {
if (db != null && tags.length() > 0) {
DatabaseHelper.setAllTagsUnfollowed(db);
try {
DatabaseHelper.setAllTagsUnfollowed(db);
} catch (IllegalStateException ex) {
// pass
}
}

followedTags = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,16 +443,16 @@ private void renderClaim() {
if (tabPager.getAdapter() == null && context instanceof MainActivity) {
tabPager.setAdapter(new ChannelPagerAdapter(claim, (MainActivity) context));
}
new TabLayoutMediator(tabLayout, tabPager, new TabLayoutMediator.TabConfigurationStrategy() {
@Override
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
tab.setText(position == 0 ? R.string.content : R.string.about);
}
}).attach();
} catch (IllegalStateException ex) {
// TODO: Fix why this is happening
// pass
}
new TabLayoutMediator(tabLayout, tabPager, new TabLayoutMediator.TabConfigurationStrategy() {
@Override
public void onConfigureTab(@NonNull TabLayout.Tab tab, int position) {
tab.setText(position == 0 ? R.string.content : R.string.about);
}
}).attach();
}

private void resetSubCount() {
Expand Down

0 comments on commit e473981

Please sign in to comment.