Skip to content

Commit

Permalink
SDK and Sample v3.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Nedzynski committed Mar 31, 2021
1 parent 2393a8b commit f513f7b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 54 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog
All notable changes to this project will be documented in this file.
## [3.7.1] - 2021-03-31
### Added
- `getScreenView()` method
- `requestEmailChange` method

### Changed
- 'requestEmailChangeByFacebook' is now deprecated
- `requestEmailChange(String email, String password, @Nullable String uuid)` is now deprecated

## [3.7.0] - 2021-02-23
### Added
- `OnRecommendationModelMapper` callback responsible for mapping objects
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ apply plugin: 'com.android.application'
dependencies {
...
// Synerise Android SDK
implementation 'com.synerise.sdk:synerise-mobile-sdk:3.7.0'
implementation 'com.synerise.sdk:synerise-mobile-sdk:3.7.1'
}
```

Expand Down
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.4.21'
repositories {
google()
maven {
url 'https://maven.fabric.io/public'
}
maven { url 'https://maven.fabric.io/public' }
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'io.fabric.tools:gradle:1.30.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down Expand Up @@ -49,8 +51,9 @@ ext {
retrofit2Adapter = "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
// Test
supportTestRunner = 'androidx.test:runner:1.1.0'
supportTestRules = 'androidx.test:rules:1.1.0'
espressoCore = 'androidx.test.espresso:espresso-core:3.1.0'
junit = 'junit:junit:4.12'
junit = 'junit:junit:4.11'
}

task clean(type: Delete) {
Expand Down
23 changes: 13 additions & 10 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'org.sonarqube'

def homePath = System.properties['user.home']
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 30
applicationId "com.synerise.sample"
versionCode 92
versionName "3.7.0"
versionCode 93
versionName "3.7.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
signingConfigs {
releaseConfig {
keyAlias project.syneriseSampleKeyAlias
keyPassword project.syneriseSampleKeyPassword
storeFile file(homePath + '../.android/release_synerise_sample.jks')
storePassword project.syneriseSampleStorePassword
keyAlias keystoreProperties['syneriseSampleKeyAlias']
keyPassword keystoreProperties['syneriseSampleKeyPassword']
storeFile file(rootDir.getCanonicalPath() + '/' + keystoreProperties['syneriseSampleKeyStore'])
storePassword keystoreProperties['syneriseSampleStorePassword']
}
developmentConfig {
keyAlias "debugKey"
Expand Down Expand Up @@ -62,7 +65,7 @@ android {

ext {
daggerVersion = '2.16'
syneriseVersion = '3.7.0'
syneriseVersion = '3.7.1'
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
public class ClientRequestEmailChangeFragment extends BaseDevFragment {

private IApiCall apiCall;
private TextInputLayout inputEmail, inputPassword, inputUuid;
private TextInputLayout inputEmail, inputPassword;

public static ClientRequestEmailChangeFragment newInstance() {
return new ClientRequestEmailChangeFragment();
Expand All @@ -37,9 +37,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat

inputEmail = view.findViewById(R.id.input_email);
inputPassword = view.findViewById(R.id.input_password);
inputUuid = view.findViewById(R.id.input_uuid);
view.findViewById(R.id.email_change).setOnClickListener(v -> requestEmailChange());
view.findViewById(R.id.generate_uuid).setOnClickListener(this::onGenerateUuidClicked);
}

@Override
Expand All @@ -52,27 +50,20 @@ public void onStop() {
private void requestEmailChange() {

inputPassword.setError(null);
inputUuid.setError(null);

boolean isValid = true;

String email = inputEmail.getEditText().getText().toString();
String password = inputPassword.getEditText().getText().toString();
String uuid = inputUuid.getEditText().getText().toString();

if (TextUtils.isEmpty(password)) {
isValid = false;
inputPassword.setError(getString(R.string.error_empty));
}

if (TextUtils.isEmpty(uuid)) {
isValid = false;
inputUuid.setError(getString(R.string.error_empty));
}

if (isValid) {
if (apiCall != null) apiCall.cancel();
apiCall = Client.requestEmailChange(email, password, uuid);
apiCall = Client.requestEmailChange(email, password, null, null);
apiCall.execute(this::onSuccess, new DataActionListener<ApiError>() {
@Override
public void onDataAction(ApiError apiError) {
Expand All @@ -81,9 +72,4 @@ public void onDataAction(ApiError apiError) {
});
}
}

@SuppressWarnings("ConstantConditions")
private void onGenerateUuidClicked(View v) {
inputUuid.getEditText().setText(Client.getUuid());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
}

public void loadWidget() {
String productId = "100004";
String productId = "0000206438331-XS";
String slug = "recommend2";
if (!productInputId.getEditText().getText().toString().matches(""))
productId = productInputId.getEditText().getText().toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,6 @@

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/input_uuid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/default_uuid"
app:errorEnabled="true"
app:hintAnimationEnabled="true">

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />

</com.google.android.material.textfield.TextInputLayout>

<Button
android:id="@+id/generate_uuid"
style="@style/ButtonSecondary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/get_sdk_uuid" />

<Button
android:id="@+id/email_change"
style="@style/ButtonPrimary"
Expand Down

0 comments on commit f513f7b

Please sign in to comment.