Skip to content
This repository was archived by the owner on Jan 16, 2023. It is now read-only.

Commit 28e461a

Browse files
committed
Restructuring code base and package names and some apis. See the
changelist for a comprehensive list of changes
1 parent 977271f commit 28e461a

101 files changed

Lines changed: 3111 additions & 3599 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AndroidManifest.xml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
1+
<!--
2+
Copyright 2015 Google Inc. All rights reserved.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
116
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.google.sample.castcompanionlibrary"
3-
android:versionCode="14"
4-
android:versionName="1.14" >
17+
package="com.google.android.libraries.cast.companionlibrary"
18+
android:versionCode="15"
19+
android:versionName="2.0" >
520

621
<uses-sdk
722
android:minSdkVersion="10"
8-
android:targetSdkVersion="21" />
9-
10-
<application
11-
android:label="@string/app_name">
12-
</application>
23+
android:targetSdkVersion="22" />
1324

14-
</manifest>
25+
</manifest>

CastCompanionLibrary.pdf

-12.4 KB
Binary file not shown.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2014 Google Inc.
1+
Copyright 2015 Google Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 55 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
CastCompanionLibrary-android is a library project to enable developers integrate Cast capabilities into their applications faster and easier.
44

55
## Dependencies
6-
* google-play-services_lib library from the Android SDK (at least version 6.1)
6+
* google-play-services_lib library from the Android SDK (at least version 7.0+)
77
* android-support-v7-appcompat (version 21 or above)
88
* android-support-v7-mediarouter (version 20 or above)
99

@@ -29,109 +29,58 @@ See LICENSE
2929
Google Cast Developers Community on Google+ [http://goo.gl/TPLDxj](http://goo.gl/TPLDxj)
3030

3131
## Change List
32-
1.14
32+
2.0
33+
#### Notice: this release introduces a restructured and updated code base that has backward-incompatible changes. Most of these changes can be handled by a simple search-and-replace action but there are some changes to the API names and signatures that may need more manual handling. Below you can find a list of changes.
34+
35+
* Change in the package name: CCL now has a new package name "com.google.android.libraries.cast.companionlibrary.cast"
36+
* All string, dimension and color resources now have "ccl_" as prefix. This allows developers to
37+
work with these resources without any collision with their own apps or other libraries. In addition, some
38+
unused resources have been removed from the "res/*" directories.
39+
* CCL no longer needs a reference to your "Activity" context. Instead, only an Application Context
40+
is adequate when you initialize it. Any API that may need an Activity Context (for example opening the
41+
VideoCastControllerActivity) will ask for such context as an argument. As a result, it is recommended
42+
to initialize the library in your Application's onCreate() and access the VideoCastManager singleton
43+
instance by VideoCastManager.getInstance(). Same applies to DataCastManager.
44+
* Most interface names have changed:
45+
* IMediaAuthListener -> MediaAuthListener
46+
* IMediaAuthService -> MediaAuthService
47+
* IBaseCastConsumer -> BaseCastConsumer
48+
* IDataCastConsumer -> DataCastConsumer
49+
* IVideoCastConsumer -> VideoCastConsumer
50+
* Some methods have been renamed:
51+
* IVideoVideoCastContoller#setLine1() -> VideoCastController#setTitle()
52+
* IVideoVideoCastContoller#setLine2() -> VideoCastController#setSubTitle()
53+
* IVideoVideoCastContoller#updateClosedCaption() -> VideoCastController#setClosedCaptionState()
54+
* VideoCastManager#getRemoteMovieUrl() -> getRemoteMediaUrl()
55+
* VideoCastManager#isRemoteMoviePlaying() -> isRemoteMediaPlaying()
56+
* VideoCastManager#isRemoteMoviePaused() -> isRemoteMediaPaused()
57+
* VideoCastManager#startCastControllerActivity() -> startVideoCastControllerActivity()
58+
* BaseCastManager#incremenetDeviceVolume() -> adjustDeviceVolume()
59+
* TracksPreferenceManager#setupPreferences() -> setUpPreferences()
60+
* VideoCastConsumer#onRemovedNamespace() -> onNamespaceRemoved()
61+
* MediaAuthService#start() -> startAuthorization()
62+
* MediaAuthService#setOnResult() -> setMediaAuthListener()
63+
* MediaAuthService#abort() -> abortAuthorization()
64+
* MediaAuthStatus#RESULT_AUTHORIZED -> AUTHORIZED
65+
* MediaAuthStatus#RESULT_NOT_AUTHORIZED -> NOT_AUTHORIZED
66+
* MediaAuthStatus#ABORT_TIMEOUT -> TIMED_OUT
67+
* MediaAuthStatus#ABORT_USER_CANCELLED -> CANCELED_BY_USER
68+
* VideoCastController#updateClosedCaption() -> setClosedCaptionStatus()
69+
* Utils#fromMediaInfo() -> mediaInfoToBundle()
70+
* Utils#toMediaInfo() -> bundleToMediaInfo()
71+
* Utils#scaleCenterCrop -> scaleAndCenterCropBitmap()
72+
* IMiniController.setSubTitle() -> setSubtitle()
73+
* MediaAuthListener#onResult() -> onAuthResult()
74+
* MediaAuthListener#onFailure() -> onAuthFailure()
75+
* BaseCastManager.clearContext() has been removed (see earlier comments)
76+
* All the "consumer" callbacks used to be wrapped inside a try-catch block inside the library. We have
77+
now removed this and expect the "consumers" to handle that in the client code; the previous approach was masking
78+
client issues in the library while they needed to be addressed inside the client itself.
79+
* BaseCastManager#addMediaRouterButton(MediaRouteButton button) now has no return value (it was redundant)
80+
* VideoCastConsumer#onApplicationConnectionFailed() no longer returns any value.
81+
* BaseCastConsumer#onConnectionFailed(() no longer returns any value.
82+
* [New] There is a new callback "void onMediaLoadResult(int statusCode)" in VideoCastConsumer to
83+
inform the consumers when a load operation is finished.
84+
* Updated the build to use the latest gradle binaries.
85+
* Updated to use the latest versions of Play Services and support libraries.
3386

34-
* Wrapped some IllegalStateExceptions for proper handling. This should address issue #144 as well.
35-
* Fixing an issue that sometimes when a media finishes, start of the next media would result in
36-
immediate closure of the VideoCastControllerActivity
37-
* Fixed a corner case where sometimes when the receiver is stopped due to reaching a time out, the
38-
sender was disconnecting but the cast icon was not reflecting that correctly.
39-
40-
1.13
41-
42-
* Addressed a NPE in reconnection task (issue #143)
43-
* Made sure we don't set the duration of a MediaInfo object to a negative number
44-
* Some internal cleanup
45-
46-
1.12
47-
#### Notice: there are some backward-incompatible changes in this release, please read the change list carefully
48-
* Changing CCL to use Application Context in most everything. As a result, one does not need to set context for CCL in each
49-
Activity which should avoid any context leaks and prevent some random NPEs. Consequently, there will be no "dialog" supported by
50-
CCL unless the caller method provides an explicit context. For various versions of reconnectSessionIfPossible, we now have
51-
reconnection callbacks that can be used by callers to provide visual feedback, so these methods now have new signatures.
52-
In addition, now you can initialize Cast Managers in your Application's onCreate().
53-
There are some backward-incompatible changes so clients need to make adjustments if needed.
54-
In particular, the noteworthy breaking changes are:
55-
* Variations of reconnectSessionIfPossible have new arguments
56-
* Utils.showErrorDialog() has been removed
57-
* setContext() on Cast Managers is removed
58-
* CastManagers' getInstance(Context) are removed
59-
* Updating BaseCastManager, VideoCastManager and DataCastManager to use CopyOnWriteArraySet to manage consumers. Since the number of
60-
consumers is low, there will be no performance hit and CopyOnWriteArraySet provides a safer data structure.
61-
* Decoupled dependency between components interested in receiving notifications when the list of active tracks
62-
changes and the sources that can cause such changes. This also allowed improving the TracksChooserDialog
63-
to gracefully rebuild itself when needed.
64-
* Improving VideoCastControllerFragment's behavior when it needs to be closed.
65-
* Fixing an issue that upon reconstruction of VideoCastControllerActivity/Fragment, it would restart the media.
66-
* In VideoCastControllerFragment, moved most of the initial work to onActivityCreated() so that a rebuild of the associated activity and fragment doesn't run into a NPE
67-
* Adding a new API to allow clients set the MediaAuthService directly (VideoCastManager.setMediaAuthService(IMediaAuthService authService))
68-
* Making sure that the reconnection AsyncTask is using a thread pool regardless of the Android version,
69-
* Removed "Video Tracks" from Tracks Chooser Dialog since that doesn't make sense to be presented there.
70-
* Updating the style of Cast dialog for Lollipop to match the respective framework.
71-
* Adding Toolbar component to the simple cast_activity.xml layout in landscape, this was missed in a previous update where toolbar was introduced.
72-
* Changing the icon representing "Disconnect" in Lollipop notification
73-
* Fixing a bug where notification service wouldn't restart if playback was restarted on a different device.
74-
* Fixing an issue that when a new media was started while another one was casting, the metadata wouldn't update immediately
75-
in VideoCastControllerActivity to reflect the new media.
76-
* Updating to the latest version of Gradle suitable for the latest publicly released version of Android Studio,
77-
* Updating the gradle build to use the latest version of Google Play Services and selectively use cast APIs from Google Play Services.
78-
* Improving discovery for MediaRouteButton by resetting the count of discovered routes whenever cast discovery is stopped.
79-
* Updating the PDF documentation
80-
* Fixing some typos
81-
* Addressing issues #89, #130, #132, #134, #137, #138, #139, #140,
82-
83-
1.11
84-
* Added support for Notifications and Lock Screen controls (via Notifications) on Android Lollipop.
85-
* Updated dependencies to use Google Play Services 6.1 and Support Libraries v21.
86-
* Added Toolbar as a replacement for ActionBar.
87-
* Added support for Android Studio 0.9.1 and updated gradle support to the latest versions.
88-
* Fixed issues 74, 110, 115, 119.
89-
90-
1.10
91-
* Added support for Tracks and Closed Captions. See the documentation for details.
92-
* Refactored image loading across the library.
93-
* Fixed issue 105
94-
95-
1.9
96-
* Added the complete reconnection logic per Cast UX Checklist
97-
* Addressed issues 70, 75, 92, 93, 94, 96
98-
* Added logic to handle failure when loading a media item in the VideoCastControllerActivity
99-
* Added "stream duration" to MediaInfo serialization
100-
* Updated the gradle build file to use newer version of the Google Play services
101-
* Updated the documentation
102-
103-
1.5
104-
* Fixed the issue where VideoCastNotificationService was not setting up data namespace if one was configured
105-
* Fixed issue 50
106-
* Added aversion number that will be printed in the log statements for tracking purposes
107-
* Correcting the typo in the name of method checkGooglePlaySevices() by introducing a new method and deprecating the old one (issue 48)
108-
* Fixing many typos in comments and some resources
109-
* Updating documentation to reflect the correct name of callbacks for the custom namespace for VideoCastManager
110-
111-
1.4
112-
* Added support for MediaRouteButton
113-
* Added "alias" resources for Mini Controller play/pause/stop buttons so clients can customize them easily
114-
* Added a color resource to control thw color of the title of the custom VideoMediaRouteControllerDialog
115-
* Fixed some typos in JavaDoc
116-
117-
1.3
118-
* Fixing issue 32
119-
* Fixing issue 33
120-
* Adding a better BaseCastManager.clearContext() variation
121-
* Implementing enhancement 30
122-
* Making sure play/pause button is hidden when ProgressBar is shown in VideoMediaRouteControllerDialog
123-
* probably some more adjustments and bug fixes
124-
125-
1.2
126-
* Improving thread-safety in calling various ConsumerImpl callbacks
127-
* (backward incompatible) Changing the signature of IMediaAuthListener.onResult
128-
* Adding an API to BaseCastManager so clients can clear the "context" to avoid any leaks
129-
* Various bug fixes
130-
131-
1.1
132-
* Added gradle build scripts (make sure you have Android Support Repository)
133-
* For live media, the "pause" button at various places is replaced with a "stop" button
134-
* Refactored the VideoCastControllerActivity to enable configuration changes without losing any running process
135-
* Added new capabilities for clients to hook in an authorization process prior to casting a video
136-
* A number of bug fixes, style fixes, etc
137-
* Updated documentation

build.gradle

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
1+
/*
2+
* Copyright (C) 2015 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
buildscript {
218
repositories {
3-
mavenCentral()
19+
jcenter()
420
}
521
dependencies {
622
classpath 'com.android.tools.build:gradle:1.0.0'
@@ -9,18 +25,21 @@ buildscript {
925

1026
repositories {
1127
mavenCentral()
28+
flatDir {
29+
dirs 'libs'
30+
}
1231
}
1332

1433
apply plugin: 'com.android.library'
1534

1635
android {
17-
compileSdkVersion 21
18-
buildToolsVersion "20.0.0"
36+
compileSdkVersion 22
37+
buildToolsVersion "22.0.1"
1938
publishNonDefault true
2039

2140
defaultConfig {
2241
minSdkVersion 10
23-
targetSdkVersion 21
42+
targetSdkVersion 22
2443
}
2544

2645
sourceSets {
@@ -30,14 +49,10 @@ android {
3049
res.srcDirs = ['res']
3150
}
3251
}
33-
34-
lintOptions {
35-
abortOnError false
36-
}
3752
}
3853

3954
dependencies {
40-
compile 'com.android.support:appcompat-v7:21.+'
41-
compile 'com.android.support:mediarouter-v7:21.+'
42-
compile 'com.google.android.gms:play-services-cast:6.5+'
55+
compile 'com.android.support:appcompat-v7:22.+'
56+
compile 'com.android.support:mediarouter-v7:22.+'
57+
compile 'com.google.android.gms:play-services:7.+'
4358
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Mon Dec 15 08:22:16 PST 2014
1+
#Fri Mar 27 23:28:18 PDT 2015
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME

libs/android-support-v4.jar

741 KB
Binary file not shown.

proguard.cfg

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}

project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
# Project target.
1414
target=android-19
1515
android.library=true
16+
android.library.reference.3=../../../../../../android-sdk/extras/google/google_play_services/libproject/google-play-services_lib
1617
android.library.reference.1=../../../../../../android-sdk/extras/android/support/v7/appcompat
1718
android.library.reference.2=../../../../../../android-sdk/extras/android/support/v7/mediarouter
18-
android.library.reference.3=../../../../../../android-sdk/extras/google/google_play_services/libproject/google-play-services_lib
-930 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)