當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。