Commit 7f2be495 by sikang

update privacy

parent bc1abe2f
......@@ -29,6 +29,13 @@ android {
buildConfigField 'Boolean', 'HIBERNATION', "false"
}
try {
buildConfigField 'Boolean', 'IS_HOST_APP', "${host_app}"
} catch (Exception e) {
buildConfigField 'Boolean', 'IS_HOST_APP', "false"
}
}
buildTypes {
release {
......
......@@ -13,6 +13,7 @@ import android.webkit.WebStorage;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.TextView;
import com.common.base.BaseActivity;
import com.common.toolbox.app_utils.DeviceInfo;
......@@ -126,7 +127,7 @@ public class AgreementPolicyActivity extends BaseActivity {
}
Type agreementType = Type.AGREEMENT_POLICY;
// Type agreementType = Type.AGREEMENT_POLICY;
public static void startForResult(FragmentActivity activity, Type type, int requestCode, EasyActivityResult.OnResultListener listener) {
Intent intent = new Intent(activity, AgreementPolicyActivity.class);
......@@ -157,9 +158,6 @@ public class AgreementPolicyActivity extends BaseActivity {
@Override
public void initView() {
if (getIntent().getSerializableExtra("agreementType") != null) {
agreementType = (Type) getIntent().getSerializableExtra("agreementType");
}
EventBus.getDefault().register(this);
mCheckBox = findViewById(R.id.activity_policy_checkbox);
......@@ -179,6 +177,8 @@ public class AgreementPolicyActivity extends BaseActivity {
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);//不加载缓存
WebStorage.getInstance().deleteAllData();//主动清除数据
loadPolicy();
UIHelper.bindClickListener(getContentView(), new OnNoShakeClickListener() {
@Override
public void onEventClick(View v) {
......@@ -199,47 +199,49 @@ public class AgreementPolicyActivity extends BaseActivity {
}, R.id.activity_policy_ok_btn);
//KSP协议
// if (agreementType == Type.AGREEMENT_KSP) {
// TextView agreeTv = findViewById(R.id.activity_policy_agreement_tv);
// String policy = getString(R.string.login_statement_title);
// String ksp_form = getString(R.string.koperasi_form);
// String agreeText = String.format(getString(R.string.i_agree_ksp_policy), policy, ksp_form);
// UIHelper.setTextHighLight(agreeTv, agreeText, LibConfig.MAIN_COLOR, policy, ksp_form);
//
// agreeTv.setOnClickListener(new OnNoShakeClickListener() {
// @Override
// public void onEventClick(View v) {
// DialogFactory.createMenuDialog(AgreementPolicyActivity.this, new String[]{policy, ksp_form},
// (dialog, which) -> {
// dialog.dismiss();
// if (which == 0) {
// setTopBarTitle(policy);
// loadPolicy();
// } else {
// setTopBarTitle(ksp_form);
// loadKspPolicy();
// }
// }).show();
// }
// });
// }
//本地协议
if (agreementType == Type.AGREEMENT_HOOK) {
webView.loadUrl(getLocalPolicy());
return;
if (BuildConfig.IS_HOST_APP) {
TextView agreeTv = findViewById(R.id.activity_policy_agreement_tv);
String policy = getString(R.string.login_statement_title);
String ksp_form = getString(R.string.koperasi_form);
String agreeText = String.format(getString(R.string.i_agree_ksp_policy), policy, ksp_form);
UIHelper.setTextHighLight(agreeTv, agreeText, LibConfig.MAIN_COLOR, policy, ksp_form);
agreeTv.setOnClickListener(new OnNoShakeClickListener() {
@Override
public void onEventClick(View v) {
DialogFactory.createMenuDialog(AgreementPolicyActivity.this, new String[]{policy, ksp_form},
(dialog, which) -> {
dialog.dismiss();
if (which == 0) {
setTopBarTitle(policy);
loadPolicy();
} else {
setTopBarTitle(ksp_form);
loadKspPolicy();
}
}).show();
}
});
}
loadPolicy();
}
private void loadKspPolicy() {
webView.loadUrl(Gateway.getKSPUrl());
if(DeviceInfo.isReviewMachine()){
webView.loadUrl("file:///android_asset/web/privacyKsp.html");
}else{
webView.loadUrl(Gateway.getKSPUrl());
}
}
private void loadPolicy() {
webView.loadUrl(Gateway.getAgreementPolicyUrl());
if(DeviceInfo.isReviewMachine()){
webView.loadUrl(getLocalPolicy());
}else{
webView.loadUrl(Gateway.getAgreementPolicyUrl());
}
}
@Subscribe(threadMode = ThreadMode.MAIN)
......
......@@ -10,15 +10,15 @@
android:id="@+id/activity_policy_webview"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="13dp"
android:layout_weight="1"
android:layout_margin="5dp"
android:background="@color/white" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="@string/read_policy_fully"
android:textSize="12dp" />
......@@ -26,15 +26,15 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="14dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<CheckBox
android:id="@+id/activity_policy_checkbox"
android:layout_width="26dp"
android:layout_marginRight="5dp"
android:layout_height="26dp" />
<TextView
......@@ -42,7 +42,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:tag="read_policy"
android:text="@string/i_agree_this_policy" />
</LinearLayout>
......@@ -50,9 +49,12 @@
<Button
android:id="@+id/activity_policy_ok_btn"
android:textColor="@color/white"
android:layout_marginTop="10dp"
android:background="@color/qmui_config_color_gray_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="15dp"
android:text="@string/button_ok" />
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment