Skip to content

Commit

Permalink
add javadoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
midhunhk committed Jul 26, 2018
1 parent 8fe2be8 commit 930c7b8
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.CALL_PHONE"/>-->

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.CALL_PHONE"/>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
*/
package com.ae.apps.common.services;

import java.io.InputStream;
import java.util.List;

import android.graphics.Bitmap;

import com.ae.apps.common.vo.ContactVo;
import com.ae.apps.common.vo.MessageVo;
import com.ae.apps.common.vo.PhoneNumberVo;

import java.io.InputStream;
import java.util.List;

/**
* Specification for a DAO that accesses the Android Contacts API
*/
Expand Down Expand Up @@ -80,7 +80,7 @@ public interface AeContactService {
/**
* Opens a contact photo?
*
* See if you could use @LINK{getContactPhoto()} instead
* See if you could use getContactPhoto instead
*
* @param contactId contactId
* @return contact photo
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/ae/apps/common/utils/ContactUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ContactUtils {
*
* @param phoneNumbers phone numbers
* @param numberToCheck number to check
* @return true if phone number exists
*/
public static boolean checkIfPhoneNumberExists(final List<String> phoneNumbers, final String numberToCheck) {
String unformattedNumber = cleanupPhoneNumber(numberToCheck);
Expand Down Expand Up @@ -60,6 +61,7 @@ public static String cleanupPhoneNumber(String formattedPhoneNumber) {
/**
* Shows this contact in the Android's Contact Manager
*
* @param context the context
* @param contactId contactId
*/
public static void showContactInAddressBook(Context context, String contactId) {
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/com/ae/apps/common/utils/IntentUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,50 @@ public static class EmailIntentBuilder {
private String mSubject;
private String mBody;

/**
* Create a new instance of the builder
*/
public EmailIntentBuilder() {
}

/**
* set the to address
*
* @param to to address
* @return this instance
*/
public EmailIntentBuilder to(String to) {
mTo = to;
return this;
}

/**
* set the subject
*
* @param subject the email subject
* @return this instance
*/
public EmailIntentBuilder subject(String subject) {
mSubject = subject;
return this;
}

/**
* set the body
*
* @param body the email body
* @return this instance
*/
public EmailIntentBuilder body(String body) {
mBody = body;
return this;
}

/**
* get the intent for an email
*
* @return the intent
*/
public Intent get() {
Intent intent = new Intent(Intent.ACTION_SENDTO);
intent.setType("text/html");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,15 @@ public static boolean isInternetAvailable(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);

NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
NetworkInfo networkInfo = connectivityManager != null ?
connectivityManager.getActiveNetworkInfo() : null;

// Check the current state of the Network Information
if (networkInfo == null)
return false;
if (!networkInfo.isConnected())
return false;
if (!networkInfo.isAvailable())
return false;
return true;
return networkInfo.isAvailable();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
/**
* Comparator that can be used for sorting a map based on the values
*
* @param <K>
* @param <V>
* @param <K> k
* @param <V> v
*/
public class ValueComparator<K, V extends Comparable<V>> implements Comparator<K> {

Expand Down

0 comments on commit 930c7b8

Please sign in to comment.