本文整理匯總了Java中com.facebook.Settings類的典型用法代碼示例。如果您正苦於以下問題:Java Settings類的具體用法?Java Settings怎麽用?Java Settings使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Settings類屬於com.facebook包,在下文中一共展示了Settings類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: log
import com.facebook.Settings; //導入依賴的package包/類
public static void log(LoggingBehavior behavior, int priority, String tag, String string) {
if (Settings.isLoggingBehaviorEnabled(behavior)) {
string = replaceStrings(string);
if (tag.startsWith(LOG_TAG_BASE) == false) {
tag = LOG_TAG_BASE + tag;
}
Log.println(priority, tag, string);
// Developer errors warrant special treatment by printing out a stack trace, to make both more noticeable,
// and let the source of the problem be more easily pinpointed.
if (behavior == LoggingBehavior.DEVELOPER_ERRORS) {
(new Exception()).printStackTrace();
}
}
}
示例2: clearCache
import com.facebook.Settings; //導入依賴的package包/類
public void clearCache() {
// get the current directory listing of files to delete
final File[] filesToDelete = directory.listFiles(BufferFile.excludeBufferFiles());
lastClearCacheTime.set(System.currentTimeMillis());
if (filesToDelete != null) {
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
for (File file : filesToDelete) {
file.delete();
}
}
});
}
}
示例3: postTrim
import com.facebook.Settings; //導入依賴的package包/類
private void postTrim() {
synchronized (lock) {
if (!isTrimPending) {
isTrimPending = true;
Settings.getExecutor().execute(new Runnable() {
@Override
public void run() {
trim();
}
});
}
}
}
示例4: createProxyAuthIntent
import com.facebook.Settings; //導入依賴的package包/類
public static Intent createProxyAuthIntent(Context context, String applicationId, List<String> permissions,
String e2e, boolean isRerequest, SessionDefaultAudience defaultAudience) {
for (NativeAppInfo appInfo : facebookAppInfoList) {
Intent intent = new Intent()
.setClassName(appInfo.getPackage(), FACEBOOK_PROXY_AUTH_ACTIVITY)
.putExtra(FACEBOOK_PROXY_AUTH_APP_ID_KEY, applicationId);
if (!Utility.isNullOrEmpty(permissions)) {
intent.putExtra(FACEBOOK_PROXY_AUTH_PERMISSIONS_KEY, TextUtils.join(",", permissions));
}
if (!Utility.isNullOrEmpty(e2e)) {
intent.putExtra(FACEBOOK_PROXY_AUTH_E2E_KEY, e2e);
}
intent.putExtra(ServerProtocol.DIALOG_PARAM_RESPONSE_TYPE, ServerProtocol.DIALOG_RESPONSE_TYPE_TOKEN);
intent.putExtra(ServerProtocol.DIALOG_PARAM_RETURN_SCOPES, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);
intent.putExtra(ServerProtocol.DIALOG_PARAM_DEFAULT_AUDIENCE, defaultAudience.getNativeProtocolAudience());
if (!Settings.getPlatformCompatibilityEnabled()) {
// Override the API Version for Auth
intent.putExtra(ServerProtocol.DIALOG_PARAM_LEGACY_OVERRIDE, ServerProtocol.GRAPH_API_VERSION);
// Only set the rerequest auth type for non legacy requests
if (isRerequest) {
intent.putExtra(ServerProtocol.DIALOG_PARAM_AUTH_TYPE, ServerProtocol.DIALOG_REREQUEST_AUTH_TYPE);
}
}
intent = validateActivityIntent(context, intent, appInfo);
if (intent != null) {
return intent;
}
}
return null;
}
示例5: requestAsync
import com.facebook.Settings; //導入依賴的package包/類
/**
* Request to login async.
*
* @param strPath
* - Path of login.
* @param callback
* - Call back function.
*/
public <T> void requestAsync( String strPath,
final OnResult<T> callback)
{
Settings.addLoggingBehavior(LoggingBehavior.INCLUDE_ACCESS_TOKENS);
Settings.addLoggingBehavior(LoggingBehavior.REQUESTS);
Session session = Session.getActiveSession();
Request request =
Request.newGraphPathRequest(session, strPath,
new Request.Callback()
{
@Override
public void onCompleted(Response response)
{
if (response.getError() != null)
{
Log.i("MainActivity",
String.format(
"Error making request: %s",
response.getError()));
}
else
{
GraphUser user =
response.getGraphObjectAs(GraphUser.class);
callback.onResult((T) user);
Log.i("MainActivity",
String.format(
"Name: %s",
user.getName()));
}
}
});
request.executeAsync();
}
示例6: registerAccessToken
import com.facebook.Settings; //導入依賴的package包/類
public synchronized static void registerAccessToken(String accessToken) {
if (Settings.isLoggingBehaviorEnabled(LoggingBehavior.INCLUDE_ACCESS_TOKENS) == false) {
registerStringToReplace(accessToken, "ACCESS_TOKEN_REMOVED");
}
}
示例7: shouldLog
import com.facebook.Settings; //導入依賴的package包/類
private boolean shouldLog() {
return Settings.isLoggingBehaviorEnabled(behavior);
}
示例8: WorkQueue
import com.facebook.Settings; //導入依賴的package包/類
WorkQueue(int maxConcurrent) {
this(maxConcurrent, Settings.getExecutor());
}
示例9: getDialogAuthority
import com.facebook.Settings; //導入依賴的package包/類
public static final String getDialogAuthority() {
return String.format(DIALOG_AUTHORITY_FORMAT, Settings.getFacebookDomain());
}
示例10: getGraphUrlBase
import com.facebook.Settings; //導入依賴的package包/類
public static final String getGraphUrlBase() {
return String.format(GRAPH_URL_FORMAT, Settings.getFacebookDomain());
}
示例11: getGraphVideoUrlBase
import com.facebook.Settings; //導入依賴的package包/類
public static final String getGraphVideoUrlBase() {
return String.format(GRAPH_VIDEO_URL_FORMAT, Settings.getFacebookDomain());
}
示例12: getRestUrlBase
import com.facebook.Settings; //導入依賴的package包/類
public static final String getRestUrlBase() {
return String.format(REST_URL_FORMAT, Settings.getFacebookDomain());
}
示例13: getAPIVersion
import com.facebook.Settings; //導入依賴的package包/類
public static final String getAPIVersion() {
if (Settings.getPlatformCompatibilityEnabled()) {
return LEGACY_API_VERSION;
}
return GRAPH_API_VERSION;
}