Skip to content

Commit

Permalink
Merge pull request google#1 from google/master
Browse files Browse the repository at this point in the history
Merge updates from source repo.
  • Loading branch information
eyecatchup committed Oct 28, 2014
2 parents bece96c + f2e8742 commit 4c5dbf0
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 901 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ language: android

android:
components:
- build-tools-20.0.0
- android-19
- build-tools-21.0.2
- android-20
- android-21
- extra-google-m2repository
- extra-android-m2repository
- sys-img-armeabi-v7a-android-20
- sys-img-armeabi-v7a-android-21

notifications:
email: false

env:
matrix:
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
- ANDROID_TARGET=android-21 ANDROID_ABI=armeabi-v7a

before_install:
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repositories {

android {
compileSdkVersion 21
buildToolsVersion "21.0.0"
buildToolsVersion "21.0.2"

defaultConfig {
minSdkVersion 14
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import android.provider.Settings;
import android.support.v4.view.ViewCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
Expand Down Expand Up @@ -76,7 +77,6 @@
import com.google.samples.apps.iosched.ui.debug.DebugActionRunnerActivity;
import com.google.samples.apps.iosched.ui.widget.MultiSwipeRefreshLayout;
import com.google.samples.apps.iosched.ui.widget.ScrimInsetsScrollView;
import com.google.samples.apps.iosched.ui.widget.SwipeRefreshLayout;
import com.google.samples.apps.iosched.util.AccountUtils;
import com.google.samples.apps.iosched.util.AnalyticsManager;
import com.google.samples.apps.iosched.util.HelpUtils;
Expand Down Expand Up @@ -270,11 +270,10 @@ protected void onCreate(Bundle savedInstanceState) {
private void trySetupSwipeRefresh() {
mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
if (mSwipeRefreshLayout != null) {
mSwipeRefreshLayout.setColorScheme(
mSwipeRefreshLayout.setColorSchemeResources(
R.color.refresh_progress_1,
R.color.refresh_progress_2,
R.color.refresh_progress_3,
R.color.refresh_progress_4);
R.color.refresh_progress_3);
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
Expand All @@ -299,11 +298,13 @@ private void updateSwipeRefreshProgressBarTop() {
return;
}

if (mActionBarShown) {
mSwipeRefreshLayout.setProgressBarTop(mProgressBarTopWhenActionBarShown);
} else {
mSwipeRefreshLayout.setProgressBarTop(0);
}
int progressBarStartMargin = getResources().getDimensionPixelSize(
R.dimen.swipe_refresh_progress_bar_start_margin);
int progressBarEndMargin = getResources().getDimensionPixelSize(
R.dimen.swipe_refresh_progress_bar_end_margin);
int top = mActionBarShown ? mProgressBarTopWhenActionBarShown : 0;
mSwipeRefreshLayout.setProgressViewOffset(false,
top + progressBarStartMargin, top + progressBarEndMargin);
}

/**
Expand Down Expand Up @@ -435,6 +436,12 @@ protected boolean isNavDrawerOpen() {
return mDrawerLayout != null && mDrawerLayout.isDrawerOpen(Gravity.START);
}

protected void closeNavDrawer() {
if (mDrawerLayout != null) {
mDrawerLayout.closeDrawer(Gravity.START);
}
}

/** Populates the navigation drawer with the appropriate items. */
private void populateNavDrawer() {
boolean attendeeAtVenue = PrefUtils.isAttendeeAtVenue(this);
Expand Down Expand Up @@ -479,6 +486,15 @@ private void populateNavDrawer() {
createNavDrawerItems();
}

@Override
public void onBackPressed() {
if (isNavDrawerOpen()) {
closeNavDrawer();
} else {
super.onBackPressed();
}
}

private void createNavDrawerItems() {
mDrawerItemsListContainer = (ViewGroup) findViewById(R.id.navdrawer_items_list);
if (mDrawerItemsListContainer == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.util.AttributeSet;

import com.google.samples.apps.iosched.R;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.widget.FrameLayout;

Expand Down Expand Up @@ -68,7 +69,7 @@ private void init(Context context, AttributeSet attrs, int defStyle) {
protected boolean fitSystemWindows(Rect insets) {
mInsets = new Rect(insets);
setWillNotDraw(mInsetForeground == null);
postInvalidateOnAnimation();
ViewCompat.postInvalidateOnAnimation(this);
if (mOnInsetsCallback != null) {
mOnInsetsCallback.onInsetsChanged(insets);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.widget.ScrollView;

Expand Down Expand Up @@ -68,7 +69,7 @@ private void init(Context context, AttributeSet attrs, int defStyle) {
protected boolean fitSystemWindows(Rect insets) {
mInsets = new Rect(insets);
setWillNotDraw(mInsetForeground == null);
postInvalidateOnAnimation();
ViewCompat.postInvalidateOnAnimation(this);
if (mOnInsetsCallback != null) {
mOnInsetsCallback.onInsetsChanged(insets);
}
Expand Down
Loading

0 comments on commit 4c5dbf0

Please sign in to comment.