Loading packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java +8 −13 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.settingslib.drawer; import android.annotation.LayoutRes; import android.annotation.Nullable; import android.app.ActionBar; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.ComponentName; Loading @@ -27,7 +28,6 @@ import android.content.pm.PackageManager; import android.content.res.TypedArray; import android.os.AsyncTask; import android.os.Bundle; import android.provider.Settings; import android.util.ArraySet; import android.util.Log; import android.view.LayoutInflater; Loading Loading @@ -117,14 +117,6 @@ public class SettingsDrawerActivity extends Activity { super.onPause(); } /** * Gets the name of the intent action of the default setting app. Used to launch setting app * when Settings Home is clicked. */ public String getSettingAction() { return Settings.ACTION_SETTINGS; } public void addCategoryListener(CategoryListener listener) { mCategoryListeners.add(listener); } Loading @@ -142,7 +134,7 @@ public class SettingsDrawerActivity extends Activity { @Override public void setContentView(@LayoutRes int layoutResID) { final ViewGroup parent = (ViewGroup) findViewById(R.id.content_frame); final ViewGroup parent = findViewById(R.id.content_frame); if (parent != null) { parent.removeAllViews(); } Loading @@ -159,11 +151,14 @@ public class SettingsDrawerActivity extends Activity { ((ViewGroup) findViewById(R.id.content_frame)).addView(view, params); } public void showMenuIcon() { getActionBar().setDisplayHomeAsUpEnabled(true); private void showMenuIcon() { final ActionBar actionBar = getActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } } protected void onCategoriesChanged() { private void onCategoriesChanged() { final int N = mCategoryListeners.size(); for (int i = 0; i < N; i++) { mCategoryListeners.get(i).onCategoriesChanged(); Loading packages/SettingsLib/tests/integ/src/com/android/settingslib/drawer/SettingsDrawerActivityTest.java +6 −12 Original line number Diff line number Diff line Loading @@ -16,7 +16,12 @@ package com.android.settingslib.drawer; import android.app.Activity; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; Loading @@ -24,23 +29,12 @@ import android.support.test.filters.SmallTest; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import com.android.settingslib.R; import com.google.common.truth.Truth; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static com.google.common.truth.Truth.assertThat; @RunWith(AndroidJUnit4.class) @SmallTest public class SettingsDrawerActivityTest { Loading Loading
packages/SettingsLib/src/com/android/settingslib/drawer/SettingsDrawerActivity.java +8 −13 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.settingslib.drawer; import android.annotation.LayoutRes; import android.annotation.Nullable; import android.app.ActionBar; import android.app.Activity; import android.content.BroadcastReceiver; import android.content.ComponentName; Loading @@ -27,7 +28,6 @@ import android.content.pm.PackageManager; import android.content.res.TypedArray; import android.os.AsyncTask; import android.os.Bundle; import android.provider.Settings; import android.util.ArraySet; import android.util.Log; import android.view.LayoutInflater; Loading Loading @@ -117,14 +117,6 @@ public class SettingsDrawerActivity extends Activity { super.onPause(); } /** * Gets the name of the intent action of the default setting app. Used to launch setting app * when Settings Home is clicked. */ public String getSettingAction() { return Settings.ACTION_SETTINGS; } public void addCategoryListener(CategoryListener listener) { mCategoryListeners.add(listener); } Loading @@ -142,7 +134,7 @@ public class SettingsDrawerActivity extends Activity { @Override public void setContentView(@LayoutRes int layoutResID) { final ViewGroup parent = (ViewGroup) findViewById(R.id.content_frame); final ViewGroup parent = findViewById(R.id.content_frame); if (parent != null) { parent.removeAllViews(); } Loading @@ -159,11 +151,14 @@ public class SettingsDrawerActivity extends Activity { ((ViewGroup) findViewById(R.id.content_frame)).addView(view, params); } public void showMenuIcon() { getActionBar().setDisplayHomeAsUpEnabled(true); private void showMenuIcon() { final ActionBar actionBar = getActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(true); } } protected void onCategoriesChanged() { private void onCategoriesChanged() { final int N = mCategoryListeners.size(); for (int i = 0; i < N; i++) { mCategoryListeners.get(i).onCategoriesChanged(); Loading
packages/SettingsLib/tests/integ/src/com/android/settingslib/drawer/SettingsDrawerActivityTest.java +6 −12 Original line number Diff line number Diff line Loading @@ -16,7 +16,12 @@ package com.android.settingslib.drawer; import android.app.Activity; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; Loading @@ -24,23 +29,12 @@ import android.support.test.filters.SmallTest; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import com.android.settingslib.R; import com.google.common.truth.Truth; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.assertion.ViewAssertions.doesNotExist; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; import static android.support.test.espresso.matcher.ViewMatchers.withContentDescription; import static com.google.common.truth.Truth.assertThat; @RunWith(AndroidJUnit4.class) @SmallTest public class SettingsDrawerActivityTest { Loading