增加一些email登录相关的界面
This commit is contained in:
parent
9236870483
commit
a1bea725a4
@ -244,6 +244,10 @@ NS_CC_BEGIN
|
||||
});
|
||||
return result == 0 ? 1 : 0;
|
||||
}
|
||||
JNIEXPORT jint JNICALL JNI_JCFW(sha512)(JNIEnv *env, jclass clazz, jstring jcontent) {
|
||||
std::string content = JniHelper::jstring2string(jcontent);
|
||||
// TODO:
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -9,4 +9,6 @@ public class Constants {
|
||||
|
||||
public static final String APPLE_AUTH_URL = "https://appleid.apple.com/auth/authorize";
|
||||
|
||||
public static final String API_HOST = "https://wallet.cebggame.com";
|
||||
|
||||
}
|
||||
|
@ -997,4 +997,19 @@ public class MainActivity extends UnityPlayerActivity
|
||||
startActivityForResult(intent, FILE_SELECTOR_CODE);
|
||||
}
|
||||
|
||||
public void sendMail() {
|
||||
Intent i=new Intent(Intent.ACTION_SENDTO);
|
||||
i.setType("message/rfc822");
|
||||
i.setData(Uri.parse("mailto:"));
|
||||
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"recipient@example.com"});
|
||||
i.putExtra(Intent.EXTRA_SUBJECT, "subject of email");
|
||||
i.putExtra(Intent.EXTRA_TEXT , "body of email");
|
||||
|
||||
try {
|
||||
startActivity(Intent.createChooser(i, "Send mail..."));
|
||||
} catch (android.content.ActivityNotFoundException ex) {
|
||||
Toast.makeText(MainActivity.this, "There are no email clients installed.", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
46
app/src/com/cege/games/release/dialog/EmailLoginDialog.java
Normal file
46
app/src/com/cege/games/release/dialog/EmailLoginDialog.java
Normal file
@ -0,0 +1,46 @@
|
||||
package com.cege.games.release.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.cege.games.release.R;
|
||||
import com.cege.games.release.net.RequestData;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
public class EmailLoginDialog extends BaseDialog {
|
||||
|
||||
private RequestData request;
|
||||
|
||||
public EmailLoginDialog(Context context) {
|
||||
super(context);
|
||||
request = new RequestData(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.email_regist);
|
||||
setCancelable(false);
|
||||
|
||||
TextInputLayout emailLayout = findViewById(R.id.emailLayout);
|
||||
TextInputLayout passLayout = findViewById(R.id.passwordLayout);
|
||||
TextInputLayout codeLayout = findViewById(R.id.verifyCodeLayout);
|
||||
passLayout.setVisibility(View.GONE);
|
||||
codeLayout.setVisibility(View.GONE);
|
||||
|
||||
Button nextButton = findViewById(R.id.next_button);
|
||||
Button preButton = findViewById(R.id.pre_button);
|
||||
preButton.setVisibility(View.GONE);
|
||||
nextButton.setOnClickListener(v -> {
|
||||
// String email = emailInput.getText().toString();
|
||||
// String code = codeInput.getText().toString();
|
||||
codeLayout.setVisibility(View.VISIBLE);
|
||||
preButton.setVisibility(View.VISIBLE);
|
||||
});
|
||||
preButton.setOnClickListener(v -> {
|
||||
preButton.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
}
|
@ -1,21 +1,25 @@
|
||||
package com.cege.games.release.dialog;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.cege.games.release.R;
|
||||
import com.cege.games.release.net.RequestData;
|
||||
import com.google.android.material.textfield.TextInputEditText;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class EmailRegistDialog extends BaseDialog {
|
||||
private final RequestData request;
|
||||
private static final String TAG = EmailRegistDialog.class.getSimpleName();
|
||||
|
||||
public EmailRegistDialog(Context context) {
|
||||
super(context);
|
||||
request = new RequestData(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -27,6 +31,11 @@ public class EmailRegistDialog extends BaseDialog {
|
||||
TextInputLayout emailLayout = findViewById(R.id.emailLayout);
|
||||
TextInputLayout passLayout = findViewById(R.id.passwordLayout);
|
||||
TextInputLayout codeLayout = findViewById(R.id.verifyCodeLayout);
|
||||
|
||||
TextInputEditText emailInput = findViewById(R.id.email);
|
||||
TextInputEditText passwordInput = findViewById(R.id.password);
|
||||
TextInputEditText codeInput = findViewById(R.id.verifyCode);
|
||||
|
||||
passLayout.setVisibility(View.GONE);
|
||||
codeLayout.setVisibility(View.GONE);
|
||||
|
||||
@ -34,13 +43,33 @@ public class EmailRegistDialog extends BaseDialog {
|
||||
Button preButton = findViewById(R.id.pre_button);
|
||||
preButton.setVisibility(View.GONE);
|
||||
nextButton.setOnClickListener(v -> {
|
||||
// String email = emailInput.getText().toString();
|
||||
// String code = codeInput.getText().toString();
|
||||
String email = emailInput.getText().toString();
|
||||
if ("".equals(email)) {
|
||||
showError(emailLayout, "Email can't be null");
|
||||
return;
|
||||
}
|
||||
|
||||
String password = passwordInput.getText().toString();
|
||||
String code = codeInput.getText().toString();
|
||||
codeLayout.setVisibility(View.VISIBLE);
|
||||
preButton.setVisibility(View.VISIBLE);
|
||||
request.checkMail(email, data -> {
|
||||
Log.i(TAG, data.toString());
|
||||
});
|
||||
});
|
||||
preButton.setOnClickListener(v -> {
|
||||
preButton.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* show error with textInputLayout
|
||||
*
|
||||
*/
|
||||
private void showError(TextInputLayout textInputLayout, String error) {
|
||||
textInputLayout.setError(error);
|
||||
Objects.requireNonNull(textInputLayout.getEditText()).setFocusable(true);
|
||||
textInputLayout.getEditText().setFocusableInTouchMode(true);
|
||||
textInputLayout.getEditText().requestFocus();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
package com.cege.games.release.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.cege.games.release.R;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class PasswordLoginDialog extends BaseDialog {
|
||||
|
||||
public PasswordLoginDialog(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.email_regist);
|
||||
setCancelable(false);
|
||||
|
||||
TextInputLayout passLayout = findViewById(R.id.passwordLayout);
|
||||
TextInputLayout codeLayout = findViewById(R.id.verifyCodeLayout);
|
||||
passLayout.setVisibility(View.GONE);
|
||||
codeLayout.setVisibility(View.GONE);
|
||||
|
||||
Button nextButton = findViewById(R.id.next_button);
|
||||
Button preButton = findViewById(R.id.pre_button);
|
||||
preButton.setVisibility(View.GONE);
|
||||
nextButton.setOnClickListener(v -> {
|
||||
// String email = emailInput.getText().toString();
|
||||
// String code = codeInput.getText().toString();
|
||||
codeLayout.setVisibility(View.VISIBLE);
|
||||
preButton.setVisibility(View.VISIBLE);
|
||||
});
|
||||
preButton.setOnClickListener(v -> {
|
||||
preButton.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.cege.games.release.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
|
||||
import com.cege.games.release.R;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
|
||||
public class PasswordRegistDialog extends BaseDialog {
|
||||
|
||||
public PasswordRegistDialog(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.email_regist);
|
||||
setCancelable(false);
|
||||
|
||||
TextInputLayout emailLayout = findViewById(R.id.emailLayout);
|
||||
TextInputLayout passLayout = findViewById(R.id.passwordLayout);
|
||||
TextInputLayout codeLayout = findViewById(R.id.verifyCodeLayout);
|
||||
passLayout.setVisibility(View.GONE);
|
||||
codeLayout.setVisibility(View.GONE);
|
||||
|
||||
Button nextButton = findViewById(R.id.next_button);
|
||||
Button preButton = findViewById(R.id.pre_button);
|
||||
preButton.setVisibility(View.GONE);
|
||||
nextButton.setOnClickListener(v -> {
|
||||
// String email = emailInput.getText().toString();
|
||||
// String code = codeInput.getText().toString();
|
||||
codeLayout.setVisibility(View.VISIBLE);
|
||||
preButton.setVisibility(View.VISIBLE);
|
||||
});
|
||||
preButton.setOnClickListener(v -> {
|
||||
preButton.setVisibility(View.GONE);
|
||||
});
|
||||
}
|
||||
}
|
78
app/src/com/cege/games/release/net/AppRequest.java
Normal file
78
app/src/com/cege/games/release/net/AppRequest.java
Normal file
@ -0,0 +1,78 @@
|
||||
package com.cege.games.release.net;
|
||||
|
||||
import com.android.volley.AuthFailureError;
|
||||
import com.android.volley.NetworkResponse;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.Response;
|
||||
import com.android.volley.toolbox.HttpHeaderParser;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AppRequest extends Request<String> {
|
||||
private final RequestListener requestListener;
|
||||
private final Map<String, String> map;
|
||||
|
||||
public AppRequest(int method, String url, Map<String, String> map, RequestListener requestListener,
|
||||
Response.ErrorListener listener) {
|
||||
super(method, url, listener);
|
||||
this.requestListener = requestListener;
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBodyContentType() {
|
||||
return "application/json; charset=utf-8";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getHeaders() {
|
||||
Map<String, String> head_map = new HashMap<>();
|
||||
head_map.put("Content-Type", "application/json");
|
||||
return head_map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getBody() throws AuthFailureError {
|
||||
try {
|
||||
JSONObject jsonBody = new JSONObject();
|
||||
if (null != map && map.size() > 0) {
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
jsonBody.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
String mRequestBody = jsonBody.toString();
|
||||
return mRequestBody.getBytes(StandardCharsets.UTF_8);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
protected void deliverResponse(String response) {
|
||||
try {
|
||||
JSONObject jo = new JSONObject(response);
|
||||
if (requestListener != null)
|
||||
requestListener.response(jo);
|
||||
} catch (JSONException | NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Response<String> parseNetworkResponse(NetworkResponse response) {
|
||||
String parsed;
|
||||
try {
|
||||
parsed = new String(response.data, HttpHeaderParser.parseCharset(response.headers));
|
||||
} catch (UnsupportedEncodingException var4) {
|
||||
parsed = new String(response.data);
|
||||
}
|
||||
return Response.success(parsed, HttpHeaderParser.parseCacheHeaders(response));
|
||||
}
|
||||
}
|
49
app/src/com/cege/games/release/net/AppRequestUtil.java
Normal file
49
app/src/com/cege/games/release/net/AppRequestUtil.java
Normal file
@ -0,0 +1,49 @@
|
||||
package com.cege.games.release.net;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.volley.DefaultRetryPolicy;
|
||||
import com.android.volley.Request;
|
||||
import com.android.volley.Response;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AppRequestUtil {
|
||||
private static final AppRequestUtil app_request_util = new AppRequestUtil();
|
||||
|
||||
private AppRequestUtil() {}
|
||||
|
||||
public static AppRequestUtil getInstance(){
|
||||
return app_request_util;
|
||||
}
|
||||
|
||||
private final Response.ErrorListener errorListener = volleyError -> {
|
||||
RequestErrorEvent event = new RequestErrorEvent();
|
||||
event.setType(1);
|
||||
event.setErrorMessage(volleyError.getMessage());
|
||||
Log.e("AppRequestUtil", volleyError.getMessage());
|
||||
EventBus.getDefault().post(event);
|
||||
};
|
||||
|
||||
//post请求
|
||||
public void postRequest(Context context, String typeUrl, Map<String, String> map, RequestListener listener){
|
||||
AppRequest request = new AppRequest(Request.Method.POST,typeUrl,map,listener, errorListener);
|
||||
request.setTag(context);
|
||||
request.setRetryPolicy(new DefaultRetryPolicy(20 * 1000, 1, 1.0f));
|
||||
request.setShouldCache(true);
|
||||
VolleyUtil.getQueue(context).add(request);
|
||||
|
||||
}
|
||||
|
||||
//get请求
|
||||
public void getRequest(Context context,String typeUrl,RequestListener listener){
|
||||
AppRequest request = new AppRequest(Request.Method.GET,typeUrl,null,listener, errorListener);
|
||||
request.setTag(context);
|
||||
request.setRetryPolicy(new DefaultRetryPolicy(20 * 1000, 1, 1.0f));
|
||||
request.setShouldCache(true);
|
||||
VolleyUtil.getQueue(context).add(request);
|
||||
}
|
||||
}
|
43
app/src/com/cege/games/release/net/RequestData.java
Normal file
43
app/src/com/cege/games/release/net/RequestData.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.cege.games.release.net;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.cege.games.release.Constants;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class RequestData {
|
||||
private final Context context;
|
||||
|
||||
private final String DEFAULT_ERROR_MSG = "服务器君开小差了!";
|
||||
|
||||
public RequestData(Context context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
private void httpGet(String url, Consumer<JSONObject> func) {
|
||||
AppRequestUtil.getInstance().getRequest(context, url, func::accept);
|
||||
}
|
||||
|
||||
private void httpPost(String url, Map<String, String> map, Consumer<JSONObject> func) {
|
||||
AppRequestUtil.getInstance().postRequest(context, url, map, func::accept);
|
||||
}
|
||||
|
||||
public void sendCode(String mail, Consumer<JSONObject> func) {
|
||||
String url = Constants.API_HOST + "/email/send_code";
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("email", mail);
|
||||
map.put("type", "1");
|
||||
httpPost(url, map, func);
|
||||
}
|
||||
|
||||
public void checkMail(String mail, Consumer<JSONObject> func) {
|
||||
String url = Constants.API_HOST + "/email/check";
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("email", mail);
|
||||
httpPost(url, map, func);
|
||||
}
|
||||
}
|
22
app/src/com/cege/games/release/net/RequestErrorEvent.java
Normal file
22
app/src/com/cege/games/release/net/RequestErrorEvent.java
Normal file
@ -0,0 +1,22 @@
|
||||
package com.cege.games.release.net;
|
||||
|
||||
public class RequestErrorEvent {
|
||||
private int type;
|
||||
private String errorMessage;
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getErrorMessage() {
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
public void setErrorMessage(String errorMessage) {
|
||||
this.errorMessage = errorMessage;
|
||||
}
|
||||
}
|
7
app/src/com/cege/games/release/net/RequestListener.java
Normal file
7
app/src/com/cege/games/release/net/RequestListener.java
Normal file
@ -0,0 +1,7 @@
|
||||
package com.cege.games.release.net;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public interface RequestListener {
|
||||
void response(JSONObject jsonObject);
|
||||
}
|
21
app/src/com/cege/games/release/net/VolleyUtil.java
Normal file
21
app/src/com/cege/games/release/net/VolleyUtil.java
Normal file
@ -0,0 +1,21 @@
|
||||
package com.cege.games.release.net;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.android.volley.RequestQueue;
|
||||
import com.android.volley.toolbox.Volley;
|
||||
|
||||
public class VolleyUtil {
|
||||
private volatile static RequestQueue requestQueue;
|
||||
|
||||
public static RequestQueue getQueue(Context ctx){
|
||||
if(requestQueue == null){
|
||||
synchronized (VolleyUtil.class){
|
||||
if(requestQueue == null){
|
||||
requestQueue = Volley.newRequestQueue(ctx.getApplicationContext());
|
||||
}
|
||||
}
|
||||
}
|
||||
return requestQueue;
|
||||
}
|
||||
}
|
33
app/src/com/cege/games/release/net/models/BaseMode.java
Normal file
33
app/src/com/cege/games/release/net/models/BaseMode.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.cege.games.release.net.models;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class BaseMode {
|
||||
private int errcode;
|
||||
private String errmsg;
|
||||
private JSONObject data;
|
||||
|
||||
public int getErrcode() {
|
||||
return errcode;
|
||||
}
|
||||
|
||||
public void setErrcode(int errcode) {
|
||||
this.errcode = errcode;
|
||||
}
|
||||
|
||||
public String getErrmsg() {
|
||||
return errmsg;
|
||||
}
|
||||
|
||||
public void setErrmsg(String errmsg) {
|
||||
this.errmsg = errmsg;
|
||||
}
|
||||
|
||||
public JSONObject getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(JSONObject data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
@ -15,6 +15,7 @@ public class JcSDK {
|
||||
private static final String TAG = JcSDK.class.getSimpleName();
|
||||
private static UnityCallback commonCB;
|
||||
private static native int runJS(final String funId, final String methodName, final String params);
|
||||
private static native int sha512(final String content);
|
||||
|
||||
public static void initCommonCB(UnityCallback callBack) {
|
||||
Log.i(TAG, "call init common callback from unity");
|
||||
@ -129,4 +130,8 @@ public class JcSDK {
|
||||
|
||||
JcSDK.runJS(funId, "jniCallback", result.toString());
|
||||
}
|
||||
|
||||
public static void hashPass(String pass) {
|
||||
JcSDK.sha512(pass);
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title_label"
|
||||
android:layout_width="276dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="12sp"
|
||||
android:autoSizeMaxTextSize="30sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:text="@string/email_register_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/desc_label"
|
||||
android:layout_width="276dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/email_register_sub_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_label" />
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/emailLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/desc_label"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/email"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textEmailAddress"
|
||||
android:hint="@string/email_register_email_input" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/passwordLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailLayout"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="@color/gray"
|
||||
>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/email_register_password_input"
|
||||
android:inputType="textPassword" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/next_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/email_register_btn_next"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/buttonBlue"
|
||||
app:hintAnimationEnabled="false"
|
||||
app:layout_constraintBottom_toTopOf="@+id/pre_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordLayout"
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/pre_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/email_register_btn_previous"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/buttonSecondary"
|
||||
app:hintAnimationEnabled="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/next_button"
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@ -9,12 +9,12 @@
|
||||
android:layout_width="276dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="12sp"
|
||||
android:autoSizeMaxTextSize="30sp"
|
||||
android:autoSizeMinTextSize="12sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:text="@string/email_register_title"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:text="What's your email?"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@ -26,10 +26,11 @@
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="Enter the email where you can be contacted."
|
||||
android:text="@string/email_register_sub_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_label" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/emailLayout"
|
||||
android:layout_width="0dp"
|
||||
@ -39,17 +40,17 @@
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/desc_label"
|
||||
>
|
||||
app:layout_constraintTop_toBottomOf="@+id/desc_label">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="textEmailAddress"
|
||||
android:hint="Email" />
|
||||
android:hint="@string/email_register_email_input"
|
||||
android:inputType="textEmailAddress" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/verifyCodeLayout"
|
||||
android:layout_width="0dp"
|
||||
@ -59,15 +60,16 @@
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailLayout"
|
||||
>
|
||||
app:layout_constraintTop_toBottomOf="@+id/emailLayout">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/verifyCode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Confirmation Code"
|
||||
android:hint="@string/email_register_verify_input"
|
||||
android:inputType="numberSigned" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/passwordLayout"
|
||||
android:layout_width="0dp"
|
||||
@ -75,17 +77,17 @@
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/verifyCodeLayout"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="@color/gray"
|
||||
>
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/verifyCodeLayout">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Password"
|
||||
android:hint="@string/email_register_password_input"
|
||||
android:inputType="textPassword" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@ -97,7 +99,7 @@
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="Next"
|
||||
android:text="@string/email_register_btn_next"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/buttonBlue"
|
||||
app:hintAnimationEnabled="false"
|
||||
@ -105,7 +107,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordLayout"
|
||||
app:theme="@style/Theme.MaterialComponents" />
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/pre_button"
|
||||
@ -115,7 +117,7 @@
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="Previous"
|
||||
android:text="@string/email_register_btn_previous"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/buttonSecondary"
|
||||
app:hintAnimationEnabled="false"
|
||||
@ -123,5 +125,5 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/next_button"
|
||||
app:theme="@style/Theme.MaterialComponents" />
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
90
app/src/main/res/layout/password_input.xml
Normal file
90
app/src/main/res/layout/password_input.xml
Normal file
@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/title_label"
|
||||
android:layout_width="276dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:autoSizeTextType="uniform"
|
||||
android:autoSizeMinTextSize="12sp"
|
||||
android:autoSizeMaxTextSize="30sp"
|
||||
android:autoSizeStepGranularity="2sp"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:text="@string/email_register_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/desc_label"
|
||||
android:layout_width="276dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/email_register_sub_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/title_label" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/passwordLayout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/desc_label"
|
||||
app:endIconMode="password_toggle"
|
||||
app:endIconTint="@color/gray"
|
||||
>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/email_register_password_input"
|
||||
android:inputType="textPassword" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/next_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/email_register_btn_next"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/buttonBlue"
|
||||
app:hintAnimationEnabled="false"
|
||||
app:layout_constraintBottom_toTopOf="@+id/pre_button"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/passwordLayout"
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/pre_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:text="@string/email_register_btn_previous"
|
||||
android:textColor="@android:color/white"
|
||||
app:backgroundTint="@color/buttonSecondary"
|
||||
app:hintAnimationEnabled="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/next_button"
|
||||
android:theme="@style/Theme.MaterialComponents" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
13
app/src/main/res/values/strings.xml
Normal file
13
app/src/main/res/values/strings.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="email_register_title">What\'s your email?</string>
|
||||
<string name="prompt_info_title">Biometric login for Wallet</string>
|
||||
<string name="prompt_info_subtitle">Login using your biometric credential</string>
|
||||
<string name="prompt_info_description">Confirm biometric to continue</string>
|
||||
<string name="email_register_sub_title">Enter the email where you can be contacted.</string>
|
||||
<string name="email_register_email_input">Email</string>
|
||||
<string name="email_register_verify_input">Confirmation Code</string>
|
||||
<string name="email_register_password_input">Password</string>
|
||||
<string name="email_register_btn_next">Next</string>
|
||||
<string name="email_register_btn_previous">Previous</string>
|
||||
</resources>
|
@ -9,7 +9,4 @@
|
||||
<string name="facebook_app_id" translatable="false">1204701000119770</string>
|
||||
<string name="fb_login_protocol_scheme" translatable="false">fb1204701000119770</string>
|
||||
<string name="facebook_client_token" translatable="false">3e29f2606ae15a99bb3824d2ef1a9d0b</string>
|
||||
<string name="prompt_info_title" translatable="false">Biometric login for Wallet</string>
|
||||
<string name="prompt_info_subtitle" translatable="false">Login using your biometric credential</string>
|
||||
<string name="prompt_info_description" translatable="false">Confirm biometric to continue</string>
|
||||
</resources>
|
Loading…
x
Reference in New Issue
Block a user