当前位置: 首页>>代码示例>>Java>>正文


Java WebDialog类代码示例

本文整理汇总了Java中com.facebook.widget.WebDialog的典型用法代码示例。如果您正苦于以下问题:Java WebDialog类的具体用法?Java WebDialog怎么用?Java WebDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WebDialog类属于com.facebook.widget包,在下文中一共展示了WebDialog类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: build

import com.facebook.widget.WebDialog; //导入依赖的package包/类
@Override
public WebDialog build() {
    Bundle parameters = getParameters();
    parameters.putString(ServerProtocol.DIALOG_PARAM_REDIRECT_URI, REDIRECT_URI);
    parameters.putString(ServerProtocol.DIALOG_PARAM_CLIENT_ID, getApplicationId());
    parameters.putString(ServerProtocol.DIALOG_PARAM_E2E, e2e);
    parameters.putString(ServerProtocol.DIALOG_PARAM_RESPONSE_TYPE, ServerProtocol.DIALOG_RESPONSE_TYPE_TOKEN);
    parameters.putString(ServerProtocol.DIALOG_PARAM_RETURN_SCOPES, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE);

    // Only set the rerequest auth type for non legacy requests
    if (isRerequest && !Settings.getPlatformCompatibilityEnabled()) {
        parameters.putString(ServerProtocol.DIALOG_PARAM_AUTH_TYPE, ServerProtocol.DIALOG_REREQUEST_AUTH_TYPE);
    }

    return new WebDialog(getContext(), OAUTH_DIALOG, parameters, getTheme(), getListener());
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:17,代码来源:AuthorizationClient.java

示例2: share_caip

import com.facebook.widget.WebDialog; //导入依赖的package包/类
private void share_caip() {
 	
 	Session session = Session.getActiveSession();
  if (session != null){
  String sesija = session.toString();
  Log.w ("ss", sesija);}

final MySQLiteHelper db = new MySQLiteHelper(getActivity());
  
  List<Avisos_Caip> avisos = db.getAllAvisos();  
 	int listcounter=0;
  Avisos_Caip avi = avisos.get(listcounter);
  aviso = avi.getTitle();

     Bundle bundle = new Bundle();
     bundle.putString("caption", "Fique informado!");
     bundle.putString("description", aviso);
     bundle.putString("name", "Aviso do Caip IPRJ");
     bundle.putString("picture", "http://www.labcor.iprj.uerj.br/imagens/logo_uerj.jpg");
  
     new WebDialog.FeedDialogBuilder(this.getActivity(), session, bundle).build().show();
 }
 
开发者ID:Paulocajr,项目名称:IPRJapp,代码行数:23,代码来源:Home_Fragment.java

示例3: share_lembrete

import com.facebook.widget.WebDialog; //导入依赖的package包/类
private void share_lembrete() {
  	
  	Session session = Session.getActiveSession();
   if (session != null){
   String sesija = session.toString();
   Log.w ("ss", sesija);}

final MySQLiteHelper db = new MySQLiteHelper(getActivity());
List<Atividade> ativ = db.getAllAtividades(); 
int listcounter=0;
Atividade atv = ativ.get(listcounter);			  
lembretes = atv.getTitle();

      Bundle bundle = new Bundle();
      bundle.putString("caption", "Lembrete Importante!");
      bundle.putString("description", lembretes);
      bundle.putString("name", "Minhas Atividades");
      bundle.putString("picture", "http://www.labcor.iprj.uerj.br/imagens/logo_uerj.jpg");
   
      new WebDialog.FeedDialogBuilder(this.getActivity(), session, bundle).build().show();
  }
 
开发者ID:Paulocajr,项目名称:IPRJapp,代码行数:22,代码来源:Home_Fragment.java

示例4: share_aviso_prof

import com.facebook.widget.WebDialog; //导入依赖的package包/类
private void share_aviso_prof() {
	
	Session session = Session.getActiveSession();
    if (session != null){
    String sesija = session.toString();
    Log.w ("ss", sesija);}

	final MySQLiteHelper db = new MySQLiteHelper(getActivity());
	List<Atividade> ativ = db.getAllAtividades(); 
	int listcounter=0;
	Atividade atv = ativ.get(listcounter);			  
	lembretes = atv.getTitle();

    Bundle bundle = new Bundle();
    bundle.putString("caption", "Fique Informado!");
    bundle.putString("description", aviso_professor);
    bundle.putString("name", "Mural do Professor");
    bundle.putString("picture", "http://www.labcor.iprj.uerj.br/imagens/logo_uerj.jpg");
 
    new WebDialog.FeedDialogBuilder(this.getActivity(), session, bundle).build().show();
}
 
开发者ID:Paulocajr,项目名称:IPRJapp,代码行数:22,代码来源:Home_Fragment.java

示例5: sendRequestDialog

import com.facebook.widget.WebDialog; //导入依赖的package包/类
private void sendRequestDialog() {

      Bundle params = new Bundle();
      params.putString("title", "Solicitação de Aplicativo");
      params.putString("message", "Experimente o IPRJapp");
      params.putString("link","https://play.google.com/store/apps/details?id=com.wb.goog.batman.brawler2013");
      params.putString("data",
          "{\"badge_of_awesomeness\":\"1\"," +
          "\"social_karma\":\"5\"}");  

      WebDialog requestsDialog = (
          new WebDialog.RequestsDialogBuilder(this.getActivity(), Session.getActiveSession(), params))
              .setOnCompleteListener(new OnCompleteListener() {

                  @Override
                  public void onComplete(Bundle values, FacebookException error) {
                  }

              })
              .build();
      requestsDialog.show();
  }
 
开发者ID:Paulocajr,项目名称:IPRJapp,代码行数:23,代码来源:Left_Menu.java

示例6: publishFeedDialog

import com.facebook.widget.WebDialog; //导入依赖的package包/类
public void publishFeedDialog(String name, String caption, String description, String linkUrl, String pictureUrl, OnCompleteListener onPostCompleteListener) {
	if(facebook.isSessionValid()) {
		Bundle params = new Bundle();
		params.putString("name", name);
		params.putString("caption", caption);
		params.putString("description", description);
		params.putString("link", linkUrl);
		params.putString("picture", pictureUrl);

		WebDialog feedDialog = (
				new WebDialog.FeedDialogBuilder(activity,
						facebook.getSession(),
						params))
						.setOnCompleteListener(onPostCompleteListener)
						.build();
		feedDialog.show();
	}
}
 
开发者ID:Nikhil-Nandagopal,项目名称:Socialite,代码行数:19,代码来源:FacebookConnector.java

示例7: onCreateDialog

import com.facebook.widget.WebDialog; //导入依赖的package包/类
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final FacebookShareDialogFragment parentFragment = (FacebookShareDialogFragment)getParentFragment();
    final Payload payload = parentFragment.getPayload();
    return new WebDialog.FeedDialogBuilder(getActivity(), Session.getActiveSession())
        .setCaption(payload.getCaption())
        .setDescription(payload.getDescription())
        .setLink(payload.getLink())
        .setName(payload.getName())
        .setPicture(payload.getPicture())
        .setOnCompleteListener(new WebDialog.OnCompleteListener() {
            @Override
            public void onComplete(final Bundle values, final FacebookException error) {
                parentFragment.onShareFinished();
            }
        })
        .build();
}
 
开发者ID:RomanZhilich,项目名称:FacebookShareDialog,代码行数:19,代码来源:FacebookShareDialogFragment.java

示例8: share

import com.facebook.widget.WebDialog; //导入依赖的package包/类
private void share( Intent intent ) {
	Entry entry = (Entry) intent.getSerializableExtra( EXTRAS_SHARED_ENTRY );

	switch( intent.getIntExtra( EXTRAS_TYPE, TYPE_NORMAL ) ) {
		case TYPE_FACEBOOK:
			Bundle postParams = new Bundle();
			final WebDialog fbDlg = new WebDialog.FeedDialogBuilder(
					NotificationShareService.this, getString( R.string.applicationId ), postParams ).setCaption( entry.getTitle() )
					.setDescription( entry.getKwic() ).setLink( mSharedEntryUrl ).build();
			fbDlg.setOnCompleteListener( new OnCompleteListener() {
				@Override
				public void onComplete( Bundle bundle, FacebookException e ) {
					fbDlg.dismiss();
					ActivityCompat.finishAfterTransition( NotificationShareService.this );
				}
			} );
			fbDlg.show();
			break;
		default:
			String subject = getString( R.string.lbl_share_entry_title, getString( R.string.application_name ), entry.getTitle() );
			String text = getString( R.string.lbl_share_entry_content, entry.getKwic(), mSharedEntryUrl,
									 Prefs.getInstance().getAppDownloadInfo()
			);
			Intent i = com.chopping.utils.Utils.getShareInformation( subject, text );
			i.addFlags( Intent.FLAG_ACTIVITY_NEW_TASK|Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT );
			startActivity( i );
			ActivityCompat.finishAfterTransition( NotificationShareService.this );
			break;
	}
}
 
开发者ID:XinyueZ,项目名称:cusnews,代码行数:31,代码来源:NotificationShareService.java

示例9: tryAuthorize

import com.facebook.widget.WebDialog; //导入依赖的package包/类
@Override
boolean tryAuthorize(final AuthorizationRequest request) {
    applicationId = request.getApplicationId();
    Bundle parameters = new Bundle();
    if (!Utility.isNullOrEmpty(request.getPermissions())) {
        String scope = TextUtils.join(",", request.getPermissions());
        parameters.putString(ServerProtocol.DIALOG_PARAM_SCOPE, scope);
        addLoggingExtra(ServerProtocol.DIALOG_PARAM_SCOPE, scope);
    }

    String previousToken = request.getPreviousAccessToken();
    if (!Utility.isNullOrEmpty(previousToken) && (previousToken.equals(loadCookieToken()))) {
        parameters.putString(ServerProtocol.DIALOG_PARAM_ACCESS_TOKEN, previousToken);
        // Don't log the actual access token, just its presence or absence.
        addLoggingExtra(ServerProtocol.DIALOG_PARAM_ACCESS_TOKEN, AppEventsConstants.EVENT_PARAM_VALUE_YES);
    } else {
        // The call to clear cookies will create the first instance of CookieSyncManager if necessary
        Utility.clearFacebookCookies(context);
        addLoggingExtra(ServerProtocol.DIALOG_PARAM_ACCESS_TOKEN, AppEventsConstants.EVENT_PARAM_VALUE_NO);
    }

    WebDialog.OnCompleteListener listener = new WebDialog.OnCompleteListener() {
        @Override
        public void onComplete(Bundle values, FacebookException error) {
            onWebDialogComplete(request, values, error);
        }
    };

    e2e = getE2E();
    addLoggingExtra(ServerProtocol.DIALOG_PARAM_E2E, e2e);

    WebDialog.Builder builder =
            new AuthDialogBuilder(getStartActivityDelegate().getActivityContext(), applicationId, parameters)
                    .setE2E(e2e)
                    .setOnCompleteListener(listener);
    loginDialog = builder.build();
    loginDialog.show();

    return true;
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:41,代码来源:AuthorizationClient.java

示例10: build

import com.facebook.widget.WebDialog; //导入依赖的package包/类
@Override
public WebDialog build() {
    Bundle parameters = getParameters();
    parameters.putString(ServerProtocol.DIALOG_PARAM_REDIRECT_URI, REDIRECT_URI);
    parameters.putString(ServerProtocol.DIALOG_PARAM_CLIENT_ID, getApplicationId());
    parameters.putString(ServerProtocol.DIALOG_PARAM_E2E, e2e);

    return new WebDialog(getContext(), OAUTH_DIALOG, parameters, getTheme(), getListener());
}
 
开发者ID:yeloapp,项目名称:yelo-android,代码行数:10,代码来源:AuthorizationClient.java

示例11: presentWebFallback

import com.facebook.widget.WebDialog; //导入依赖的package包/类
public static boolean presentWebFallback(final Context context,
                                         String dialogUrl,
                                         String applicationId,
                                         final FacebookDialog.PendingCall appCall,
                                         final FacebookDialog.Callback callback) {
    if (Utility.isNullOrEmpty(dialogUrl)) {
        return false;
    }

    String redirectUrl = String.format("fb%s://bridge/", applicationId);

    // Show the webdialog.
    FacebookWebFallbackDialog fallbackWebDialog = new FacebookWebFallbackDialog(
            context, dialogUrl, redirectUrl);
    fallbackWebDialog.setOnCompleteListener(new WebDialog.OnCompleteListener() {
        @Override
        public void onComplete(Bundle values, FacebookException error) {
            Intent dummyIntent = new Intent();
            dummyIntent.putExtras(values == null ? new Bundle() : values);
            FacebookDialog.handleActivityResult(
                    context,
                    appCall,
                    appCall.getRequestCode(),
                    dummyIntent,
                    callback);
        }
    });

    fallbackWebDialog.show();
    return true;
}
 
开发者ID:dannegm,项目名称:BrillaMXAndroid,代码行数:32,代码来源:FacebookWebFallbackDialog.java


注:本文中的com.facebook.widget.WebDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。