Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! We cleaned up your code for you! #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You only need to perform this step when Google releases a new platform version o
Update your SDK files to the latest version like so:

$ android update sdk --no-ui

It's important that you repeat this command until you see the message "There is nothing to install or update." That's because the tools update themselves,
so it may take several iterations of this command until everything is fully updated.

Expand Down
4 changes: 2 additions & 2 deletions default.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
#
# This file must be checked in Version Control Systems.
#
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
Expand Down
44 changes: 22 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<version>1.0-SNAPSHOT</version>
<description>A utility library for your daily Android needs.</description>
<url>http://github.com/kaeppler/droid-fu</url>

<developers>
<developer>
<id>mk</id>
Expand Down Expand Up @@ -50,13 +50,13 @@

<!-- build settings -->
<packaging>jar</packaging>

<build>

<defaultGoal>package</defaultGoal>

<plugins>

<!-- compiler settings -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -66,7 +66,7 @@
<target>1.5</target>
</configuration>
</plugin>

<!-- jar builder settings -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -77,12 +77,12 @@
<exclude>**/*.apk</exclude>
<exclude>**/*.dex</exclude>
<exclude>**/*.ap_</exclude>
</excludes>
</excludes>
</configuration>
</plugin>

<!-- we always wanna have a nice up-to-date JavaDoc JAR -->
<!--
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand All @@ -106,7 +106,7 @@
<tagBase>http://github.com/kaeppler/droid-fu/tree</tagBase>
</configuration>
</plugin>

<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>maven-android-plugin</artifactId>
Expand All @@ -121,18 +121,18 @@
</configuration>
<extensions>true</extensions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>${androidVersion}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.google.android.maps</groupId>
<artifactId>maps</artifactId>
Expand All @@ -146,23 +146,23 @@
<version>2.2.1</version>
<scope>provided</scope>
</dependency>


<dependency>
<groupId>org.powermock.modules</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.powermock.api</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependency>

</dependencies>

<!-- external repositories -->
<repositories>
Expand All @@ -175,7 +175,7 @@
<distributionManagement>
<downloadUrl>http://github.com/kaeppler/droid-fu/downloads</downloadUrl>
</distributionManagement>

<profiles>
<profile>
<id>copy-jar</id>
Expand All @@ -201,11 +201,11 @@
</configuration>
</execution>
</executions>
</plugin>
</plugin>
</plugins>
</build>
</profile>

<!-- Sonatype requires releases to be signed before being pushed to central -->
<profile>
<id>release-sign-artifacts</id>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/github/droidfu/activities/BetterActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface BetterActivity {
* Activity of your own application, or by an Activity of an entirely
* different application. This function only returns true, if your Activity
* is being paused by an Activity of another app, thus hiding yours.
*
*
* @return true, if the Activity is being paused because an Activity of
* another application received focus.
*/
Expand All @@ -68,7 +68,7 @@ public interface BetterActivity {
* returned. Otherwise the returned Intent is the intent returned by
* getIntent (which is the Intent which was used to initially launch this
* activity).
*
*
* @return the current {@link Intent}
*/
public Intent getCurrentIntent();
Expand Down Expand Up @@ -104,7 +104,7 @@ public AlertDialog newYesNoDialog(int titleResourceId, int messageResourceId,
* email</li>
* </ul>
* </p>
*
*
* @param titleResourceId
* the string resource that should be used as the dialog title
* @param error
Expand Down Expand Up @@ -134,7 +134,7 @@ public AlertDialog newYesNoDialog(int titleResourceId, int messageResourceId,
* email</li>
* </ul>
* </p>
*
*
* @param error
* the exception that should be displayed and/or reported
* @return the dialog
Expand All @@ -144,7 +144,7 @@ public AlertDialog newYesNoDialog(int titleResourceId, int messageResourceId,
/**
* Creates a new list style dialog from a list of objects. The toString()
* method of any such object will be used to generate the list item's label.
*
*
* @param <T>
* the type of the list items
* @param dialogTitle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static int getWindowFeatures(Activity activity) {

/**
* Creates a new ProgressDialog
*
*
* @param activity
* @param progressDialogTitleId
* The resource id for the title. If this is less than or equal to 0, a default title
Expand Down Expand Up @@ -102,7 +102,7 @@ public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {

/**
* Creates a new Yes/No AlertDialog
*
*
* @param context
* @param dialogTitle
* @param screenMessage
Expand All @@ -126,7 +126,7 @@ public static AlertDialog newYesNoDialog(final Context context, String dialogTit

/**
* Creates a new AlertDialog to display a simple message
*
*
* @param context
* @param dialogTitle
* @param screenMessage
Expand Down Expand Up @@ -157,7 +157,7 @@ public void onClick(DialogInterface dialog, int which) {
* droidfu_error_report_email_address - The email address the exception is sent to.
* droidfu_error_report_email_subject - The subject of the email.
* droidfu_dialog_button_send_error_report - The text on the Send Email button.
*
*
* @param activity
* @param dialogTitle
* @param error
Expand Down Expand Up @@ -214,7 +214,7 @@ public void onClick(DialogInterface dialog, int which) {
/**
* Creates a AlertDialog that shows a list of elements. The listener's onClick method gets
* called when the user taps a list item.
*
*
* @param <T>
* The type of each element
* @param context
Expand Down Expand Up @@ -262,7 +262,7 @@ public void onClick(DialogInterface dialog, int which) {

/**
* Checks if the application is in the background (i.e behind another application's Activity).
*
*
* @param context
* @return true if another application is above this one.
*/
Expand All @@ -284,7 +284,7 @@ public static boolean isApplicationBroughtToBackground(final Context context) {
* {@link DroidFuApplication#onClose()} life-cycle handler. Application close is being defined
* as the transition of the last running Activity of the current application to the Android home
* screen using the BACK button.
*
*
* @param context
* the current context
* @param keyCode
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/com/github/droidfu/activities/BetterMapActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,27 @@
import com.google.android.maps.MyLocationOverlay;

public class BetterMapActivity extends MapActivity implements BetterActivity {

private boolean wasCreated, wasInterrupted;

private int progressDialogTitleId;

private int progressDialogMsgId;

private Intent currentIntent;

private MyLocationOverlay myLocationOverlay;

private GestureDetector tapDetector;

private OnTouchListener tapListener;

private MapView mapView;

@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);

this.wasCreated = true;
this.currentIntent = getIntent();

Expand All @@ -52,32 +52,32 @@ protected void onCreate(Bundle icicle) {
((DroidFuApplication) application).setActiveContext(getClass().getCanonicalName(), this);
}
}

@Override
protected void onPause() {
super.onPause();
wasCreated = wasInterrupted = false;

if (myLocationOverlay != null) {
myLocationOverlay.disableMyLocation();
}
}

@Override
protected void onResume() {
super.onResume();

if (myLocationOverlay != null) {
myLocationOverlay.enableMyLocation();
}
}

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
wasInterrupted = true;
}

@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
Expand Down Expand Up @@ -151,7 +151,7 @@ public <T> Dialog newListDialog(String title, List<T> elements,
boolean closeOnSelect) {
return BetterActivityHelper.newListDialog(this, title, elements, listener, closeOnSelect);
}

@Override
protected Dialog onCreateDialog(int id) {
return BetterActivityHelper.createProgressDialog(this, progressDialogTitleId,
Expand All @@ -165,14 +165,14 @@ public void setProgressDialogTitleId(int progressDialogTitleId) {
public void setProgressDialogMsgId(int progressDialogMsgId) {
this.progressDialogMsgId = progressDialogMsgId;
}

public void setMapView(int mapLayoutId) {
this.mapView = (MapView) findViewById(mapLayoutId);
}

public void setMapViewWithZoom(int mapLayoutId, int zoomControlsLayoutId) {
this.mapView = (MapView) findViewById(mapLayoutId);

ZoomControls zoomControls = (ZoomControls) findViewById(zoomControlsLayoutId);
zoomControls.setOnZoomInClickListener(new View.OnClickListener() {
public void onClick(View v) {
Expand All @@ -186,23 +186,23 @@ public void onClick(View v) {
}
});
}

public MapView getMapView() {
return mapView;
}

public void setMyLocationOverlay(MyLocationOverlay myLocationOverlay) {
// Create the overlay and add it to the map.
this.myLocationOverlay = myLocationOverlay;
mapView.getOverlays().add(this.myLocationOverlay);
}

public MyLocationOverlay getMyLocationOverlay() {
return myLocationOverlay;
}

protected void setMapGestureListener(MapGestureListener mapGestureListener) {
// Map gesture listener. Our default implementation handles a double tap action
// Map gesture listener. Our default implementation handles a double tap action
// as a zoom in.
tapDetector = new GestureDetector(mapGestureListener);
tapListener = new View.OnTouchListener() {
Expand Down
Loading