Skip to content

Commit

Permalink
Android demo app updated
Browse files Browse the repository at this point in the history
  • Loading branch information
hayk committed Dec 15, 2023
1 parent 2f47871 commit 250e991
Show file tree
Hide file tree
Showing 21 changed files with 660 additions and 94 deletions.
42 changes: 41 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,54 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".ColorsCustomizationActivity"
android:label="ColorsCustomization" />
<activity
android:name=".CooldownActivity"
android:label="Cooldown" />
<activity
android:name=".EncryptionConfigActivity"
android:label="EncryptionConfig" />
<activity
android:name=".FaceMatchActivity"
android:label="FaceMatch" />
<activity
android:name=".FontCustomizationActivity"
android:label="FontCustomization" />
<activity
android:name=".LanguageConfigActivity"
android:label="LanguageConfig" />
<activity
android:name=".MetadataActivity"
android:label="Metadata" />
<activity
android:name=".MetamapButtonActivity"
android:label="MetamapButton" />
<activity
android:name=".MethodCallActivity"
android:label="MethodCall" />
<activity
android:name=".OnActivityResultActivity"
android:label="OnActivityResult" />
<activity
android:name=".OnDemandConfigActivity"
android:label="OnDemandConfig" />
<activity
android:name=".ResultApiActivity"
android:label="ResultApi" />
<activity
android:name=".SmartCaptureActivity"
android:label="SmartCapture" />
</application>

</manifest>
Binary file added app/src/main/assets/fonts/comic_neue.ttf
Binary file not shown.
Binary file added app/src/main/assets/fonts/comic_neue_bold.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.matilock.matiintegrationdemo;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import com.metamap.metamap_sdk.Metadata;
import com.metamap.metamap_sdk.MetamapButton;
import com.metamap.metamap_sdk.metadata.UIConfig;

public class ColorsCustomizationActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_metamap_button);

MetamapButton btn = findViewById(R.id.metamapButton);

int accentColor = ContextCompat.getColor(this, R.color.colorAccent);
int titleTextColor = ContextCompat.getColor(this, R.color.titleTextColor);
int subtitleTextColor = ContextCompat.getColor(this, R.color.subtitleTextColor);
int backgroundColor = ContextCompat.getColor(this, R.color.backgroundColor);
int lineColor = ContextCompat.getColor(this, R.color.lineColor);

btn.setParams(
this,
"YOUR_CLIENT_ID",
"YOUR_FLOW_ID",
new Metadata.Builder()
.uiConfig(
new UIConfig(
null, null, null, accentColor, titleTextColor, //These colors are used in the loading screen,
subtitleTextColor, backgroundColor, lineColor //Other screens apply the colors from the dashboard configuration
)
)
.build());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.matilock.matiintegrationdemo;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.metamap.metamap_sdk.Metadata;
import com.metamap.metamap_sdk.MetamapButton;

public class CooldownActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_metamap_button);

MetamapButton btn = findViewById(R.id.metamapButton);

btn.setParams(
this,
"YOUR_CLIENT_ID",
"YOUR_FLOW_ID",
new Metadata.Builder()
.additionalData("phoneNumber", "USER_PHONE_NUMBER") //Any of the fields is valid
// .additionalData("email", "USER_EMAIL")
// .additionalData("documentNumber", "USER_DOCUMENT_NUMBER")
.build()
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.matilock.matiintegrationdemo;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.metamap.metamap_sdk.MetamapButton;
import com.metamap.metamap_sdk.MetamapSdk;

public class EncryptionConfigActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_metamap_button);

MetamapButton btn = findViewById(R.id.metamapButton);

btn.setParams(this, "YOUR_CLIENT_ID", "YOUR_FLOW_ID", null,
MetamapSdk.DEFAULT_REQUEST_CODE, null, "YOUR_ENCRYPTION_CONFIGURATION_ID");

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.matilock.matiintegrationdemo;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.metamap.metamap_sdk.Metadata;
import com.metamap.metamap_sdk.MetamapButton;

public class FaceMatchActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_metamap_button);

MetamapButton btn = findViewById(R.id.metamapButton);

btn.setParams(
this,
"YOUR_CLIENT_ID",
"YOUR_FLOW_ID",
new Metadata.Builder()
.identityId("USER_IDENTITY_ID")
.build()
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.matilock.matiintegrationdemo;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.metamap.metamap_sdk.Metadata;
import com.metamap.metamap_sdk.MetamapButton;
import com.metamap.metamap_sdk.metadata.FontConfig;
import com.metamap.metamap_sdk.metadata.UIConfig;

public class FontCustomizationActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_metamap_button);

MetamapButton btn = findViewById(R.id.metamapButton);

btn.setParams(
this,
"YOUR_CLIENT_ID",
"YOUR_FLOW_ID",
new Metadata.Builder()
.uiConfig(
new UIConfig(null, null, null, null, null, null, null, null,
new FontConfig(
"comic_neue.ttf",
"comic_neue_bold.ttf"
)
)
)
.build()
);

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.matilock.matiintegrationdemo;

import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.metamap.metamap_sdk.Metadata;
import com.metamap.metamap_sdk.MetamapButton;
import com.metamap.metamap_sdk.metadata.MetamapLanguage;
import com.metamap.metamap_sdk.metadata.UIConfig;

public class LanguageConfigActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_metamap_button);

MetamapButton btn = findViewById(R.id.metamapButton);

btn.setParams(
this,
"YOUR_CLIENT_ID",
"YOUR_FLOW_ID",
new Metadata.Builder()
.uiConfig(new UIConfig(MetamapLanguage.SPANISH))
.build()
);
}
}
Loading

0 comments on commit 250e991

Please sign in to comment.