Update browseable samples for lmp-docs

Synced to commit df5e5013422b81b4fd05c0ac9fd964b13624847a. Includes
new samples for Android Auto.

Change-Id: I3fec46e2a6b3f196682a92f1afd91eb682dc2dc1
This commit is contained in:
Trevor Johns
2014-11-12 11:39:30 -08:00
parent fcd28181a1
commit 527a4f30a6
684 changed files with 10100 additions and 10207 deletions

View File

@@ -13,9 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.batchstepsensor;
import android.os.Bundle;
@@ -58,7 +55,7 @@ public class MainActivity extends SampleActivityBase implements CardStream {
}
// Use fragment as click listener for cards, but must implement correct interface
if(!(fragment instanceof OnCardClickListener)){
if (!(fragment instanceof OnCardClickListener)){
throw new ClassCastException("BatchStepSensorFragment must " +
"implement OnCardClickListener interface.");
}

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.animation.Animator;

View File

@@ -14,12 +14,11 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.content.Context;
import android.os.Build;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.animation.BounceInterpolator;
@@ -46,20 +45,28 @@ public class CardActionButton extends Button {
@Override
public boolean onTouchEvent(MotionEvent event) {
switch(event.getAction()){
case MotionEvent.ACTION_DOWN:
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
setPressed(true);
animate().scaleX(0.98f).scaleY(0.98f).alpha(0.8f).setDuration(100).
setInterpolator(new DecelerateInterpolator());
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
animate().scaleX(0.98f).scaleY(0.98f).setDuration(100)
.setInterpolator(new DecelerateInterpolator());
} else {
ViewCompat.setElevation(this, 8.f);
}
break;
}
case MotionEvent.ACTION_UP:
animate().scaleX(1.0f).scaleY(1.f).alpha(1.0f).setDuration(50).
setInterpolator(new BounceInterpolator());
break;
case MotionEvent.ACTION_CANCEL:
animate().scaleX(1.0f).scaleY(1.f).alpha(1.0f).setDuration(50).
setInterpolator(new BounceInterpolator());
case MotionEvent.ACTION_CANCEL: {
setPressed(false);
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
animate().scaleX(1.f).scaleY(1.f).setDuration(50)
.setInterpolator(new BounceInterpolator());
} else {
ViewCompat.setElevation(this, 0.f);
}
break;
}
}
return super.onTouchEvent(event);

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.content.Context;

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
public interface CardStream {

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.animation.ObjectAnimator;

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.os.Bundle;

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.animation.Animator;

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import java.util.HashSet;

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.animation.ObjectAnimator;

View File

@@ -14,9 +14,6 @@
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
public interface OnCardClickListener {

View File

@@ -13,9 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.batchstepsensor.cardstream;
import android.os.Bundle;