Ejemplo n.º 1
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            input = FindViewById <EditText>(Resource.Id.editText1);
            input.EditorAction += Et_EditorAction;
            rot = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath;

            await PermissionReaderAsync();

            if (!Directory.Exists(rot + "/ADL"))
            {
                Directory.CreateDirectory(rot + "/ADL");
            }
            if (!Directory.Exists(rot + "/ADL/Epubs"))
            {
                Directory.CreateDirectory(rot + "/ADL/Epubs");
            }
            if (!Directory.Exists(rot + "/ADL/Anime"))
            {
                Directory.CreateDirectory(rot + "/ADL/Anime");
            }
            if (!Directory.Exists(rot + "/ADL/HAnime"))
            {
                Directory.CreateDirectory(rot + "/ADL/HAnime");
            }

            rot = Path.Combine(rot, "ADL");

            tviews          = new TextView[3];
            tasksRunning    = new bool[3];
            concurrentTasks = new arrWrapper <string>(3, new Action <int, string>(UpdateTask));

            tviews[0] = FindViewById <TextView>(Resource.Id.textView2);
            tviews[1] = FindViewById <TextView>(Resource.Id.textView3);
            tviews[2] = FindViewById <TextView>(Resource.Id.textView4);

            cons = FindViewById <TextView>(Resource.Id.textView1);
            cons.MovementMethod = new ScrollingMovementMethod();
            ADLCore.Alert.ADLUpdates.onSystemUpdate += WriteToConsole;
        }
Ejemplo n.º 2
0
        protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Forms.Forms.Init(this, savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);
            input = FindViewById <EditText>(Resource.Id.editText1);
            input.EditorAction += Et_EditorAction;
            rot = ApplicationContext.GetExternalFilesDir("Data").AbsolutePath;
            await PermissionReaderAsync();

            Directory.CreateDirectory(rot + "/ADL");
            using (StreamWriter sw = new StreamWriter(new FileStream(rot + "/ADL/" + "dummy.txt", FileMode.OpenOrCreate)))
            {
                sw.WriteLine("hello world");
            }

            rotNovelDir = rot + "/ADL/Epubs";
            rotAnimeDir = rot + "/ADL/Anime";
            Directory.CreateDirectory(rotNovelDir);
            Directory.CreateDirectory(rotAnimeDir);
            Directory.CreateDirectory(rot + "/ADL/HAnime");

            rot = Path.Combine(rot, "ADL");

            tviews          = new TextView[3];
            tasksRunning    = new bool[3];
            concurrentTasks = new arrWrapper <string>(3, new Action <int, string>(UpdateTask));

            reloadActivityMain();

            //Android.Widget.Button back = FindViewById<Android.Widget.Button>(Resource.Id.stgs_button_back);
            //back.Click += Back_Click;


            cons = FindViewById <TextView>(Resource.Id.textView1);
            cons.MovementMethod = new ScrollingMovementMethod();
            ADLCore.Alert.ADLUpdates.onSystemUpdate += WriteToConsole;
        }