| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.preferences; | 5 package org.chromium.chrome.browser.preferences; |
| 6 | 6 |
| 7 import android.os.Bundle; | 7 import android.os.Bundle; |
| 8 import android.preference.PreferenceFragment; | 8 import android.preference.PreferenceFragment; |
| 9 import android.view.ViewGroup.MarginLayoutParams; | 9 import android.view.ViewGroup.MarginLayoutParams; |
| 10 import android.widget.ListView; | 10 import android.widget.ListView; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 int marginTop = getActivity().getResources().getDimensionPixelSize( | 49 int marginTop = getActivity().getResources().getDimensionPixelSize( |
| 50 R.dimen.search_engine_list_margin_top); | 50 R.dimen.search_engine_list_margin_top); |
| 51 MarginLayoutParams layoutParams = (MarginLayoutParams) mListView.getLayo
utParams(); | 51 MarginLayoutParams layoutParams = (MarginLayoutParams) mListView.getLayo
utParams(); |
| 52 layoutParams.setMargins(0, marginTop, 0, 0); | 52 layoutParams.setMargins(0, marginTop, 0, 0); |
| 53 mListView.setLayoutParams(layoutParams); | 53 mListView.setLayoutParams(layoutParams); |
| 54 mListView.setAdapter(mSearchEngineAdapter); | 54 mListView.setAdapter(mSearchEngineAdapter); |
| 55 mListView.setDivider(null); | 55 mListView.setDivider(null); |
| 56 } | 56 } |
| 57 | 57 |
| 58 @Override | 58 @Override |
| 59 public void onResume() { | 59 public void onStart() { |
| 60 super.onResume(); | 60 super.onStart(); |
| 61 /** | 61 mSearchEngineAdapter.start(); |
| 62 * Handle UI update when location setting for a search engine is changed
. | 62 } |
| 63 */ | 63 |
| 64 mSearchEngineAdapter.notifyDataSetChanged(); | 64 @Override |
| 65 public void onStop() { |
| 66 super.onStop(); |
| 67 mSearchEngineAdapter.stop(); |
| 65 } | 68 } |
| 66 } | 69 } |
| OLD | NEW |