wxr
2023-06-06 592974441a4df95fffd9167c90192da1a390b1c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using System;
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Net;
using Android.OS;
using CN.Jpush.Android.Api;
//using Android.Widget;
using Com.Hdl.ON.Jpush.Androidjpush;
using HDL_ON;
using Java.Util;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
using Shared;
 
 
namespace HDL_ON_Android
{
    [Activity(Label = "AgreementActivity", Theme = "@style/MyTheme1", ScreenOrientation = ScreenOrientation.Portrait)]
    public class AgreementActivity : Activity
    {
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
 
            // Create your application here
            SetContentView(Resource.Layout.activity_splash);
 
            Android.Widget.TextView tvPrivacyPolicy = FindViewById<Android.Widget.TextView>(Resource.Id.privacy_policy_btn);
            Android.Widget.TextView tvServiceAgreement = FindViewById<Android.Widget.TextView>(Resource.Id.service_agreement_btn);
 
            Android.Widget.Button btnDisagree = FindViewById<Android.Widget.Button>(Resource.Id.disagree_btn);
            Android.Widget.Button btnAgree = FindViewById<Android.Widget.Button>(Resource.Id.agree_btn);
 
            tvPrivacyPolicy.Click += (sender, e) =>
            {
                Intent i = new Intent(this, typeof(WebviewActivity));
 
                i.PutExtra("url", HDL_ON.Constant.URL_PRIVACYPOLICY);
                StartActivity(i);
                Intent data = new Intent();
                data.PutExtra("data", "disagree");
                SetResult(Result.Canceled, Intent);
            };
            tvServiceAgreement.Click += (sender, e) =>
            {
                Intent i = new Intent(this, typeof(WebviewActivity));
 
                i.PutExtra("url",HDL_ON.Constant.URL_USERAGREEMENT);
 
                StartActivity(i);
                Intent data = new Intent();
                data.PutExtra("data", "disagree");
                SetResult(Result.Canceled, Intent);
            };
            btnDisagree.Click += (sender, e) =>
            {
                //Java.Lang.JavaSystem.Exit(0);
                FinishAffinity();
            };
            btnAgree.Click += (sender, e) =>
            {
                OnAppConfig.Instance.isAgreePrivacyPolicy = true;
                OnAppConfig.Instance.FirstRunApp = false;
                OnAppConfig.Instance.SaveConfig();
 
                Intent data = new Intent();
                data.PutExtra("data", "agree");
                SetResult(Result.Ok, Intent);
                Finish();
            };
        }
    }
}