Move up spinner in apps screen

Bug: 18006320
Change-Id: Ic23c2c3e02a6c6a20b180065975228d42fd91899
This commit is contained in:
Alexandra Gherghina
2014-10-16 23:03:10 +01:00
parent 2f90c4cd52
commit aadc070a35
4 changed files with 14 additions and 22 deletions

View File

@@ -19,11 +19,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout android:id="@+id/pinned_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"

View File

@@ -25,6 +25,11 @@
android:orientation="vertical"
android:background="@drawable/default_preference_background">
<FrameLayout android:id="@+id/pinned_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"

View File

@@ -19,11 +19,6 @@
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout android:id="@+id/pinned_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >

View File

@@ -197,8 +197,6 @@ public class ManageApplications extends Fragment implements
private View mListContainer;
private ViewGroup mPinnedHeader;
// ListView used to display list
private ListView mListView;
// Custom view used to display running processes
@@ -245,19 +243,10 @@ public class ManageApplications extends Fragment implements
if (mRootView != null) {
return mRootView;
}
mInflater = inflater;
mRootView = inflater.inflate(mListType == LIST_TYPE_RUNNING
? R.layout.manage_applications_running
: R.layout.manage_applications_apps, null);
mPinnedHeader = (ViewGroup) mRootView.findViewById(R.id.pinned_header);
if (mOwner.mProfileSpinnerAdapter != null) {
mOwner.mSpinner = (Spinner) inflater.inflate(R.layout.spinner_view, null);
mOwner.mSpinner.setAdapter(mOwner.mProfileSpinnerAdapter);
mOwner.mSpinner.setOnItemSelectedListener(mOwner);
mPinnedHeader.addView(mOwner.mSpinner);
mPinnedHeader.setVisibility(View.VISIBLE);
}
mLoadingContainer = mRootView.findViewById(R.id.loading_container);
mLoadingContainer.setVisibility(View.VISIBLE);
mListContainer = mRootView.findViewById(R.id.list_container);
@@ -482,6 +471,7 @@ public class ManageApplications extends Fragment implements
private ViewGroup mContentContainer;
private View mRootView;
private ViewPager mViewPager;
private ViewGroup mPinnedHeader;
private UserSpinnerAdapter mProfileSpinnerAdapter;
private Spinner mSpinner;
private Context mContext;
@@ -936,7 +926,14 @@ public class ManageApplications extends Fragment implements
container, false);
mContentContainer = container;
mRootView = rootView;
mPinnedHeader = (ViewGroup) mRootView.findViewById(R.id.pinned_header);
if (mProfileSpinnerAdapter != null) {
mSpinner = (Spinner) inflater.inflate(R.layout.spinner_view, null);
mSpinner.setAdapter(mProfileSpinnerAdapter);
mSpinner.setOnItemSelectedListener(this);
mPinnedHeader.addView(mSpinner);
mPinnedHeader.setVisibility(View.VISIBLE);
}
mViewPager = (ViewPager) rootView.findViewById(R.id.pager);
MyPagerAdapter adapter = new MyPagerAdapter();
mViewPager.setAdapter(adapter);