Updated browseable samples for april push
Change-Id: Idd8cc6b7c43ab93f05f0a5d69d5379631721d185
This commit is contained in:
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,6 @@ limitations under the License.
|
|||||||
<item
|
<item
|
||||||
android:id="@+id/action_toggle"
|
android:id="@+id/action_toggle"
|
||||||
android:icon="@drawable/ic_action_grid"
|
android:icon="@drawable/ic_action_grid"
|
||||||
android:showAsAction="always"
|
android:showAsAction="always|withText"
|
||||||
android:title="Toggle view"/>
|
android:title="@string/show_as_grid"/>
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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>
|
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<![CDATA[
|
<![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.
|
||||||
|
|
||||||
|
|
||||||
]]>
|
]]>
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import android.widget.AbsListView;
|
|||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.GridView;
|
import android.widget.GridView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main screen for AdapterTransition sample.
|
* Main screen for AdapterTransition sample.
|
||||||
@@ -45,6 +46,11 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
|
|||||||
*/
|
*/
|
||||||
private static final int ROOT_ID = 1;
|
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).
|
* This is where we place our AdapterView (ListView / GridView).
|
||||||
*/
|
*/
|
||||||
@@ -80,20 +86,32 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
// We use a ListView at first
|
Bundle savedInstanceState) {
|
||||||
mAbsListView = (AbsListView) inflater.inflate(R.layout.fragment_meat_list, container, false);
|
// If savedInstanceState is available, we restore the state whether the list is a ListView
|
||||||
mAdapter = new MeatAdapter(inflater, R.layout.item_meat_list);
|
// 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);
|
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
|
@Override
|
||||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||||
// Retaining references for FrameLayouts that we use later.
|
// Retaining references for FrameLayouts that we use later.
|
||||||
mContent = (FrameLayout) view.findViewById(R.id.content);
|
mContent = (FrameLayout) view.findViewById(R.id.content);
|
||||||
mCover = (FrameLayout) view.findViewById(R.id.cover);
|
mCover = (FrameLayout) view.findViewById(R.id.cover);
|
||||||
// We are attaching the list to the screen here.
|
// We are attaching the list to the screen here.
|
||||||
mAbsListView.setAdapter(mAdapter);
|
|
||||||
mContent.addView(mAbsListView);
|
mContent.addView(mAbsListView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,8 +127,10 @@ public class AdapterTransitionFragment extends Fragment implements Transition.Tr
|
|||||||
if (null != item) {
|
if (null != item) {
|
||||||
if (mAbsListView instanceof ListView) {
|
if (mAbsListView instanceof ListView) {
|
||||||
item.setIcon(R.drawable.ic_action_grid);
|
item.setIcon(R.drawable.ic_action_grid);
|
||||||
|
item.setTitle(R.string.show_as_grid);
|
||||||
} else {
|
} else {
|
||||||
item.setIcon(R.drawable.ic_action_list);
|
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) {
|
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.
|
* 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,
|
// If the current list is a GridView, we replace it with a ListView. If it is a ListView,
|
||||||
// a GridView.
|
// a GridView.
|
||||||
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
LayoutInflater inflater = LayoutInflater.from(getActivity());
|
||||||
if (mAbsListView instanceof GridView) {
|
inflateAbsList(inflater, (ViewGroup) mAbsListView.getParent(),
|
||||||
mAbsListView = (AbsListView) inflater.inflate(
|
mAbsListView instanceof GridView);
|
||||||
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);
|
|
||||||
}
|
|
||||||
mAbsListView.setAdapter(mAdapter);
|
mAbsListView.setAdapter(mAdapter);
|
||||||
// We restore the scrolling position here.
|
// We restore the scrolling position here.
|
||||||
mAbsListView.setSelection(first);
|
mAbsListView.setSelection(first);
|
||||||
|
|||||||
@@ -16,18 +16,22 @@
|
|||||||
|
|
||||||
package com.example.android.adaptertransition;
|
package com.example.android.adaptertransition;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AbsListView;
|
||||||
|
import android.widget.AdapterView;
|
||||||
import android.widget.BaseAdapter;
|
import android.widget.BaseAdapter;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class provides data as Views. It is designed to support both ListView and GridView by
|
* This class provides data as Views. It is designed to support both ListView and GridView by
|
||||||
* changing a layout resource file to inflate.
|
* 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 LayoutInflater mLayoutInflater;
|
||||||
private final int mResourceId;
|
private final int mResourceId;
|
||||||
@@ -80,6 +84,16 @@ public class MeatAdapter extends BaseAdapter {
|
|||||||
return view;
|
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 {
|
private static class ViewHolder {
|
||||||
public ImageView image;
|
public ImageView image;
|
||||||
public TextView title;
|
public TextView title;
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
37
samples/browseable/BasicGestureDetect/res/layout-sw600dp/activity_main.xml
Executable file
37
samples/browseable/BasicGestureDetect/res/layout-sw600dp/activity_main.xml
Executable 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>
|
||||||
@@ -24,7 +24,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="@string/intro_message" />
|
android:text="@string/intro_message"
|
||||||
|
android:padding="16dp" />
|
||||||
<View
|
<View
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
|||||||
@@ -17,9 +17,17 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Widget.SampleMessage">
|
<style name="Widget.SampleMessage">
|
||||||
<item name="android:textAppearance">?android:textAppearanceLarge</item>
|
<item name="android:padding">@dimen/margin_medium</item>
|
||||||
<item name="android:lineSpacingMultiplier">1.2</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>
|
<item name="android:shadowDy">-6.5</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Log" parent="Widget.SampleOutput">
|
||||||
|
<item name="android:typeface">monospace</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.example.android.basicgesturedetect;
|
package com.example.android.basicgesturedetect;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@@ -74,6 +75,9 @@ public class MainActivity extends SampleActivityBase {
|
|||||||
LogFragment logFragment = (LogFragment) getSupportFragmentManager()
|
LogFragment logFragment = (LogFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.log_fragment);
|
.findFragmentById(R.id.log_fragment);
|
||||||
msgFilter.setNext(logFragment.getLogView());
|
msgFilter.setNext(logFragment.getLogView());
|
||||||
|
logFragment.getLogView().setTextAppearance(this, R.style.Log);
|
||||||
|
logFragment.getLogView().setBackgroundColor(Color.WHITE);
|
||||||
|
|
||||||
|
|
||||||
Log.i(TAG, "Ready");
|
Log.i(TAG, "Ready");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
37
samples/browseable/BasicImmersiveMode/res/layout-sw600dp/activity_main.xml
Executable file
37
samples/browseable/BasicImmersiveMode/res/layout-sw600dp/activity_main.xml
Executable 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>
|
||||||
@@ -24,7 +24,8 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:text="@string/intro_message" />
|
android:text="@string/intro_message"
|
||||||
|
android:padding="16dp" />
|
||||||
<View
|
<View
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
|
|||||||
@@ -17,9 +17,17 @@
|
|||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
<style name="Widget.SampleMessage">
|
<style name="Widget.SampleMessage">
|
||||||
<item name="android:textAppearance">?android:textAppearanceLarge</item>
|
<item name="android:padding">@dimen/margin_medium</item>
|
||||||
<item name="android:lineSpacingMultiplier">1.2</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>
|
<item name="android:shadowDy">-6.5</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Log" parent="Widget.SampleOutput">
|
||||||
|
<item name="android:typeface">monospace</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package com.example.android.basicimmersivemode;
|
package com.example.android.basicimmersivemode;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.FragmentTransaction;
|
import android.support.v4.app.FragmentTransaction;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@@ -74,6 +75,9 @@ public class MainActivity extends SampleActivityBase {
|
|||||||
LogFragment logFragment = (LogFragment) getSupportFragmentManager()
|
LogFragment logFragment = (LogFragment) getSupportFragmentManager()
|
||||||
.findFragmentById(R.id.log_fragment);
|
.findFragmentById(R.id.log_fragment);
|
||||||
msgFilter.setNext(logFragment.getLogView());
|
msgFilter.setNext(logFragment.getLogView());
|
||||||
|
logFragment.getLogView().setTextAppearance(this, R.style.Log);
|
||||||
|
logFragment.getLogView().setBackgroundColor(Color.WHITE);
|
||||||
|
|
||||||
|
|
||||||
Log.i(TAG, "Ready");
|
Log.i(TAG, "Ready");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
36
samples/browseable/BasicRenderScript/src/rs/saturation.rs
Normal file
36
samples/browseable/BasicRenderScript/src/rs/saturation.rs
Normal 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);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:text="@string/this_is_scene_3"
|
android:text="@string/additional_message"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
android:textAppearance="?android:attr/textAppearanceLarge"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/fragment_cardstream"
|
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:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<com.example.android.batchstepsensor.CardLayout
|
<com.example.android.batchstepsensor.cardstream.CardLayout
|
||||||
android:id="@+id/card_layout"
|
android:id="@+id/card_layout"
|
||||||
style="@style/Card"
|
style="@style/Card"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
@@ -71,4 +71,4 @@
|
|||||||
android:layout_alignWithParentIfMissing="false"
|
android:layout_alignWithParentIfMissing="false"
|
||||||
android:visibility="invisible"/>
|
android:visibility="invisible"/>
|
||||||
|
|
||||||
</com.example.android.batchstepsensor.CardLayout>
|
</com.example.android.batchstepsensor.cardstream.CardLayout>
|
||||||
|
|||||||
@@ -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"
|
android:id="@+id/card_button"
|
||||||
style="@style/CardActionNegative"
|
style="@style/CardActionNegative"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -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"
|
android:id="@+id/card_button"
|
||||||
style="@style/CardActionNeutral"
|
style="@style/CardActionNeutral"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -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"
|
android:id="@+id/card_button"
|
||||||
style="@style/CardActionPositive"
|
style="@style/CardActionPositive"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:fillViewport="true">
|
android:fillViewport="true">
|
||||||
|
|
||||||
<com.example.android.batchstepsensor.CardStreamLinearLayout
|
<com.example.android.batchstepsensor.cardstream.CardStreamLinearLayout
|
||||||
style="@style/CardStream"
|
style="@style/CardStream"
|
||||||
android:id="@+id/card_stream"
|
android:id="@+id/card_stream"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"/>
|
||||||
</com.example.android.batchstepsensor.CardStreamLinearLayout>
|
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ import android.os.Bundle;
|
|||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
|
||||||
import com.example.android.common.logger.Log;
|
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 {
|
public class BatchStepSensorFragment extends Fragment implements OnCardClickListener {
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ import android.view.Menu;
|
|||||||
import com.example.android.common.activities.SampleActivityBase;
|
import com.example.android.common.activities.SampleActivityBase;
|
||||||
import com.example.android.common.logger.Log;
|
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 class MainActivity extends SampleActivityBase implements CardStream {
|
||||||
public static final String TAG = "MainActivity";
|
public static final String TAG = "MainActivity";
|
||||||
public static final String FRAGTAG = "BatchStepSensorFragment";
|
public static final String FRAGTAG = "BatchStepSensorFragment";
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
@@ -31,6 +31,8 @@ import android.widget.Button;
|
|||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.example.android.batchstepsensor.R;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
public interface CardStream {
|
public interface CardStream {
|
||||||
public CardStreamFragment getCardStream();
|
public CardStreamFragment getCardStream();
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
@@ -30,6 +30,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
|
||||||
|
import com.example.android.batchstepsensor.R;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Fragment that handles a stream of cards.
|
* A Fragment that handles a stream of cards.
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.LayoutTransition;
|
import android.animation.LayoutTransition;
|
||||||
@@ -38,6 +38,7 @@ import android.widget.LinearLayout;
|
|||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
|
|
||||||
import com.example.android.common.logger.Log;
|
import com.example.android.common.logger.Log;
|
||||||
|
import com.example.android.batchstepsensor.R;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -17,14 +17,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A struct object that holds the state of a {@link CardStreamFragment}.
|
* A struct object that holds the state of a {@link CardStreamFragment}.
|
||||||
*/
|
*/
|
||||||
class CardStreamState{
|
public class CardStreamState {
|
||||||
protected Card[] visibleCards;
|
protected Card[] visibleCards;
|
||||||
protected Card[] hiddenCards;
|
protected Card[] hiddenCards;
|
||||||
protected HashSet<String> dismissibleCards;
|
protected HashSet<String> dismissibleCards;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.animation.PropertyValuesHolder;
|
import android.animation.PropertyValuesHolder;
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
public interface OnCardClickListener {
|
public interface OnCardClickListener {
|
||||||
public void onCardClick(int cardActionId, String cardTag);
|
public void onCardClick(int cardActionId, String cardTag);
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
package com.example.android.batchstepsensor;
|
package com.example.android.batchstepsensor.cardstream;
|
||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<!-- Activity themes -->
|
<!-- 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" />
|
<style name="Theme.Sample" parent="Theme.Base" />
|
||||||
|
|
||||||
|
|||||||
42
samples/browseable/CustomTransition/AndroidManifest.xml
Normal file
42
samples/browseable/CustomTransition/AndroidManifest.xml
Normal 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>
|
||||||
12
samples/browseable/CustomTransition/_index.jd
Normal file
12
samples/browseable/CustomTransition/_index.jd
Normal 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 |
BIN
samples/browseable/CustomTransition/res/drawable-hdpi/tile.9.png
Normal file
BIN
samples/browseable/CustomTransition/res/drawable-hdpi/tile.9.png
Normal file
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 |
73
samples/browseable/CustomTransition/res/layout-w720dp/activity_main.xml
Executable file
73
samples/browseable/CustomTransition/res/layout-w720dp/activity_main.xml
Executable 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>
|
||||||
|
|
||||||
|
|
||||||
65
samples/browseable/CustomTransition/res/layout/activity_main.xml
Executable file
65
samples/browseable/CustomTransition/res/layout/activity_main.xml
Executable 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>
|
||||||
|
|
||||||
@@ -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
Reference in New Issue
Block a user