Permalink
Browse files

Merge branch 'master' of github.com:swisscodemonkeys/appbrain-sdk

Conflicts:
	example/src/com/appbrain/example/ExampleActivity.java
  • Loading branch information...
2 parents f2f2e54 + b3df737 commit 2ace8df32e92035b6ba5319557d085c72ebaa89b @mathijs81 mathijs81 committed Jul 17, 2012
@@ -7,13 +7,13 @@
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
-
+
<application
android:icon="@drawable/ic_launcher"
- android:label="@string/app_name" >
+ android:label="@string/app_name">
<activity
android:label="@string/app_name"
- android:name=".ExampleActivity" >
+ android:name=".ExampleActivity">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@@ -33,5 +33,4 @@
<service android:name="com.appbrain.AppBrainService" />
<!-- End of AppLift SDK -->
</application>
-
</manifest>
@@ -7,10 +7,6 @@
android:layout_width="fill_parent"
android:layout_height="120dip" >
</com.appbrain.example.fun.LogoView>
-
-
- <Button android:id="@+id/show_popup" android:layout_width="200dp" android:layout_marginTop="40dp"
- android:layout_height="wrap_content" android:text="Show Dialog" />
<Button android:id="@+id/maybe_show_interstitial"
android:layout_width="200dp" android:layout_height="wrap_content"
@@ -67,21 +67,6 @@ public void onClick(View v) {
ads.showOfferWall(ExampleActivity.this);
}
});
-
-
- findViewById(R.id.show_popup).setOnClickListener(new OnClickListener() {
-
- @Override
- public void onClick(View v) {
- ads.showDialog(ExampleActivity.this, "Hello", "This is an example", "Ok", new Runnable() {
-
- @Override
- public void run() {
- Toast.makeText(ExampleActivity.this, "You selected 'Ok'", Toast.LENGTH_LONG).show();
- }
- });
- }
- });
findViewById(R.id.show_banners).setOnClickListener(new OnClickListener() {
@@ -91,7 +76,6 @@ public void onClick(View arg0) {
startActivity(intent);
}
});
-
}
// @Override
@@ -56,9 +56,10 @@ public void update() {
}
public void draw(Canvas canvas) {
-
paint.setColor(color);
- canvas.drawCircle(pos.x, pos.y, radius, paint);
-
+ // don't do circles, they are extremely slow on hardware accelerated devices
+ //canvas.drawCircle(pos.x, pos.y, radius, paint);
+ canvas.drawRect(pos.x - radius / 2, pos.y - radius / 2, pos.x + radius / 2, pos.y + radius
+ / 2, paint);
}
}
@@ -4,19 +4,21 @@
import java.util.List;
import android.graphics.Bitmap;
+import android.graphics.Bitmap.Config;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
-import android.graphics.Bitmap.Config;
-import android.graphics.Paint.Align;
+import android.util.Log;
public class BallGroup {
final int width;
final int height;
List<Ball> balls;
private Bitmap bitmap;
+ private final int step;
- public BallGroup(int width, int height) {
+ public BallGroup(int width, int height, int step) {
+ this.step = step;
this.width = width;
this.height = height;
balls = new ArrayList<Ball>(0);
@@ -26,7 +28,6 @@ public BallGroup(int width, int height) {
}
private void createText(List<Ball> ballsArrayList, String text) {
- int step = 6;
int w = (width / step) * step;
int h = (height / step) * step;
@@ -36,7 +36,8 @@ protected void onDraw(Canvas canvas) {
void doUpdate(Canvas canvas) {
if (ballGroup == null || ballGroup.width != getWidth() || ballGroup.height != getHeight()) {
- ballGroup = new BallGroup(getWidth(), getHeight());
+ ballGroup = new BallGroup(getWidth(), getHeight(),
+ (int) (4.0 * getResources().getDisplayMetrics().density));
}
ballGroup.update(touchX, touchY);

0 comments on commit 2ace8df

Please sign in to comment.