Skip to content

Commit

Permalink
Use Android Support Library 23.1
Browse files Browse the repository at this point in the history
* Add `SCROLL_FLAG_SNAP` flag for `AppBarLayout`.
* Add `EXTRA_ENABLE_URLBAR_HIDING` for Custom Tabs.
  • Loading branch information
floating-cat committed Oct 16, 2015
1 parent 7c75842 commit e99aabc
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 23 deletions.
32 changes: 16 additions & 16 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.databinding/adapters/1.0-rc3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.databinding/library/1.0-rc3/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/preference-v14/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/preference-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/design/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/preference-v14/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/preference-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/recyclerview-v7/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.hannesdorfmann/adapterdelegates/1.0.2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.squareup.leakcanary/leakcanary-android/1.4-SNAPSHOT/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/io.reactivex/rxandroid/1.0.1/jars" />
Expand Down Expand Up @@ -112,35 +112,35 @@
<orderEntry type="library" exported="" name="okio-1.6.0" level="project" />
<orderEntry type="library" exported="" name="haha-2.0.2" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.5.0" level="project" />
<orderEntry type="library" exported="" name="preference-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="preference-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="jsr305-3.0.0" level="project" />
<orderEntry type="library" exported="" name="leakcanary-watcher-1.4-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="jackson-annotations-2.6.0" level="project" />
<orderEntry type="library" exported="" name="commons-lang3-3.4" level="project" />
<orderEntry type="library" exported="" name="library-1.0-rc3" level="project" />
<orderEntry type="library" exported="" name="adapterdelegates-1.0.2" level="project" />
<orderEntry type="library" exported="" name="jsr250-api-1.0" level="project" />
<orderEntry type="library" exported="" name="leakcanary-analyzer-1.4-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.1.0" level="project" />
<orderEntry type="library" exported="" name="glide-3.6.1" level="project" />
<orderEntry type="library" exported="" name="adapters-1.0-rc3" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.1.0" level="project" />
<orderEntry type="library" exported="" name="jackson-core-2.6.2" level="project" />
<orderEntry type="library" exported="" name="guava-18.0" level="project" />
<orderEntry type="library" exported="" name="compiler-1.0-rc4" level="project" />
<orderEntry type="library" exported="" name="guava-18.0" level="project" />
<orderEntry type="library" exported="" name="leakcanary-android-1.4-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="retrofit-2.0.0-beta2" level="project" />
<orderEntry type="library" exported="" name="adapter-rxjava-2.0.0-beta2" level="project" />
<orderEntry type="library" exported="" name="baseLibrary-1.0-rc4" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-23.0.1" level="project" />
<orderEntry type="library" exported="" name="cardview-v7-23.1.0" level="project" />
<orderEntry type="library" exported="" name="dagger-2.0.1" level="project" />
<orderEntry type="library" exported="" name="javax.inject-1" level="project" />
<orderEntry type="library" exported="" name="rxandroid-1.0.1" level="project" />
<orderEntry type="library" exported="" name="jackson-databind-2.6.2" level="project" />
<orderEntry type="library" exported="" name="design-23.0.1" level="project" />
<orderEntry type="library" exported="" name="preference-v14-23.0.1" level="project" />
<orderEntry type="library" exported="" name="design-23.1.0" level="project" />
<orderEntry type="library" exported="" name="preference-v14-23.1.0" level="project" />
<orderEntry type="library" exported="" name="rxjava-1.0.14" level="project" />
</component>
</module>
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-SNAPSHOT'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-SNAPSHOT'

ext.supportVersion = '23.0.1'
ext.supportVersion = '23.1.0'
compile "com.android.support:design:$supportVersion"
compile "com.android.support:recyclerview-v7:$supportVersion"
compile "com.android.support:cardview-v7:$supportVersion"
Expand Down
5 changes: 4 additions & 1 deletion app/src/main/java/cl/monsoon/s1next/util/IntentUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public final class IntentUtil {
private static final String ANDROID_RESOLVER_ACTIVITY = "com.android.internal.app.ResolverActivity";

/**
* https://developer.chrome.com/multidevice/android/customtabs
* see https://github.com/GoogleChrome/custom-tabs-client/blob/master/customtabs/src/android/support/customtabs/CustomTabsIntent.java
*/
private static final String EXTRA_CUSTOM_TABS_SESSION = "android.support.customtabs.extra.SESSION";
public static final String EXTRA_ENABLE_URLBAR_HIDING = "android.support.customtabs.extra.ENABLE_URLBAR_HIDING";

private IntentUtil() {}

Expand Down Expand Up @@ -98,6 +99,7 @@ public static void putCustomTabsExtra(Intent intent) {
Bundle bundle = new Bundle();
BundleCompat.putBinder(bundle, EXTRA_CUSTOM_TABS_SESSION, null);
intent.putExtras(bundle);
intent.putExtra(EXTRA_ENABLE_URLBAR_HIDING, true);
}

private static void putCustomTabsExtra(List<Intent> intentList) {
Expand All @@ -106,6 +108,7 @@ private static void putCustomTabsExtra(List<Intent> intentList) {
BundleCompat.putBinder(bundle, EXTRA_CUSTOM_TABS_SESSION, null);
for (Intent intent : intentList) {
intent.putExtras(bundle);
intent.putExtra(EXTRA_ENABLE_URLBAR_HIDING, true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ protected void setupNavDrawerItem(DrawerLayout drawerLayout, NavigationView navi
}

private void setupNavDrawerHeader(DrawerLayout drawerLayout, NavigationView navigationView) {
NavigationViewHeaderBinding binding = DataBindingUtil.bind(navigationView.findViewById(
R.id.drawer_header));
// see https://code.google.com/p/android/issues/detail?id=190226
NavigationViewHeaderBinding binding = DataBindingUtil.inflate(
mFragmentActivity.getLayoutInflater(), R.layout.navigation_view_header,
navigationView, false);
navigationView.addHeaderView(binding.getRoot());
binding.setUserViewModel(mUserViewModel);

// let status bar display over drawer if API >= 21
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/activity_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/navigation_view_header"
app:itemBackground="@drawable/selector_empty"
app:menu="@menu/drawer"
app:theme="?attr/navigationViewTheme" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/app_bar_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways" />
app:layout_scrollFlags="scroll|enterAlways|snap" />

</android.support.design.widget.AppBarLayout>
1 change: 0 additions & 1 deletion app/src/main/res/layout/navigation_view_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
</data>

<RelativeLayout
android:id="@+id/drawer_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
Expand Down

1 comment on commit e99aabc

@floating-cat
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android Support Library 23.1 -> Android Support Library 23.1.0

Please sign in to comment.