Skip to content

Commit

Permalink
Apptentive Android SDK 5.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
weeeBox committed Jan 4, 2021
1 parent ad6a71e commit 3a03cc5
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 1,958 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 2021-01-04 - v5.6.1

#### Improvements

* Accessibility improvements.

# 2020-09-28 - v5.6.0

#### Improvements
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use your app, to talk to them at the right time, and in the right way.

##### [Release Notes](https://learn.apptentive.com/knowledge-base/android-sdk-release-notes/)

##### Binary releases are hosted for Maven [here](http://search.maven.org/#artifactdetails|com.apptentive|apptentive-android|5.6.0|aar)
##### Binary releases are hosted for Maven [here](http://search.maven.org/#artifactdetails|com.apptentive|apptentive-android|5.6.1|aar)

#### Reporting Bugs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import android.widget.TextView;
import android.widget.Toast;

import androidx.core.widget.NestedScrollView;
import androidx.fragment.app.Fragment;
import com.apptentive.android.sdk.ApptentiveInternal;
import com.apptentive.android.sdk.ApptentiveLog;
Expand All @@ -52,7 +53,7 @@
import com.apptentive.android.sdk.module.survey.OnSurveyQuestionAnsweredListener;
import com.apptentive.android.sdk.util.StringUtils;
import com.apptentive.android.sdk.util.Util;
import com.apptentive.android.sdk.view.ApptentiveNestedScrollView;
import com.apptentive.android.sdk.view.NestedScrollViewHelper;

import org.json.JSONException;
import org.json.JSONObject;
Expand All @@ -66,14 +67,14 @@


public class SurveyFragment extends ApptentiveBaseFragment<SurveyInteraction> implements OnSurveyQuestionAnsweredListener,
ApptentiveNestedScrollView.OnScrollChangeListener {
NestedScrollView.OnScrollChangeListener {

private static final String EVENT_CANCEL = "cancel";
private static final String EVENT_CLOSE = "close";
private static final String EVENT_SUBMIT = "submit";
private static final String EVENT_QUESTION_RESPONSE = "question_response";

private ApptentiveNestedScrollView scrollView;
private NestedScrollView scrollView;
private LinearLayout questionsContainer;

private Map<String, Object> answers;
Expand Down Expand Up @@ -152,7 +153,7 @@ public void onClick(View view) {
final Fragment fragment = getFirstRequiredQuestionPos();
Assert.assertNotNull(fragment, "Expected to have a scroll pos");
if (fragment != null) {
scrollView.scrollToChild(fragment.getView());
NestedScrollViewHelper.scrollToChild(scrollView, fragment.getView());
if (fragment instanceof SurveyQuestionView) {
((SurveyQuestionView) fragment).focusOnQuestionTitleView();
}
Expand Down Expand Up @@ -264,7 +265,7 @@ public void run() {
ApptentiveInternal.getInstance().showAboutInternal(getActivity(), false);
}
}));
scrollView = (ApptentiveNestedScrollView) view.findViewById(R.id.survey_scrollview);
scrollView = (NestedScrollView) view.findViewById(R.id.survey_scrollview);
scrollView.setOnScrollChangeListener(this);

/* Android's ScrollView (when scrolled or fling'd) by default always set the focus to an EditText when
Expand Down Expand Up @@ -292,7 +293,7 @@ public boolean onTouch(View v, MotionEvent event) {
}

@Override
public void onScrollChange(ApptentiveNestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
showToolbarElevation(v.getTop() != scrollY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class RangeQuestion extends BaseQuestion {
private static final String KEY_MAX = "max";
private static final String KEY_MIN_LABEL = "min_label";
private static final String KEY_MAX_LABEL = "max_label";
private static final String DEFAULT_MIN_RANGE_LABEL = "Lowest";
private static final String DEFAULT_MAX_RANGE_LABEL = "Highest";

private static final int DEFAULT_MIN = 0;
private static final int DEFAULT_MAX = 10;
Expand All @@ -35,10 +37,10 @@ public int getMax() {
}

public String getMinLabel() {
return optString(KEY_MIN_LABEL, null);
return optString(KEY_MIN_LABEL, DEFAULT_MIN_RANGE_LABEL);
}

public String getMaxLabel() {
return optString(KEY_MAX_LABEL, null);
return optString(KEY_MAX_LABEL, DEFAULT_MAX_RANGE_LABEL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
root.setTag(Integer.parseInt(getTag()));

setQuestion(question.getValue());
questionView.setContentDescription(getTitleContentDescription(true));

setInstructions(question.getRequiredText(), question.getInstructions());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class Constants {

public static final int API_VERSION = 10;
private static final String APPTENTIVE_SDK_VERSION = "5.6.0";
private static final String APPTENTIVE_SDK_VERSION = "5.6.1";

public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS = 45000;
public static final int DEFAULT_READ_TIMEOUT_MILLIS = 45000;
Expand Down
Loading

0 comments on commit 3a03cc5

Please sign in to comment.