Exemplo n.º 1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.activity_main);

            settings = PreferenceManager.GetDefaultSharedPreferences(this);
            editor   = settings.Edit();
            //editor.Clear().Commit();
            prefListener = new PrefListener(this);

            clickableFrameLayout = FindViewById <FrameLayout>(Resource.Id.clickableFrameLayout);

            currentAccentColor = AccentColors.GetIdFromResource(settings.GetString(ACCENT_COLOR_KEY, ACCENT_COLOR_DEFAULT));

            clickableFrameLayout.SetBackgroundColor(GetColor(currentAccentColor));
            clickableFrameLayout.SetOnClickListener(this);

            SetAmbientEnabled();
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_main);

            settings = PreferenceManager.GetDefaultSharedPreferences(this);
            editor   = settings.Edit();
            //editor.Clear().Commit();
            prefListener = new PrefListener(this);

            colorSpinner = FindViewById <Spinner>(Resource.Id.colorSpinner);
            colorLayout  = FindViewById <FrameLayout>(Resource.Id.colorLayout);

            currentAccentColor = AccentColors.GetIdFromResource(settings.GetString(ACCENT_COLOR_KEY, ACCENT_COLOR_DEFAULT));

            AccentColor[] colors = AccentColors.GetAccentColors().ToArray();
            colorSpinner.Adapter = new ArrayAdapter <AccentColor>(this, Resource.Layout.colorspinner_item, colors);

            colorLayout.SetBackgroundColor(GetColor(currentAccentColor));
            colorSpinner.ItemSelected += ColorSpinner_ItemSelected;
        }