Exemplo n.º 1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Resource.Layout.cLock2, container, false);

            date          = v.FindViewById <TextView>(Resource.Id.txtFechaLock);
            clock         = v.FindViewById <TextClock>(Resource.Id.clockLock);
            maincontainer = v.FindViewById <LinearLayout>(Resource.Id.container);
            battery       = v.FindViewById <TextView>(Resource.Id.batteryLevel);
            batteryIcon   = v.FindViewById <ImageView>(Resource.Id.batteryIcon);
            temperature   = v.FindViewById <TextView>(Resource.Id.temperature);
            //minimumTemperature = v.FindViewById<TextView>(Resource.Id.minimumtemperature);
            //maximumTemperature = v.FindViewById<TextView>(Resource.Id.maximumtemperature);
            //humidity = v.FindViewById<TextView>(Resource.Id.humidity);
            description = v.FindViewById <TextView>(Resource.Id.weatherdescription);
            lastupdated = v.FindViewById <TextView>(Resource.Id.lastupdated);
            city        = v.FindViewById <TextView>(Resource.Id.city);
            LoadDate();
            RegisterBatteryReceiver();

            //View Events
            clock.Click += Clock_Click;
            //weatherclockcontainer.Click += Weatherclockcontainer_Click;
            BatteryReceiver.BatteryInfoChanged += BatteryReceiver_BatteryInfoChanged;

            return(v);
        }
Exemplo n.º 2
0
 void Initilizing()
 {
     tim                     = new DateTime();
     textView2               = (TextView)FindViewById(Resource.Id.textView2);
     textView4               = (TextView)FindViewById(Resource.Id.textView4);
     textView5               = (TextView)FindViewById(Resource.Id.textView5);
     textView6               = (TextView)FindViewById(Resource.Id.textView6);
     textView7               = (TextView)FindViewById(Resource.Id.textView7);
     textView8               = (TextView)FindViewById(Resource.Id.textView8);
     textView9               = (TextView)FindViewById(Resource.Id.textView9);
     textView10              = (TextView)FindViewById(Resource.Id.textView10);
     textView11              = (TextView)FindViewById(Resource.Id.textView11);
     textView12              = (TextView)FindViewById(Resource.Id.textView12);
     textView14              = (TextView)FindViewById(Resource.Id.textView14);
     textView17              = (TextView)FindViewById(Resource.Id.textView17);
     textView18              = (TextView)FindViewById(Resource.Id.textView18);
     textView20              = (TextView)FindViewById(Resource.Id.textView20);
     textView21              = (TextView)FindViewById(Resource.Id.textView21);
     textView23              = (TextView)FindViewById(Resource.Id.textView23);
     textView24              = (TextView)FindViewById(Resource.Id.textView24);
     textView26              = (TextView)FindViewById(Resource.Id.textView26);
     textView27              = (TextView)FindViewById(Resource.Id.textView27);
     textView29              = (TextView)FindViewById(Resource.Id.textView29);
     textView30              = (TextView)FindViewById(Resource.Id.textView30);
     textClock2              = (TextClock)FindViewById(Resource.Id.textClock2);
     button1                 = (Button)FindViewById(Resource.Id.button1);
     button2                 = (Button)FindViewById(Resource.Id.button2);
     textClock2.TextChanged += TextClock2_TextChanged;
     button1.Click          += Button1_Click;
     button2.Click          += Button2_Click;
 }
Exemplo n.º 3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Resource.Layout.cLock, container, false);

            date  = v.FindViewById <TextView>(Resource.Id.txtFechaLock);
            clock = v.FindViewById <TextClock>(Resource.Id.clockLock);
            //weatherclockcontainer = v.FindViewById<RelativeLayout>(Resource.Id.weatherclockcontainer);
            battery     = v.FindViewById <TextView>(Resource.Id.batteryLevel);
            batteryIcon = v.FindViewById <ImageView>(Resource.Id.batteryIcon);
            temperature = v.FindViewById <TextView>(Resource.Id.temperature);
            //minimumTemperature = v.FindViewById<TextView>(Resource.Id.minimumtemperature);
            //maximumTemperature = v.FindViewById<TextView>(Resource.Id.maximumtemperature);
            //humidity = v.FindViewById<TextView>(Resource.Id.humidity);
            description = v.FindViewById <TextView>(Resource.Id.weatherdescription);
            //lastupdated = v.FindViewById<TextView>(Resource.Id.lastupdated);
            //city = v.FindViewById<TextView>(Resource.Id.city);
            LoadDate();

            //View Events
            clock.Click += Clock_Click;
            //weatherclockcontainer.Click += Weatherclockcontainer_Click;
            BatteryReceiver.BatteryInfoChanged += BatteryReceiver_BatteryInfoChanged;
            ConfigurationManager configurationManager = new ConfigurationManager(AppPreferences.Default);

            if (configurationManager.RetrieveAValue(ConfigurationParameters.HiddenClock) == true)
            {
                //Hide the clock
                Activity.RunOnUiThread(() => clock.Visibility = ViewStates.Invisible);
            }
            return(v);
        }
Exemplo n.º 4
0
 void Initilizing()
 {
     textClock2 = (TextClock)FindViewById(Resource.Id.textClock2);
     textView2  = (TextView)FindViewById(Resource.Id.textView2);
     textView3  = (TextView)FindViewById(Resource.Id.textView3);
     textView4  = (TextView)FindViewById(Resource.Id.textView4);
     textView5  = (TextView)FindViewById(Resource.Id.textView5);
     textView6  = (TextView)FindViewById(Resource.Id.textView6);
     textView7  = (TextView)FindViewById(Resource.Id.textView7);
     textView8  = (TextView)FindViewById(Resource.Id.textView8);
     textView9  = (TextView)FindViewById(Resource.Id.textView9);
     textView10 = (TextView)FindViewById(Resource.Id.textView10);
     textView11 = (TextView)FindViewById(Resource.Id.textView11);
     textView12 = (TextView)FindViewById(Resource.Id.textView12);
     textView14 = (TextView)FindViewById(Resource.Id.textView14);
     textView15 = (TextView)FindViewById(Resource.Id.textView15);
     textView16 = (TextView)FindViewById(Resource.Id.textView16);
     textView17 = (TextView)FindViewById(Resource.Id.textView17);
     textView18 = (TextView)FindViewById(Resource.Id.textView18);
     textView19 = (TextView)FindViewById(Resource.Id.textView19);
     textView20 = (TextView)FindViewById(Resource.Id.textView20);
     textView21 = (TextView)FindViewById(Resource.Id.textView21);
     textView22 = (TextView)FindViewById(Resource.Id.textView22);
     textView23 = (TextView)FindViewById(Resource.Id.textView23);
     textView24 = (TextView)FindViewById(Resource.Id.textView24);
     textView25 = (TextView)FindViewById(Resource.Id.textView25);
     textView26 = (TextView)FindViewById(Resource.Id.textView26);
     textView27 = (TextView)FindViewById(Resource.Id.textView27);
     textView28 = (TextView)FindViewById(Resource.Id.textView28);
     button1    = (Button)FindViewById(Resource.Id.button1);
     button2    = (Button)FindViewById(Resource.Id.button2);
     WeekReader();
     TimeReader();
     textClock2.TextChanged += TextClock2_textChanged;
     button1.Click          += Button1_click;
     button2.Click          += Button2_click;
     textView14.Click       += First_click;
     textView15.Click       += First_click;
     textView16.Click       += First_click;
     textView17.Click       += Second_click;
     textView18.Click       += Second_click;
     textView19.Click       += Second_click;
     textView20.Click       += Third_click;
     textView21.Click       += Third_click;
     textView22.Click       += Third_click;
     textView23.Click       += Fourth_click;
     textView24.Click       += Fourth_click;
     textView25.Click       += Fourth_click;
     textView26.Click       += Fifth_click;
     textView27.Click       += Fifth_click;
     textView28.Click       += Fifth_click;
 }
Exemplo n.º 5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            String row1  = Intent.GetStringExtra("row1");
            String row1s = Intent.GetStringExtra("row1s");
            String row2  = Intent.GetStringExtra("row2");
            String row2s = Intent.GetStringExtra("row2s");
            String row3  = Intent.GetStringExtra("row3");
            String row3s = Intent.GetStringExtra("row3s");
            String row4  = Intent.GetStringExtra("row4");
            String row4s = Intent.GetStringExtra("row4s");
            String row5  = Intent.GetStringExtra("row5");
            String row5s = Intent.GetStringExtra("row5s");
            String row6  = Intent.GetStringExtra("row6");
            String row6s = Intent.GetStringExtra("row6s");

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            ImageButton addClock = FindViewById <ImageButton>(Resource.Id.addTimeZone);

            addClock.Click += delegate {
                StartActivity(new Intent(this, typeof(AddAClockActivity)));
            };

            TextClock txtc1 = (TextClock)FindViewById(Resource.Id.row1);
            TextView  txtv1 = (TextView)FindViewById(Resource.Id.row1s);
            TextClock txtc2 = (TextClock)FindViewById(Resource.Id.row2);
            TextView  txtv2 = (TextView)FindViewById(Resource.Id.row2s);
            TextClock txtc3 = (TextClock)FindViewById(Resource.Id.row3);
            TextView  txtv3 = (TextView)FindViewById(Resource.Id.row3s);
            TextClock txtc4 = (TextClock)FindViewById(Resource.Id.row4);
            TextView  txtv4 = (TextView)FindViewById(Resource.Id.row4s);
            TextClock txtc5 = (TextClock)FindViewById(Resource.Id.row5);
            TextView  txtv5 = (TextView)FindViewById(Resource.Id.row5s);
            TextClock txtc6 = (TextClock)FindViewById(Resource.Id.row6);
            TextView  txtv6 = (TextView)FindViewById(Resource.Id.row6s);
        }
Exemplo n.º 6
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View v = inflater.Inflate(Resource.Layout.cLock, container, false);

            date        = v.FindViewById <TextView>(Resource.Id.txtFechaLock);
            clock       = v.FindViewById <TextClock>(Resource.Id.clockLock);
            battery     = v.FindViewById <TextView>(Resource.Id.batteryLevel);
            batteryIcon = v.FindViewById <ImageView>(Resource.Id.batteryIcon);
            LoadDate();

            //View Events
            clock.Click += Clock_Click;
            BatteryReceiver.BatteryInfoChanged += BatteryReceiver_BatteryInfoChanged;
            ConfigurationManager configurationManager = new ConfigurationManager(PreferenceManager.GetDefaultSharedPreferences(Application.Context));

            if (configurationManager.RetrieveAValue(ConfigurationParameters.HiddenClock) == true)
            {
                //Hide the clock
                Activity.RunOnUiThread(() => clock.Visibility = ViewStates.Invisible);
            }
            return(v);
        }
Exemplo n.º 7
0
 void Initilizing()
 {
     tim        = new DateTime();
     tim        = DateTime.Now;
     weekNo     = (int)tim.DayOfWeek;
     textView2  = (TextView)FindViewById(Resource.Id.textView2);
     textView3  = (TextView)FindViewById(Resource.Id.textView3);
     textView6  = (TextView)FindViewById(Resource.Id.textView6);
     textView7  = (TextView)FindViewById(Resource.Id.textView7);
     textView8  = (TextView)FindViewById(Resource.Id.textView8);
     textView9  = (TextView)FindViewById(Resource.Id.textView9);
     textView10 = (TextView)FindViewById(Resource.Id.textView10);
     textView11 = (TextView)FindViewById(Resource.Id.textView11);
     textView12 = (TextView)FindViewById(Resource.Id.textView12);
     textView13 = (TextView)FindViewById(Resource.Id.textView13);
     textView15 = (TextView)FindViewById(Resource.Id.textView15);
     textView16 = (TextView)FindViewById(Resource.Id.textView16);
     textView17 = (TextView)FindViewById(Resource.Id.textView17);
     textView18 = (TextView)FindViewById(Resource.Id.textView18);
     textView19 = (TextView)FindViewById(Resource.Id.textView19);
     spinner1   = (Spinner)FindViewById(Resource.Id.spinner1);
     spinner2   = (Spinner)FindViewById(Resource.Id.spinner2);
     spinner3   = (Spinner)FindViewById(Resource.Id.spinner3);
     textClock2 = (TextClock)FindViewById(Resource.Id.textClock2);
     Initalizing_Spinner();
     textView2.Text = tim.ToString("ddd");
     WeekReader();
     hour   = tim.Hour;
     min    = tim.Minute;
     second = tim.Second;
     Data();
     spinner1.ItemSelected  += Spinner1_ItemSelected;
     spinner2.ItemSelected  += Spinner2_ItemSelected;
     spinner3.ItemSelected  += Spinner3_ItemSelected;
     textClock2.TextChanged += TextClock2_TextChanged;
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            //Fullscreen
            this.Window.SetFlags(WindowManagerFlags.KeepScreenOn, WindowManagerFlags.KeepScreenOn);
            this.Window.AddFlags(WindowManagerFlags.Fullscreen);
            SetContentView(Resource.Layout.activity_main);

            console = FindViewById <TextView>(Resource.Id.console);
            string a = DateTime.Now.ToLocalTime().ToString();

            clock       = FindViewById <TextClock>(Resource.Id.textView2);
            Temperature = FindViewById <TextView>(Resource.Id.textView3);
            TempImage   = FindViewById <ImageView>(Resource.Id.imageView2);

            //Temperature data
            Wind     = FindViewById <TextView>(Resource.Id.windText);
            Pressure = FindViewById <TextView>(Resource.Id.pressureText);
            Humidity = FindViewById <TextView>(Resource.Id.humidityText);
            Water    = FindViewById <TextView>(Resource.Id.waterText);

            Battery    = FindViewById <TextView>(Resource.Id.batterText);
            brightness = FindViewById <TextView>(Resource.Id.brightnessText);

            SetBrightness(100);

            parsing = new DataParsing();
            //Temperature task updater (10 sec)
            Task.Run(() =>
            {
                updateWithInterval();
                BatteryManagement();
            });

            ToCityList           = new MyList <TrafiListModel>();
            mRecyclerViewToCity  = FindViewById <RecyclerView>(Resource.Id.recyclerviewToCity);
            mLayoutManagerToCity = new LinearLayoutManager(this);
            mRecyclerViewToCity.SetLayoutManager(mLayoutManagerToCity);
            mAdapterToCity     = new RecyclerAdapterTrafi(ToCityList, mRecyclerViewToCity, this);
            ToCityList.Adapter = mAdapterToCity;
            mRecyclerViewToCity.SetAdapter(mAdapterToCity);


            ToGymList           = new MyList <TrafiListModel>();
            mRecyclerViewToGym  = FindViewById <RecyclerView>(Resource.Id.recyclerviewToGym);
            mLayoutManagerToGym = new LinearLayoutManager(this);
            mRecyclerViewToGym.SetLayoutManager(mLayoutManagerToGym);
            mAdapterToGym     = new RecyclerAdapterTrafi(ToGymList, mRecyclerViewToGym, this);
            ToGymList.Adapter = mAdapterToGym;
            mRecyclerViewToGym.SetAdapter(mAdapterToGym);

            List           = new MyList <LinkomanijosData>();
            mRecyclerView  = FindViewById <RecyclerView>(Resource.Id.recyclerview);
            mLayoutManager = new LinearLayoutManager(this);
            mRecyclerView.SetLayoutManager(mLayoutManager);
            mAdapter     = new RecyclerAdapter(List, mRecyclerView);
            List.Adapter = mAdapter;
            mRecyclerView.SetAdapter(mAdapter);

            //SPEECH

            //For audio control
            audioManager = (AudioManager)GetSystemService(Context.AudioService);

            textToSpeech = FindViewById <Button>(Resource.Id.button);
            SpeechText   = FindViewById <TextView>(Resource.Id.textView27);

            SpeechToText = FindViewById <Button>(Resource.Id.button2);
            lisenTome    = FindViewById <TextView>(Resource.Id.textView28);

            tts = new TextToSpeech(this, this);

            sr = SpeechRecognizer.CreateSpeechRecognizer(this);
            sr.SetRecognitionListener(this);

            textToSpeech.Click += TextToSpeech_Click;

            SpeechToText.Click += (sender, e) =>
            {
                musicOrigVol = audioManager.GetStreamVolume(Stream.Music);
                audioManager.SetStreamVolume(Stream.Music, 0, 0);
                Intent intent = new Intent(RecognizerIntent.ActionRecognizeSpeech);
                intent.PutExtra(RecognizerIntent.ExtraLanguageModel, RecognizerIntent.LanguageModelFreeForm);
                intent.PutExtra(RecognizerIntent.ExtraCallingPackage, "this package");
                intent.PutExtra(RecognizerIntent.ExtraMaxResults, 5);
                sr.StartListening(intent);
            };
            //SpeechToText.Click += RecordVoice;

            recognition     = FindViewById <Button>(Resource.Id.button3);
            recognitionText = FindViewById <TextView>(Resource.Id.textView6);


            camereImg          = FindViewById <ImageView>(Resource.Id.imageView);
            recognition.Click += async delegate
            {
                //static final int REQUEST_IMAGE_CAPTURE = 1;
                //Intent takePictureIntent = new Intent(MediaStore.ActionImageCapture);
                //if (takePictureIntent.ResolveActivity(PackageManager) != null)
                //{
                //    StartActivityForResult(takePictureIntent, 1);
                //}


                var    classs = new FaceRecognition();
                string path   = @"/data/user/0/camerapictureTaking.camerapictureTaking/filesEimantas.jpg";
                recognitionText.Text = await classs.RecognitionFace("1", path);

                SpeechText.Text = "Authorization succeeded, Hello came back " + recognitionText.Text;
                //Speak();
            };
        }