// Path: app/src/main/java/io/github/droidkaigi/confsched2017/model/SessionFeedback.java
// @Table
// public class SessionFeedback {
// 
//     @PrimaryKey(auto = false)
//     @Column(indexed = true)
//     @SerializedName("session_id")
//     public int sessionId;
// 
//     @Column
//     @SerializedName("session_title")
//     public String sessionTitle;
// 
//     @Column
//     @SerializedName("relevancy")
//     public int relevancy;
// 
//     @Column
//     @SerializedName("as_expected")
//     public int asExpected;
// 
//     @Column
//     @SerializedName("difficulty")
//     public int difficulty;
// 
//     @Column
//     @SerializedName("knowledgeable")
//     public int knowledgeable;
// 
//     @Column
//     @Nullable
//     @SerializedName("comment")
//     public String comment;
// 
//     @Column
//     @SerializedName("is_submitted")
//     public boolean isSubmitted;
// 
//     public SessionFeedback() {
// 
//     }
// 
//     public SessionFeedback(@NonNull Session session, int relevancy, int asExpected,
//             int difficulty, int knowledgeable, @Nullable String comment) {
//         this.sessionId = session.id;
//         this.sessionTitle = session.title;
//         this.relevancy = relevancy;
//         this.asExpected = asExpected;
//         this.difficulty = difficulty;
//         this.knowledgeable = knowledgeable;
//         this.comment = comment;
//     }
// 
//     public boolean isAllFilled() {
//         return sessionId > 0
//                 && sessionTitle != null
//                 && relevancy > 0
//                 && asExpected > 0
//                 && difficulty > 0
//                 && knowledgeable > 0;
//     }
// }


import com.sys1yagi.fragmentcreator.annotation.Args;
import com.sys1yagi.fragmentcreator.annotation.FragmentCreator;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import javax.inject.Inject;
import io.github.droidkaigi.confsched2017.R;
import io.github.droidkaigi.confsched2017.databinding.FragmentSessionFeedbackBinding;
import io.github.droidkaigi.confsched2017.model.SessionFeedback;
import io.github.droidkaigi.confsched2017.viewmodel.SessionFeedbackViewModel;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = FragmentSessionFeedbackBinding.inflate(inflater, container, false);
        binding.setViewModel(viewModel);
        return binding.getRoot();
    }

    @Override
    public void onDetach() {
        viewModel.destroy();
        super.onDetach();
    }

    @Override
    public void onSuccessSubmit() {
        showToast(R.string.session_feedback_submit_success);
    }

    @Override
    public void onErrorSubmit() {
        showToast(R.string.session_feedback_submit_failure);
    }

    @Override
    public void onErrorUnFilled() {
        showToast(R.string.session_feedback_error_not_filled);
    }

    @Override
// Path: app/src/main/java/io/github/droidkaigi/confsched2017/model/SessionFeedback.java
// @Table
// public class SessionFeedback {
// 
//     @PrimaryKey(auto = false)
//     @Column(indexed = true)
//     @SerializedName("session_id")
//     public int sessionId;
// 
//     @Column
//     @SerializedName("session_title")
//     public String sessionTitle;
// 
//     @Column
//     @SerializedName("relevancy")
//     public int relevancy;
// 
//     @Column
//     @SerializedName("as_expected")
//     public int asExpected;
// 
//     @Column
//     @SerializedName("difficulty")
//     public int difficulty;
// 
//     @Column
//     @SerializedName("knowledgeable")
//     public int knowledgeable;
// 
//     @Column
//     @Nullable
//     @SerializedName("comment")
//     public String comment;
// 
//     @Column
//     @SerializedName("is_submitted")
//     public boolean isSubmitted;
// 
//     public SessionFeedback() {
// 
//     }
// 
//     public SessionFeedback(@NonNull Session session, int relevancy, int asExpected,
//             int difficulty, int knowledgeable, @Nullable String comment) {
//         this.sessionId = session.id;
//         this.sessionTitle = session.title;
//         this.relevancy = relevancy;
//         this.asExpected = asExpected;
//         this.difficulty = difficulty;
//         this.knowledgeable = knowledgeable;
//         this.comment = comment;
//     }
// 
//     public boolean isAllFilled() {
//         return sessionId > 0
//                 && sessionTitle != null
//                 && relevancy > 0
//                 && asExpected > 0
//                 && difficulty > 0
//                 && knowledgeable > 0;
//     }
// }


// Path: app/src/main/java/io/github/droidkaigi/confsched2017/view/fragment/SessionFeedbackFragment.java
import com.sys1yagi.fragmentcreator.annotation.Args;
import com.sys1yagi.fragmentcreator.annotation.FragmentCreator;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import javax.inject.Inject;
import io.github.droidkaigi.confsched2017.R;
import io.github.droidkaigi.confsched2017.databinding.FragmentSessionFeedbackBinding;
import io.github.droidkaigi.confsched2017.model.SessionFeedback;
import io.github.droidkaigi.confsched2017.viewmodel.SessionFeedbackViewModel;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        binding = FragmentSessionFeedbackBinding.inflate(inflater, container, false);
        binding.setViewModel(viewModel);
        return binding.getRoot();
    }

    @Override
    public void onDetach() {
        viewModel.destroy();
        super.onDetach();
    }

    @Override
    public void onSuccessSubmit() {
        showToast(R.string.session_feedback_submit_success);
    }

    @Override
    public void onErrorSubmit() {
        showToast(R.string.session_feedback_submit_failure);
    }

    @Override
    public void onErrorUnFilled() {
        showToast(R.string.session_feedback_error_not_filled);
    }

    @Override
    public void onSessionFeedbackInitialized(@NonNull SessionFeedback sessionFeedback) {