Exemplo n.º 1
0
 protected override void OnElementChanged(ElementChangedEventArgs <Entry> e)
 {
     base.OnElementChanged(e);
     //Control?.SetBackgroundColor(Android.Graphics.Color.Transparent);
     Android.Graphics.Typeface tf = global::Android.Graphics.Typeface.CreateFromAsset(Context.Assets, "HelveticaNeueMed.ttf");
     Control?.SetTypeface(tf, Android.Graphics.TypefaceStyle.Normal);
     Control?.SetTextSize(Android.Util.ComplexUnitType.Sp, 16);
     Control.SetHintTextColor(ColorStateList.ValueOf(global::Android.Graphics.Color.ParseColor(Globals.TEXT_GRAY)));
 }
Exemplo n.º 2
0
 protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
 {
     if (args.PropertyName == CustomFontEffect.FontFileNameProperty.PropertyName)
     {
         //Android.Graphics.Typeface font = Android.Graphics.Typeface.CreateFromAsset(Forms.Context.ApplicationContext.Assets, "Fonts/" + CustomFontEffect.GetFontFileName(Element) + ".ttf");
         string fontPath = "Fonts/" + CustomFontEffect.GetFontFileName(Element) + ".ttf";
         Android.Graphics.Typeface font = Android.Graphics.Typeface.CreateFromAsset(context.Assets, fontPath);
         textViewControl.Typeface = font;
     }
 }
Exemplo n.º 3
0
 public virtual Com.Zhy.Adapter.Abslistview.ViewHolder SetTypeface(Android.Graphics.Typeface
                                                                   typeface, params int[] viewIds)
 {
     foreach (int viewId in viewIds)
     {
         Android.Widget.TextView view = GetView <TextView>(viewId);
         view.Typeface   = typeface;
         view.PaintFlags = (view.PaintFlags | Android.Graphics.PaintFlags.SubpixelText);
     }
     return(this);
 }
Exemplo n.º 4
0
        protected void Init(Texture pTexture, Typeface pTypeface, float pSize, bool pAntiAlias, int pColor, float pStrokeWidth, int pStrokeColor, bool pStrokeOnly)
        {
            this.mStrokePaint = new Paint();
            this.mStrokePaint.SetTypeface(pTypeface);
            this.mStrokePaint.SetStyle(Style.Stroke);
            this.mStrokePaint.StrokeWidth = pStrokeWidth;
            this.mStrokePaint.Color       = pStrokeColor;
            this.mStrokePaint.TextSize    = pSize;
            this.mStrokePaint.AntiAlias   = pAntiAlias;

            this.mStrokeOnly = pStrokeOnly;
        }
 public Android.Graphics.Typeface GetTypeface(Android.Content.Context context)
 {
     if (_typeface == null)
     {
         try
         {
             _typeface = Android.Graphics.Typeface.CreateFromAsset(context.Assets, "fonts/" + TtfFile);
         }
         catch (Exception e)
         {
             Log.Error("Iconics", "Failed to load font from Assets: " + e.Message);
         }
     }
     return(_typeface);
 }
Exemplo n.º 6
0
        protected override void OnAttached()
        {
            try
            {
                //Xamarin.Forms.PlatformEffect<TContainer, TControl> : Control
                textViewControl = Control as TextView;
                //Xamarin.Forms.Effect : Element
                string fontPath = "Fonts/" + CustomFontEffect.GetFontFileName(Element) + ".ttf";

                //Typeface font = Typeface.CreateFromAsset(Forms.Context.Assets, fontPath);
                Android.Graphics.Typeface font = Android.Graphics.Typeface.CreateFromAsset(context.Assets, fontPath);
                textViewControl.Typeface = font;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Cannot set property on attached control. Error: ", ex.Message);
            }
        }
Exemplo n.º 7
0
 public static StrokeFont CreateStroke(Texture pTexture, Typeface pTypeface, float pSize, bool pAntiAlias, int pColor, int pStrokeWidth, int pStrokeColor, bool pStrokeOnly)
 {
     return(new StrokeFont(pTexture, pTypeface, pSize, pAntiAlias, pColor, pStrokeWidth, pStrokeColor, pStrokeOnly));
 }
Exemplo n.º 8
0
        // ===========================================================
        // Methods for/from SuperClass/Interfaces
        // ===========================================================

        // ===========================================================
        // Methods
        // ===========================================================

        public static Font Create(Texture pTexture, Typeface pTypeface, float pSize, bool pAntiAlias, int pColor)
        {
            return(new Font(pTexture, pTypeface, pSize, pAntiAlias, pColor));
        }
 public Android.Graphics.Typeface GetTypeface(Android.Content.Context context)
 {
     if (_typeface == null)
       {
     try
     {
       _typeface = Android.Graphics.Typeface.CreateFromAsset(context.Assets, "fonts/" + TtfFile);
     }
     catch (Exception e)
     {
       Log.Error("Iconics", "Failed to load font from Assets: " + e.Message);
     }
       }
       return _typeface;
 }
Exemplo n.º 10
0
        protected virtual BottomSheetDialog CreateMoreBottomSheet(Action <ShellSection, BottomSheetDialog> selectCallback)
        {
            var bottomSheetDialog = new BottomSheetDialog(Context);
            var bottomSheetLayout = new LinearLayout(Context);

            using (var bottomShellLP = new LP(LP.MatchParent, LP.WrapContent))
                bottomSheetLayout.LayoutParameters = bottomShellLP;
            bottomSheetLayout.Orientation = Orientation.Vertical;
            // handle the more tab
            for (int i = 4; i < ShellItem.Items.Count; i++)
            {
                var shellContent = ShellItem.Items[i];

                using (var innerLayout = new LinearLayout(Context))
                {
                    innerLayout.ClipToOutline = true;
                    innerLayout.SetBackground(CreateItemBackgroundDrawable());
                    innerLayout.SetPadding(0, (int)Context.ToPixels(6), 0, (int)Context.ToPixels(6));
                    innerLayout.Orientation = Orientation.Horizontal;
                    using (var param = new LP(LP.MatchParent, LP.WrapContent))
                        innerLayout.LayoutParameters = param;

                    // technically the unhook isn't needed
                    // we dont even unhook the events that dont fire
                    void clickCallback(object s, EventArgs e)
                    {
                        selectCallback(shellContent, bottomSheetDialog);
                        innerLayout.Click -= clickCallback;
                    }

                    innerLayout.Click += clickCallback;

                    var image = new ImageView(Context);
                    var lp    = new LinearLayout.LayoutParams((int)Context.ToPixels(32), (int)Context.ToPixels(32))
                    {
                        LeftMargin   = (int)Context.ToPixels(20),
                        RightMargin  = (int)Context.ToPixels(20),
                        TopMargin    = (int)Context.ToPixels(6),
                        BottomMargin = (int)Context.ToPixels(6),
                        Gravity      = GravityFlags.Center
                    };
                    image.LayoutParameters = lp;
                    lp.Dispose();

                    image.ImageTintList = ColorStateList.ValueOf(Color.Black.MultiplyAlpha(0.6).ToAndroid());
                    SetImage(image, shellContent.Icon);

                    innerLayout.AddView(image);

                    using (var text = new TextView(Context))
                    {
                        text.SetTypeface(Typeface.Create("sans-serif-medium", TypefaceStyle.Normal), TypefaceStyle.Normal);
                        text.SetTextColor(AColor.Black);
                        text.Text = shellContent.Title;
                        lp        = new LinearLayout.LayoutParams(0, LP.WrapContent)
                        {
                            Gravity = GravityFlags.Center,
                            Weight  = 1
                        };
                        text.LayoutParameters = lp;
                        lp.Dispose();

                        innerLayout.AddView(text);
                    }

                    bottomSheetLayout.AddView(innerLayout);
                }
            }

            bottomSheetDialog.SetContentView(bottomSheetLayout);
            bottomSheetLayout.Dispose();

            return(bottomSheetDialog);
        }
Exemplo n.º 11
0
 private void setTypeFace()
 {
     Android.Graphics.Typeface tf = global::Android.Graphics.Typeface.CreateFromAsset(Context.Assets, "fonts/bpg_arial.ttf");
     this.SetTypeface(tf, Android.Graphics.TypefaceStyle.Normal);
 }
Exemplo n.º 12
0
        public void initInterface()
        {
            bnve_normal                          = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_normal);
            bnve_no_animation                    = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_animation);
            bnve_no_shifting_mode                = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_shifting_mode);
            bnve_no_item_shifting_mode           = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_item_shifting_mode);
            bnve_no_text                         = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_text);
            bnve_no_icon                         = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_icon);
            bnve_no_animation_shifting_mode      = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_animation_shifting_mode);
            bnve_no_animation_item_shifting_mode = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_animation_item_shifting_mode);
            bnve_no_animation_shifting_mode_item_shifting_mode      = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_animation_shifting_mode_item_shifting_mode);
            bnve_no_shifting_mode_item_shifting_mode_text           = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_shifting_mode_item_shifting_mode_text);
            bnve_no_animation_shifting_mode_item_shifting_mode_text = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_animation_shifting_mode_item_shifting_mode_text);
            bnve_no_shifting_mode_item_shifting_mode_and_icon       = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_shifting_mode_item_shifting_mode_and_icon);
            bnve_no_item_shifting_mode_icon = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_item_shifting_mode_icon);
            bnve_no_animation_shifting_mode_item_shifting_mode_icon = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_no_animation_shifting_mode_item_shifting_mode_icon);
            bnve_with_padding     = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_with_padding);
            bnve_center_icon_only = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_center_icon_only);
            bnve_smaller_text     = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_smaller_text);
            bnve_bigger_icon      = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_bigger_icon);
            bnve_custom_typeface  = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_custom_typeface);
            bnve_icon_selector    = (BottomNavigationViewEx)FindViewById(Resource.Id.bnve_icon_selector);

            //no animation
            bnve_no_animation.EnableAnimation(false);

            //no shifting mode
            bnve_no_shifting_mode.EnableShiftingMode(false);

            //no item shifting mode
            bnve_no_item_shifting_mode.EnableItemShiftingMode(false);

            //bnve no text
            bnve_no_text.SetTextVisibility(false);

            //bnve no icon
            bnve_no_icon.SetIconVisibility(false);

            //bnve no animation shifting mode
            bnve_no_animation_shifting_mode.EnableAnimation(false);
            bnve_no_animation_shifting_mode.EnableShiftingMode(false);

            //bnve_no_animation_item_shifting_mode
            bnve_no_animation_shifting_mode_item_shifting_mode.EnableAnimation(false);
            bnve_no_animation_shifting_mode_item_shifting_mode.EnableItemShiftingMode(false);

            //bnve_no_animation_shifting_mode_item_shifting_mode
            bnve_no_animation_shifting_mode_item_shifting_mode.EnableAnimation(false);
            bnve_no_animation_shifting_mode_item_shifting_mode.EnableShiftingMode(false);
            bnve_no_animation_shifting_mode_item_shifting_mode.EnableItemShiftingMode(false);

            //bnve_no_shifting_mode_item_shifting_mode_text
            bnve_no_shifting_mode_item_shifting_mode_text.EnableItemShiftingMode(false);
            bnve_no_shifting_mode_item_shifting_mode_text.EnableShiftingMode(false);
            bnve_no_shifting_mode_item_shifting_mode_text.SetTextVisibility(false);

            //bnve_no_animation_shifting_mode_item_shifting_mode_text
            bnve_no_animation_shifting_mode_item_shifting_mode_text.EnableAnimation(false);
            bnve_no_animation_shifting_mode_item_shifting_mode_text.EnableShiftingMode(false);
            bnve_no_animation_shifting_mode_item_shifting_mode_text.EnableItemShiftingMode(false);

            //bnve_no_shifting_mode_item_shifting_mode_and_icon
            bnve_no_shifting_mode_item_shifting_mode_and_icon.EnableItemShiftingMode(false);
            bnve_no_shifting_mode_item_shifting_mode_and_icon.EnableShiftingMode(false);
            bnve_no_shifting_mode_item_shifting_mode_and_icon.SetIconVisibility(false);

            //bnve_no_item_shifting_mode_icon
            bnve_no_item_shifting_mode_icon.EnableItemShiftingMode(false);
            bnve_no_item_shifting_mode_icon.SetIconVisibility(false);

            //bnve_no_animation_shifting_mode_item_shifting_mode_icon
            bnve_no_animation_shifting_mode_item_shifting_mode_icon.EnableAnimation(false);
            bnve_no_animation_shifting_mode_item_shifting_mode_icon.EnableItemShiftingMode(false);
            bnve_no_animation_shifting_mode_item_shifting_mode_icon.EnableShiftingMode(false);
            bnve_no_animation_shifting_mode_item_shifting_mode_icon.SetIconVisibility(false);

            //bnve_with_padding
            bnve_with_padding.SetPadding(8, 8, 8, 8);

            //bnve_center_icon_only

            //bnve_smaller_text
            bnve_smaller_text.SetTextSize(10);

            //bnve_bigger_icon
            bnve_bigger_icon.SetIconSize(48, 48);
            bnve_bigger_icon.SetTextVisibility(false);

            //bnve_custom_typeface
            Android.Graphics.Typeface typeface = Android.Graphics.Typeface.CreateFromAsset(this.Assets, "fonts/JOKERMAN.TTF");
            bnve_custom_typeface.SetTypeface(typeface);

            //bnve_icon_selector
        }
Exemplo n.º 13
0
        public void Startup()
        {
            /*** NEW PLAYER ***/
            _player = ExoPlayerFactory.NewSimpleInstance(Context, new DefaultTrackSelector());
            _player.PlayWhenReady = true;
            _player.AddListener(this);

            progress?.Dispose();
            clipper?.Dispose();

            progress = new ProgressTracker(_player);
            progress.OnPositionChange += Progress_OnPositionChange;
            clipper = new ProgressTracker(_player, 50);
            clipper.OnPositionChange += Clipper_OnPositionChange;

            _playerView = FindViewById <PlayerView>(Resource.Id.videoview);

            Android.Graphics.Typeface subtitleTypeface = ResourcesCompat.GetFont(Context, Resource.Font.montserratregular);

            var captionStyleCompat = new CaptionStyleCompat(Android.Graphics.Color.White, Android.Graphics.Color.Transparent, Android.Graphics.Color.Transparent, CaptionStyleCompat.EdgeTypeNone, Android.Graphics.Color.Transparent, subtitleTypeface);

            _playerView.SubtitleView.SetStyle(captionStyleCompat);
            _playerView.SubtitleView.SetFractionalTextSize(0.06f);
            //_playerView.SubtitleView.SetFixedTextSize((int)ComplexUnitType.Sp, 10);

            _playerView.SubtitleView.SetBottomPaddingFraction(0.4f);
            _playerView.SubtitleView.TextAlignment = TextAlignment.Center;


            _playerView.Player        = _player;
            _playerView.UseController = true;

            webclient = new OkHttpClient.Builder()
                        .Cache((Context.ApplicationContext as BootleggerApp).FilesCache)
                        .Build();
            httpDataSourceFactory    = new OkHttpDataSourceFactory(webclient, "BootleggerEditor", null);
            extractorsFactory        = new DefaultExtractorsFactory();
            defaultDataSourceFactory = new DefaultDataSourceFactory(Context, "BootleggerEditor");
            /*************/

            _audioPlayer            = ExoPlayerFactory.NewSimpleInstance(Context, new DefaultTrackSelector());
            _audioPlayer.Volume     = 0.4f;
            _audioPlayer.RepeatMode = Player.RepeatModeOne;

            cursor                       = FindViewById <View>(Resource.Id.trackposition);
            seeker                       = FindViewById <RangeSliderControl>(Resource.Id.seeker);
            trackcontrols                = FindViewById <View>(Resource.Id.trackcontrols);
            seeker.LowerValueChanged    += Seeker_LeftValueChanged;
            seeker.UpperValueChanged    += Seeker_RightValueChanged;
            seeker.StepValueContinuously = true;
            track = FindViewById <View>(Resource.Id.track);

            title = FindViewById <TextView>(Resource.Id.title);

            FindViewById <ImageButton>(Resource.Id.fullscreenbtn).Click += Fullscreen_Click;

            videoWrapper = FindViewById(Resource.Id.videoWrapper);

            mFullScreenDialog = new FullScreenVideoDialog(Context, Android.Resource.Style.ThemeBlackNoTitleBarFullScreen);
            mFullScreenDialog.OnAboutToClose += MFullScreenDialog_OnAboutToClose;

            seeker.Visibility = ViewStates.Invisible;
        }
Exemplo n.º 14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.WorkLayout);

            // View elements
            var saveImageButton = FindViewById <ImageButton>(Resource.Id.SaveWorkImageButton);

            titleEditText     = FindViewById <EditText>(Resource.Id.TitleEditText);
            syllabelsTextView = FindViewById <TextView>(Resource.Id.SyllablesCountTextView);
            workEditText      = FindViewById <EditText>(Resource.Id.WorkEditText);

            findSynonymsButton = FindViewById <Button>(Resource.Id.FindSynonymsButton);
            findRhymesButton   = FindViewById <Button>(Resource.Id.FindRhymesButton);

            searchButton          = FindViewById <Button>(Resource.Id.SearchButton);
            searchEditText        = FindViewById <SearchView>(Resource.Id.SearchEditText);
            searchingLinearLayout = FindViewById <LinearLayout>(Resource.Id.SearchingLinearLayout);

            numberPickersLinearLayout = FindViewById <LinearLayout>(Resource.Id.NumberPickersLinearLayout);

            var matchingNumberTextView       = FindViewById <TextView>(Resource.Id.MatchingNumberTextView);
            var matchingNumberDecreaseButton = FindViewById <Button>(Resource.Id.MatchingNumberDecreaseButton);
            var matchingNumberIncreaseButton = FindViewById <Button>(Resource.Id.MatchingNumberIncreaseButton);

            var lengthNumberTextView       = FindViewById <TextView>(Resource.Id.LengthNumberTextView);
            var lengthNumberDecreaseButton = FindViewById <Button>(Resource.Id.LengthNumberDecreaseButton);
            var lengthNumberIncreaseButton = FindViewById <Button>(Resource.Id.LengthNumberIncreaseButton);

            var syllablesNumberTextView       = FindViewById <TextView>(Resource.Id.SyllablesNumberTextView);
            var syllablesNumberDecreaseButton = FindViewById <Button>(Resource.Id.SyllablesNumberDecreaseButton);
            var syllablesNumberIncreaseButton = FindViewById <Button>(Resource.Id.SyllablesNumberIncreaseButton);


            syllabelsTextView.Visibility = ViewStates.Gone;
            findSynonymsButton.Click    += FindSynonymsButton_Click;
            typeface = findSynonymsButton.Typeface;
            workEditText.TextChanged += WorkEditText_TextChanged;
            findRhymesButton.Click   += FindRhymesButton_Click;

            //matching number picker
            {
                matchingNumberDecreaseButton.Click += (o, e) => //decreasing number of matching letters
                {
                    if (matchingNumberTextView.Text != "1")
                    {
                        matchingNumberTextView.Text = (Convert.ToInt32(matchingNumberTextView.Text) - 1).ToString();
                    }
                };
                matchingNumberDecreaseButton.LongClick += (o, e) => // fast decreasing
                {
                    matchingNumberTextView.Text = "1";
                };
                matchingNumberIncreaseButton.Click += (o, e) => //increasing number of matching letters
                {
                    matchingNumberTextView.Text = (Convert.ToInt32(matchingNumberTextView.Text) + 1).ToString();
                };
            }

            //length number picker
            {
                lengthNumberDecreaseButton.Click += (o, e) => //decreasing number of words length
                {
                    if (lengthNumberTextView.Text != "1")
                    {
                        lengthNumberTextView.Text = (Convert.ToInt32(lengthNumberTextView.Text) - 1).ToString();
                    }
                };
                lengthNumberDecreaseButton.LongClick += (o, e) => // fast decreasing
                {
                    lengthNumberTextView.Text = "1";
                };
                lengthNumberIncreaseButton.Click += (o, e) => //increasing number of words length
                {
                    lengthNumberTextView.Text = (Convert.ToInt32(lengthNumberTextView.Text) + 1).ToString();
                };
            }

            //syllables number picker
            {
                syllablesNumberDecreaseButton.Click += (o, e) => //decreasing number of syllables
                {
                    if (syllablesNumberTextView.Text != "1")
                    {
                        syllablesNumberTextView.Text = (Convert.ToInt32(syllablesNumberTextView.Text) - 1).ToString();
                    }
                };
                syllablesNumberDecreaseButton.LongClick += (o, e) => // fast decreasing
                {
                    syllablesNumberTextView.Text = "1";
                };
                syllablesNumberIncreaseButton.Click += (o, e) => //increasing number of syllables
                {
                    syllablesNumberTextView.Text = (Convert.ToInt32(syllablesNumberTextView.Text) + 1).ToString();
                };
            }

            //search button clicked
            searchButton.Click += (o, e) =>
            {
                if (searchEditText.Query != "") // searching if not empty
                {
                    var progressBar = FindViewById <ProgressBar>(Resource.Id.SearchingContentLoadingProgressBar);
                    progressBar.Visibility = ViewStates.Visible;
                    var intent = new Intent(this, typeof(SearchActivity));
                    intent.PutExtra("KindOfSearching", toSearch);
                    intent.PutExtra("ToFind", searchEditText.Query);
                    if (toSearch == "Rhymes")
                    {
                        intent.PutExtra("MatchingNumber", Convert.ToInt32(matchingNumberTextView.Text));
                        intent.PutExtra("Length", Convert.ToInt32(lengthNumberTextView.Text));
                        intent.PutExtra("Syllables", Convert.ToInt32(syllablesNumberTextView.Text));
                        findRhymesButton.PerformClick();
                    }
                    else
                    {
                        findSynonymsButton.PerformClick();
                    }
                    StartActivityForResult(intent, 1);
                    progressBar = null;
                    intent      = null;
                }
            };

            //search button clicked on keayboard
            searchEditText.QueryTextSubmit += (o, e) =>
            {
                searchButton.PerformClick();
            };

            colors = findSynonymsButton.TextColors;                       //saving states of button text colors

            findSynonymsButton.SetTextColor(Android.Graphics.Color.Gray); //setting buttons text grey color
            findRhymesButton.SetTextColor(Android.Graphics.Color.Gray);

            // loading work if id was passed
            var choosenWorkId = Intent.GetIntExtra("choosenWork", 0);

            if (choosenWorkId != 0)
            {
                work = SQLiteDb.GetWorks().First(w => w.Id == choosenWorkId);
                workEditText.Text  = work.Text;
                titleEditText.Text = work.Title;
            }

            saveImageButton.Click += (o, e) => // saving work with save button
            {
                OnBackPressed();
            };
            CheckIfDataLoaded();
        }
Exemplo n.º 15
0
 public static StrokeFont CreateStrokeFromAsset(Texture pTexture, Context pContext, String pAssetPath, float pSize, bool pAntiAlias, int pColor, int pStrokeWidth, int pStrokeColor, bool pStrokeOnly)
 {
     // return new StrokeFont(pTexture, Typeface.CreateFromAsset(pContext.getAssets(), FontFactory.sAssetBasePath + pAssetPath), pSize, pAntiAlias, pColor, pStrokeWidth, pStrokeColor, pStrokeOnly);
     return(new StrokeFont(pTexture, Typeface.CreateFromAsset(pContext.Assets, FontFactory.sAssetBasePath + pAssetPath), pSize, pAntiAlias, pColor, pStrokeWidth, pStrokeColor, pStrokeOnly));
 }
 public override void OnTypefaceRetrieved(Android.Graphics.Typeface typeface)
 {
     mDownloadableFontTextView.Typeface = typeface;
     mProgressBar.Visibility            = Android.Views.ViewStates.Gone;
     mRequestDownloadButton.Enabled     = true;
 }
Exemplo n.º 17
0
        private void SetDrawerLayout()
        {
            mDrawerLayout = FindViewById <DrawerLayout>(Resource.Id.myDrawer);
            mLeftDrawer   = FindViewById <LinearLayout>(Resource.Id.leftListView);

            // Declate Text Views
            TextView txtTabNDName        = FindViewById <TextView>(Resource.Id.txtTabNDName);
            TextView txtTabNDCompanyName = FindViewById <TextView>(Resource.Id.txtTabNDCompanyName);
            TextView txtTabNDEmail       = FindViewById <TextView>(Resource.Id.txtTabNDEmail);
            TextView txtTabNDMobile      = FindViewById <TextView>(Resource.Id.txtTabNDMobile);
            TextView txtTabNDAddress     = FindViewById <TextView>(Resource.Id.txtTabNDAddress);

            txtTabNDEmail.SetOnKeyListener(null);

            // Declare Switches
            Switch swTabNDOptionsAlert           = FindViewById <Switch>(Resource.Id.swTabNDOptionsAlert);
            Switch swTabNDOptionsVibration       = FindViewById <Switch>(Resource.Id.swTabNDOptionsVibration);
            Switch swTabNDOptionsUploadOnWifi    = FindViewById <Switch>(Resource.Id.swTabNDOptionsUploadOnWifi);
            Switch swTabNDOptionsScanViaBlutooth = FindViewById <Switch>(Resource.Id.swTabNDOptionsScanViaBlutooth);

            // Set font face
            Android.Graphics.Typeface tf = Android.Graphics.Typeface.CreateFromAsset(Assets, "Fonts/ROBOTO-LIGHT.TTF");
            txtTabNDName.Typeface = tf;
            txtTabNDName.Invalidate();
            txtTabNDCompanyName.Typeface = tf;
            txtTabNDCompanyName.Invalidate();
            txtTabNDEmail.Typeface = tf;
            txtTabNDEmail.Invalidate();
            txtTabNDMobile.Typeface = tf;
            txtTabNDMobile.Invalidate();
            txtTabNDAddress.Typeface = tf;
            txtTabNDAddress.Invalidate();

            // Set As Last Input Field
            txtTabNDAddress.ImeOptions = Android.Views.InputMethods.ImeAction.Done;

            // Get Content In Drawer Layout
            DataTable dtProfile = PopulateProfile();

            if (dtProfile.Rows.Count > 0)
            {
                pdialog.Dismiss();
                txtTabNDName.Text                     = Convert.ToString(dtProfile.Rows[0]["Name"]);
                txtTabNDCompanyName.Text              = Convert.ToString(dtProfile.Rows[0]["Company"]);
                txtTabNDEmail.Text                    = Convert.ToString(dtProfile.Rows[0]["Email"]);
                txtTabNDMobile.Text                   = Convert.ToString(dtProfile.Rows[0]["Phone"]);
                txtTabNDAddress.Text                  = Convert.ToString(dtProfile.Rows[0]["Address"]);
                swTabNDOptionsAlert.Checked           = Convert.ToString(dtProfile.Rows[0]["Alert"]) == "0" ? false : true;
                swTabNDOptionsVibration.Checked       = Convert.ToString(dtProfile.Rows[0]["Vibrate"]) == "0" ? false : true;
                swTabNDOptionsUploadOnWifi.Checked    = Convert.ToString(dtProfile.Rows[0]["Wifi"]) == "0" ? false : true;
                swTabNDOptionsScanViaBlutooth.Checked = Convert.ToString(dtProfile.Rows[0]["Bluetooth"]) == "0" ? false : true;

                // Store Global Value
                prefs = PreferenceManager.GetDefaultSharedPreferences(this);
                ISharedPreferencesEditor editor = prefs.Edit();
                editor.PutInt("AlertVibrate", Convert.ToInt32(dtProfile.Rows[0]["Vibrate"]));
                editor.PutInt("AlertTone", Convert.ToInt32(dtProfile.Rows[0]["Alert"]));
                editor.PutInt("WifiUpload", Convert.ToInt32(dtProfile.Rows[0]["Wifi"]));
                editor.PutInt("Bluetooth", Convert.ToInt32(dtProfile.Rows[0]["Bluetooth"]));
                editor.Commit();
                editor.Apply();
            }
        }
Exemplo n.º 18
0
 public StrokeFont(Texture pTexture, Typeface pTypeface, float pSize, bool pAntiAlias, int pColor, float pStrokeWidth, int pStrokeColor, bool pStrokeOnly)
     : base(pTexture, pTypeface, pSize, pAntiAlias, pColor)
 {
     Init(pTexture, pTypeface, pSize, pAntiAlias, pColor, pStrokeWidth, pStrokeColor, pStrokeOnly);
 }