java Anki Android#01

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java Anki Android#01相关的知识,希望对你有一定的参考价值。

public class AudioView extends LinearLayout {

    /**
     * @param context Resources for images
     * @param resPlay
     * @param resPause
     * @param resStop
     * @param audioPath
     * @return
     */
    public static AudioView createPlayerInstance(Context context, int resPlay, int resPause, int resStop,
            String audioPath) {
        return new AudioView(context, resPlay, resPause, resStop, audioPath);
    }


    public static AudioView createRecorderInstance(Context context, int resPlay, int resPause, int resStop,
            int resRecord, int resRecordStop, String audioPath) {
        return new AudioView(context, resPlay, resPause, resStop, resRecord, resRecordStop, audioPath);
    }


    private AudioView(Context context, int resPlay, int resPause, int resStop, String audioPath) {
        super(context);

        mContext = context;

        mResPlayImage = resPlay;
        mResPauseImage = resPause;
        mResStopImage = resStop;
        mAudioPath = audioPath;

        this.setOrientation(HORIZONTAL);

        mPlayPause = new PlayPauseButton(context);
        addView(mPlayPause, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

        mStop = new StopButton(context);
        addView(mStop, new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
    }

}

以上是关于java Anki Android#01的主要内容,如果未能解决你的问题,请参考以下文章

java Anki Android#02

java 189.旋转数组(#anki01).java

java 189.旋转数组(#anki01).java

java 189.旋转数组(#anki01).java

java 189.旋转数组(#anki01).java

java 189.旋转数组(#anki01).java