Skip to content

Commit

Permalink
add ads and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
romanbb committed Dec 7, 2011
1 parent 8f80e0a commit be0a0c6
Show file tree
Hide file tree
Showing 15 changed files with 332 additions and 138 deletions.
1 change: 1 addition & 0 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="lib" path="/media/android/home/roman/android/projects/GoogleAdMobAdsSdkAndroid-4.3.1/GoogleAdMobAdsSdk-4.3.1.jar"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
16 changes: 14 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.roman.tweaks"
android:versionCode="36" >
android:versionCode="39"
android:versionName="v39" >

<uses-feature android:name="android.hardware.camera" />

Expand All @@ -12,7 +13,8 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<supports-screens
android:anyDensity="true"
Expand Down Expand Up @@ -99,6 +101,16 @@
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:label="Tweaks - Statusbar Options"
android:name=".activities.PullDownActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
android:name="com.google.ads.AdActivity" />
</application>

</manifest>
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

#proguard.config=proguard.cfg
# Project target.
target=android-10
target=android-13
6 changes: 6 additions & 0 deletions res/layout/ad_preference.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?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">
</LinearLayout>
10 changes: 10 additions & 0 deletions res/layout/test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?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:orientation="vertical"
android:gravity="">



</RelativeLayout>
187 changes: 100 additions & 87 deletions res/xml/main_prefs.xml
Original file line number Diff line number Diff line change
@@ -1,88 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
android:key="pref_root"
xmlns:android="http://schemas.android.com/apk/res/android">

<PreferenceCategory
android:title="ROM Information"
android:key="rom_control">

<Preference
android:title="ROM Version"
android:key="rom_version" />

</PreferenceCategory>

<PreferenceCategory
android:title="Statusbar Tweaks"
android:key="statusbar_cat">

<Preference
android:title="Quick settings... settings"
android:key="quick_settings">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.roman.tweaks"
android:targetClass="com.roman.tweaks.activities.QuickSettingsActivity" />
</Preference>

<Preference
android:title="Lockscreen Settings"
android:key="lockscreen_settings">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.roman.tweaks"
android:targetClass="com.roman.tweaks.activities.LockscreensActivity"></intent>
</Preference>

<Preference
android:title="Clock options"
android:key="clock_options_pref">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.roman.tweaks"
android:targetClass="com.roman.tweaks.activities.ClockActivity" />
</Preference>

<Preference
android:title="Battery options"
android:key="battery_options_pref">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.roman.tweaks"
android:targetClass="com.roman.tweaks.activities.BatteryActivity" />
</Preference>

<Preference
android:title="Signal options"
android:key="signal_options_pref">
<intent
android:action="android.intent.action.MAIN"
android:targetPackage="com.roman.tweaks"
android:targetClass="com.roman.tweaks.activities.SignalsActivity" />
</Preference>

</PreferenceCategory>

<PreferenceCategory
android:title="Other"
android:key="other_cat">

<CheckBoxPreference
android:key="pref_animate_off"
android:title="Animate screen off" />

<CheckBoxPreference
android:key="pref_animate_on"
android:title="Animate screen on" />

<ListPreference
android:key="pref_overscroll_effect"
android:title="Overscroll Settings"
android:entries="@array/pref_overscroll_effect_entries"
android:entryValues="@array/pref_overscroll_effect_values" />



</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="pref_root" >

<PreferenceCategory
android:key="rom_control"
android:title="ROM Information" >

<Preference
android:key="rom_version"
android:title="ROM Version" />

<com.roman.tweaks.AdPreference android:layout="@layout/ad_preference" />
</PreferenceCategory>

<PreferenceCategory
android:key="statusbar_cat"
android:title="Statusbar Tweaks" >

<Preference
android:key="quick_settings"
android:title="Quick settings... settings" >

<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.roman.tweaks.activities.QuickSettingsActivity"
android:targetPackage="com.roman.tweaks" />
</Preference>

<Preference
android:key="lockscreen_settings"
android:title="Lockscreen Settings" >

<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.roman.tweaks.activities.LockscreensActivity"
android:targetPackage="com.roman.tweaks" >
</intent>
</Preference>

<Preference
android:key="clock_options_pref"
android:title="Clock options" >

<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.roman.tweaks.activities.ClockActivity"
android:targetPackage="com.roman.tweaks" />
</Preference>

<Preference
android:key="battery_options_pref"
android:title="Battery options" >

<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.roman.tweaks.activities.BatteryActivity"
android:targetPackage="com.roman.tweaks" />
</Preference>

<Preference
android:key="sustemui"
android:title="Statusbar Options" >

<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.roman.tweaks.activities.PullDownActivity"
android:targetPackage="com.roman.tweaks" />
</Preference>

<Preference
android:key="signal_options_pref"
android:title="Signal options" >

<intent
android:action="android.intent.action.MAIN"
android:targetClass="com.roman.tweaks.activities.SignalsActivity"
android:targetPackage="com.roman.tweaks" />
</Preference>
</PreferenceCategory>

<PreferenceCategory
android:key="other_cat"
android:title="Other" >

<CheckBoxPreference
android:key="pref_animate_off"
android:title="Animate screen off" />

<CheckBoxPreference
android:key="pref_animate_on"
android:title="Animate screen on" />

<ListPreference
android:entries="@array/pref_overscroll_effect_entries"
android:entryValues="@array/pref_overscroll_effect_values"
android:key="pref_overscroll_effect"
android:title="Overscroll Settings" />
</PreferenceCategory>

</PreferenceScreen>
16 changes: 16 additions & 0 deletions res/xml/pulldown_prefs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >

<CheckBoxPreference
android:key="swipe_to_clear"
android:title="Swipe-to-clear" />

<CheckBoxPreference
android:key="long_clock_to_clear"
android:title="Longpress-to-clear" />

<CheckBoxPreference
android:key="alternate_layout"
android:title="Alternate Layout" />

</PreferenceScreen>
6 changes: 3 additions & 3 deletions src/com/android/internal/policy/impl/GlobalActions.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

package com.android.internal.policy.impl;

import java.io.IOException;
import java.util.ArrayList;

import android.R;
import android.app.AlertDialog;
import android.app.StatusBarManager;
Expand Down Expand Up @@ -34,6 +31,9 @@
import com.android.internal.app.ShutdownThread;
import com.google.android.collect.Lists;

import java.io.IOException;
import java.util.ArrayList;

public class GlobalActions implements OnClickListener, OnDismissListener {

public static final String TAG = "GlobalActions";
Expand Down
54 changes: 54 additions & 0 deletions src/com/roman/tweaks/AdPreference.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

package com.roman.tweaks;

import android.app.Activity;
import android.content.Context;
import android.preference.Preference;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;

public class AdPreference extends Preference {

public AdPreference(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}

public AdPreference(Context context, AttributeSet attrs) {
super(context, attrs);
}

public AdPreference(Context context) {
super(context);
}

@Override
protected View onCreateView(ViewGroup parent) {
// this will create the linear layout defined in ads_layout.xml
View view = super.onCreateView(parent);

// the context is a PreferenceActivity
Activity activity = (Activity) getContext();

// Create the adView
AdView adView = new AdView(activity, AdSize.BANNER, "a14eded2475e9ba");

((LinearLayout) view).addView(adView);

// Initiate a generic request to load it with an ad
AdRequest request = new AdRequest();
request.addTestDevice("FFACA8A2CF5F68C71EDD6B8BB46D2ECA");

adView.loadAd(request);

return view;
}



}
Loading

0 comments on commit be0a0c6

Please sign in to comment.