// Path: app/src/main/java/com/haogefeifei/odoo/ui/activity/base/ToolbarActivity.java
// public abstract class ToolbarActivity extends AppCompatActivity {
// 
//     abstract protected int getLayoutResource();
// 
//     protected AppBarLayout mAppBar;
//     protected Toolbar mToolbar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(getLayoutResource());
// 
//         mAppBar = (AppBarLayout) findViewById(R.id.app_bar_layout);
//         mToolbar = (Toolbar) findViewById(R.id.toolbar);
// 
//         if (mToolbar == null || mAppBar == null) {
//             throw new IllegalStateException("no toolbar");
//         }
// 
//         setSupportActionBar(mToolbar);
// 
//         if (canBack()) {
//             ActionBar actionBar = getSupportActionBar();
//             if (actionBar != null) actionBar.setDisplayHomeAsUpEnabled(true);
//         }
// 
//         if (Build.VERSION.SDK_INT >= 21) {
//             mAppBar.setElevation(10.6f);
//         }
//     }
// 
//     public boolean canBack() {
//         return false;
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         if (item.getItemId() == android.R.id.home) {
//             onBackPressed();
//             return true;
//         } else {
//             return super.onOptionsItemSelected(item);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/haogefeifei/odoo/ui/settings/SettingFragment.java
// public class SettingFragment extends PreferenceFragment
//         implements Preference.OnPreferenceClickListener {
// 
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         addPreferencesFromResource(R.xml.prefs);
//     }
// 
// 
//     @Override
//     public boolean onPreferenceClick(Preference preference) {
// 
//         return false;
//     }
// }


import android.os.Bundle;
import com.haogefeifei.odoo.R;
import com.haogefeifei.odoo.ui.activity.base.ToolbarActivity;
import com.haogefeifei.odoo.ui.settings.SettingFragment;
package com.haogefeifei.odoo.ui.activity;



public class SettingActivity extends ToolbarActivity {

    public static final String TAG = "SettingActivity";

    @Override
    protected int getLayoutResource() {
        return R.layout.activity_setting;
    }

    @Override
    public boolean canBack() {
        return true;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setTitle(getString(R.string.title_activity_setting));
        getFragmentManager()
                .beginTransaction()
// Path: app/src/main/java/com/haogefeifei/odoo/ui/activity/base/ToolbarActivity.java
// public abstract class ToolbarActivity extends AppCompatActivity {
// 
//     abstract protected int getLayoutResource();
// 
//     protected AppBarLayout mAppBar;
//     protected Toolbar mToolbar;
// 
//     @Override
//     protected void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         setContentView(getLayoutResource());
// 
//         mAppBar = (AppBarLayout) findViewById(R.id.app_bar_layout);
//         mToolbar = (Toolbar) findViewById(R.id.toolbar);
// 
//         if (mToolbar == null || mAppBar == null) {
//             throw new IllegalStateException("no toolbar");
//         }
// 
//         setSupportActionBar(mToolbar);
// 
//         if (canBack()) {
//             ActionBar actionBar = getSupportActionBar();
//             if (actionBar != null) actionBar.setDisplayHomeAsUpEnabled(true);
//         }
// 
//         if (Build.VERSION.SDK_INT >= 21) {
//             mAppBar.setElevation(10.6f);
//         }
//     }
// 
//     public boolean canBack() {
//         return false;
//     }
// 
//     @Override
//     public boolean onOptionsItemSelected(MenuItem item) {
//         if (item.getItemId() == android.R.id.home) {
//             onBackPressed();
//             return true;
//         } else {
//             return super.onOptionsItemSelected(item);
//         }
//     }
// }
// 
// Path: app/src/main/java/com/haogefeifei/odoo/ui/settings/SettingFragment.java
// public class SettingFragment extends PreferenceFragment
//         implements Preference.OnPreferenceClickListener {
// 
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         addPreferencesFromResource(R.xml.prefs);
//     }
// 
// 
//     @Override
//     public boolean onPreferenceClick(Preference preference) {
// 
//         return false;
//     }
// }


// Path: app/src/main/java/com/haogefeifei/odoo/ui/activity/SettingActivity.java
import android.os.Bundle;
import com.haogefeifei.odoo.R;
import com.haogefeifei.odoo.ui.activity.base.ToolbarActivity;
import com.haogefeifei.odoo.ui.settings.SettingFragment;

package com.haogefeifei.odoo.ui.activity;



public class SettingActivity extends ToolbarActivity {

    public static final String TAG = "SettingActivity";

    @Override
    protected int getLayoutResource() {
        return R.layout.activity_setting;
    }

    @Override
    public boolean canBack() {
        return true;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setTitle(getString(R.string.title_activity_setting));
        getFragmentManager()
                .beginTransaction()
                .replace(R.id.fragment_frame, new SettingFragment())