// Path: app/src/main/java/com/paulds/simpleftp/presentation/activities/ListServerActivity.java
// public class ListServerActivity extends AppCompatActivity {
// 
//     public static final int KEY_EDIT_SERVER = 199;
// 
//     /**
//      * The activity binding.
//      */
//     ActivityListServerBinding binding;
// 
//     /**
//      * The current view model.
//      */
//     ListServerViewModel viewModel;
// 
//     /**
//      * Method called at activity creation.
//      * @param savedInstanceState The saved instance state.
//      */
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         binding = DataBindingUtil.setContentView(this, R.layout.activity_list_server);
//         viewModel = new ListServerViewModel(this);
//         binding.setModel(viewModel);
//         binding.ListServerRecyclerView.setLayoutManager(new LinearLayoutManager(this));
//     }
// 
//     /**
//      * Method called when resuming activity.
//      */
//     @Override
//     protected void onResume() {
//         super.onResume();
// 
//         this.viewModel.updateList();
//     }
// 
//     @Override
//     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//         if (requestCode == KEY_EDIT_SERVER) {
//             if(resultCode == Activity.RESULT_OK){
//                 this.viewModel.selectedServerVisible.set(false);
//             }
//         }
//     }
// 
//     /**
//      * Method called when the back button is pressed.
//      */
//     @Override
//     public void onBackPressed() {
//         if(viewModel.selectedServerVisible.get()) {
//             viewModel.closeServer(null);
//         }
//         else {
//             super.onBackPressed();
//         }
//     }
// }


import android.content.Context;
import android.content.Intent;
import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.databinding.ObservableArrayList;
import android.view.View;
import com.paulds.simpleftp.presentation.activities.ListServerActivity;
package com.paulds.simpleftp.presentation.model;



/**
 * The view model for the main activity.
 *
 * @author Paul-DS
 */
public class MainViewModel extends BaseObservable {
    /**
     * The activity context.
     */
    private Context context;

    /**
     * Default constructor.
     * @param context The context of the current activity.
     */
    public MainViewModel(Context context) {
        this.context = context;
    }

    /**
     * Open the server list activity.
     * @param view The current view
     */
    public void openParameters(View view) {
// Path: app/src/main/java/com/paulds/simpleftp/presentation/activities/ListServerActivity.java
// public class ListServerActivity extends AppCompatActivity {
// 
//     public static final int KEY_EDIT_SERVER = 199;
// 
//     /**
//      * The activity binding.
//      */
//     ActivityListServerBinding binding;
// 
//     /**
//      * The current view model.
//      */
//     ListServerViewModel viewModel;
// 
//     /**
//      * Method called at activity creation.
//      * @param savedInstanceState The saved instance state.
//      */
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         binding = DataBindingUtil.setContentView(this, R.layout.activity_list_server);
//         viewModel = new ListServerViewModel(this);
//         binding.setModel(viewModel);
//         binding.ListServerRecyclerView.setLayoutManager(new LinearLayoutManager(this));
//     }
// 
//     /**
//      * Method called when resuming activity.
//      */
//     @Override
//     protected void onResume() {
//         super.onResume();
// 
//         this.viewModel.updateList();
//     }
// 
//     @Override
//     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//         if (requestCode == KEY_EDIT_SERVER) {
//             if(resultCode == Activity.RESULT_OK){
//                 this.viewModel.selectedServerVisible.set(false);
//             }
//         }
//     }
// 
//     /**
//      * Method called when the back button is pressed.
//      */
//     @Override
//     public void onBackPressed() {
//         if(viewModel.selectedServerVisible.get()) {
//             viewModel.closeServer(null);
//         }
//         else {
//             super.onBackPressed();
//         }
//     }
// }


// Path: app/src/main/java/com/paulds/simpleftp/presentation/model/MainViewModel.java
import android.content.Context;
import android.content.Intent;
import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.databinding.ObservableArrayList;
import android.view.View;
import com.paulds.simpleftp.presentation.activities.ListServerActivity;

package com.paulds.simpleftp.presentation.model;



/**
 * The view model for the main activity.
 *
 * @author Paul-DS
 */
public class MainViewModel extends BaseObservable {
    /**
     * The activity context.
     */
    private Context context;

    /**
     * Default constructor.
     * @param context The context of the current activity.
     */
    public MainViewModel(Context context) {
        this.context = context;
    }

    /**
     * Open the server list activity.
     * @param view The current view
     */
    public void openParameters(View view) {
        Intent intent = new Intent(context, ListServerActivity.class);