com.facebook.android.R Java Examples
The following examples show how to use
com.facebook.android.R.
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: PickerFragment.java From platform-friends-android with BSD 2-Clause "Simplified" License | 6 votes |
@Override public void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState) { super.onInflate(activity, attrs, savedInstanceState); TypedArray a = activity.obtainStyledAttributes(attrs, R.styleable.com_facebook_picker_fragment); setShowPictures(a.getBoolean(R.styleable.com_facebook_picker_fragment_show_pictures, showPictures)); String extraFieldsString = a.getString(R.styleable.com_facebook_picker_fragment_extra_fields); if (extraFieldsString != null) { String[] strings = extraFieldsString.split(","); setExtraFields(Arrays.asList(strings)); } showTitleBar = a.getBoolean(R.styleable.com_facebook_picker_fragment_show_title_bar, showTitleBar); titleText = a.getString(R.styleable.com_facebook_picker_fragment_title_text); doneButtonText = a.getString(R.styleable.com_facebook_picker_fragment_done_button_text); titleBarBackground = a.getDrawable(R.styleable.com_facebook_picker_fragment_title_bar_background); doneButtonBackground = a.getDrawable(R.styleable.com_facebook_picker_fragment_done_button_background); a.recycle(); }
Example #2
Source File: GraphObjectAdapter.java From aws-mobile-self-paced-labs-samples with Apache License 2.0 | 6 votes |
protected View createGraphObjectView(T graphObject, View convertView) { View result = inflater.inflate(getGraphObjectRowLayoutId(graphObject), null); ViewStub checkboxStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_checkbox_stub); if (checkboxStub != null) { if (!getShowCheckbox()) { checkboxStub.setVisibility(View.GONE); } else { CheckBox checkBox = (CheckBox) checkboxStub.inflate(); updateCheckboxState(checkBox, false); } } ViewStub profilePicStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_profile_pic_stub); if (!getShowPicture()) { profilePicStub.setVisibility(View.GONE); } else { ImageView imageView = (ImageView) profilePicStub.inflate(); imageView.setVisibility(View.VISIBLE); } return result; }
Example #3
Source File: ProfilePictureView.java From android-skeleton-project with MIT License | 6 votes |
private int getPresetSizeInPixels(boolean forcePreset) { int dimensionId; switch (presetSizeType) { case SMALL: dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_small; break; case NORMAL: dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_normal; break; case LARGE: dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_large; break; case CUSTOM: if (!forcePreset) { return ImageRequest.UNSPECIFIED_DIMENSION; } else { dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_normal; break; } default: return ImageRequest.UNSPECIFIED_DIMENSION; } return getResources().getDimensionPixelSize(dimensionId); }
Example #4
Source File: AuthorizationClient.java From platform-friends-android with BSD 2-Clause "Simplified" License | 6 votes |
boolean checkInternetPermission() { if (checkedInternetPermission) { return true; } int permissionCheck = checkPermission(Manifest.permission.INTERNET); if (permissionCheck != PackageManager.PERMISSION_GRANTED) { String errorType = context.getString(R.string.com_facebook_internet_permission_error_title); String errorDescription = context.getString(R.string.com_facebook_internet_permission_error_message); complete(Result.createErrorResult(pendingRequest, errorType, errorDescription)); return false; } checkedInternetPermission = true; return true; }
Example #5
Source File: PlacePickerFragment.java From platform-friends-android with BSD 2-Clause "Simplified" License | 6 votes |
@Override void setupViews(ViewGroup view) { if (showSearchBox) { ListView listView = (ListView) view.findViewById(R.id.com_facebook_picker_list_view); View searchHeaderView = getActivity().getLayoutInflater().inflate( R.layout.com_facebook_picker_search_box, listView, false); listView.addHeaderView(searchHeaderView, null, false); searchBox = (EditText) view.findViewById(R.id.com_facebook_picker_search_text); searchBox.addTextChangedListener(new SearchTextWatcher()); if (!TextUtils.isEmpty(searchText)) { searchBox.setText(searchText); } } }
Example #6
Source File: AuthorizationClient.java From android-skeleton-project with MIT License | 6 votes |
boolean checkInternetPermission() { if (checkedInternetPermission) { return true; } int permissionCheck = checkPermission(Manifest.permission.INTERNET); if (permissionCheck != PackageManager.PERMISSION_GRANTED) { String errorType = context.getString(R.string.com_facebook_internet_permission_error_title); String errorDescription = context.getString(R.string.com_facebook_internet_permission_error_message); complete(Result.createErrorResult(pendingRequest, errorType, errorDescription)); return false; } checkedInternetPermission = true; return true; }
Example #7
Source File: FriendPickerFragment.java From platform-friends-android with BSD 2-Clause "Simplified" License | 6 votes |
@Override PickerFragmentAdapter<GraphUser> createAdapter() { PickerFragmentAdapter<GraphUser> adapter = new PickerFragmentAdapter<GraphUser>( this.getActivity()) { @Override protected int getGraphObjectRowLayoutId(GraphUser graphObject) { return R.layout.com_facebook_picker_list_row; } @Override protected int getDefaultPicture() { return R.drawable.com_facebook_profile_default_icon; } }; adapter.setShowCheckbox(true); adapter.setShowPicture(getShowPictures()); adapter.setSortFields(Arrays.asList(new String[]{NAME})); adapter.setGroupByField(NAME); return adapter; }
Example #8
Source File: AuthorizationClient.java From Abelana-Android with Apache License 2.0 | 6 votes |
boolean checkInternetPermission() { if (checkedInternetPermission) { return true; } int permissionCheck = checkPermission(Manifest.permission.INTERNET); if (permissionCheck != PackageManager.PERMISSION_GRANTED) { String errorType = context.getString(R.string.com_facebook_internet_permission_error_title); String errorDescription = context.getString(R.string.com_facebook_internet_permission_error_message); complete(Result.createErrorResult(pendingRequest, errorType, errorDescription)); return false; } checkedInternetPermission = true; return true; }
Example #9
Source File: UserSettingsFragment.java From barterli_android with Apache License 2.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false); loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button); loginButton.setProperties(loginButtonProperties); loginButton.setFragment(this); loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE); Session session = getSession(); if (session != null && !session.equals(Session.getActiveSession())) { loginButton.setSession(session); } connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name); // if no background is set for some reason, then default to Facebook blue if (view.getBackground() == null) { view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue)); } else { view.getBackground().setDither(true); } return view; }
Example #10
Source File: ProfilePictureView.java From Klyph with MIT License | 6 votes |
private int getPresetSizeInPixels(boolean forcePreset) { int dimensionId; switch (presetSizeType) { case SMALL: dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_small; break; case NORMAL: dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_normal; break; case LARGE: dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_large; break; case CUSTOM: if (!forcePreset) { return ImageRequest.UNSPECIFIED_DIMENSION; } else { dimensionId = R.dimen.com_facebook_profilepictureview_preset_size_normal; break; } default: return ImageRequest.UNSPECIFIED_DIMENSION; } return getResources().getDimensionPixelSize(dimensionId); }
Example #11
Source File: GraphObjectAdapter.java From Abelana-Android with Apache License 2.0 | 6 votes |
protected View createGraphObjectView(T graphObject) { View result = inflater.inflate(getGraphObjectRowLayoutId(graphObject), null); ViewStub checkboxStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_checkbox_stub); if (checkboxStub != null) { if (!getShowCheckbox()) { checkboxStub.setVisibility(View.GONE); } else { CheckBox checkBox = (CheckBox) checkboxStub.inflate(); updateCheckboxState(checkBox, false); } } ViewStub profilePicStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_profile_pic_stub); if (!getShowPicture()) { profilePicStub.setVisibility(View.GONE); } else { ImageView imageView = (ImageView) profilePicStub.inflate(); imageView.setVisibility(View.VISIBLE); } return result; }
Example #12
Source File: LoginButton.java From Abelana-Android with Apache License 2.0 | 6 votes |
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 #13
Source File: WebDialog.java From Abelana-Android with Apache License 2.0 | 6 votes |
private void createCrossImage() { crossImageView = new ImageView(getContext()); // Dismiss the dialog when user click on the 'x' crossImageView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { sendCancelToListener(); WebDialog.this.dismiss(); } }); Drawable crossDrawable = getContext().getResources().getDrawable(R.drawable.com_facebook_close); crossImageView.setImageDrawable(crossDrawable); /* 'x' should not be visible while webview is loading * make it visible only after webview has fully loaded */ crossImageView.setVisibility(View.INVISIBLE); }
Example #14
Source File: UserSettingsFragment.java From Klyph with MIT License | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.com_facebook_usersettingsfragment, container, false); loginButton = (LoginButton) view.findViewById(R.id.com_facebook_usersettingsfragment_login_button); loginButton.setProperties(loginButtonProperties); loginButton.setFragment(this); loginButton.setLoginLogoutEventName(AnalyticsEvents.EVENT_USER_SETTINGS_USAGE); Session session = getSession(); if (session != null && !session.equals(Session.getActiveSession())) { loginButton.setSession(session); } connectedStateLabel = (TextView) view.findViewById(R.id.com_facebook_usersettingsfragment_profile_name); // if no background is set for some reason, then default to Facebook blue if (view.getBackground() == null) { view.setBackgroundColor(getResources().getColor(R.color.com_facebook_blue)); } else { view.getBackground().setDither(true); } return view; }
Example #15
Source File: UserSettingsFragment.java From Klyph with MIT License | 6 votes |
private ImageRequest getImageRequest() { ImageRequest request = null; try { ImageRequest.Builder requestBuilder = new ImageRequest.Builder( getActivity(), ImageRequest.getProfilePictureUrl( user.getId(), getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width), getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height))); request = requestBuilder.setCallerTag(this) .setCallback( new ImageRequest.Callback() { @Override public void onCompleted(ImageResponse response) { processImageResponse(user.getId(), response); } }) .build(); } catch (URISyntaxException e) { } return request; }
Example #16
Source File: GraphObjectAdapter.java From android-skeleton-project with MIT License | 6 votes |
protected View createGraphObjectView(T graphObject) { View result = inflater.inflate(getGraphObjectRowLayoutId(graphObject), null); ViewStub checkboxStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_checkbox_stub); if (checkboxStub != null) { if (!getShowCheckbox()) { checkboxStub.setVisibility(View.GONE); } else { CheckBox checkBox = (CheckBox) checkboxStub.inflate(); updateCheckboxState(checkBox, false); } } ViewStub profilePicStub = (ViewStub) result.findViewById(R.id.com_facebook_picker_profile_pic_stub); if (!getShowPicture()) { profilePicStub.setVisibility(View.GONE); } else { ImageView imageView = (ImageView) profilePicStub.inflate(); imageView.setVisibility(View.VISIBLE); } return result; }
Example #17
Source File: LoginActivity.java From FacebookImageShareIntent with MIT License | 5 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.com_facebook_login_activity_layout); if (savedInstanceState != null) { callingPackage = savedInstanceState.getString(SAVED_CALLING_PKG_KEY); authorizationClient = (AuthorizationClient) savedInstanceState.getSerializable(SAVED_AUTH_CLIENT); } else { callingPackage = getCallingPackage(); authorizationClient = new AuthorizationClient(); request = (AuthorizationClient.AuthorizationRequest) getIntent().getSerializableExtra(EXTRA_REQUEST); } authorizationClient.setContext(this); authorizationClient.setOnCompletedListener(new AuthorizationClient.OnCompletedListener() { @Override public void onCompleted(AuthorizationClient.Result outcome) { onAuthClientCompleted(outcome); } }); authorizationClient.setBackgroundProcessingListener(new AuthorizationClient.BackgroundProcessingListener() { @Override public void onBackgroundProcessingStarted() { findViewById(R.id.com_facebook_login_activity_progress_bar).setVisibility(View.VISIBLE); } @Override public void onBackgroundProcessingStopped() { findViewById(R.id.com_facebook_login_activity_progress_bar).setVisibility(View.GONE); } }); }
Example #18
Source File: GraphObjectAdapter.java From android-skeleton-project with MIT License | 5 votes |
String getPictureFieldSpecifier() { // How big is our image? View view = createGraphObjectView(null); ImageView picture = (ImageView) view.findViewById(R.id.com_facebook_picker_image); if (picture == null) { return null; } // Note: these dimensions are in pixels, not dips ViewGroup.LayoutParams layoutParams = picture.getLayoutParams(); return String.format("picture.height(%d).width(%d)", layoutParams.height, layoutParams.width); }
Example #19
Source File: UserSettingsFragment.java From FacebookImageShareIntent with MIT License | 5 votes |
private void processImageResponse(String id, ImageResponse response) { if (response != null) { Bitmap bitmap = response.getBitmap(); if (bitmap != null) { BitmapDrawable drawable = new BitmapDrawable(UserSettingsFragment.this.getResources(), bitmap); drawable.setBounds(0, 0, getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width), getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)); userProfilePic = drawable; userProfilePicID = id; connectedStateLabel.setCompoundDrawables(null, drawable, null, null); connectedStateLabel.setTag(response.getRequest().getImageUri()); } } }
Example #20
Source File: LoginActivity.java From platform-friends-android with BSD 2-Clause "Simplified" License | 5 votes |
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.com_facebook_login_activity_layout); if (savedInstanceState != null) { callingPackage = savedInstanceState.getString(SAVED_CALLING_PKG_KEY); authorizationClient = (AuthorizationClient) savedInstanceState.getSerializable(SAVED_AUTH_CLIENT); } else { callingPackage = getCallingPackage(); authorizationClient = new AuthorizationClient(); request = (AuthorizationClient.AuthorizationRequest) getIntent().getSerializableExtra(EXTRA_REQUEST); } authorizationClient.setContext(this); authorizationClient.setOnCompletedListener(new AuthorizationClient.OnCompletedListener() { @Override public void onCompleted(AuthorizationClient.Result outcome) { onAuthClientCompleted(outcome); } }); authorizationClient.setBackgroundProcessingListener(new AuthorizationClient.BackgroundProcessingListener() { @Override public void onBackgroundProcessingStarted() { findViewById(R.id.com_facebook_login_activity_progress_bar).setVisibility(View.VISIBLE); } @Override public void onBackgroundProcessingStopped() { findViewById(R.id.com_facebook_login_activity_progress_bar).setVisibility(View.GONE); } }); }
Example #21
Source File: GraphObjectAdapter.java From android-skeleton-project with MIT License | 5 votes |
protected View getSectionHeaderView(String sectionHeader, View convertView, ViewGroup parent) { TextView result = (TextView) convertView; if (result == null) { result = (TextView) inflater.inflate(R.layout.com_facebook_picker_list_section_header, null); } result.setText(sectionHeader); return result; }
Example #22
Source File: GraphObjectAdapter.java From KlyphMessenger with MIT License | 5 votes |
String getPictureFieldSpecifier() { // How big is our image? View view = createGraphObjectView(null); ImageView picture = (ImageView) view.findViewById(R.id.com_facebook_picker_image); if (picture == null) { return null; } // Note: these dimensions are in pixels, not dips ViewGroup.LayoutParams layoutParams = picture.getLayoutParams(); return String.format("picture.height(%d).width(%d)", layoutParams.height, layoutParams.width); }
Example #23
Source File: LoginButton.java From Klyph with MIT License | 5 votes |
private void setButtonText() { if (sessionTracker != null && sessionTracker.getOpenSession() != null) { setText((logoutText != null) ? logoutText : getResources().getString(R.string.com_facebook_loginview_log_out_button)); } else { setText((loginText != null) ? loginText : getResources().getString(R.string.com_facebook_loginview_log_in_button)); } }
Example #24
Source File: UserSettingsFragment.java From barterli_android with Apache License 2.0 | 5 votes |
private void processImageResponse(String id, ImageResponse response) { if (response != null) { Bitmap bitmap = response.getBitmap(); if (bitmap != null) { BitmapDrawable drawable = new BitmapDrawable(UserSettingsFragment.this.getResources(), bitmap); drawable.setBounds(0, 0, getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_width), getResources().getDimensionPixelSize(R.dimen.com_facebook_usersettingsfragment_profile_picture_height)); userProfilePic = drawable; userProfilePicID = id; connectedStateLabel.setCompoundDrawables(null, drawable, null, null); connectedStateLabel.setTag(response.getRequest().getImageUri()); } } }
Example #25
Source File: LoginButton.java From aws-mobile-self-paced-labs-samples with Apache License 2.0 | 5 votes |
private void setButtonText() { if (sessionTracker != null && sessionTracker.getOpenSession() != null) { setText((logoutText != null) ? logoutText : getResources().getString(R.string.com_facebook_loginview_log_out_button)); } else { setText((loginText != null) ? loginText : getResources().getString(R.string.com_facebook_loginview_log_in_button)); } }
Example #26
Source File: PlacePickerFragment.java From aws-mobile-self-paced-labs-samples with Apache License 2.0 | 5 votes |
@Override public void onActivityCreated(final Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); ViewGroup view = (ViewGroup) getView(); if (showSearchBox) { ViewStub stub = (ViewStub) view.findViewById(R.id.com_facebook_placepickerfragment_search_box_stub); if (stub != null) { searchBox = (EditText) stub.inflate(); // Put the list under the search box RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT); layoutParams.addRule(RelativeLayout.BELOW, R.id.search_box); ListView listView = (ListView) view.findViewById(R.id.com_facebook_picker_list_view); listView.setLayoutParams(layoutParams); // If we need to, put the search box under the title bar. if (view.findViewById(R.id.com_facebook_picker_title_bar) != null) { layoutParams = new RelativeLayout.LayoutParams( RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT); layoutParams.addRule(RelativeLayout.BELOW, R.id.com_facebook_picker_title_bar); searchBox.setLayoutParams(layoutParams); } searchBox.addTextChangedListener(new SearchTextWatcher()); if (!TextUtils.isEmpty(searchText)) { searchBox.setText(searchText); } } } }
Example #27
Source File: PlacePickerFragment.java From barterli_android with Apache License 2.0 | 5 votes |
@Override public void onInflate(Activity activity, AttributeSet attrs, Bundle savedInstanceState) { super.onInflate(activity, attrs, savedInstanceState); TypedArray a = activity.obtainStyledAttributes(attrs, R.styleable.com_facebook_place_picker_fragment); setRadiusInMeters(a.getInt(R.styleable.com_facebook_place_picker_fragment_radius_in_meters, radiusInMeters)); setResultsLimit(a.getInt(R.styleable.com_facebook_place_picker_fragment_results_limit, resultsLimit)); if (a.hasValue(R.styleable.com_facebook_place_picker_fragment_results_limit)) { setSearchText(a.getString(R.styleable.com_facebook_place_picker_fragment_search_text)); } showSearchBox = a.getBoolean(R.styleable.com_facebook_place_picker_fragment_show_search_box, showSearchBox); a.recycle(); }
Example #28
Source File: ProfilePictureView.java From FacebookImageShareIntent with MIT License | 5 votes |
private void setBlankProfilePicture() { if (customizedDefaultProfilePicture == null) { int blankImageResource = isCropped() ? R.drawable.com_facebook_profile_picture_blank_square : R.drawable.com_facebook_profile_picture_blank_portrait; setImageBitmap( BitmapFactory.decodeResource(getResources(), blankImageResource)); } else { // Update profile image dimensions. updateImageQueryParameters(); // Resize inputBitmap to new dimensions of queryWidth and queryHeight. Bitmap scaledBitmap = Bitmap.createScaledBitmap(customizedDefaultProfilePicture, queryWidth, queryHeight, false); setImageBitmap(scaledBitmap); } }
Example #29
Source File: LoginActivity.java From Klyph with MIT License | 5 votes |
@Override public void onPause() { super.onPause(); authorizationClient.cancelCurrentHandler(); findViewById(R.id.com_facebook_login_activity_progress_bar).setVisibility(View.GONE); }
Example #30
Source File: GraphObjectAdapter.java From Klyph with MIT License | 5 votes |
private View getActivityCircleView(View convertView, ViewGroup parent) { View result = convertView; if (result == null) { result = inflater.inflate(R.layout.com_facebook_picker_activity_circle_row, null); } ProgressBar activityCircle = (ProgressBar) result.findViewById(R.id.com_facebook_picker_row_activity_circle); activityCircle.setVisibility(View.VISIBLE); return result; }