Android Open Source - misound Q A Element






From Project

Back to project page misound.

License

The source code is released under:

Apache License

If you think the Android project misound 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 com.xiaomi.mitv.soundbarapp.diagnosis.data;
/*from w  ww. ja  va2  s  .c  om*/
/**
 * Created by chenxuetong on 7/9/14.
 */
public abstract class QAElement{
    public static final String TYPE_CATEGORY = "category";
    public static final String TYPE_QUESTION = "question";
    public static final String TYPE_ANSWER = "answer";

    protected String mType;
    protected String mText;
    protected String[] mImagePath; //relative

    public String getType() { return mType; }
    public String getText() { return mText; }
    public void setText(String text) { this.mText = trim(text); }
    public String[] getImagePath() { return mImagePath; }
    public void setImagePath(String[] mImagePath) { this.mImagePath = mImagePath; }
    public boolean isCategory(){ return this instanceof Category; }
    public boolean isQuestion(){ return this instanceof Question; }
    public boolean isFix(){ return this instanceof Fix; }

    public static QAElement createCategory(String text) {
        QAElement e =  new Category();
        e.setText(text);
        return e;
    }

    public static QAElement createQuestion(String text) {
        QAElement e =  new Question();
        e.setText(text);
        return e;
    }

    public static QAElement createFix(String[] imgs) {
        QAElement e =  new Fix();
        e.setImagePath(imgs);
        return e;
    }

    @Override
    public boolean equals(Object o) {
        if(!(o instanceof QAElement)) return false;
        QAElement q = (QAElement)o;
        return mType.equals(q.mType) && mText.equals(q.mText);
    }

    public static class Category extends QAElement{
        Category(){mType = TYPE_CATEGORY;}
    }
    public static class Question extends QAElement{
        Question(){mType= TYPE_QUESTION;}
    }
    public static class Fix extends QAElement{
        Fix(){mType= TYPE_ANSWER;}
    }

    private String trim(String text){
        return text.trim()
                .replaceFirst("\n", "").replaceFirst("\n", "")
                .replaceFirst("\t", "");
    }
}




Java Source Code List

com.xiaomi.mitv.soundbar.DefaultMisoundDevice.java
com.xiaomi.mitv.soundbarapp.BarInfoUtils.java
com.xiaomi.mitv.soundbarapp.ConnectingActivity.java
com.xiaomi.mitv.soundbarapp.MainActivity2.java
com.xiaomi.mitv.soundbarapp.SoundBarApplication.java
com.xiaomi.mitv.soundbarapp.TestActivity.java
com.xiaomi.mitv.soundbarapp.TypefaceManager.java
com.xiaomi.mitv.soundbarapp.WrapperActivity.java
com.xiaomi.mitv.soundbarapp.diagnosis.DiagnosisFragment.java
com.xiaomi.mitv.soundbarapp.diagnosis.Engine.java
com.xiaomi.mitv.soundbarapp.diagnosis.ViewWrapper.java
com.xiaomi.mitv.soundbarapp.diagnosis.data.Entry.java
com.xiaomi.mitv.soundbarapp.diagnosis.data.Node.java
com.xiaomi.mitv.soundbarapp.diagnosis.data.OrderedList.java
com.xiaomi.mitv.soundbarapp.diagnosis.data.QAElement.java
com.xiaomi.mitv.soundbarapp.eq.EQManager.java
com.xiaomi.mitv.soundbarapp.eq.EQSettingsFragment.java
com.xiaomi.mitv.soundbarapp.eq.EQStyleResource.java
com.xiaomi.mitv.soundbarapp.eq.EQStyle.java
com.xiaomi.mitv.soundbarapp.eq.UserEQControlFragment.java
com.xiaomi.mitv.soundbarapp.faq.FaqDataStore.java
com.xiaomi.mitv.soundbarapp.faq.FaqFragment.java
com.xiaomi.mitv.soundbarapp.fragment.A2dpDlg.java
com.xiaomi.mitv.soundbarapp.fragment.BaseFragment.java
com.xiaomi.mitv.soundbarapp.fragment.FeedbackFragment.java
com.xiaomi.mitv.soundbarapp.fragment.MainEntryFragment.java
com.xiaomi.mitv.soundbarapp.fragment.PanelFragment.java
com.xiaomi.mitv.soundbarapp.fragment.SettingsFragment.java
com.xiaomi.mitv.soundbarapp.player.MediaButtonIntentReceiver.java
com.xiaomi.mitv.soundbarapp.player.MusicUtils.java
com.xiaomi.mitv.soundbarapp.player.PlayListFragment.java
com.xiaomi.mitv.soundbarapp.player.PlayerFragment.java
com.xiaomi.mitv.soundbarapp.player.PlayerService.java
com.xiaomi.mitv.soundbarapp.player.Player.java
com.xiaomi.mitv.soundbarapp.provider.DataProvider.java
com.xiaomi.mitv.soundbarapp.upgrade.FirmwareManager.java
com.xiaomi.mitv.soundbarapp.upgrade.FirmwareZipFile.java
com.xiaomi.mitv.soundbarapp.upgrade.UpdateActivity.java
com.xiaomi.mitv.soundbarapp.upgrade.UpgradeFragment.java
com.xiaomi.mitv.soundbarapp.upgrade.VersionSelectFragment.java
com.xiaomi.mitv.soundbarapp.util.ConfirmActivityDlg.java
com.xiaomi.mitv.soundbarapp.util.Worker.java
com.xiaomi.mitv.widget.GainView.java
com.xiaomi.mitv.widget.GifView.java
com.xiaomi.mitv.widget.LetterIndexSilderBar.java
com.xiaomi.mitv.widget.MiSwitch.java
com.xiaomi.mitv.widget.RoundAnimationView.java
com.xiaomi.mitv.widget.RoundProgressBar.java
com.xiaomi.mitv.widget.RoundSeekBar.java