Skip to content

Commit

Permalink
Merge pull request #77 from juank-pa/enable_disable_voting_article_view
Browse files Browse the repository at this point in the history
Enable disable voting article view
  • Loading branch information
e2po committed Jun 20, 2018
2 parents 17b0abf + 0d87326 commit 71ccaa5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions android-plugin/src/main/java/com/zendesk/unity/ZDK_Plugin.java
Expand Up @@ -44,10 +44,15 @@ public class ZDK_Plugin extends UnityComponent {
private static final int CONTACT_US_BUTTON_VISIBILITY_OFF = 0;
private static final int CONTACT_US_BUTTON_VISIBILITY_ARTICLE_LIST_ONLY = 1;
private static final int CONTACT_US_BUTTON_VISIBILITY_ARTICLE_LIST_ARTICLE_VIEW = 2;

// Original behavior was to have article voting enabled
private boolean _articleVotingEnabled = true;

public static ZDK_Plugin _instance;
public static Object instance(){
_instance = new ZDK_Plugin();
if (_instance == null) {
_instance = new ZDK_Plugin();
}
return _instance;
}

Expand Down Expand Up @@ -124,6 +129,9 @@ public void setUserLocale(String locale) {
}
}

public void setArticleVotingEnabled(boolean enabled) {
_articleVotingEnabled = enabled;
}

// ##### ##### ##### ##### ##### ##### ##### #####
// ZDKLogger
Expand Down Expand Up @@ -231,7 +239,12 @@ public void viewArticle(final String id){
provider.getArticle(idLong, new ZendeskCallback<Article>() {
@Override
public void onSuccess(Article article) {
ViewArticleActivity.startActivity(getActivity(), article);
ViewArticleActivity.startActivity(
getActivity(),
article,
true, // By default enable add ticket button, might allow customization later
null, // TODO: add further customization here
_articleVotingEnabled);
}

@Override
Expand Down

0 comments on commit 71ccaa5

Please sign in to comment.