Exemplo n.º 1
0
        public static ValueChooserDialogFragment NewInstance(int id, int titleId, int itemsArrayId)
        {
            ValueChooserDialogFragment fragment = new ValueChooserDialogFragment();
            Bundle args = new Bundle();

            args.PutInt(ARG_ID, id);
            args.PutInt(ARG_TITLE, titleId);
            args.PutInt(ARG_ITEMS_ARRAY, itemsArrayId);
            fragment.Arguments = args;

            return(fragment);
        }
Exemplo n.º 2
0
        public void OnClick(View v)
        {
            int id = v.Id;

            int titleId;
            int valueId;
            int itemsArrayId;
            int valuesArrayId;

            switch (id)
            {
            case PREF_SPACING_TYPE:
                titleId       = Resource.String.pref_spacing_type;
                valueId       = PREF_SPACING_TYPE_VALUE;
                itemsArrayId  = Resource.Array.spacing_types;
                valuesArrayId = Resource.Array.spacing_types_values;
                break;

            case PREF_SPACING_WIDTH:
                titleId       = Resource.String.pref_spacing_width;
                valueId       = PREF_SPACING_WIDTH_VALUE;
                itemsArrayId  = Resource.Array.width_strings;
                valuesArrayId = Resource.Array.width_values;
                break;

            case PREF_SPACING_ACTIONS_WIDTH:
                titleId       = Resource.String.pref_spacing_actions;
                valueId       = PREF_SPACING_ACTIONS_WIDTH_VALUE;
                itemsArrayId  = Resource.Array.width_strings;
                valuesArrayId = Resource.Array.width_values;
                break;

            case PREF_SHOW_SHADOW:
                CheckBox viewValue = v.FindViewById <CheckBox>(PREF_SHOW_SHADOW_VALUE);
                bool     @checked  = !viewValue.Checked;
                viewValue.Checked = @checked;
                if (mSettingsChangedListener != null)
                {
                    mSettingsChangedListener.OnSettingChanged(id, @checked ? 1 : 0);
                }
                else if (DEBUG)
                {
                    System.Console.WriteLine("OnSettingsChangedListener is not set");
                }
                return;

            case PREF_SHADOW_WIDTH:
                valueId       = PREF_SHADOW_WIDTH_VALUE;
                titleId       = Resource.String.pref_shadow_width;
                itemsArrayId  = Resource.Array.width_strings;
                valuesArrayId = Resource.Array.width_values;
                break;

            case PREF_FADE_TYPE:
                titleId       = Resource.String.pref_fade_type;
                valueId       = PREF_FADE_TYPE_VALUE;
                itemsArrayId  = Resource.Array.fade_types;
                valuesArrayId = Resource.Array.fade_types_values;
                break;

            case PREF_FADE_MAX_VALUE:
                titleId       = Resource.String.pref_fade_max_value;
                valueId       = PREF_FADE_MAX_VALUE_VALUE;
                itemsArrayId  = Resource.Array.fade_max_value_strings;
                valuesArrayId = Resource.Array.fade_max_value_values;
                break;

            case PREF_SWIPING_TYPE:
                titleId       = Resource.String.pref_swiping_type;
                valueId       = PREF_SWIPING_TYPE_VALUE;
                itemsArrayId  = Resource.Array.swiping_types;
                valuesArrayId = Resource.Array.swiping_types_values;
                break;

            case PREF_SWIPING_EDGE_WIDTH:
                valueId       = PREF_SWIPING_EDGE_WIDTH_VALUE;
                titleId       = Resource.String.pref_swiping_edge_width;
                itemsArrayId  = Resource.Array.width_strings;
                valuesArrayId = Resource.Array.width_values;
                break;

            case PREF_FLING_DURATION:
                titleId       = Resource.String.pref_other_fling_duration;
                valueId       = PREF_FLING_DURATION_VALUE;
                itemsArrayId  = Resource.Array.fling_duration_strings;
                valuesArrayId = Resource.Array.fling_duration_values;
                break;

            default:
                return;
            }

            Fragment prev = FragmentManager.FindFragmentByTag(ValueChooserDialogFragment.TAG);

            if (prev != null)
            {
                FragmentManager.BeginTransaction().Remove(prev).Commit();
            }

            ValueChooserDialogFragment fragment = ValueChooserDialogFragment.NewInstance(id, titleId, itemsArrayId);

            fragment.OnSettingsSelectedListener = new MyOnSettingSelectedListener(this, v, id, valueId, valuesArrayId);
            fragment.Show(FragmentManager, ValueChooserDialogFragment.TAG);
        }
Exemplo n.º 3
0
 public OnClickListenerAnonymousInnerClassHelper(ValueChooserDialogFragment outerInstance, int id)
 {
     this.OuterInstance = outerInstance;
     this.Id            = id;
 }