Пример #1
0
        public void onNumberClick(View v)
        {
            Button button = (Button)v;

            // Append the text to account for however many numbers the user presses.
            currentNumber += button.Text;
            calculatorTextview.Append(button.Text);

            // Auto scroll the view so the text being typed stays on screen.
            horizontalScrollView.FullScroll(FocusSearchDirection.Right);

            lastKeyPressed = KeyPressed.Number;
        }
Пример #2
0
        /// <summary>
        /// Set the Song props - Name, Artist, Album, Duration
        /// </summary>
        /// <param name="listPositionIndex"></param>
        private void SetSongControls(int listPositionIndex)
        {
            ListItemSong item = ListItemsRecycler[listPositionIndex].Value;

            if (mediaPlayer != null)
            {
                SimpleDateFormat dateFormat = new SimpleDateFormat("mm:ss");
                item.setDuration(dateFormat.Format(new Date(mediaPlayer.Duration)));
            }

            lblSongName.Text = item.getSongName();
            ScrollSongName.SCROLL_END_POINT = lblSongName.Text.Length * 9;
            lblSongArtist.Text = item.getArtist();
            lblAlbum.Text      = GetFolderNameFromPath(item.getSongPath());

            //ScrollSongName.StartPosstion();


            if (lblSongName.Text.Length > SONG_NAME_CHARS_LENGTH_TO_SCROLL)
            {
                scrHorizonSongName.FullScroll(FocusSearchDirection.Right);
                ScrollSongName.Start();
            }
            else
            {
                scrHorizonSongName.FullScroll(FocusSearchDirection.Right);
            }

            UpdateProgressControls();



            //Drawable drawable;
            //Bitmap bitmap;
            //if (item.getPicsToSongPathsArray().size() > 0)
            //{
            //    bitmap = ConvertPictureFileToDrawable(item.getPicsToSongPathsArray().get(0));
            //    imgSongArtist1.setImageBitmap(bitmap);
            //}
            //else
            //{
            //    imgSongArtist1.setImageDrawable(getDrawable(R.drawable.default1));
            //}

            //MainActivity.FadeInPicture(getApplicationContext(), imgSongArtist1, 1);

            //if (item.getPicsToSongPathsArray().size() > 1)
            //{
            //    bitmap = ConvertPictureFileToDrawable(item.getPicsToSongPathsArray().get(1));
            //    imgSongArtist2.setImageBitmap(bitmap);
            //}
            //else
            //{
            //    imgSongArtist2.setImageDrawable(getDrawable(R.drawable.default2));
            //}


            //if (item.getPicsToSongPathsArray().size() > 2)
            //{
            //    bitmap = ConvertPictureFileToDrawable(item.getPicsToSongPathsArray().get(2));
            //    imgSongArtist2.setImageBitmap(bitmap);
            //}
            //else
            //{
            //    imgSongArtist3.setImageDrawable(getDrawable(R.drawable.default3));
            //}

            //keepX = 0;
        }