// Path: robota/src/main/java/com/uphyca/robota/InjectionUtils.java
// public abstract class InjectionUtils {
// 
//     private InjectionUtils() {
//     }
// 
//     public static ObjectGraph getObjectGraph(Context context) {
//         return RobotaApplication.class.cast(context.getApplicationContext())
//                                        .getObjectGraph();
//     }
// }
// 
// Path: robota/src/main/java/com/uphyca/robota/data/prefs/BooleanPreference.java
// public class BooleanPreference {
// 
//     private final SharedPreferences mSharedPreferences;
//     private final String mKey;
//     private final boolean mDefaultValue;
// 
//     public BooleanPreference(SharedPreferences sharedPreferences, String key) {
//         this(sharedPreferences, key, false);
//     }
// 
//     public BooleanPreference(SharedPreferences sharedPreferences, String key, boolean defaultValue) {
//         mSharedPreferences = sharedPreferences;
//         mKey = key;
//         mDefaultValue = defaultValue;
//     }
// 
//     public boolean get() {
//         return mSharedPreferences.getBoolean(mKey, mDefaultValue);
//     }
// 
//     public boolean isSet() {
//         return mSharedPreferences.contains(mKey);
//     }
// 
//     public void set(boolean value) {
//         mSharedPreferences.edit()
//                           .putBoolean(mKey, value)
//                           .apply();
//     }
// 
//     public void delete() {
//         mSharedPreferences.edit()
//                           .remove(mKey)
//                           .apply();
//     }
// }
// 
// Path: robota/src/main/java/com/uphyca/robota/data/prefs/StringPreference.java
// public class StringPreference {
// 
//     private final SharedPreferences mSharedPreferences;
//     private final String mKey;
//     private final String mDefaultValue;
// 
//     public StringPreference(SharedPreferences sharedPreferences, String key) {
//         this(sharedPreferences, key, null);
//     }
// 
//     public StringPreference(SharedPreferences sharedPreferences, String key, String defaultValue) {
//         mSharedPreferences = sharedPreferences;
//         mKey = key;
//         mDefaultValue = defaultValue;
//     }
// 
//     public String get() {
//         return mSharedPreferences.getString(mKey, mDefaultValue);
//     }
// 
//     public boolean isSet() {
//         return mSharedPreferences.contains(mKey);
//     }
// 
//     public void set(String value) {
//         mSharedPreferences.edit()
//                           .putString(mKey, value)
//                           .apply();
//     }
// 
//     public void delete() {
//         mSharedPreferences.edit()
//                           .remove(mKey)
//                           .apply();
//     }
// }


import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.uphyca.idobata.Idobata;
import com.uphyca.idobata.IdobataError;
import com.uphyca.idobata.model.Seed;
import com.uphyca.robota.InjectionUtils;
import com.uphyca.robota.R;
import com.uphyca.robota.data.api.ApiToken;
import com.uphyca.robota.data.api.Enabled;
import com.uphyca.robota.data.api.Main;
import com.uphyca.robota.data.api.Networking;
import com.uphyca.robota.data.prefs.BooleanPreference;
import com.uphyca.robota.data.prefs.StringPreference;
import java.util.concurrent.Executor;
import javax.inject.Inject;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;
/*
 * Copyright (C) 2014 uPhyca Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.uphyca.robota.ui;






/**
 * @author Sosuke Masui (masui@uphyca.com)
 */
public class BotActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bot);
    }

    public static class BotFragment extends Fragment {

        @Inject
        Idobata mIdobata;

        @Inject
        @Networking
        Executor mExecutor;

        @Inject
        @Main
        Executor mDispatcher;

        @Inject
        @ApiToken
        StringPreference mApiTokenPreference;

        @Inject
        @Enabled
        BooleanPreference mEnabledPreference;

        @InjectView(R.id.api_token)
        EditText mApiToken;

        @InjectView(R.id.update)
        Button mUpdateButton;

        @Override
        public void onActivityCreated(Bundle savedInstanceState) {
            super.onActivityCreated(savedInstanceState);
// Path: robota/src/main/java/com/uphyca/robota/InjectionUtils.java
// public abstract class InjectionUtils {
// 
//     private InjectionUtils() {
//     }
// 
//     public static ObjectGraph getObjectGraph(Context context) {
//         return RobotaApplication.class.cast(context.getApplicationContext())
//                                        .getObjectGraph();
//     }
// }
// 
// Path: robota/src/main/java/com/uphyca/robota/data/prefs/BooleanPreference.java
// public class BooleanPreference {
// 
//     private final SharedPreferences mSharedPreferences;
//     private final String mKey;
//     private final boolean mDefaultValue;
// 
//     public BooleanPreference(SharedPreferences sharedPreferences, String key) {
//         this(sharedPreferences, key, false);
//     }
// 
//     public BooleanPreference(SharedPreferences sharedPreferences, String key, boolean defaultValue) {
//         mSharedPreferences = sharedPreferences;
//         mKey = key;
//         mDefaultValue = defaultValue;
//     }
// 
//     public boolean get() {
//         return mSharedPreferences.getBoolean(mKey, mDefaultValue);
//     }
// 
//     public boolean isSet() {
//         return mSharedPreferences.contains(mKey);
//     }
// 
//     public void set(boolean value) {
//         mSharedPreferences.edit()
//                           .putBoolean(mKey, value)
//                           .apply();
//     }
// 
//     public void delete() {
//         mSharedPreferences.edit()
//                           .remove(mKey)
//                           .apply();
//     }
// }
// 
// Path: robota/src/main/java/com/uphyca/robota/data/prefs/StringPreference.java
// public class StringPreference {
// 
//     private final SharedPreferences mSharedPreferences;
//     private final String mKey;
//     private final String mDefaultValue;
// 
//     public StringPreference(SharedPreferences sharedPreferences, String key) {
//         this(sharedPreferences, key, null);
//     }
// 
//     public StringPreference(SharedPreferences sharedPreferences, String key, String defaultValue) {
//         mSharedPreferences = sharedPreferences;
//         mKey = key;
//         mDefaultValue = defaultValue;
//     }
// 
//     public String get() {
//         return mSharedPreferences.getString(mKey, mDefaultValue);
//     }
// 
//     public boolean isSet() {
//         return mSharedPreferences.contains(mKey);
//     }
// 
//     public void set(String value) {
//         mSharedPreferences.edit()
//                           .putString(mKey, value)
//                           .apply();
//     }
// 
//     public void delete() {
//         mSharedPreferences.edit()
//                           .remove(mKey)
//                           .apply();
//     }
// }


// Path: robota/src/main/java/com/uphyca/robota/ui/BotActivity.java
import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.uphyca.idobata.Idobata;
import com.uphyca.idobata.IdobataError;
import com.uphyca.idobata.model.Seed;
import com.uphyca.robota.InjectionUtils;
import com.uphyca.robota.R;
import com.uphyca.robota.data.api.ApiToken;
import com.uphyca.robota.data.api.Enabled;
import com.uphyca.robota.data.api.Main;
import com.uphyca.robota.data.api.Networking;
import com.uphyca.robota.data.prefs.BooleanPreference;
import com.uphyca.robota.data.prefs.StringPreference;
import java.util.concurrent.Executor;
import javax.inject.Inject;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/*
 * Copyright (C) 2014 uPhyca Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.uphyca.robota.ui;






/**
 * @author Sosuke Masui (masui@uphyca.com)
 */
public class BotActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bot);
    }

    public static class BotFragment extends Fragment {

        @Inject
        Idobata mIdobata;

        @Inject
        @Networking
        Executor mExecutor;

        @Inject
        @Main
        Executor mDispatcher;

        @Inject
        @ApiToken
        StringPreference mApiTokenPreference;

        @Inject
        @Enabled
        BooleanPreference mEnabledPreference;

        @InjectView(R.id.api_token)
        EditText mApiToken;

        @InjectView(R.id.update)
        Button mUpdateButton;

        @Override
        public void onActivityCreated(Bundle savedInstanceState) {
            super.onActivityCreated(savedInstanceState);
            InjectionUtils.getObjectGraph(getActivity())