Skip to content

Commit

Permalink
first time modification
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsquid888 committed Apr 26, 2011
1 parent f1d45a1 commit e486146
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 3 deletions.
3 changes: 2 additions & 1 deletion astrid/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<classpathentry kind="src" path="src-legacy"/>
<classpathentry kind="src" path="common-src"/>
<classpathentry excluding="com/todoroo/astrid/rmilk/EditOperationExposer.java|com/todoroo/astrid/rmilk/MilkEditActivity.java" kind="src" path="plugin-src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="src" path="rmilk-src"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="lib" path="libs/annotations.jar"/>
Expand All @@ -15,8 +14,10 @@
<classpathentry exported="true" kind="lib" path="libs/locale_platform.jar"/>
<classpathentry exported="true" kind="lib" path="libs/todoroo-g.jar"/>
<classpathentry kind="lib" path="libs/framework.jar"/>
<classpathentry kind="lib" path="/Users/spicysquid/androidstuff/admob/GoogleAdMobAdsSdkAndroid-4.0.4/GoogleAdMobAdsSdk-4.0.4.jar"/>
<classpathentry kind="src" path="GreenDroid_src"/>
<classpathentry kind="src" path="astridApi_src"/>
<classpathentry kind="src" path="facebook_src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="ecbuild"/>
</classpath>
6 changes: 5 additions & 1 deletion astrid/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<uses-permission android:name="android.permission.VIBRATE"/>
<!-- for synchronization -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- for google calendar integration -->
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
Expand Down Expand Up @@ -58,7 +59,10 @@

<application android:icon="@drawable/icon" android:label="@string/app_name"
android:theme="@style/Theme">


<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>

<!-- ====================================================== Activities = -->

<!-- Activity that displays task list -->
Expand Down
12 changes: 11 additions & 1 deletion astrid/res/layout/task_list_activity.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- See the file "LICENSE" for the full license governing this code. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/res/com.timsu.astrid"
android:id="@+id/taskListParent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background_gradient"
android:orientation="vertical">



<!-- Header -->
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="42dip"
android:layout_weight="1"
android:orientation="horizontal"
android:background="@drawable/edit_header">


<!-- Filters Button -->
<ImageView android:id="@+id/back"
Expand All @@ -39,6 +42,13 @@
</LinearLayout>

<!-- Body goes here -->
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"

ads:adSize="BANNER"
/>


<!-- Footer -->
<LinearLayout
Expand Down
12 changes: 12 additions & 0 deletions astrid/res/values/attrs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.google.ads.AdView">
<attr name="adSize">
<enum name="BANNER" value="1"/>
<enum name="IAB_MRECT" value="2"/>
<enum name="IAB_BANNER" value="3"/>
<enum name="IAB_LEADERBOARD" value="4"/>
</attr>
<attr name="adUnitId" format="string"/>
</declare-styleable>
</resources>
17 changes: 17 additions & 0 deletions astrid/src/com/todoroo/astrid/activity/TaskListActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
import android.widget.TextView.OnEditorActionListener;
import android.widget.Toast;

import com.google.ads.AdRequest;
import com.google.ads.AdView;
import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property;
import com.todoroo.andlib.data.TodorooCursor;
Expand Down Expand Up @@ -139,6 +141,7 @@ public class TaskListActivity extends ListActivity implements OnScrollListener,

/** token for passing a {@link Filter} object through extras */
public static final String TOKEN_FILTER = "filter"; //$NON-NLS-1$
private static final String MY_AD_UNIT_ID = "a14cb151eb21c6c";

// --- instance variables

Expand Down Expand Up @@ -204,17 +207,31 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

new StartupService().onStartupApplication(this);


//AdView adView = new AdView(this, AdSize.BANNER, MY_AD_UNIT_ID);

ViewGroup parent = (ViewGroup) getLayoutInflater().inflate(R.layout.task_list_activity, null);
//parent.addView(adView,1);
parent.addView(getListBody(parent), 1);

setContentView(parent);

AdView adView = (AdView)this.findViewById(R.id.adView);
adView.loadAd(new AdRequest());


if(database == null)
return;

database.openForWriting();
setUpUiComponents();
onNewIntent(getIntent());




//adView.loadAd(new AdRequest());
Eula.showEula(this);
}

Expand Down

0 comments on commit e486146

Please sign in to comment.