From 57d28dab0e11ab5bc7c3220a6b3522bd94f6b1a0 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 29 Jan 2015 16:20:06 -0800 Subject: [PATCH] Add sample for nested scrolling Change-Id: Ib4969cbee1228ef3b2b0fca0fb89b87bda1db711 --- samples/Support4Demos/AndroidManifest.xml | 8 +++ .../res/layout/nested_scroll.xml | 52 +++++++++++++++++++ samples/Support4Demos/res/values/strings.xml | 5 ++ .../widget/NestedScrollActivity.java | 35 +++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 samples/Support4Demos/res/layout/nested_scroll.xml create mode 100644 samples/Support4Demos/src/com/example/android/supportv4/widget/NestedScrollActivity.java diff --git a/samples/Support4Demos/AndroidManifest.xml b/samples/Support4Demos/AndroidManifest.xml index 5b434886d..f66f58534 100644 --- a/samples/Support4Demos/AndroidManifest.xml +++ b/samples/Support4Demos/AndroidManifest.xml @@ -351,6 +351,14 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/Support4Demos/res/values/strings.xml b/samples/Support4Demos/res/values/strings.xml index 91b5c42ec..d17c06274 100644 --- a/samples/Support4Demos/res/values/strings.xml +++ b/samples/Support4Demos/res/values/strings.xml @@ -184,4 +184,9 @@ Widget/SwipeRefreshLayout + + Widget/Nested Scrolling + + This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. This is some long text. It just keeps going. Look at it. Scroll it. Scroll the nested version of it. + diff --git a/samples/Support4Demos/src/com/example/android/supportv4/widget/NestedScrollActivity.java b/samples/Support4Demos/src/com/example/android/supportv4/widget/NestedScrollActivity.java new file mode 100644 index 000000000..87a31fc87 --- /dev/null +++ b/samples/Support4Demos/src/com/example/android/supportv4/widget/NestedScrollActivity.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2015 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. + */ + + +package com.example.android.supportv4.widget; + +import android.app.Activity; +import android.os.Bundle; + +import com.example.android.supportv4.R; + +/** + * This activity demonstrates the use of nested scrolling in the v4 support library. + * See the associated layout file for details. + */ +public class NestedScrollActivity extends Activity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.nested_scroll); + } +}