Example #1
0
        /// <summary>
        /// Fill controls values in card
        /// </summary>
        /// <param name="listViewHolder"></param>
        /// <param name="position"></param>
        private void OnListViewSetControls(ListViewAdapter.ListViewHolder listViewHolder, int position)
        {
            ListItemSong listItemSong = null;

            if (IsFolderButtonPressed)
            {
                listItemSong = SongFoldersList[position];
                string pathOnlyName = GetFolderNameFromPath(listItemSong.getSongPath());
                string fileName     = listItemSong.getSongName();

                listViewHolder.FirstLine.SetText(pathOnlyName, TextView.BufferType.Normal);
                listViewHolder.SecondLine.SetText(listItemSong.getArtist(), TextView.BufferType.Normal);
                listViewHolder.ThirdLine.SetText(listItemSong.getSongPath(), TextView.BufferType.Normal);
            }
            else
            {
                KeyValuePair <string, ListItemSong> songItem = ListItemsRecycler[position];
                listItemSong = songItem.Value;

                string songLenght = (listItemSong.getDuration() == "") ? listItemSong.getArtist() : listItemSong.getDuration();
                string songName   = listItemSong.getSongName();

                listViewHolder.FirstLine.SetText(songName, TextView.BufferType.Normal);
                listViewHolder.SecondLine.SetText(songLenght, TextView.BufferType.Normal);
                listViewHolder.ThirdLine.SetText(listItemSong.getSongPath(), TextView.BufferType.Normal);
            }
        }
Example #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;
        }