|
@ -135,7 +135,7 @@ public class TopicActivity extends BaseActivity { |
|
|
ThmmyPage.PageCategory target = ThmmyPage.resolvePageCategory( |
|
|
ThmmyPage.PageCategory target = ThmmyPage.resolvePageCategory( |
|
|
Uri.parse(topicPageUrl)); |
|
|
Uri.parse(topicPageUrl)); |
|
|
if (!target.is(ThmmyPage.PageCategory.TOPIC)) { |
|
|
if (!target.is(ThmmyPage.PageCategory.TOPIC)) { |
|
|
Timber.e("Bundle came with a non topic url!\nUrl: %s" , topicPageUrl); |
|
|
Timber.e("Bundle came with a non topic url!\nUrl: %s", topicPageUrl); |
|
|
Toast.makeText(this, "An error has occurred\n Aborting.", Toast.LENGTH_SHORT).show(); |
|
|
Toast.makeText(this, "An error has occurred\n Aborting.", Toast.LENGTH_SHORT).show(); |
|
|
finish(); |
|
|
finish(); |
|
|
} |
|
|
} |
|
@ -551,8 +551,11 @@ public class TopicActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
progressBar.setVisibility(ProgressBar.INVISIBLE); |
|
|
progressBar.setVisibility(ProgressBar.INVISIBLE); |
|
|
topicAdapter.customNotifyDataSetChanged(new TopicTask()); |
|
|
if (replyPageUrl == null) { |
|
|
if (replyPageUrl == null) replyFAB.hide(); |
|
|
replyFAB.hide(); |
|
|
|
|
|
topicAdapter.customNotifyDataSetChanged(new TopicTask(), false); |
|
|
|
|
|
} else topicAdapter.customNotifyDataSetChanged(new TopicTask(), true); |
|
|
|
|
|
|
|
|
if (replyFAB.getVisibility() != View.GONE) replyFAB.setEnabled(true); |
|
|
if (replyFAB.getVisibility() != View.GONE) replyFAB.setEnabled(true); |
|
|
|
|
|
|
|
|
//Set current page
|
|
|
//Set current page
|
|
@ -566,7 +569,10 @@ public class TopicActivity extends BaseActivity { |
|
|
break; |
|
|
break; |
|
|
case SAME_PAGE: |
|
|
case SAME_PAGE: |
|
|
progressBar.setVisibility(ProgressBar.INVISIBLE); |
|
|
progressBar.setVisibility(ProgressBar.INVISIBLE); |
|
|
topicAdapter.customNotifyDataSetChanged(new TopicTask()); |
|
|
if (replyPageUrl == null) { |
|
|
|
|
|
replyFAB.hide(); |
|
|
|
|
|
topicAdapter.customNotifyDataSetChanged(new TopicTask(), false); |
|
|
|
|
|
} else topicAdapter.customNotifyDataSetChanged(new TopicTask(), true); |
|
|
if (replyFAB.getVisibility() != View.GONE) replyFAB.setEnabled(true); |
|
|
if (replyFAB.getVisibility() != View.GONE) replyFAB.setEnabled(true); |
|
|
paginationEnabled(true); |
|
|
paginationEnabled(true); |
|
|
Toast.makeText(TopicActivity.this, "That's the same page.", Toast.LENGTH_SHORT).show(); |
|
|
Toast.makeText(TopicActivity.this, "That's the same page.", Toast.LENGTH_SHORT).show(); |
|
@ -709,10 +715,10 @@ public class TopicActivity extends BaseActivity { |
|
|
sc = document.select("input[name=sc]").first().attr("value"); |
|
|
sc = document.select("input[name=sc]").first().attr("value"); |
|
|
topic = document.select("input[name=topic]").first().attr("value"); |
|
|
topic = document.select("input[name=topic]").first().attr("value"); |
|
|
} catch (IOException e) { |
|
|
} catch (IOException e) { |
|
|
Timber.e(e,"Post failed."); |
|
|
Timber.e(e, "Post failed."); |
|
|
return false; |
|
|
return false; |
|
|
} catch (Selector.SelectorParseException e) { |
|
|
} catch (Selector.SelectorParseException e) { |
|
|
Timber.e(e,"Post failed."); |
|
|
Timber.e(e, "Post failed."); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -746,7 +752,7 @@ public class TopicActivity extends BaseActivity { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
} catch (IOException e) { |
|
|
} catch (IOException e) { |
|
|
Timber.e(e,"Post failed."); |
|
|
Timber.e(e, "Post failed."); |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|