am e6dcd2f5: am 4bf9ebc7: am fb5e574e: Updated browseable samples for april push

* commit 'e6dcd2f593c8d4aba9b2ec8bc9a8a99eb23d5bbe':
  Updated browseable samples for april push
This commit is contained in:
Alexander Lucas
2014-04-11 16:15:34 +00:00
committed by Android Git Automerger
309 changed files with 12685 additions and 105 deletions

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -18,6 +18,6 @@ limitations under the License.
<item
android:id="@+id/action_toggle"
android:icon="@drawable/ic_action_grid"
android:showAsAction="always"
android:title="Toggle view"/>
android:showAsAction="always|withText"
android:title="@string/show_as_grid"/>
</menu>

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -1,6 +0,0 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>

View File

@@ -23,7 +23,7 @@
<![CDATA[
Transition cannot be directly applied to AdapterViews. In this sample, we demonstrate how to create a overlay layout and run a Transition on it.
Transition cannot be directly applied to AdapterViews. In this sample, we demonstrate how to create an overlay layout and run a Transition on it. Press the action bar button to toggle between ListView and GridView.
]]>

View File

@@ -1,6 +0,0 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -33,6 +33,7 @@ import android.widget.AbsListView;
import android.widget.FrameLayout;
import android.widget.GridView;
import android.widget.ListView;
import android.widget.Toast;
/**
* Main screen for AdapterTransition sample.
@@ -45,6 +46,11 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
*/
private static final int ROOT_ID = 1;
/**
* A tag for saving state whether the mAbsListView is ListView or GridView.
*/
private static final String STATE_IS_LISTVIEW = "is_listview";
/**
* This is where we place our AdapterView (ListView / GridView).
*/
@@ -80,20 +86,32 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
// We use a ListView at first
mAbsListView = (AbsListView) inflater.inflate(R.layout.fragment_meat_list, container, false);
mAdapter = new MeatAdapter(inflater, R.layout.item_meat_list);
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// If savedInstanceState is available, we restore the state whether the list is a ListView
// or a GridView.
boolean isListView;
if (null == savedInstanceState) {
isListView = true;
} else {
isListView = savedInstanceState.getBoolean(STATE_IS_LISTVIEW, true);
}
inflateAbsList(inflater, container, isListView);
return inflater.inflate(R.layout.fragment_adapter_transition, container, false);
}
@Override
public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putBoolean(STATE_IS_LISTVIEW, mAbsListView instanceof ListView);
}
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
// Retaining references for FrameLayouts that we use later.
mContent = (FrameLayout) view.findViewById(R.id.content);
mCover = (FrameLayout) view.findViewById(R.id.cover);
// We are attaching the list to the screen here.
mAbsListView.setAdapter(mAdapter);
mContent.addView(mAbsListView);
}
@@ -109,8 +127,10 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
if (null != item) {
if (mAbsListView instanceof ListView) {
item.setIcon(R.drawable.ic_action_grid);
item.setTitle(R.string.show_as_grid);
} else {
item.setIcon(R.drawable.ic_action_list);
item.setTitle(R.string.show_as_list);
}
}
}
@@ -151,6 +171,29 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
public void onTransitionResume(Transition transition) {
}
/**
* Inflate a ListView or a GridView with a corresponding ListAdapter.
*
* @param inflater The LayoutInflater.
* @param container The ViewGroup that contains this AbsListView. The AbsListView won't be
* attached to it.
* @param inflateListView Pass true to inflate a ListView, or false to inflate a GridView.
*/
private void inflateAbsList(LayoutInflater inflater, ViewGroup container,
boolean inflateListView) {
if (inflateListView) {
mAbsListView = (AbsListView) inflater.inflate(R.layout.fragment_meat_list,
container, false);
mAdapter = new MeatAdapter(inflater, R.layout.item_meat_list);
} else {
mAbsListView = (AbsListView) inflater.inflate(R.layout.fragment_meat_grid,
container, false);
mAdapter = new MeatAdapter(inflater, R.layout.item_meat_grid);
}
mAbsListView.setAdapter(mAdapter);
mAbsListView.setOnItemClickListener(mAdapter);
}
/**
* Toggle the UI between ListView and GridView.
*/
@@ -190,15 +233,8 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
// If the current list is a GridView, we replace it with a ListView. If it is a ListView,
// a GridView.
LayoutInflater inflater = LayoutInflater.from(getActivity());
if (mAbsListView instanceof GridView) {
mAbsListView = (AbsListView) inflater.inflate(
R.layout.fragment_meat_list, (ViewGroup) mAbsListView.getParent(), false);
mAdapter = new MeatAdapter(inflater, R.layout.item_meat_list);
} else {
mAbsListView = (AbsListView) inflater.inflate(
R.layout.fragment_meat_grid, (ViewGroup) mAbsListView.getParent(), false);
mAdapter = new MeatAdapter(inflater, R.layout.item_meat_grid);
}
inflateAbsList(inflater, (ViewGroup) mAbsListView.getParent(),
mAbsListView instanceof GridView);
mAbsListView.setAdapter(mAdapter);
// We restore the scrolling position here.
mAbsListView.setSelection(first);

View File

@@ -16,18 +16,22 @@
package com.example.android.adaptertransition;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
/**
* This class provides data as Views. It is designed to support both ListView and GridView by
* changing a layout resource file to inflate.
*/
public class MeatAdapter extends BaseAdapter {
public class MeatAdapter extends BaseAdapter implements AbsListView.OnItemClickListener {
private final LayoutInflater mLayoutInflater;
private final int mResourceId;
@@ -80,6 +84,16 @@ public class MeatAdapter extends BaseAdapter {
return view;
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
ViewHolder holder = (ViewHolder) view.getTag();
Context context = view.getContext();
if (null != holder && null != holder.title && null != context) {
Toast.makeText(context, context.getString(R.string.item_clicked,
holder.title.getText()), Toast.LENGTH_SHORT).show();
}
}
private static class ViewHolder {
public ImageView image;
public TextView title;

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,37 @@
<!--
Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/sample_main_layout">
<TextView android:id="@+id/sample_output"
style="@style/Widget.SampleMessage"
android:background="@android:color/white"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/intro_message"
android:layout_margin="16dp" />
<fragment
android:name="com.example.android.common.logger.LogFragment"
android:id="@+id/log_fragment"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp" />
</LinearLayout>

View File

@@ -0,0 +1,37 @@
<!--
Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/sample_main_layout" >
<TextView android:id="@+id/sample_output"
style="@style/Widget.SampleMessage"
android:background="@android:color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/intro_message"
android:padding="16dp"
android:layout_margin="16dp"/>
<fragment
android:name="com.example.android.common.logger.LogFragment"
android:id="@+id/log_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp" />
</LinearLayout>

View File

@@ -24,7 +24,8 @@
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/intro_message" />
android:text="@string/intro_message"
android:padding="16dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"

View File

@@ -17,9 +17,17 @@
<resources>
<style name="Widget.SampleMessage">
<item name="android:textAppearance">?android:textAppearanceLarge</item>
<item name="android:lineSpacingMultiplier">1.2</item>
<item name="android:padding">@dimen/margin_medium</item>
<item name="android:textAppearance">?android:textAppearanceMedium</item>
<item name="android:lineSpacingMultiplier">1.1</item>
<item name="android:layout_margin">16dp</item>
<item name="android:shadowDy">-6.5</item>
</style>
<style name="Log" parent="Widget.SampleOutput">
<item name="android:typeface">monospace</item>
</style>
</resources>

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -19,6 +19,7 @@
package com.example.android.basicgesturedetect;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
@@ -74,6 +75,9 @@ public class MainActivity extends SampleActivityBase {
LogFragment logFragment = (LogFragment) getSupportFragmentManager()
.findFragmentById(R.id.log_fragment);
msgFilter.setNext(logFragment.getLogView());
logFragment.getLogView().setTextAppearance(this, R.style.Log);
logFragment.getLogView().setBackgroundColor(Color.WHITE);
Log.i(TAG, "Ready");
}

View File

@@ -0,0 +1,37 @@
<!--
Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/sample_main_layout">
<TextView android:id="@+id/sample_output"
style="@style/Widget.SampleMessage"
android:background="@android:color/white"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/intro_message"
android:layout_margin="16dp" />
<fragment
android:name="com.example.android.common.logger.LogFragment"
android:id="@+id/log_fragment"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp" />
</LinearLayout>

View File

@@ -0,0 +1,37 @@
<!--
Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/sample_main_layout" >
<TextView android:id="@+id/sample_output"
style="@style/Widget.SampleMessage"
android:background="@android:color/white"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/intro_message"
android:padding="16dp"
android:layout_margin="16dp"/>
<fragment
android:name="com.example.android.common.logger.LogFragment"
android:id="@+id/log_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="16dp" />
</LinearLayout>

View File

@@ -24,7 +24,8 @@
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/intro_message" />
android:text="@string/intro_message"
android:padding="16dp" />
<View
android:layout_width="fill_parent"
android:layout_height="1dp"

View File

@@ -17,9 +17,17 @@
<resources>
<style name="Widget.SampleMessage">
<item name="android:textAppearance">?android:textAppearanceLarge</item>
<item name="android:lineSpacingMultiplier">1.2</item>
<item name="android:padding">@dimen/margin_medium</item>
<item name="android:textAppearance">?android:textAppearanceMedium</item>
<item name="android:lineSpacingMultiplier">1.1</item>
<item name="android:layout_margin">16dp</item>
<item name="android:shadowDy">-6.5</item>
</style>
<style name="Log" parent="Widget.SampleOutput">
<item name="android:typeface">monospace</item>
</style>
</resources>

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -19,6 +19,7 @@
package com.example.android.basicimmersivemode;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
@@ -74,6 +75,9 @@ public class MainActivity extends SampleActivityBase {
LogFragment logFragment = (LogFragment) getSupportFragmentManager()
.findFragmentById(R.id.log_fragment);
msgFilter.setNext(logFragment.getLogView());
logFragment.getLogView().setTextAppearance(this, R.style.Log);
logFragment.getLogView().setBackgroundColor(Color.WHITE);
Log.i(TAG, "Ready");
}

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,36 @@
/*
* Copyright (C) 2014 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.
*/
#pragma version(1)
#pragma rs java_package_name(com.example.android.basicrenderscript)
#pragma rs_fp_relaxed
const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};
float saturationValue = 0.f;
/*
RenderScript kernel that performs saturation manipulation.
*/
uchar4 __attribute__((kernel)) saturation(uchar4 in)
{
float4 f4 = rsUnpackColor8888(in);
float3 result = dot(f4.rgb, gMonoMult);
result = mix( result, f4.rgb, saturationValue );
return rsPackColorTo8888(result);
}

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -48,7 +48,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/this_is_scene_3"
android:text="@string/additional_message"
android:textAppearance="?android:attr/textAppearanceLarge"/>
</RelativeLayout>

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -19,7 +19,7 @@
<fragment
android:id="@+id/fragment_cardstream"
android:name="com.example.android.batchstepsensor.CardStreamFragment"
android:name="com.example.android.batchstepsensor.cardstream.CardStreamFragment"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"

View File

@@ -17,7 +17,7 @@
<com.example.android.batchstepsensor.CardLayout
<com.example.android.batchstepsensor.cardstream.CardLayout
android:id="@+id/card_layout"
style="@style/Card"
xmlns:android="http://schemas.android.com/apk/res/android"
@@ -71,4 +71,4 @@
android:layout_alignWithParentIfMissing="false"
android:visibility="invisible"/>
</com.example.android.batchstepsensor.CardLayout>
</com.example.android.batchstepsensor.cardstream.CardLayout>

View File

@@ -17,7 +17,7 @@
<com.example.android.batchstepsensor.CardActionButton xmlns:android="http://schemas.android.com/apk/res/android"
<com.example.android.batchstepsensor.cardstream.CardActionButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_button"
style="@style/CardActionNegative"
android:layout_width="match_parent"

View File

@@ -17,7 +17,7 @@
<com.example.android.batchstepsensor.CardActionButton xmlns:android="http://schemas.android.com/apk/res/android"
<com.example.android.batchstepsensor.cardstream.CardActionButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_button"
style="@style/CardActionNeutral"
android:layout_width="match_parent"

View File

@@ -17,7 +17,7 @@
<com.example.android.batchstepsensor.CardActionButton xmlns:android="http://schemas.android.com/apk/res/android"
<com.example.android.batchstepsensor.cardstream.CardActionButton xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_button"
style="@style/CardActionPositive"
android:layout_width="match_parent"

View File

@@ -22,10 +22,10 @@
android:layout_height="match_parent"
android:fillViewport="true">
<com.example.android.batchstepsensor.CardStreamLinearLayout
<com.example.android.batchstepsensor.cardstream.CardStreamLinearLayout
style="@style/CardStream"
android:id="@+id/card_stream"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.example.android.batchstepsensor.CardStreamLinearLayout>
android:layout_height="match_parent"/>
</ScrollView>

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -26,6 +26,10 @@ import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.example.android.common.logger.Log;
import com.example.android.batchstepsensor.cardstream.Card;
import com.example.android.batchstepsensor.cardstream.CardStream;
import com.example.android.batchstepsensor.cardstream.CardStreamFragment;
import com.example.android.batchstepsensor.cardstream.OnCardClickListener;
public class BatchStepSensorFragment extends Fragment implements OnCardClickListener {

View File

@@ -26,6 +26,12 @@ import android.view.Menu;
import com.example.android.common.activities.SampleActivityBase;
import com.example.android.common.logger.Log;
import com.example.android.batchstepsensor.cardstream.CardStream;
import com.example.android.batchstepsensor.cardstream.CardStreamFragment;
import com.example.android.batchstepsensor.cardstream.CardStreamState;
import com.example.android.batchstepsensor.cardstream.OnCardClickListener;
import com.example.android.batchstepsensor.cardstream.StreamRetentionFragment;
public class MainActivity extends SampleActivityBase implements CardStream {
public static final String TAG = "MainActivity";
public static final String FRAGTAG = "BatchStepSensorFragment";

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -31,6 +31,8 @@ import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.android.batchstepsensor.R;
import java.util.ArrayList;
/**

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.content.Context;
import android.util.AttributeSet;

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.content.Context;
import android.util.AttributeSet;

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
public interface CardStream {
public CardStreamFragment getCardStream();

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.animation.ObjectAnimator;
import android.content.Context;

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.os.Bundle;
import android.support.v4.app.Fragment;
@@ -30,6 +30,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import com.example.android.batchstepsensor.R;
/**
* A Fragment that handles a stream of cards.

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.animation.Animator;
import android.animation.LayoutTransition;
@@ -38,6 +38,7 @@ import android.widget.LinearLayout;
import android.widget.ScrollView;
import com.example.android.common.logger.Log;
import com.example.android.batchstepsensor.R;
import java.util.ArrayList;

View File

@@ -17,14 +17,14 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import java.util.HashSet;
/**
* A struct object that holds the state of a {@link CardStreamFragment}.
*/
class CardStreamState{
public class CardStreamState {
protected Card[] visibleCards;
protected Card[] hiddenCards;
protected HashSet<String> dismissibleCards;

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;

View File

@@ -17,7 +17,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
public interface OnCardClickListener {
public void onCardClick(int cardActionId, String cardTag);

View File

@@ -16,7 +16,7 @@
package com.example.android.batchstepsensor;
package com.example.android.batchstepsensor.cardstream;
import android.os.Bundle;
import android.support.v4.app.Fragment;

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,22 @@
<!--
Copyright 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.
-->
<resources>
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
</resources>

View File

@@ -18,7 +18,7 @@
<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Holo.Light" />
<style name="Theme.Base" parent="android:Theme.Light" />
<style name="Theme.Sample" parent="Theme.Base" />

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 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.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.customtransition"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
<application android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -0,0 +1,12 @@
page.tags="CustomTransition"
sample.group=UI
@jd:body
<p>
This sample demonstrates how to create and use a custom Transition.
</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,73 @@
<!--
Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/sample_main_layout">
<LinearLayout
android:id="@+id/sample_output"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<FrameLayout
style="@style/Widget.SampleMessageTile"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
style="@style/Widget.SampleMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/margin_medium"
android:paddingRight="@dimen/margin_medium"
android:paddingTop="@dimen/margin_large"
android:paddingBottom="@dimen/margin_large"
android:text="@string/intro_message" />
</FrameLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
<fragment
android:name="com.example.android.common.logger.LogFragment"
android:id="@+id/log_fragment"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1" />
</LinearLayout>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:background="@android:color/darker_gray" />
<FrameLayout
android:id="@+id/sample_content_fragment"
android:layout_weight="2"
android:layout_width="0px"
android:layout_height="match_parent" />
</LinearLayout>

View File

@@ -0,0 +1,65 @@
<!--
Copyright 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/sample_main_layout">
<ViewAnimator
android:id="@+id/sample_output"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
<ScrollView
style="@style/Widget.SampleMessageTile"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
style="@style/Widget.SampleMessage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/horizontal_page_margin"
android:paddingRight="@dimen/horizontal_page_margin"
android:paddingTop="@dimen/vertical_page_margin"
android:paddingBottom="@dimen/vertical_page_margin"
android:text="@string/intro_message" />
</ScrollView>
<fragment
android:name="com.example.android.common.logger.LogFragment"
android:id="@+id/log_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</ViewAnimator>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray" />
<FrameLayout
android:id="@+id/sample_content_fragment"
android:layout_weight="2"
android:layout_width="match_parent"
android:layout_height="0px" />
</LinearLayout>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.android.customtransition.CustomTransitionFragment">
<Button
android:id="@+id/show_next_scene"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Show next scene"/>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
</LinearLayout>

Some files were not shown because too many files have changed in this diff Show More