Runt
2022-05-15 75360a9fa2fcead8b516467d982c5cdf82c63263
app/src/main/java/com/auto/lyric/data/LyricServer.java
@@ -6,7 +6,6 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Iterator;
import java.util.List;
import java.util.TreeMap;
import java.util.regex.Matcher;
@@ -69,18 +68,22 @@
        // System.out.println("++++++++++++>>"+data);
        /*text = text.replace("[","");//将前面的替换成后面的
        text = text.replace("]","@");
        String splitdata[] = text.split("@");//分隔*/
        String splitdata[] = text.split("@");//分隔
        String regex = "(?<=\\])";
        Pattern compile = Pattern.compile(regex);
        String[] splitdata = compile.split(text,2);//分隔
        if(text.endsWith("]") || splitdata.length == 1){
            String str = text;
            str = str.replace("[","");
            str = str.replace("]","");
            str = str.replace(":",".");
            str = str.replace(".","@");
            String timedata[] =str.split("@");
        String[] splitdata = compile.split(text,2);//分隔*/
        int index = text.indexOf("]");
        String[] splitdata;
        if(text.length()-1 == index){
            splitdata = new String[]{text};
        }else{
            splitdata = new String[]{text.substring(0,index),text.substring(index+1)};
        }
        String tmpstr = splitdata[0].replace("[","").replace("]","");
        if(splitdata.length == 1){
            tmpstr = tmpstr.replace(":",".");
            tmpstr = tmpstr.replace(".","@");
            String timedata[] =tmpstr.split("@");
            Matcher matcher = pattern.matcher(timedata[0]);
            if(timedata.length==3 && matcher.matches()){
                int m = Integer.parseInt(timedata[0]);  //分
@@ -94,9 +97,6 @@
            }
        } else{
            String lrcContenet = splitdata[1];
            String tmpstr = splitdata[0];
            tmpstr = tmpstr.replace("[","");
            tmpstr = tmpstr.replace("]","");
            tmpstr = tmpstr.replace(":",".");
            tmpstr = tmpstr.replace(".","@");
            String timedata[] =tmpstr.split("@");
@@ -119,7 +119,6 @@
     */
    private static void initLrc(TreeMap<Integer, LyricObject> lrc_read){
        lrc_map.clear();
        Iterator<Integer> iterator = lrc_read.keySet().iterator();
        LyricObject oldval  = null;
        int i =0;
        for(Integer key : lrc_read.keySet()){
@@ -127,8 +126,7 @@
            if (oldval == null) {
                oldval = val;
            } else {
                LyricObject item1= new LyricObject();
                item1  = oldval;
                LyricObject item1 = oldval;
                item1.timeline = val.begintime-oldval.begintime;
                lrc_map.put(new Integer(i), item1);
                i++;