Skip to content

Commit

Permalink
Merge pull request #25 from airrobe/eli/initialAddToTextIssue
Browse files Browse the repository at this point in the history
use Add to text as initial text in optin widgets
  • Loading branch information
creative-dev-lab authored Jun 16, 2022
2 parents 9111cea + 52ed94f commit c8b3c67
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ class AirRobeMultiOptIn @JvmOverloads constructor(
setDetailedDescriptionText()
setExtraInfoText()
optInSwitch.isChecked = AirRobeSharedPreferenceManager.getOptedIn(context)
if (optInSwitch.isChecked) {
tvTitle.text = context.resources.getString(R.string.airrobe_added_to)
} else {
tvTitle.text = context.resources.getString(R.string.airrobe_add_to)
}
optInSwitch.setOnCheckedChangeListener { _, isChecked ->
AirRobeSharedPreferenceManager.setOptedIn(context, isChecked)
AirRobeSharedPreferenceManager.setOrderOptedIn(context, isChecked)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ class AirRobeOptIn @JvmOverloads constructor(
setDetailedDescriptionText()
setExtraInfoText()
optInSwitch.isChecked = AirRobeSharedPreferenceManager.getOptedIn(context)
if (optInSwitch.isChecked) {
tvTitle.text = context.resources.getString(R.string.airrobe_added_to)
} else {
tvTitle.text = context.resources.getString(R.string.airrobe_add_to)
}
optInSwitch.setOnCheckedChangeListener { _, isChecked ->
AirRobeSharedPreferenceManager.setOptedIn(context, isChecked)

Expand Down
2 changes: 1 addition & 1 deletion AirRobeWidget/src/main/res/layout/airrobe_multi_opt_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/airrobe_added_to"
android:text="@string/airrobe_add_to"
android:textSize="16sp"
android:singleLine="true"
android:layout_marginTop="3dp"
Expand Down
2 changes: 1 addition & 1 deletion AirRobeWidget/src/main/res/layout/airrobe_opt_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/airrobe_added_to"
android:text="@string/airrobe_add_to"
android:textSize="16sp"
android:singleLine="true"
android:layout_marginTop="3dp"
Expand Down
2 changes: 1 addition & 1 deletion demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ android {

dependencies {
implementation project(':AirRobeWidget')
// implementation "com.airrobe:airrobe-widget-sdk:1.0.3"
// implementation "com.airrobe:airrobe-widget-sdk:1.0.5"

implementation "androidx.core:core-ktx:$kotlin_version"
implementation "androidx.appcompat:appcompat:$rootProject.ext.appCompatLibVersion"
Expand Down

0 comments on commit c8b3c67

Please sign in to comment.