This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package <Package Name>; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.preference.PreferenceManager; | |
import java.util.Map; | |
import java.util.Set; | |
public class PreferenceHelper { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package <Package Name>; | |
import android.content.Context; | |
import android.graphics.Typeface; | |
import android.text.TextUtils; | |
public class FontUtils { | |
/** | |
* Loads the desired font. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FragmentHelper { | |
public static boolean isFragmentVisible(WeakReference<Fragment> fragment) { | |
if (fragment!=null && fragment.get() != null && fragment.get().getActivity() != null && | |
fragment.get() | |
.isVisible() | |
&& !fragment.get().isRemoving()) { | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocationHelper{ | |
public static boolean isLocationEnabled(Context context) { | |
LocationManager locationManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); | |
// Check GPS status | |
boolean isGPSEnabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER); | |
// Check network status | |
boolean isNetworkEnabled = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER); | |
if (!isGPSEnabled && !isNetworkEnabled) { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.AlertDialog; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
/** | |
* Dialog helper class | |
*/ | |
public class DestructiveDialog { | |
public DestructiveDialog(Context context, String title, String message, String positive, String negative, final DialogListener dialogListener) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import java.util.concurrent.TimeUnit; | |
import rx.Observable; | |
import rx.Observer; | |
import rx.Subscription; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.os.BatteryManager; | |
import com.mobyta.mobilewebdashboard.ThisApplication; | |
public class BatteryHelper { | |
private Intent mBatteryDataIntent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = angular.module('MainApp', ['ngMaterial']); | |
var icons = { | |
refresh: "M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z", | |
share: "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92 1.61 0 2.92-1.31 2.92-2.92s-1.31-2.92-2.92-2.92z" | |
}; | |
app.directive('svgIcon', function() { | |
function link(scope, element, attrs) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var fs = require('fs'); | |
app.get('/get', function (req, res) { | |
res.sendFile(__dirname + '/' + req.query.type + '/' + req.query.name); | |
}) | |
app.get('/list', function (req, res) { |
OlderNewer