AppCompatPreferenceActivity.java
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2014 The Android Open Source Project
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 package eu.intermodalics.tango_ros_streamer.activities;
00017 import android.content.res.Configuration;
00018 import android.os.Bundle;
00019 import android.preference.PreferenceActivity;
00020 import android.support.annotation.LayoutRes;
00021 import android.support.annotation.Nullable;
00022 import android.support.v7.app.ActionBar;
00023 import android.support.v7.app.AppCompatDelegate;
00024 import android.support.v7.widget.Toolbar;
00025 import android.view.MenuInflater;
00026 import android.view.View;
00027 import android.view.ViewGroup;
00035 public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
00036     private AppCompatDelegate mDelegate;
00037     @Override
00038     protected void onCreate(Bundle savedInstanceState) {
00039         getDelegate().installViewFactory();
00040         getDelegate().onCreate(savedInstanceState);
00041         super.onCreate(savedInstanceState);
00042     }
00043     @Override
00044     protected void onPostCreate(Bundle savedInstanceState) {
00045         super.onPostCreate(savedInstanceState);
00046         getDelegate().onPostCreate(savedInstanceState);
00047     }
00048     public ActionBar getSupportActionBar() {
00049         return getDelegate().getSupportActionBar();
00050     }
00051     public void setSupportActionBar(@Nullable Toolbar toolbar) {
00052         getDelegate().setSupportActionBar(toolbar);
00053     }
00054     @Override
00055     public MenuInflater getMenuInflater() {
00056         return getDelegate().getMenuInflater();
00057     }
00058     @Override
00059     public void setContentView(@LayoutRes int layoutResID) {
00060         getDelegate().setContentView(layoutResID);
00061     }
00062     @Override
00063     public void setContentView(View view) {
00064         getDelegate().setContentView(view);
00065     }
00066     @Override
00067     public void setContentView(View view, ViewGroup.LayoutParams params) {
00068         getDelegate().setContentView(view, params);
00069     }
00070     @Override
00071     public void addContentView(View view, ViewGroup.LayoutParams params) {
00072         getDelegate().addContentView(view, params);
00073     }
00074     @Override
00075     protected void onPostResume() {
00076         super.onPostResume();
00077         getDelegate().onPostResume();
00078     }
00079     @Override
00080     protected void onTitleChanged(CharSequence title, int color) {
00081         super.onTitleChanged(title, color);
00082         getDelegate().setTitle(title);
00083     }
00084     @Override
00085     public void onConfigurationChanged(Configuration newConfig) {
00086         super.onConfigurationChanged(newConfig);
00087         getDelegate().onConfigurationChanged(newConfig);
00088     }
00089     @Override
00090     protected void onStop() {
00091         super.onStop();
00092         getDelegate().onStop();
00093     }
00094     @Override
00095     protected void onDestroy() {
00096         super.onDestroy();
00097         getDelegate().onDestroy();
00098     }
00099     public void invalidateOptionsMenu() {
00100         getDelegate().invalidateOptionsMenu();
00101     }
00102     private AppCompatDelegate getDelegate() {
00103         if (mDelegate == null) {
00104             mDelegate = AppCompatDelegate.create(this, null);
00105         }
00106         return mDelegate;
00107     }
00108 }


TangoRosStreamer
Author(s):
autogenerated on Thu Jun 6 2019 19:49:57