本文整理匯總了Java中com.facebook.android.R類的典型用法代碼示例。如果您正苦於以下問題:Java R類的具體用法?Java R怎麽用?Java R使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
R類屬於com.facebook.android包,在下文中一共展示了R類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkInternetPermission
import com.facebook.android.R; //導入依賴的package包/類
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;
}
示例2: getPresetSizeInPixels
import com.facebook.android.R; //導入依賴的package包/類
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);
}
示例3: checkNuxSettings
import com.facebook.android.R; //導入依賴的package包/類
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);
}
}
示例4: createGraphObjectView
import com.facebook.android.R; //導入依賴的package包/類
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;
}
示例5: onCreateView
import com.facebook.android.R; //導入依賴的package包/類
@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;
}
示例6: getImageRequest
import com.facebook.android.R; //導入依賴的package包/類
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;
}
示例7: setupViews
import com.facebook.android.R; //導入依賴的package包/類
@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);
}
}
}
示例8: onInflate
import com.facebook.android.R; //導入依賴的package包/類
@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();
}
示例9: createAdapter
import com.facebook.android.R; //導入依賴的package包/類
@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;
}
示例10: createCrossImage
import com.facebook.android.R; //導入依賴的package包/類
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);
}
示例11: initialize
import com.facebook.android.R; //導入依賴的package包/類
private void initialize() {
// apparently there's no method of setting a default style in xml,
// so in case the users do not explicitly specify a style, we need
// to use sensible defaults.
this.setGravity(Gravity.CENTER_VERTICAL);
this.setTextColor(getResources().getColor(R.color.com_facebook_likebutton_text_color));
this.setTextSize(TypedValue.COMPLEX_UNIT_PX,
getResources().getDimension(R.dimen.com_facebook_likebutton_text_size));
this.setTypeface(Typeface.DEFAULT_BOLD);
this.setCompoundDrawablePadding(
getResources().getDimensionPixelSize(R.dimen.com_facebook_likebutton_compound_drawable_padding));
this.setPadding(
getResources().getDimensionPixelSize(R.dimen.com_facebook_likebutton_padding_left),
getResources().getDimensionPixelSize(R.dimen.com_facebook_likebutton_padding_top),
getResources().getDimensionPixelSize(R.dimen.com_facebook_likebutton_padding_right),
getResources().getDimensionPixelSize(R.dimen.com_facebook_likebutton_padding_bottom));
updateForLikeStatus();
}
示例12: initializeLikeCountLabel
import com.facebook.android.R; //導入依賴的package包/類
private void initializeLikeCountLabel(Context context) {
likeCountLabel = new TextView(context);
LayoutParams likeCountLabelLayoutParams = new LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
likeCountLabel.setLayoutParams(likeCountLabelLayoutParams);
likeCountLabel.setGravity(Gravity.CENTER);
likeCountLabel.setTextSize(
TypedValue.COMPLEX_UNIT_PX,
getResources().getDimension(R.dimen.com_facebook_likeboxcountview_text_size));
likeCountLabel.setTextColor(getResources().getColor(R.color.com_facebook_likeboxcountview_text_color));
textPadding = getResources().getDimensionPixelSize(R.dimen.com_facebook_likeboxcountview_text_padding);
// Calculate the additional text padding that will be applied in the direction of the caret.
additionalTextPadding = getResources().getDimensionPixelSize(R.dimen.com_facebook_likeboxcountview_caret_height);
}
示例13: createCrossImage
import com.facebook.android.R; //導入依賴的package包/類
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) {
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);
}