예제 #1
0
 private Color SetColor()
 {
     if (int.Parse(Android.OS.Build.VERSION.Sdk) >= 23)
     {
         if (ChangeTheme.getTheme() == Resource.Style.DarkTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.osoite_tausta_tumma)));
         }
         if (ChangeTheme.getTheme() == Resource.Style.MyCustomTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.sonaatti_violetti)));
         }
         if (ChangeTheme.getTheme() == Resource.Style.PinkTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.sonaatti_pinkki)));
         }
         return(Color.Black);
     }
     else
     {
         if (ChangeTheme.getTheme() == Resource.Style.DarkTheme)
         {
             return(new Color(Color.ParseColor("#1a1a1a")));
         }
         if (ChangeTheme.getTheme() == Resource.Style.MyCustomTheme)
         {
             return(new Color(Color.ParseColor("#6a6ff2")));
         }
         if (ChangeTheme.getTheme() == Resource.Style.PinkTheme)
         {
             return(new Color(Color.ParseColor("#9e069e")));
         }
         return(Color.Black);
     }
 }
예제 #2
0
 public static Color setDescColor()
 {
     if (int.Parse(Android.OS.Build.VERSION.Sdk) >= 23)
     {
         if (ChangeTheme.getTheme() == Resource.Style.DarkTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.lista_kuvaus_kirkas)));
         }
         if (ChangeTheme.getTheme() == Resource.Style.MyCustomTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.lista_kuvaus_tumma)));
         }
         if (ChangeTheme.getTheme() == Resource.Style.PinkTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.valkoinen)));
         }
         return(Color.Black);
     }
     else
     {
         if (ChangeTheme.getTheme() == Resource.Style.DarkTheme)
         {
             return(new Color(Color.ParseColor("#ffffff")));
         }
         if (ChangeTheme.getTheme() == Resource.Style.MyCustomTheme)
         {
             return(new Color(Color.ParseColor("#050505")));
         }
         if (ChangeTheme.getTheme() == Resource.Style.PinkTheme)
         {
             return(new Color(Color.ParseColor("#ffffff")));
         }
         return(Color.Black);
     }
 }
예제 #3
0
 public static Color setTitleColor()
 {
     if (int.Parse(Android.OS.Build.VERSION.Sdk) >= 23)
     {
         if (ChangeTheme.getTheme() == Resource.Style.DarkTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.lista_otsikko_vihrea)));
         }
         if (ChangeTheme.getTheme() == Resource.Style.MyCustomTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.lista_otsikko_vihrea)));
         }
         if (ChangeTheme.getTheme() == Resource.Style.PinkTheme)
         {
             return(new Color(Application.Context.GetColor(Resource.Color.valkoinen)));
         }
         return(Color.Black);
     }
     else
     {
         if (ChangeTheme.getTheme() == Resource.Style.DarkTheme)
         {
             return(new Color(Color.ParseColor("#93B233")));
         }
         if (ChangeTheme.getTheme() == Resource.Style.MyCustomTheme)
         {
             return(new Color(Color.ParseColor("#93B233")));
         }
         if (ChangeTheme.getTheme() == Resource.Style.PinkTheme)
         {
             return(new Color(Color.ParseColor("#ffffff")));
         }
         return(Color.Black);
     }
 }
예제 #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.SetTheme(ChangeTheme.getTheme());
            SetContentView(Resource.Layout.Wilhelmiina);

            //Tuodaan activitylle ravintolan nimi ja sijainti listassa
            string rnimi  = Intent.GetStringExtra("rnimi") ?? "Virhe ravintolan tietojen saannissa";
            int    rkoodi = Intent.GetIntExtra("rkoodi", 0);

            //Asetetaan luotava listView layoutissa olevaksi
            this.feedItemsListView = this.FindViewById <ListView>(Resource.Id.feedItemsListView);

            //Latausdialogi
            this.progressDialog = new ProgressDialog(this);
            this.progressDialog.SetMessage("Ladataan...");

            //Tuodaan ravintolan tiedot URL-luokasta
            URL SonaattiData = new URL();

            string[] rssURL    = { SonaattiData.getWeekURL(rkoodi) };
            string[] aoAjat    = SonaattiData.getHours();
            string[] osoitteet = SonaattiData.getAddresses();

            //Haetaan netistä RSS-syöte, jossa on ruokalistat
            this.GetFeedItemsList(rssURL);

            //Luodaan toolbar
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetActionBar(toolbar);
            //Asetetaan toolbarin title näyttämään päivämäärä
            ActionBar.Title = rnimi;
            ActionBar.SetHomeButtonEnabled(true); //Takaisin-painike päällä
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            //Asetetaan aukioloajat näkymään
            FindViewById <TextView>(Resource.Id.aukioloajat).Text = Resources.GetString(Resource.String.openhours) + aoAjat[rkoodi];

            //Asetetaan osoite näkymään
            FindViewById <TextView>(Resource.Id.osoite).Text = osoitteet[rkoodi];

            //Asetetaan väri osoitteen taustalle
            FindViewById <FrameLayout>(Resource.Id.frameLayout1).SetBackgroundColor(SetColor());
        }
예제 #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            //Vaihtaa teeman
            this.SetTheme(ChangeTheme.getTheme());

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

            this.RavintolaListView = this.FindViewById <ListView>(Resource.Id.feedItemsListView);

            this.progressDialog = new ProgressDialog(this);
            this.progressDialog.SetMessage("Ladataan...");

            //Ravintolat: 1. Piato, 2. Wilhelmiina, 3. Tilia, 4. Libri, 5. Lozzi, 6. Kahvila Syke, 7. Uno, 8. Ylistö, 9. Kvarkki, 10. Novelli, 11. Normaalikoulu
            string[] url = { "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1408&language=fi",   "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1402&language=fi",
                             "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1413&language=fi",   "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=141301&language=fi",
                             "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1401&language=fi",   "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1405&language=fi",
                             "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1414&language=fi",   "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1403&language=fi",
                             "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=140301&language=fi",
                             "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1409&language=fi",   "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1411&language=fi",
                             "http://www.sonaatti.fi/modules/MenuRss/MenuRss/CurrentDay?costNumber=1404&language=fi" };

            this.GetRavintolatList(url); //piato

            //Aukioloajat: http://users.jyu.fi/~jualkaup/www/aukioloajat.rss

            //Haetaan nykyinen päivämäärä ja tallennetaan merkkijonoksi
            DateTime now         = DateTime.Now.ToLocalTime();
            string   currentTime = now.ToString("dd.MM.yyyy");

            //Luodaan toolbar
            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetActionBar(toolbar);
            //Asetetaan toolbarin title näyttämään päivämäärä
            ActionBar.Title = "Sonatiina - " + currentTime;
        }
예제 #6
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.SetTheme(ChangeTheme.getTheme());
            SetContentView(Resource.Layout.Settings);

            var transaction = FragmentManager.BeginTransaction();
            var setFragment = new SettingsFragment();

            transaction.Replace(Resource.Id.container, setFragment);
            transaction.Commit();

            var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);

            SetActionBar(toolbar);
            ActionBar.Title = "Asetukset";

            ActionBar.SetHomeButtonEnabled(true); // Takaisin-painike päällä
            ActionBar.SetDisplayHomeAsUpEnabled(true);

            ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(ApplicationContext);

            prefs.RegisterOnSharedPreferenceChangeListener(this);
        }