com.facebook.internal.Utility.FetchedAppSettings Java Examples

The following examples show how to use com.facebook.internal.Utility.FetchedAppSettings. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LoginButton.java    From android-skeleton-project with MIT License 6 votes vote down vote up
private void checkNuxSettings() {
    if (nuxMode == ToolTipMode.DISPLAY_ALWAYS) {
        String nuxString = getResources().getString(R.string.com_facebook_tooltip_default);
        displayNux(nuxString);
    } else {
        // kick off an async request
        final String appId = Utility.getMetadataApplicationId(getContext());
        AsyncTask<Void, Void, FetchedAppSettings> task = new AsyncTask<Void, Void, Utility.FetchedAppSettings>() {
            @Override
            protected FetchedAppSettings doInBackground(Void... params) {
                FetchedAppSettings settings = Utility.queryAppSettings(appId, false);
                return settings;
            }

            @Override
            protected void onPostExecute(FetchedAppSettings result) {
                showNuxPerSettings(result);
            }
        };
        task.execute((Void[])null);
    }

}
 
Example #2
Source File: LoginButton.java    From FacebookImageShareIntent with MIT License 6 votes vote down vote up
private void checkNuxSettings() {
    if (nuxMode == ToolTipMode.DISPLAY_ALWAYS) {
        String nuxString = getResources().getString(R.string.com_facebook_tooltip_default);
        displayNux(nuxString);
    } else {
        // kick off an async request
        final String appId = Utility.getMetadataApplicationId(getContext());
        AsyncTask<Void, Void, FetchedAppSettings> task = new AsyncTask<Void, Void, Utility.FetchedAppSettings>() {
            @Override
            protected FetchedAppSettings doInBackground(Void... params) {
                FetchedAppSettings settings = Utility.queryAppSettings(appId, false);
                return settings;
            }

            @Override
            protected void onPostExecute(FetchedAppSettings result) {
                showNuxPerSettings(result);
            }
        };
        task.execute((Void[])null);
    }

}
 
Example #3
Source File: LoginButton.java    From Abelana-Android with Apache License 2.0 6 votes vote down vote up
private void checkNuxSettings() {
    if (nuxMode == ToolTipMode.DISPLAY_ALWAYS) {
        String nuxString = getResources().getString(R.string.com_facebook_tooltip_default);
        displayNux(nuxString);
    } else {
        // kick off an async request
        final String appId = Utility.getMetadataApplicationId(getContext());
        AsyncTask<Void, Void, FetchedAppSettings> task = new AsyncTask<Void, Void, Utility.FetchedAppSettings>() {
            @Override
            protected FetchedAppSettings doInBackground(Void... params) {
                FetchedAppSettings settings = Utility.queryAppSettings(appId, false);
                return settings;
            }

            @Override
            protected void onPostExecute(FetchedAppSettings result) {
                showNuxPerSettings(result);
            }
        };
        task.execute((Void[])null);
    }

}
 
Example #4
Source File: LoginButton.java    From facebook-api-android-maven with Apache License 2.0 6 votes vote down vote up
private void checkNuxSettings() {
    if (nuxMode == ToolTipMode.DISPLAY_ALWAYS) {
        String nuxString = getResources().getString(R.string.com_facebook_tooltip_default);
        displayNux(nuxString);
    } else {
        // kick off an async request
        final String appId = Utility.getMetadataApplicationId(getContext());
        AsyncTask<Void, Void, FetchedAppSettings> task = new AsyncTask<Void, Void, Utility.FetchedAppSettings>() {
            @Override
            protected FetchedAppSettings doInBackground(Void... params) {
                FetchedAppSettings settings = Utility.queryAppSettings(appId, false);
                return settings;
            }

            @Override
            protected void onPostExecute(FetchedAppSettings result) {
                showNuxPerSettings(result);
            }
        };
        task.execute((Void[])null);
    }

}
 
Example #5
Source File: LoginButton.java    From kognitivo with Apache License 2.0 5 votes vote down vote up
private void checkToolTipSettings() {
    switch (toolTipMode) {
        case AUTOMATIC:
            // kick off an async request
            final String appId = Utility.getMetadataApplicationId(getContext());
            FacebookSdk.getExecutor().execute(new Runnable() {
                @Override
                public void run() {
                    final FetchedAppSettings settings = Utility.queryAppSettings(appId, false);
                    getActivity().runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            showToolTipPerSettings(settings);
                        }
                    });
                }
            });
            break;
        case DISPLAY_ALWAYS:
            String toolTipString = getResources().getString(
                    R.string.com_facebook_tooltip_default);
            displayToolTip(toolTipString);
            break;
        case NEVER_DISPLAY:
            break;
    }
}
 
Example #6
Source File: LoginButton.java    From kognitivo with Apache License 2.0 4 votes vote down vote up
private void showToolTipPerSettings(FetchedAppSettings settings) {
    if (settings != null && settings.getNuxEnabled() && getVisibility() == View.VISIBLE) {
        String toolTipString = settings.getNuxContent();
        displayToolTip(toolTipString);
    }
}
 
Example #7
Source File: LoginButton.java    From android-skeleton-project with MIT License 4 votes vote down vote up
private void showNuxPerSettings(FetchedAppSettings settings) {
    if (settings != null && settings.getNuxEnabled() && getVisibility() == View.VISIBLE) {
        String nuxString = settings.getNuxContent();
        displayNux(nuxString);
    }
}
 
Example #8
Source File: LoginButton.java    From FacebookImageShareIntent with MIT License 4 votes vote down vote up
private void showNuxPerSettings(FetchedAppSettings settings) {
    if (settings != null && settings.getNuxEnabled() && getVisibility() == View.VISIBLE) {
        String nuxString = settings.getNuxContent();
        displayNux(nuxString);
    }
}
 
Example #9
Source File: LoginButton.java    From Abelana-Android with Apache License 2.0 4 votes vote down vote up
private void showNuxPerSettings(FetchedAppSettings settings) {
    if (settings != null && settings.getNuxEnabled() && getVisibility() == View.VISIBLE) {
        String nuxString = settings.getNuxContent();
        displayNux(nuxString);
    }
}
 
Example #10
Source File: LoginButton.java    From facebook-api-android-maven with Apache License 2.0 4 votes vote down vote up
private void showNuxPerSettings(FetchedAppSettings settings) {
    if (settings != null && settings.getNuxEnabled() && getVisibility() == View.VISIBLE) {
        String nuxString = settings.getNuxContent();
        displayNux(nuxString);
    }
}