Skip to content
Permalink
Browse files

Auto-update

  • Loading branch information...
google-automerger committed Dec 3, 2014
1 parent 8048fe2 commit b10be78cd8a2884c949c215ad60c2bc2899c201a
@@ -0,0 +1,16 @@
# GOOGLE SAMPLE PACKAGING DATA
#
# This file is used by Google as part of our samples packaging process.
# End users may safely ignore this file. It has no relevance to other systems.
---
status: PUBLISHED
technologies: [Android]
categories: [UI]
languages: [Java]
solutions: [Mobile]
github: android-DoneBar
level: INTERMEDIATE
icon: screenshots/icon-web.png
api_refs:
- android:android.app.ActionBar
license: apache2
@@ -1,15 +1,19 @@
buildscript {
repositories {
mavenCentral()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
classpath 'com.android.tools.build:gradle:1.0.0-rc1'
}
}

apply plugin: 'com.android.application'

repositories {
jcenter()
}


dependencies {

@@ -29,7 +33,7 @@ List<String> dirs = [

android {
compileSdkVersion 21
buildToolsVersion "21.0.0"
buildToolsVersion "21.1.1"

defaultConfig {
minSdkVersion 14
@@ -0,0 +1,20 @@
<?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.
-->
<resources>


</resources>
@@ -0,0 +1,23 @@
<?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.
-->
<resources>

<!-- Activity themes -->
<style name="Theme.Base" parent="android:Theme.Material.Light">
</style>

</resources>

This file was deleted.

@@ -9,10 +9,10 @@ Please fill out either the individual or corporate Contributor License Agreement

* If you are an individual writing original source code and you're sure you
own the intellectual property, then you'll need to sign an [individual CLA]
(https://developers.google.com/open-source/cla/individual).
(https://cla.developers.google.com).
* If you work for a company that wants to allow you to contribute your work,
then you'll need to sign a [corporate CLA]
(https://developers.google.com/open-source/cla/corporate).
(https://cla.developers.google.com).

Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it. Once we receive it, we'll be able to
@@ -1,21 +1,44 @@
Android DoneBar Sample
==============================
===================================

This sample demonstrates two alternative presentations of the
action bar that are well-suited for simple data entry scenarios.
This sample shows how to create a custom view in the ActionBar to show a done button, using
2 alternative layouts. This is well suited for simple data entry activities, where the only
options for the user are to cancel or confirm the data changes.

In this presentation, a done bar replaces the action
bar entirely, providing two direct actions to persist or dismiss changes. This is
suitable for cases where no additional view details or actions are needed in the
action bar.
Introduction
------------

API 11 introduced the [ActionBar][1] as a navigational UI element. In most cases, a custom view isn't required
or even recommended, as using a menu xml file is all that is needed to add action icons to it. However, it is
possible to use a custom view and it is useful in some cases.

This sample contains two activities with custom views in their action bar, each with a "done" button. These are
designed to be used with simple data entry screen where the only options for the user are to cancel or confirm
the changes.

1. Create a layout for the [ActionBar][2].
2. In the activity, before setting the content view, inflate the view using the LayoutInflater.
3. Use `getActionBar()` to get the ActionBar, and set the display options with `ActionBar.DISPLAY_SHOW_CUSTOM`.
4. Set the custom view by calling `setCustomView(customActionBarView, new ActionBar.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT))` on the ActionBar.
5. You can now set the content view of the Activity.


[1]: http://developer.android.com/design/patterns/actionbar.html
[2]: http://developer.android.com/reference/android/app/ActionBar.html

Pre-requisites
--------------

- Android SDK v20
- Android Build Tools v20
- Android SDK v21
- Android Build Tools v21.1.1
- Android Support Repository

Screenshots
-------------

<img src=screenshots/1-main.png height="400" alt="Screenshot"/> <img src=screenshots/2-done-bar.png height="400" alt="Screenshot"/> <img src=screenshots/3-done-button.png height="400" alt="Screenshot"/>

Getting Started
---------------

@@ -46,7 +69,7 @@ file to you 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
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
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit b10be78

Please sign in to comment.
You can’t perform that action at this time.