Skip to content

Commit

Permalink
Added setEngagedText and setCompletedText
Browse files Browse the repository at this point in the history
  • Loading branch information
chinalwb committed Jun 30, 2020
1 parent 1125286 commit af4ea8c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions slidetoconfirmlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'com.airbnb.android:lottie:3.4.0'
implementation 'com.airbnb.android:lottie:3.4.1'
}

apply from: './build-aar.gradle'
// apply from: './build-aar.gradle'
// apply from: 'https://raw.githubusercontent.com/blundell/release-android-library/master/android-release-aar.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private void initAttrs(Context context, AttributeSet attrs, int defStyleAttr) {

mCompletedText = ta.getString(R.styleable.SlideToConfirm_completed_text);
if (mCompletedText == null) {
mCompletedText = DEFAULT_ENGAGED_TEXT;
mCompletedText = DEFAULT_COMPLETED_TEXT;
}
mCompletedTextColor = ta.getColor(R.styleable.SlideToConfirm_completed_text_color, DEFAULT_COMPLETED_TEXT_COLOR);
mCompletedTextSize = ta.getDimension(R.styleable.SlideToConfirm_completed_text_size, DEFAULT_COMPLETED_TEXT_SIZE);
Expand Down Expand Up @@ -423,6 +423,25 @@ public void reset() {
mCTA.setVisibility(View.GONE);
}

public void setEngageText(String engageText) {
if (TextUtils.isEmpty(engageText)) {
return;
}
mEngagedText = engageText;
if (mEngagedTextView != null) {
mEngagedTextView.setText(engageText);
}
}

public void setCompletedText(String completedText) {
if (TextUtils.isEmpty(completedText)) {
return;
}
mCompletedText = completedText;
if (mCTA != null) {
mCTA.setText(completedText);
}
}

private void handleVibration() {
if (ContextCompat.checkSelfPermission(mContext, Manifest.permission.VIBRATE) !=
Expand Down

0 comments on commit af4ea8c

Please sign in to comment.