...
 
Commits (16)
......@@ -4,6 +4,7 @@
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="lib" path="libs/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="libs/feedback_v6.jar"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>TTTCLient</name>
<name>AndroidTTTClient</name>
<comment></comment>
<projects>
</projects>
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.tum.in.tttclient"
android:versionCode="1"
android:versionName="1.0" >
package="de.tum.in.tttclient"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" >
</uses-permission>
<uses-permission android:name="android.permission.INTERNET" >
</uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" >
</uses-permission>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" >
</uses-permission>
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="19" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ttt24"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/Theme.Customactionbar" >
<activity
android:name="tttclient.activities.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<application
android:allowBackup="true"
android:icon="@drawable/ttt24"
android:label="@string/app_name"
android:largeHeap="true"
android:theme="@style/Sherlock.__Theme.Light" >
<activity
android:name="tttclient.activities.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>
<activity
android:name="tttclient.activities.FeedActivity"
android:configChanges="orientation|screenSize"
android:label="Feeds"
android:launchMode="singleTask" >
<intent-filter>
<data android:scheme="http" />
<data android:host="ttt.in.tum.de" />
<data android:pathPattern="\\/lectures\\/rss\\.php.*"/>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<activity
android:name="tttclient.activities.FeedDetailActivity"
android:configChanges="orientation|screenSize" >
</activity>
<activity
android:name="tttclient.activities.PlayerActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="landscape" >
</activity>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="tttclient.activities.FeedActivity"
android:configChanges="orientation|screenSize"
android:label="Feeds" >
</activity>
<activity
android:name="tttclient.activities.FeedWizardActivity"
android:label="Add new Feed"
android:launchMode="singleTask" >
<intent-filter>
<data android:scheme="http" />
<data android:host="ttt.in.tum.de" />
<data android:pathPattern="\\/lectures\\/ttt-android.*" />
<service android:name="tttclient.services.DownloadService" >
</service>
<service android:name="tttclient.services.ParseService" >
</service>
</application>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
>
</activity>
<activity
android:name="tttclient.activities.FeedDetailActivity"
android:configChanges="orientation|screenSize" >
</activity>
<activity
android:name="tttclient.activities.PlayerActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="landscape" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="file" />
<data android:host="*" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.ttt" />
</intent-filter>
</activity>
<service android:name="tttclient.services.DownloadService" >
</service>
<service android:name="tttclient.services.ParseService" >
</service>
</application>
</manifest>
\ No newline at end of file
......@@ -11,6 +11,6 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-19
target=android-18
android.library=false
android.library.reference.1=../../Downloads/JakeWharton-ActionBarSherlock-5a15d92/actionbarsherlock
android.library.reference.1=../../Arbeit_workspace/DrawerToggleLibrary
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="2"
android:baselineAligned="false">
<LinearLayout
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical">
<EditText
android:id="@+id/tx_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="23dp"
android:ems="10"
android:hint="Name"
android:singleLine="true" />
<EditText
android:id="@+id/tx_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="33dp"
android:ems="10"
android:hint="Url"
android:singleLine="true" >
</EditText>
<Button
android:id="@+id/button_paste"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/paste_url" />
</LinearLayout>
<LinearLayout
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:gravity="center_horizontal"
android:text="Suscribe to all Lectures since the following date"
android:textAppearance="?android:attr/textAppearanceMedium" />
<DatePicker
android:id="@+id/datePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:calendarViewShown="false" />
<Button
android:id="@+id/button_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/save" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/actionbar_blue"
android:baselineAligned="false"
android:orientation="horizontal"
android:weightSum="5" >
<fragment
android:id="@+id/feedFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginRight="5dp"
android:layout_weight="2"
class="tttclient.fragments.FeedFragment" />
<fragment
android:id="@+id/itemFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="3"
class="tttclient.fragments.FeedDetailsFragment" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<fragment
android:id="@+id/detailFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="tttclient.fragments.FeedDetailsFragment" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@+id/fragmentContainer"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<fragment
android:id="@+id/feedFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="tttclient.fragments.FeedFragment" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true"
android:orientation="vertical" >
<ViewSwitcher
android:id="@+id/viewSwitcher"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/playerView_fullscreen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:scaleType="centerInside" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:orientation="horizontal"
android:weightSum="3" >
<ScrollView
android:id="@+id/indexScrollView"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:fillViewport="false"
android:paddingLeft="5dip" >
</ScrollView>
<ImageView
android:id="@+id/playerView_extended"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="@drawable/my_border"
android:padding="10dip"
android:scaleType="centerInside"
android:src="@drawable/ic_launcher" />
</LinearLayout>
</ViewSwitcher>
</LinearLayout>
\ No newline at end of file
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- The main content view -->
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<LinearLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center">
<SurfaceView
android:id="@+id/playerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"/>
</LinearLayout>
</LinearLayout>
<ScrollView
android:id="@+id/indexScrollView"
android:layout_gravity="start"
android:layout_width="240dp"
android:layout_height="match_parent"
android:fillViewport="false" />
</android.support.v4.widget.DrawerLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ListView
android:id="@+id/feedDetailsLv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
</ListView>
<ViewStub
android:id="@+id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout="@layout/empty_feed_items" >
</ViewStub>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white" >
<ListView
android:id="@+id/feedDetailsLv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
</ListView>
<ViewStub
android:id="@+id/empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout="@layout/empty_feed_items" >
</ViewStub>
</RelativeLayout>
\ No newline at end of file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="60dp"
android:hapticFeedbackEnabled="true"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/headerLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/listHeader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="@android:color/darker_gray"
android:gravity="center"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="5" >
<TextView
android:id="@+id/itemTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="4"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/statusIcon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:src="@drawable/ic_action_download" >
</ImageView>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical" >
<ListView
android:id="@+id/feed_list"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/abs__background_holo_light"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:text="Please Enter the Name and the Url of the Lecture-Feed you want to add."
android:textSize="18sp" >
</TextView>
<EditText
android:id="@+id/tx_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="10dp"
android:background="@android:color/white"
android:ems="10"
android:hint="Name"
android:singleLine="true"
android:textColor="@android:color/black" />
<EditText
android:id="@+id/tx_url"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@android:color/white"
android:ems="10"
android:hint="Url"
android:inputType="textUri"
android:singleLine="true"
android:textColor="@android:color/black" >
</EditText>
<Button
android:id="@+id/button_paste"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp"
android:background="@color/light_gray"
android:text="@string/paste_url"
android:textSize="18sp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/abs__background_holo_light"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="28dp"
android:gravity="center_horizontal"
android:text="Suscribe to all Lectures since the following date"
android:textAppearance="?android:attr/textAppearanceMedium" />
<DatePicker
android:id="@+id/datePicker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:calendarViewShown="false" />
</LinearLayout>
\ No newline at end of file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="60dp">
<LinearLayout
android:id="@+id/headerLayout"
android:layout_height="wrap_content"
android:layout_width="match_parent"
>
<TextView
android:id="@+id/listHeader"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:background="@android:color/darker_gray"
android:visibility="gone"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="5" >
<TextView
android:id="@+id/itemTitle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:layout_gravity="center"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/statusIcon"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:gravity="center"
android:src="@drawable/ic_action_download" >
</ImageView>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/next"
android:showAsAction="always"
android:title="Next">
</item>
</menu>
\ No newline at end of file
......@@ -10,10 +10,7 @@
<item
android:id="@+id/next"
android:icon="@drawable/abs__ic_go"
android:showAsAction="always"/>
<item
android:id="@+id/extend"
android:icon="@drawable/ic_action_return_from_full_screen"
android:showAsAction="always"/>
android:showAsAction="always" android:title="Next"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Theme.Customactionbar" parent="@style/Theme.Sherlock.Light">
<item name="android:actionBarItemBackground">@drawable/selectable_background_customactionbar</item>
<item name="android:dropDownListViewStyle">@style/DropDownListView.Customactionbar</item>
<item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Customactionbar</item>
<item name="android:actionDropDownStyle">@style/DropDownNav.Customactionbar</item>
<item name="android:actionBarStyle">@style/ActionBar.Solid.Customactionbar</item>
<item name="android:actionModeBackground">@drawable/cab_background_top_customactionbar</item>
<item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_customactionbar</item>
<item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Customactionbar</item>
</style>
<style name="ActionBar.Solid.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionBar.Solid">
<item name="android:background">@drawable/ab_solid_customactionbar</item>
<item name="android:backgroundStacked">@drawable/ab_stacked_solid_customactionbar</item>
<item name="android:backgroundSplit">@drawable/ab_bottom_solid_customactionbar</item>
<item name="android:progressBarStyle">@style/ProgressBar.Customactionbar</item>
</style>
<style name="ActionBar.Transparent.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="android:background">@drawable/ab_transparent_customactionbar</item>
<item name="android:progressBarStyle">@style/ProgressBar.Customactionbar</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Customactionbar.Widget" parent="@style/Theme.Sherlock">
<item name="android:dropDownListViewStyle">@style/DropDownListView.Customactionbar</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">TTTClient</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="wait">Please Wait. Reading File</string>
<string name="confirm_download">Do you want to download this Lecture?\nThis could take some time and can\'t be canceled</string>
<string name="yes">Yes</string>
<string name="cancel">Cancel</string>
<string name="inet_needed">Internet Connection needed</string>
<string name="not_found">File was not found</string>
<string name="deleted">File was deleted</string>
<string name="delete_feed">Do you want to delete this feed? All corresponding Lectures on this devices will be deleted!</string>
<string name="delete_lecture"> Do you want to delete this lecture from your devices?</string>
<string name="delete">Delete</string>
<string name="add_feed">Add a new Feed</string>
<string name="parse_fail_title">Connection Failed!!!</string>
<string name="parse_fail_message">Please make sure that the URL is correct and reachable</string>
<string name="save">Save</string>
<string name="paste_url">Paste URL</string>
<string name="toast_clipboard_no_url">no URL in clipboard</string>
<string name="toast_insert_name">Please insert a name for this feed</string>
<string name="toast_insert_url">Please insert a valid Url</string>
<string name="toast_internet_needed">Internet Connection needed</string>
<string name="no_lectures">No Lectures Available</string>
<string name="no_feeds">No Feeds found!!! \n\n Add a feed by clicking on \n + \nin the Actionbar</string>
<string name="watch">Watch Lectures</string>
<string name="app_name">TTTClient</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="wait">Please Wait. Reading File</string>
<string name="confirm_download">Do you want to download this Lecture?\nThis could take some time and can\'t be canceled</string>
<string name="yes">Yes</string>
<string name="cancel">Cancel</string>
<string name="inet_needed">Internet Connection needed</string>
<string name="not_found">File was not found</string>
<string name="deleted">File was deleted</string>
<string name="delete_feed">Do you want to delete this feed? All corresponding Lectures on this devices will be deleted!</string>
<string name="delete_lecture"> Do you want to delete this lecture from your devices?</string>
<string name="delete">Delete</string>
<string name="add_feed">Add a new Feed</string>
<string name="parse_fail_title">Connection Failed!!!</string>
<string name="parse_fail_message">Please make sure that the URL is correct and reachable</string>
<string name="save">Save</string>
<string name="paste_url">Paste URL</string>
<string name="toast_clipboard_no_url">no URL in clipboard</string>
<string name="toast_insert_name">Please insert a name for this feed</string>
<string name="toast_insert_url">Please insert a valid Url</string>
<string name="toast_internet_needed">Internet Connection needed</string>
<string name="no_lectures">No Lectures Available</string>
<string name="no_feeds">No Feeds found!!! \n\n Add a feed by clicking on \n + \nin the Actionbar</string>
<string name="watch">Watch Lectures</string>
<color name="light_gray">#66bfbdbd</color>
<color name="trans_blue">#660063d2</color>
<color name="trans_black">#d1212427</color>
<string name="drawer_open">Open Index Navigation</string>
<string name="drawer_close">Close Index Navigation</string>
<color name="actionbar_blue">#6fbcfc</color>
</resources>
\ No newline at end of file
<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="android:Theme.Light">
<!--
-->
<style name="AppBaseTheme" parent="android:Theme.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>
-->
</style>
<style name="android:Theme.MusicPlayer">
<item name="android:textColor">#FFFFFF</item>
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
File created by the Android Action Bar Style Generator
Copyright (C) 2011 The Android Open Source Project
Copyright (C) 2012 readyState Software Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<style name="Theme.Customactionbar" parent="@style/Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarItemBackground">@drawable/selectable_background_customactionbar</item>
<item name="dropDownListViewStyle">@style/DropDownListView.Customactionbar</item>
<item name="actionBarTabStyle">@style/ActionBarTabStyle.Customactionbar</item>
<item name="actionDropDownStyle">@style/DropDownNav.Customactionbar</item>
<item name="actionBarStyle">@style/ActionBar.Solid.Customactionbar</item>
<item name="actionModeBackground">@drawable/cab_background_top_customactionbar</item>
<item name="actionModeSplitBackground">@drawable/cab_background_bottom_customactionbar</item>
<item name="actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Customactionbar</item>
</style>
<style name="ActionBar.Solid.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="background">@drawable/ab_solid_customactionbar</item>
<item name="backgroundStacked">@drawable/ab_stacked_solid_customactionbar</item>
<item name="backgroundSplit">@drawable/ab_bottom_solid_customactionbar</item>
<item name="progressBarStyle">@style/ProgressBar.Customactionbar</item>
</style>
<style name="ActionBar.Transparent.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionBar">
<item name="background">@drawable/ab_transparent_customactionbar</item>
<item name="progressBarStyle">@style/ProgressBar.Customactionbar</item>
</style>
<style name="DropDownListView.Customactionbar" parent="@style/Widget.Sherlock.Light.ListView.DropDown">
<item name="android:listSelector">@drawable/selectable_background_customactionbar</item>
</style>
<style name="ActionBarTabStyle.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionBar.TabView">
<item name="android:background">@drawable/tab_indicator_ab_customactionbar</item>
</style>
<style name="DropDownNav.Customactionbar" parent="@style/Widget.Sherlock.Light.Spinner.DropDown.ActionBar">
<item name="android:background">@drawable/spinner_background_ab_customactionbar</item>
<item name="android:popupBackground">@drawable/menu_dropdown_panel_customactionbar</item>
<item name="android:dropDownSelector">@drawable/selectable_background_customactionbar</item>
</style>
<style name="ProgressBar.Customactionbar" parent="@style/Widget.Sherlock.Light.ProgressBar.Horizontal">
<item name="android:progressDrawable">@drawable/progress_horizontal_customactionbar</item>
</style>
<style name="ActionButton.CloseMode.Customactionbar" parent="@style/Widget.Sherlock.Light.ActionButton.CloseMode">
<item name="android:background">@drawable/btn_cab_done_customactionbar</item>
</style>
<!-- this style is only referenced in a Light.DarkActionBar based theme -->
<style name="Theme.Customactionbar.Widget" parent="@style/Theme.Sherlock">
<item name="dropDownListViewStyle">@style/DropDownListView.Customactionbar</item>
</style>
</resources>
\ No newline at end of file
package tttclient.activities;
import java.util.Calendar;
import tttclient.fragments.FeedDetailsFragment;
import tttclient.fragments.FeedFragment.OnFeedSelectedListener;
import tttclient.models.Feed;
import tttclient.models.FeedDbManager;
import tttclient.models.FeedItemDbManager;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ClipData;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.os.Vibrator;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.URLUtil;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import de.tum.in.tttclient.R;
/**
*
* @author Thomas Krex
*
* Activity for adding and Displaying Feeds. This class uses the
* FeedDbManger to store feeds and a Listview to display them.
*
* @see FeedDbManager, Feed
*
*
*/
public class FeedActivity extends SherlockActivity implements
OnItemClickListener, OnItemLongClickListener {
private SimpleCursorAdapter adapter;
private String feedUrl;
private String feedName;
private int feedId;
private Dialog addDialog;
private EditText urlTxt;
private EditText nameTxt;
private DatePicker datePicker;
private Button pasteButton;
private Button saveButton;
private Vibrator myVib;
private ListView feedLv;
public class FeedActivity extends SherlockFragmentActivity implements
OnFeedSelectedListener {
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.feed_activity);
myVib = (Vibrator) this.getSystemService(VIBRATOR_SERVICE);
feedLv = (ListView) findViewById(R.id.feed_list);
FeedDbManager fManager = new FeedDbManager(this);
Cursor cursor = fManager.getAllFromDB();
adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_2, cursor,
new String[] { FeedDbManager.COLUMN_NAME,
FeedDbManager.COLUMN_FEEDURL }, new int[] {
android.R.id.text1, android.R.id.text2 });
feedLv.setAdapter(adapter);
// set view for empty list
View empty = findViewById(R.id.empty);
feedLv.setEmptyView(empty);
feedLv.setOnItemClickListener(this);
feedLv.setOnItemLongClickListener(this);
// initializing Dialog for adding Feeds
addDialog = new Dialog(this);
addDialog.setContentView(R.layout.dialog_feeds);
urlTxt = (EditText) addDialog.findViewById(R.id.tx_url);
nameTxt = (EditText) addDialog.findViewById(R.id.tx_name);
addDialog.setTitle(R.string.add_feed);
addDialog.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
// emptying textfields after canceling dialog
urlTxt.setText("");
nameTxt.setText("");
}
});
datePicker= (DatePicker) addDialog.findViewById(R.id.datePicker);
//determine the current semester and set the spinner to its beginning
Calendar c = Calendar.getInstance();
int currMonth= c.get(Calendar.MONTH);
int year;
int month;
//winter semester
if(currMonth>=Calendar.OCTOBER || currMonth<Calendar.APRIL){
month =Calendar.OCTOBER;
if(currMonth>=Calendar.OCTOBER)
year=c.get(Calendar.YEAR);
else
year=c.get(Calendar.YEAR)-1;
}
//summer semester
else{
year=c.get(Calendar.YEAR);
month= Calendar.APRIL;
}
datePicker.init(year, month, 1, null);
// Button for pasting Url from the clipboard into the textfield
pasteButton = (Button) addDialog.findViewById(R.id.button_paste);
pasteButton.setOnClickListener(new OnClickListener() {
/**
* handles Click on "Paste URL" Button
*/
@SuppressLint("NewApi")
@Override
public void onClick(View v) {
// ClipBoardManager moved from android.text to android.content
// from API 10 to 11
// // pasting for API >= 11
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
android.content.ClipboardManager clipboard = (android.content.ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
if (!clipboard.hasPrimaryClip()) {
Toast.makeText(getApplicationContext(),
R.string.toast_clipboard_no_url,
Toast.LENGTH_SHORT).show();
} else {
ClipData.Item item = clipboard.getPrimaryClip()
.getItemAt(0);
CharSequence pasteText = item.getText();
urlTxt.setText(pasteText);
}
} else {
// pasting for API < 11
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
if (!clipboard.hasText())
Toast.makeText(getApplicationContext(),
R.string.toast_clipboard_no_url,
Toast.LENGTH_SHORT).show();
else {
urlTxt.setText(clipboard.getText());
}
}
}
});
saveButton = (Button) addDialog.findViewById(R.id.button_save);
saveButton.setOnClickListener(new OnClickListener() {
setContentView(R.layout.activity_feeds);
@Override
public void onClick(View v) {
// name has to contains of at least one character
String name = nameTxt.getText().toString();
if (name.isEmpty()) {
Toast.makeText(getApplicationContext(),
R.string.toast_insert_name, Toast.LENGTH_LONG)
.show();
return;
}
String url = urlTxt.getText().toString();
// validate url
if (!URLUtil.isValidUrl(url)) {
Toast.makeText(getApplicationContext(),
R.string.toast_insert_url, Toast.LENGTH_LONG)
.show();
return;
}
// delete all whitespaces from url before inserting into the
// database
url.replaceAll("\\s+", "");
int month= datePicker.getMonth()+1;
int day= datePicker.getDayOfMonth();
String beginDate = "&begindate="+datePicker.getYear()+"_"+(month <10 ? "0" :"")+month+"_"+(day<10 ? "0" :"" )+day;
url=url +beginDate;
Log.d("FEED URL", url);
Feed feed = new Feed(name, url);
FeedDbManager fm = new FeedDbManager(getParent());
try {
fm.insertintoDB(feed);
} catch (Exception e) {
Log.e("FeedActivitity", "DB insert failure");
e.printStackTrace();
}
// refresh list
adapter.changeCursor(fm.getAllFromDB());
// clear textfields of dialog
nameTxt.setText("");
urlTxt.setText("");
// close dialog
addDialog.dismiss();
}
});
Intent intent = getIntent();
String action = intent.getAction();
if (Intent.ACTION_VIEW.equals(action)) {
Log.d("IntentFIlter", intent.getDataString());
urlTxt.setText(intent.getDataString());
addDialog.show();
}
}
@Override
......@@ -250,7 +34,9 @@ public class FeedActivity extends SherlockActivity implements
if (item.getItemId() == R.id.add) {
addDialog.show();
// addDialog.show();
Intent intent = new Intent(this, FeedWizardActivity.class);
startActivityForResult(intent, 0);
}
......@@ -258,58 +44,21 @@ public class FeedActivity extends SherlockActivity implements
}
@Override
public void onItemClick(AdapterView<?> av, View v, int position, long id) {
// click on feed in list
if (position != -1) {
Cursor c = (Cursor) av.getAdapter().getItem(position);
feedUrl = c.getString(c
.getColumnIndex(FeedDbManager.COLUMN_FEEDURL));
feedName = c.getString(c.getColumnIndex(FeedDbManager.COLUMN_NAME));
feedId = c.getInt(c.getColumnIndex("_id"));
Feed feed = new Feed(feedId, feedName, feedUrl);
public void onFeedSelected(Feed feed) {
FeedDetailsFragment detailsFragment = (FeedDetailsFragment) getSupportFragmentManager()
.findFragmentById(R.id.itemFragment);
if (detailsFragment == null) {
// send Feed to FeedDetailsActivity for displaying items
Intent intent = new Intent(this, FeedDetailActivity.class);
Intent intent = new Intent(this, FeedDetailActivity_old.class);
intent.putExtra("feed", feed);
startActivity(intent);
}
}
@Override
public boolean onItemLongClick(final AdapterView<?> av, View v,
final int position, long id) {
if (id == -1) {
return false;
}
// haptic feedback for longclick
myVib.vibrate(50);
// confirm delete
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
} else {
detailsFragment.updateList(feed);
@Override
public void onClick(DialogInterface dialog, int id) {
// delete feed from list, refresh feed list
Cursor c = (Cursor) av.getAdapter().getItem(position);
feedId = c.getInt(c.getColumnIndex("_id"));
}
FeedDbManager fm = new FeedDbManager(av.getContext());
FeedItemDbManager fim = new FeedItemDbManager(av.getContext());
// delete all childs and their folders
fim.deleteFromDb(feedId);
fm.deleteFromDb(feedId);
adapter.changeCursor(fm.getAllFromDB());
}
};
// show alert dialog to get confirmed delete process
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.delete_feed);
builder.setPositiveButton(R.string.delete, listener);
builder.setNegativeButton(R.string.cancel, null);
builder.show();
return true;
}
}
package tttclient.activities;
import tttclient.models.Feed;
import tttclient.models.FeedDbManager;
import tttclient.models.FeedItemDbManager;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.os.Vibrator;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import de.tum.in.tttclient.R;
/**
*
* @author Thomas Krex
*
* Activity for adding and Displaying Feeds. This class uses the
* FeedDbManger to store feeds and a ListView to display them. For
* adding a feed, the FeedWizardActivity is opened.
*
* @see FeedDbManager, Feed, FeedWizardActivity
*
*
*/
public class FeedActivity_old extends SherlockActivity implements
OnItemClickListener, OnItemLongClickListener {
private SimpleCursorAdapter adapter;
private String feedUrl;
private String feedName;
private int feedId;
private Vibrator myVib;
private ListView feedLv;
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_feeds);
myVib = (Vibrator) this.getSystemService(VIBRATOR_SERVICE);
feedLv = (ListView) findViewById(R.id.feed_list);
FeedDbManager fManager = new FeedDbManager(this);
Cursor cursor = fManager.getAllFromDB();
adapter = new SimpleCursorAdapter(this,
android.R.layout.simple_list_item_2, cursor,
new String[] { FeedDbManager.COLUMN_NAME,
FeedDbManager.COLUMN_FEEDURL }, new int[] {
android.R.id.text1, android.R.id.text2 });
feedLv.setAdapter(adapter);
// set view for empty list
View empty = findViewById(R.id.empty);
feedLv.setEmptyView(empty);
feedLv.setOnItemClickListener(this);
feedLv.setOnItemLongClickListener(this);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getSupportMenuInflater().inflate(R.menu.feed_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.add) {
// addDialog.show();
Intent intent = new Intent(this, FeedWizardActivity.class);
startActivityForResult(intent, 0);
}
return true;
}
@Override
public void onItemClick(AdapterView<?> av, View v, int position, long id) {
// click on feed in list
if (position != -1) {
Cursor c = (Cursor) av.getAdapter().getItem(position);
feedUrl = c.getString(c
.getColumnIndex(FeedDbManager.COLUMN_FEEDURL));
feedName = c.getString(c.getColumnIndex(FeedDbManager.COLUMN_NAME));
feedId = c.getInt(c.getColumnIndex("_id"));
Feed feed = new Feed(feedId, feedName, feedUrl);
// send Feed to FeedDetailsActivity for displaying items
Intent intent = new Intent(this, FeedDetailActivity_old.class);
intent.putExtra("feed", feed);
startActivity(intent);
}
}
@Override
public boolean onItemLongClick(final AdapterView<?> av, View v,
final int position, long id) {
if (id == -1) {
return false;
}
// haptic feedback for longclick
myVib.vibrate(50);
// v.performHapticFeedback(HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
// confirm delete
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// delete feed from list, refresh feed list
Cursor c = (Cursor) av.getAdapter().getItem(position);
feedId = c.getInt(c.getColumnIndex("_id"));
FeedDbManager fm = new FeedDbManager(av.getContext());
FeedItemDbManager fim = new FeedItemDbManager(av.getContext());
// delete all childs and their folders
fim.deleteFromDb(feedId);
fm.deleteFromDb(feedId);
adapter.changeCursor(fm.getAllFromDB());
}
};
// show alert dialog to get confirmed delete process
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.delete_feed);
builder.setPositiveButton(R.string.delete, listener);
builder.setNegativeButton(R.string.cancel, null);
builder.show();
return true;
}
@Override
protected void onResume() {
super.onResume();
adapter.changeCursor(new FeedDbManager(this).getAllFromDB());
}
}
This diff is collapsed.
package tttclient.activities;
import tttclient.fragments.FeedWizardFirstFragement;
import tttclient.fragments.FeedWizardSecondFragment;
import tttclient.models.Feed;
import tttclient.models.FeedDbManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.widget.FrameLayout;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import de.tum.in.tttclient.R;
/**
* @author thomas
*
* Activity for Adding new Feeds. This Activity uses two fragments, each
* for one step of the adding process.
*
*/
public class FeedWizardActivity extends SherlockFragmentActivity {
FrameLayout container;
FeedWizardFirstFragement firstFragment;
FeedWizardSecondFragment secondFragment;
Feed feed;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_feed_wizard);
setTitle("Adding new Feed");
container = (FrameLayout) findViewById(R.id.fragmentContainer);
firstFragment = new FeedWizardFirstFragement();
secondFragment = new FeedWizardSecondFragment();
Intent intent = getIntent();
String action = intent.getAction();
if (Intent.ACTION_VIEW.equals(action)) {
Bundle args = new Bundle();
args.putString("url", intent.getDataString());
firstFragment.setArguments(args);
}
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.fragmentContainer, firstFragment).commit();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
getSupportMenuInflater().inflate(R.menu.feed_wizard_menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.next) {
if (getSupportFragmentManager().findFragmentById(
R.id.fragmentContainer) instanceof FeedWizardFirstFragement) {
feed = firstFragment.saveInput();
if (feed == null)
return false;
Bundle args = new Bundle();
args.putParcelable("feed", feed);
secondFragment.setArguments(args);
FragmentTransaction ft = getSupportFragmentManager()
.beginTransaction();
ft.replace(R.id.fragmentContainer, secondFragment);
ft.commit();
item.setTitle("Done");
} else {
feed = secondFragment.saveInput();
FeedDbManager fm = new FeedDbManager(getParent());
try {
fm.insertintoDB(feed);
} catch (Exception e) {
Log.e("FeedActivitity", "DB insert failure");
e.printStackTrace();
}
finish();
}
return true;
}
return false;
}
}
......@@ -18,9 +18,9 @@ import de.tum.in.tttclient.R;
*
*/
public class MainActivity extends SherlockActivity {
private FeedbackDialog feedBack;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -37,21 +37,21 @@ public class MainActivity extends SherlockActivity {
}
});
Button feedbackButton = (Button) findViewById(R.id.feedback_button);
feedbackButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
feedBack.show();
}
});
}
@Override
protected void onPause() {
super.onPause();
feedBack.dismiss();
super.onPause();
feedBack.dismiss();
}
}
package tttclient.activities;
import android.content.Context;
import android.util.AttributeSet;