Merge "Use resource aliases in-lieu of ViewStubs."

This commit is contained in:
Steve McKay
2015-08-24 19:31:15 +00:00
committed by Android (Google) Code Review
7 changed files with 12 additions and 66 deletions

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ViewStub xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stub"
android:inflatedId="@+id/drawer_layout"
android:layout="@layout/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2013 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<ViewStub xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stub"
android:inflatedId="@+id/drawer_layout"
android:layout="@layout/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@@ -14,9 +14,6 @@
limitations under the License.
-->
<ViewStub xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stub"
android:inflatedId="@+id/fixed_layout"
android:layout="@layout/fixed_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<resources>
<item name="files_activity" type="layout">@layout/fixed_layout</item>
</resources>

View File

@@ -14,9 +14,6 @@
limitations under the License.
-->
<ViewStub xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stub"
android:inflatedId="@+id/drawer_layout"
android:layout="@layout/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<resources>
<item name="docs_activity" type="layout">@layout/fixed_layout</item>
</resources>

View File

@@ -14,9 +14,7 @@
limitations under the License.
-->
<ViewStub xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/stub"
android:inflatedId="@+id/drawer_layout"
android:layout="@layout/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<resources>
<item name="docs_activity" type="layout">@layout/drawer_layout</item>
<item name="files_activity" type="layout">@layout/drawer_layout</item>
</resources>

View File

@@ -108,9 +108,7 @@ abstract class BaseActivity extends Activity {
? icicle.<State>getParcelable(EXTRA_STATE)
: buildDefaultState();
setContentView(R.layout.files_activity);
ViewStub stub = (ViewStub) findViewById(R.id.stub);
stub.inflate();
setContentView(mLayoutId);
mRoots = DocumentsApplication.getRootsCache(this);
mSearchManager = new SearchManager();

View File

@@ -82,7 +82,7 @@ public class DocumentsActivity extends BaseActivity {
private BaseAdapter mStackAdapter;
public DocumentsActivity() {
super(R.layout.activity, TAG);
super(R.layout.docs_activity, TAG);
}
@Override