Commit 003948d2d7cfe8135f9019cf967340daec7dcac5
1 parent
edda399f
1、添加判断是否设置过支付密码接口
2、添加跳转到设置支付密码页面页面
Showing
8 changed files
with
115 additions
and
16 deletions
.idea/gradle.xml
| ... | ... | @@ -3,11 +3,14 @@ |
| 3 | 3 | <component name="GradleSettings"> |
| 4 | 4 | <option name="linkedExternalProjectsSettings"> |
| 5 | 5 | <GradleProjectSettings> |
| 6 | - <compositeConfiguration> | |
| 7 | - <compositeBuild compositeDefinitionSource="SCRIPT" /> | |
| 8 | - </compositeConfiguration> | |
| 9 | 6 | <option name="distributionType" value="DEFAULT_WRAPPED" /> |
| 10 | 7 | <option name="externalProjectPath" value="$PROJECT_DIR$" /> |
| 8 | + <option name="modules"> | |
| 9 | + <set> | |
| 10 | + <option value="$PROJECT_DIR$" /> | |
| 11 | + <option value="$PROJECT_DIR$/app" /> | |
| 12 | + </set> | |
| 13 | + </option> | |
| 11 | 14 | <option name="resolveModulePerSourceSet" value="false" /> |
| 12 | 15 | </GradleProjectSettings> |
| 13 | 16 | </option> | ... | ... |
.idea/misc.xml
| ... | ... | @@ -5,6 +5,30 @@ |
| 5 | 5 | <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" /> |
| 6 | 6 | </configurations> |
| 7 | 7 | </component> |
| 8 | + <component name="NullableNotNullManager"> | |
| 9 | + <option name="myDefaultNullable" value="android.support.annotation.Nullable" /> | |
| 10 | + <option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> | |
| 11 | + <option name="myNullables"> | |
| 12 | + <value> | |
| 13 | + <list size="4"> | |
| 14 | + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" /> | |
| 15 | + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" /> | |
| 16 | + <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" /> | |
| 17 | + <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" /> | |
| 18 | + </list> | |
| 19 | + </value> | |
| 20 | + </option> | |
| 21 | + <option name="myNotNulls"> | |
| 22 | + <value> | |
| 23 | + <list size="4"> | |
| 24 | + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" /> | |
| 25 | + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" /> | |
| 26 | + <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" /> | |
| 27 | + <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" /> | |
| 28 | + </list> | |
| 29 | + </value> | |
| 30 | + </option> | |
| 31 | + </component> | |
| 8 | 32 | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK"> |
| 9 | 33 | <output url="file://$PROJECT_DIR$/build/classes" /> |
| 10 | 34 | </component> | ... | ... |
.idea/vcs.xml
0 → 100644
README.md
app/build.gradle
| 1 | 1 | apply plugin: 'com.android.application' |
| 2 | +apply plugin: 'com.alibaba.arouter' | |
| 2 | 3 | |
| 3 | 4 | static def stringValue(def value) { |
| 4 | 5 | return "\"${value}\"" |
| ... | ... | @@ -14,6 +15,12 @@ android { |
| 14 | 15 | versionCode 1 |
| 15 | 16 | versionName "1.0" |
| 16 | 17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 18 | + | |
| 19 | + javaCompileOptions { | |
| 20 | + annotationProcessorOptions { | |
| 21 | + arguments = [AROUTER_MODULE_NAME: project.getName(), AROUTER_GENERATE_DOC: "enable"] | |
| 22 | + } | |
| 23 | + } | |
| 17 | 24 | } |
| 18 | 25 | compileOptions { |
| 19 | 26 | sourceCompatibility JavaVersion.VERSION_1_8 |
| ... | ... | @@ -42,7 +49,11 @@ dependencies { |
| 42 | 49 | androidTestImplementation 'com.android.support.test:runner:1.0.2' |
| 43 | 50 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' |
| 44 | 51 | |
| 45 | - implementation "com.cnlive.libs:wjjpay:1.0.3" | |
| 52 | + implementation "com.cnlive.libs:wjjpay:1.0.4" | |
| 46 | 53 | implementation "com.cnlive.libs:base:1.0.7" |
| 47 | 54 | implementation "com.cnlive:lib_network:1.0.12" |
| 55 | + | |
| 56 | + //ARouter | |
| 57 | + implementation 'com.alibaba:arouter-api:1.4.0' | |
| 58 | + annotationProcessor 'com.alibaba:arouter-compiler:1.2.1' | |
| 48 | 59 | } |
| 49 | 60 | \ No newline at end of file | ... | ... |
app/src/main/java/com/cnlive/test/wjjpayutil/MainActivity.java
| ... | ... | @@ -5,6 +5,7 @@ import android.support.v7.app.AppCompatActivity; |
| 5 | 5 | import android.os.Bundle; |
| 6 | 6 | import android.util.Log; |
| 7 | 7 | |
| 8 | +import com.alibaba.android.arouter.launcher.ARouter; | |
| 8 | 9 | import com.cnlive.libs.base.application.AppConfig; |
| 9 | 10 | import com.cnlive.libs.wjjpay.pay.WjjPay; |
| 10 | 11 | import com.cnlive.strike.BuildConfig; |
| ... | ... | @@ -28,6 +29,12 @@ public class MainActivity extends AppCompatActivity { |
| 28 | 29 | commitPaymentOrder(this, "uid", "preId", "password"); |
| 29 | 30 | |
| 30 | 31 | setPassword(this, "uid", ""); |
| 32 | + | |
| 33 | + passwordExisting(this, "uid"); | |
| 34 | + | |
| 35 | + findViewById(R.id.setting).setOnClickListener(view -> settingPaySecret()); | |
| 36 | + | |
| 37 | + findViewById(R.id.modify).setOnClickListener(view -> modifyPaySecret()); | |
| 31 | 38 | } |
| 32 | 39 | |
| 33 | 40 | /** |
| ... | ... | @@ -76,4 +83,41 @@ public class MainActivity extends AppCompatActivity { |
| 76 | 83 | .setSuccessCallback(data -> Log.e("DemoView", "成功")) |
| 77 | 84 | .start(); |
| 78 | 85 | } |
| 86 | + | |
| 87 | + /** | |
| 88 | + * 判断是设置 过支付密码 | |
| 89 | + * | |
| 90 | + * @param context | |
| 91 | + * @param userId | |
| 92 | + */ | |
| 93 | + public static void passwordExisting(Context context, String userId) { | |
| 94 | + WjjPay.passwordIsExisting(context, userId) | |
| 95 | + .setFailureCallback((i, s) -> { | |
| 96 | + if (i == 402) { | |
| 97 | + Log.e("DemoView 1", "没有设置支付密码"); | |
| 98 | + } else { | |
| 99 | + Log.e("DemoView 1", s); | |
| 100 | + } | |
| 101 | + }) | |
| 102 | + .setSuccessCallback(groupBalanceInfoPayBaseInfo -> Log.e("DemoView 1", "成功")) | |
| 103 | + .start(); | |
| 104 | + } | |
| 105 | + | |
| 106 | + /** | |
| 107 | + * 跳转到第一次设置支付密码页面 | |
| 108 | + */ | |
| 109 | + public static void settingPaySecret() { | |
| 110 | + ARouter.getInstance().build("/paysecret/PaySecretActivity") | |
| 111 | + .withString("type", "set_pay_secret")//设置支付密码 | |
| 112 | + .navigation(); | |
| 113 | + } | |
| 114 | + | |
| 115 | + /** | |
| 116 | + * 跳转到修改支付密码页面 | |
| 117 | + */ | |
| 118 | + public static void modifyPaySecret() { | |
| 119 | + ARouter.getInstance().build("/paysecret/PaySecretActivity") | |
| 120 | + .withString("type", "modify_pay_secret")//修改支付密码 | |
| 121 | + .navigation(); | |
| 122 | + } | |
| 79 | 123 | } | ... | ... |
app/src/main/res/layout/activity_main.xml
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | -<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 3 | - xmlns:app="http://schemas.android.com/apk/res-auto" | |
| 4 | - xmlns:tools="http://schemas.android.com/tools" | |
| 2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
| 5 | 3 | android:layout_width="match_parent" |
| 6 | - android:layout_height="match_parent" | |
| 7 | - tools:context=".MainActivity"> | |
| 4 | + android:layout_height="match_parent"> | |
| 8 | 5 | |
| 9 | - <TextView | |
| 6 | + <Button | |
| 7 | + android:id="@+id/setting" | |
| 10 | 8 | android:layout_width="wrap_content" |
| 11 | 9 | android:layout_height="wrap_content" |
| 12 | - android:text="Hello World!" | |
| 13 | - app:layout_constraintBottom_toBottomOf="parent" | |
| 14 | - app:layout_constraintLeft_toLeftOf="parent" | |
| 15 | - app:layout_constraintRight_toRightOf="parent" | |
| 16 | - app:layout_constraintTop_toTopOf="parent" /> | |
| 10 | + android:layout_gravity="center_horizontal" | |
| 11 | + android:text="设置支付密码" /> | |
| 17 | 12 | |
| 18 | -</android.support.constraint.ConstraintLayout> | |
| 19 | 13 | \ No newline at end of file |
| 14 | + | |
| 15 | + <Button | |
| 16 | + android:id="@+id/modify" | |
| 17 | + android:layout_width="wrap_content" | |
| 18 | + android:layout_height="wrap_content" | |
| 19 | + android:layout_gravity="center_horizontal" | |
| 20 | + android:text="修改支付密码" /> | |
| 21 | +</LinearLayout> | |
| 20 | 22 | \ No newline at end of file | ... | ... |