Android Open Source - LyricHere Lyric






From Project

Back to project page LyricHere.

License

The source code is released under:

Apache License

If you think the Android project LyricHere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package cn.zhaiyifan.lyrichere.model;
//from   w  w  w .  ja v a 2 s  .co  m
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

public class Lyric {
    private static final String TAG = Lyric.class.getSimpleName();
    private String mTitle;
    private String mArtist;
    private String mAlbum;
    private String mBy;
    private String mAuthor;
    private int mOffset;
    private long mLength;
    private List<Sentence> mSentenceList = new ArrayList<Sentence>(100);

    public List<Sentence> getSentenceList() {
        return mSentenceList;
    }

    public void setSentenceList(List<Sentence> sentenceList) {
        this.mSentenceList = sentenceList;
    }

    public String toString() {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("Title: " + getTitle() + "\n");
        stringBuilder.append("Artist: " + getArtist() + "\n");
        stringBuilder.append("Album: " + getAlbum() + "\n");
        stringBuilder.append("By: " + getBy() + "\n");
        stringBuilder.append("Author: " + getAuthor() + "\n");
        stringBuilder.append("Length: " + mLength + "\n");
        stringBuilder.append("Offset: " + mOffset + "\n");
        if (mSentenceList != null) {
            for (Sentence sentence : mSentenceList) {
                stringBuilder.append(sentence.toString() + "\n");
            }
        }
        return stringBuilder.toString();
    }

    public int getOffset() {
        return this.mOffset;
    }

    public void setOffset(int offset) {
        this.mOffset = offset;
    }

    public void addOffset(int offset) {
        this.mOffset += offset;
    }

    public String getTitle() {
        return mTitle;
    }

    public void setTitle(String title) {
        this.mTitle = title;
    }

    public String getArtist() {
        return mArtist;
    }

    public void setArtist(String artist) {
        mArtist = artist;
    }

    public String getAlbum() {
        return mAlbum;
    }

    public void setAlbum(String album) {
        mAlbum = album;
    }

    public String getBy() {
        return mBy;
    }

    public void setBy(String by) {
        mBy = by;
    }

    public String getAuthor() {
        return mAuthor;
    }

    public void setAuthor(String author) {
        this.mAuthor = author;
    }

    public long getLength() {
        return mLength;
    }

    public void setLength(long length) {
        this.mLength = length;
    }

    public void addSentence(String content, long time) {
        mSentenceList.add(new Sentence(content, time));
    }

    public static class SentenceComparator implements Comparator<Sentence> {
        @Override
        public int compare(Sentence sent1, Sentence sent2) {
            return (int) (sent1.getFromTime() - sent2.getFromTime());
        }
    }

    public class Sentence {
        private String mContent;
        private long mFromTime;

        public Sentence(String content, long fromTime) {
            this.mContent = content;
            this.mFromTime = fromTime;
        }

        public String getContent() {
            return mContent;
        }

        public long getFromTime() {
            return mFromTime;
        }

        public String toString() {
            return String.valueOf(mFromTime) + ": " + mContent;
        }
    }
}




Java Source Code List

cn.zhaiyifan.lyrichere.ApplicationTest.java
cn.zhaiyifan.lyrichere.Constants.java
cn.zhaiyifan.lyrichere.MusicBroadcastReceiver.java
cn.zhaiyifan.lyrichere.adapters.LyricCursorAdapter.java
cn.zhaiyifan.lyrichere.db.DbHelper.java
cn.zhaiyifan.lyrichere.db.LyricContentProvider.java
cn.zhaiyifan.lyrichere.model.Lyric.java
cn.zhaiyifan.lyrichere.prefs.SettingsActivity.java
cn.zhaiyifan.lyrichere.prefs.SettingsFragment.java
cn.zhaiyifan.lyrichere.prefs.colorpicker.AlphaPatternDrawable.java
cn.zhaiyifan.lyrichere.prefs.colorpicker.ColorPickerDialog.java
cn.zhaiyifan.lyrichere.prefs.colorpicker.ColorPickerPanelView.java
cn.zhaiyifan.lyrichere.prefs.colorpicker.ColorPickerPreference.java
cn.zhaiyifan.lyrichere.prefs.colorpicker.ColorPickerView.java
cn.zhaiyifan.lyrichere.prefs.colorpicker.Test.java
cn.zhaiyifan.lyrichere.ui.AboutActivity.java
cn.zhaiyifan.lyrichere.ui.DownloadFragment.java
cn.zhaiyifan.lyrichere.ui.ListScrollTextView.java
cn.zhaiyifan.lyrichere.ui.LyricExplorerActivity.java
cn.zhaiyifan.lyrichere.ui.LyricExplorerFragment.java
cn.zhaiyifan.lyrichere.ui.LyricPlayerActivity.java
cn.zhaiyifan.lyrichere.ui.LyricPlayerFragment.java
cn.zhaiyifan.lyrichere.ui.LyricSearchView.java
cn.zhaiyifan.lyrichere.ui.LyricView.java
cn.zhaiyifan.lyrichere.utils.DbUtils.java
cn.zhaiyifan.lyrichere.utils.FileUtils.java
cn.zhaiyifan.lyrichere.utils.LyricCache.java
cn.zhaiyifan.lyrichere.utils.LyricProvider.java
cn.zhaiyifan.lyrichere.utils.LyricUtils.java
cn.zhaiyifan.lyrichere.utils.Util.java
cn.zhaiyifan.lyrichere.workers.Finder.java
cn.zhaiyifan.lyrichere.workers.LyricEncodingUpdater.java
cn.zhaiyifan.lyrichere.workers.LyricLastVisitUpdater.java
cn.zhaiyifan.lyrichere.workers.LyricOpener.java