Skip to content

Commit

Permalink
Start implementation of Android client
Browse files Browse the repository at this point in the history
not finished, sign-in works, albums are fetched in background, chromecast
API is initialized and receiver unit can be chosen
  • Loading branch information
Scarygami committed Sep 23, 2013
1 parent be4d472 commit 013fd79
Show file tree
Hide file tree
Showing 22 changed files with 568 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bin/
gen/
libs/
.metadata/
*.apk
*.ap_
*.dex
*.class
.classpath
.project
.settings/
proguard/
project.properties
proguard-project.txt
30 changes: 30 additions & 0 deletions slideshow/android/SlideshowCast/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="at.foldedsoft.slideshowcast"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="13"
android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="at.foldedsoft.slideshowcast.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 58 additions & 0 deletions slideshow/android/SlideshowCast/res/layout/main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/sources_fragment">

<com.google.android.gms.common.SignInButton
android:id="@+id/sign_in_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>

<RelativeLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/sign_in_button"
android:visibility="gone">

<android.support.v7.app.MediaRouteButton
android:id="@+id/media_route_button"
android:mediaRouteTypes="user"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
/>

<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge"
android:drawableLeft="@drawable/ic_user"
android:id="@+id/user_info"
android:gravity="center_vertical"
android:layout_toLeftOf="@id/media_route_button"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"/>

<GridView
android:id="@+id/album_grid"
android:numColumns="auto_fit"
android:columnWidth="90dp"
android:horizontalSpacing="5dp"
android:verticalSpacing="5dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="fill_vertical|fill_horizontal"
android:stretchMode="columnWidth"
android:layout_below="@id/user_info">
</GridView>

</RelativeLayout>

</RelativeLayout>
8 changes: 8 additions & 0 deletions slideshow/android/SlideshowCast/res/menu/menu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/action_signout"
android:title="@string/action_signout"
android:showAsAction="never" />
<item android:id="@+id/action_revoke"
android:title="@string/action_revoke"
android:showAsAction="never" />
</menu>
4 changes: 4 additions & 0 deletions slideshow/android/SlideshowCast/res/values-sw600dp/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<!-- Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw600dp devices (e.g. 7" tablets) here. -->
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>
<!-- Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here. -->
<dimen name="activity_horizontal_margin">128dp</dimen>
</resources>
11 changes: 11 additions & 0 deletions slideshow/android/SlideshowCast/res/values-v11/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<resources>

<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
<!-- API 11 theme customizations can go here. -->
</style>

</resources>
12 changes: 12 additions & 0 deletions slideshow/android/SlideshowCast/res/values-v14/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<resources>

<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
<!-- API 14 theme customizations can go here. -->
</style>

</resources>
5 changes: 5 additions & 0 deletions slideshow/android/SlideshowCast/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
12 changes: 12 additions & 0 deletions slideshow/android/SlideshowCast/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">Slideshow for Chomecast</string>
<string name="action_settings">Settings</string>
<string name="button_add">Add</string>
<string name="edit_url">Enter a URL</string>
<string name="tab_cast">Controls</string>
<string name="tab_albums">Albums</string>
<string name="action_signout">Sign out</string>
<string name="action_revoke">Revoke access</string>
</resources>
20 changes: 20 additions & 0 deletions slideshow/android/SlideshowCast/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<resources>

<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package at.foldedsoft.slideshowcast;

public abstract class AsyncReceiver {
public abstract void finished(int results);
}
Loading

0 comments on commit 013fd79

Please sign in to comment.