packageorg.marcinzelent.liberavem;importandroid.content.res.Configuration;importandroid.os.Bundle;importandroid.preference.PreferenceActivity;importandroid.support.annotation.LayoutRes;importandroid.support.annotation.Nullable;importandroid.support.v7.app.ActionBar;importandroid.support.v7.app.AppCompatDelegate;importandroid.support.v7.widget.Toolbar;importandroid.view.MenuInflater;importandroid.view.View;importandroid.view.ViewGroup;/** * A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls * to be used with AppCompat. */publicabstractclassAppCompatPreferenceActivityextendsPreferenceActivity{privateAppCompatDelegatemDelegate;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){getDelegate().installViewFactory();getDelegate().onCreate(savedInstanceState);super.onCreate(savedInstanceState);}@OverrideprotectedvoidonPostCreate(BundlesavedInstanceState){super.onPostCreate(savedInstanceState);getDelegate().onPostCreate(savedInstanceState);}publicActionBargetSupportActionBar(){returngetDelegate().getSupportActionBar();}publicvoidsetSupportActionBar(@NullableToolbartoolbar){getDelegate().setSupportActionBar(toolbar);}@OverridepublicMenuInflatergetMenuInflater(){returngetDelegate().getMenuInflater();}@OverridepublicvoidsetContentView(@LayoutResintlayoutResID){getDelegate().setContentView(layoutResID);}@OverridepublicvoidsetContentView(Viewview){getDelegate().setContentView(view);}@OverridepublicvoidsetContentView(Viewview,ViewGroup.LayoutParamsparams){getDelegate().setContentView(view,params);}@OverridepublicvoidaddContentView(Viewview,ViewGroup.LayoutParamsparams){getDelegate().addContentView(view,params);}@OverrideprotectedvoidonPostResume(){super.onPostResume();getDelegate().onPostResume();}@OverrideprotectedvoidonTitleChanged(CharSequencetitle,intcolor){super.onTitleChanged(title,color);getDelegate().setTitle(title);}@OverridepublicvoidonConfigurationChanged(ConfigurationnewConfig){super.onConfigurationChanged(newConfig);getDelegate().onConfigurationChanged(newConfig);}@OverrideprotectedvoidonStop(){super.onStop();getDelegate().onStop();}@OverrideprotectedvoidonDestroy(){super.onDestroy();getDelegate().onDestroy();}publicvoidinvalidateOptionsMenu(){getDelegate().invalidateOptionsMenu();}privateAppCompatDelegategetDelegate(){if(mDelegate==null){mDelegate=AppCompatDelegate.create(this,null);}returnmDelegate;}}