// Path: sample/src/main/java/net/derohimat/samplebasemvp/data/local/PreferencesHelper.java
// public class PreferencesHelper extends BasePreferenceUtils {
// 
//     private static final String KEY_USER_ID = "user_id";
//     private static final String KEY_NOTIFICATIONS_PREFERENCES = "notifications_preferences";
//     private static SharedPreferences mPref;
// 
//     public PreferencesHelper(Context context) {
//         mPref = getSharedPreference(context);
//     }
// 
//     public long getUserId() {
//         return mPref.getLong(KEY_USER_ID, 1);
//     }
// 
//     public void setUserId(long userId) {
//         mPref.edit().putLong(KEY_USER_ID, userId).apply();
//     }
// 
//     public boolean getNotificationsPrefs() {
//         return mPref.getBoolean(KEY_NOTIFICATIONS_PREFERENCES, false);
//     }
// 
//     public void setNotificationsPrefs(boolean acceptsNotifications) {
//         mPref.edit().putBoolean(KEY_NOTIFICATIONS_PREFERENCES, acceptsNotifications).apply();
//     }
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/view/AppActivity.java
// public abstract class AppActivity extends AppCompatActivity {
// 
//     private ActivityComponent mComponent;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mComponent = DaggerActivityComponent.builder().applicationComponent(getApp().getApplicationComponent()).build();
//     }
// 
//     protected ActivityComponent getComponent() {
//         return mComponent;
//     }
// 
//     protected BaseApplication getApp() {
//         return (BaseApplication) getApplicationContext();
//     }
// 
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/view/fragment/preference/MyPreferenceFragment.java
// public class MyPreferenceFragment extends PreferenceFragment {
// 
//     @Override
//     public void onCreate(final Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         addPreferencesFromResource(R.xml.settings);
// 
//         Preference version = findPreference("version");
//         try {
//             String versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName;
//             version.setSummary(versionName);
//         } catch (PackageManager.NameNotFoundException e) {
//             e.printStackTrace();
//         }
// 
//         Preference buttonfeedback = findPreference(getString(R.string.send_feedback));
//         buttonfeedback.setOnPreferenceClickListener(preference -> {
//             Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "your_email@gmail.com", null));
//             emailIntent.putExtra(Intent.EXTRA_SUBJECT, this.getString(R.string.app_name) + " Feedback");
//             emailIntent.putExtra(Intent.EXTRA_TEXT, "Write your feedback here...");
//             startActivity(Intent.createChooser(emailIntent, "Send email..."));
// 
//             return true;
//         });
//     }
// 
// }


import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;
import net.derohimat.samplebasemvp.data.local.PreferencesHelper;
import net.derohimat.samplebasemvp.view.AppActivity;
import net.derohimat.samplebasemvp.view.fragment.preference.MyPreferenceFragment;
import javax.inject.Inject;
package net.derohimat.samplebasemvp.view.activity.settings;




public class SettingsActivity extends AppActivity {

    @Inject
    PreferencesHelper preferencesHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getComponent().inject(this);
// Path: sample/src/main/java/net/derohimat/samplebasemvp/data/local/PreferencesHelper.java
// public class PreferencesHelper extends BasePreferenceUtils {
// 
//     private static final String KEY_USER_ID = "user_id";
//     private static final String KEY_NOTIFICATIONS_PREFERENCES = "notifications_preferences";
//     private static SharedPreferences mPref;
// 
//     public PreferencesHelper(Context context) {
//         mPref = getSharedPreference(context);
//     }
// 
//     public long getUserId() {
//         return mPref.getLong(KEY_USER_ID, 1);
//     }
// 
//     public void setUserId(long userId) {
//         mPref.edit().putLong(KEY_USER_ID, userId).apply();
//     }
// 
//     public boolean getNotificationsPrefs() {
//         return mPref.getBoolean(KEY_NOTIFICATIONS_PREFERENCES, false);
//     }
// 
//     public void setNotificationsPrefs(boolean acceptsNotifications) {
//         mPref.edit().putBoolean(KEY_NOTIFICATIONS_PREFERENCES, acceptsNotifications).apply();
//     }
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/view/AppActivity.java
// public abstract class AppActivity extends AppCompatActivity {
// 
//     private ActivityComponent mComponent;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mComponent = DaggerActivityComponent.builder().applicationComponent(getApp().getApplicationComponent()).build();
//     }
// 
//     protected ActivityComponent getComponent() {
//         return mComponent;
//     }
// 
//     protected BaseApplication getApp() {
//         return (BaseApplication) getApplicationContext();
//     }
// 
// }
// 
// Path: sample/src/main/java/net/derohimat/samplebasemvp/view/fragment/preference/MyPreferenceFragment.java
// public class MyPreferenceFragment extends PreferenceFragment {
// 
//     @Override
//     public void onCreate(final Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         addPreferencesFromResource(R.xml.settings);
// 
//         Preference version = findPreference("version");
//         try {
//             String versionName = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName;
//             version.setSummary(versionName);
//         } catch (PackageManager.NameNotFoundException e) {
//             e.printStackTrace();
//         }
// 
//         Preference buttonfeedback = findPreference(getString(R.string.send_feedback));
//         buttonfeedback.setOnPreferenceClickListener(preference -> {
//             Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts("mailto", "your_email@gmail.com", null));
//             emailIntent.putExtra(Intent.EXTRA_SUBJECT, this.getString(R.string.app_name) + " Feedback");
//             emailIntent.putExtra(Intent.EXTRA_TEXT, "Write your feedback here...");
//             startActivity(Intent.createChooser(emailIntent, "Send email..."));
// 
//             return true;
//         });
//     }
// 
// }


// Path: sample/src/main/java/net/derohimat/samplebasemvp/view/activity/settings/SettingsActivity.java
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.NavUtils;
import android.view.MenuItem;
import net.derohimat.samplebasemvp.data.local.PreferencesHelper;
import net.derohimat.samplebasemvp.view.AppActivity;
import net.derohimat.samplebasemvp.view.fragment.preference.MyPreferenceFragment;
import javax.inject.Inject;

package net.derohimat.samplebasemvp.view.activity.settings;




public class SettingsActivity extends AppActivity {

    @Inject
    PreferencesHelper preferencesHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getComponent().inject(this);
        getFragmentManager().beginTransaction().replace(android.R.id.content, new MyPreferenceFragment()).commit();