// Path: app/src/main/java/com/landtanin/studentattendancecheck/activity/AddModuleActivity.java
// public class AddModuleActivity extends AppCompatActivity {
// 
// //    ActivityAddModuleBinding b;
//     ActivityAddModuleBinding b;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         b = DataBindingUtil.setContentView(this, R.layout.activity_add_module);
// 
//         initInstance();
// 
//         if (savedInstanceState == null) {
// 
//             getSupportFragmentManager().beginTransaction()
//                     .add(R.id.addModuleFragmentContentContainer,
//                             FragmentAddModule.newInstance(),
//                             "AddModuleFragment")
//                     .commit();
// 
//         }
//         
//     }
// 
//     private void initInstance() {
// 
//         // **** toolbar
//         setSupportActionBar(b.addModuleActivityToolbar);
// 
//         // **** done button
//         b.btnDoneAddModule.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
// 
//                 Intent returnIntent = new Intent();
//                 returnIntent.putExtra("result", "test");
//                 setResult(RESULT_OK, returnIntent);
// 
//                 finish();
// 
//                 // TODO: Save selected item into local database
// 
//             }
//         });
// 
//     }
// 
// }


import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.Toast;
import com.landtanin.studentattendancecheck.R;
import com.landtanin.studentattendancecheck.activity.AddModuleActivity;
import com.landtanin.studentattendancecheck.databinding.FragmentMainBinding;
import static android.app.Activity.RESULT_OK;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init(savedInstanceState);

        if (savedInstanceState != null)
            onRestoreInstanceState(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        b = DataBindingUtil.inflate(inflater, R.layout.fragment_main, container, false);
        View rootView = b.getRoot();
        initInstances(rootView);
        return rootView;
    }

    @SuppressWarnings("UnusedParameters")
    private void init(Bundle savedInstanceState) {
        // Init Fragment level's variable(s) here
    }

    private void initInstances(View rootView) {
        // Init 'View' instance(s) with rootView.findViewById here
        b.plusSignImg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

// Path: app/src/main/java/com/landtanin/studentattendancecheck/activity/AddModuleActivity.java
// public class AddModuleActivity extends AppCompatActivity {
// 
// //    ActivityAddModuleBinding b;
//     ActivityAddModuleBinding b;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         b = DataBindingUtil.setContentView(this, R.layout.activity_add_module);
// 
//         initInstance();
// 
//         if (savedInstanceState == null) {
// 
//             getSupportFragmentManager().beginTransaction()
//                     .add(R.id.addModuleFragmentContentContainer,
//                             FragmentAddModule.newInstance(),
//                             "AddModuleFragment")
//                     .commit();
// 
//         }
//         
//     }
// 
//     private void initInstance() {
// 
//         // **** toolbar
//         setSupportActionBar(b.addModuleActivityToolbar);
// 
//         // **** done button
//         b.btnDoneAddModule.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
// 
//                 Intent returnIntent = new Intent();
//                 returnIntent.putExtra("result", "test");
//                 setResult(RESULT_OK, returnIntent);
// 
//                 finish();
// 
//                 // TODO: Save selected item into local database
// 
//             }
//         });
// 
//     }
// 
// }


// Path: app/src/main/java/com/landtanin/studentattendancecheck/fragment/MainFragment.java
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.Toast;
import com.landtanin.studentattendancecheck.R;
import com.landtanin.studentattendancecheck.activity.AddModuleActivity;
import com.landtanin.studentattendancecheck.databinding.FragmentMainBinding;
import static android.app.Activity.RESULT_OK;


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        init(savedInstanceState);

        if (savedInstanceState != null)
            onRestoreInstanceState(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        b = DataBindingUtil.inflate(inflater, R.layout.fragment_main, container, false);
        View rootView = b.getRoot();
        initInstances(rootView);
        return rootView;
    }

    @SuppressWarnings("UnusedParameters")
    private void init(Bundle savedInstanceState) {
        // Init Fragment level's variable(s) here
    }

    private void initInstances(View rootView) {
        // Init 'View' instance(s) with rootView.findViewById here
        b.plusSignImg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                Intent objIntent = new Intent(getContext(), AddModuleActivity.class);