Search in sources :

Example 46 with FragmentManager

use of android.support.v4.app.FragmentManager in project android by owncloud.

the class AuthenticatorActivity method createAuthenticationDialog.

/**
     * Create and show dialog for request authentication to the user
     * @param webView   Web view to embed into the authentication dialog.
     * @param handler   Object responsible for catching and recovering HTTP authentication fails.
     */
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {
    // Show a dialog with the certificate info
    CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    ft.addToBackStack(null);
    dialog.setCancelable(false);
    dialog.show(ft, CREDENTIALS_DIALOG_TAG);
    if (!mIsFirstAuthAttempt) {
        showSnackMessage(R.string.saml_authentication_wrong_pass);
    } else {
        mIsFirstAuthAttempt = false;
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) CredentialsDialogFragment(com.owncloud.android.ui.dialog.CredentialsDialogFragment)

Example 47 with FragmentManager

use of android.support.v4.app.FragmentManager in project android by owncloud.

the class FileActivity method showLoadingDialog.

/**
     * Show loading dialog
     */
public void showLoadingDialog(int messageId) {
    // grant that only one waiting dialog is shown
    dismissLoadingDialog();
    // Construct dialog
    Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
    if (frag == null) {
        Log_OC.d(TAG, "show loading dialog");
        LoadingDialog loading = LoadingDialog.newInstance(messageId, false);
        FragmentManager fm = getSupportFragmentManager();
        FragmentTransaction ft = fm.beginTransaction();
        loading.show(ft, DIALOG_WAIT_TAG);
        fm.executePendingTransactions();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) LoadingDialog(com.owncloud.android.ui.dialog.LoadingDialog) ConfirmationDialogFragment(com.owncloud.android.ui.dialog.ConfirmationDialogFragment) Fragment(android.support.v4.app.Fragment)

Example 48 with FragmentManager

use of android.support.v4.app.FragmentManager in project android by owncloud.

the class LogHistoryActivity method showLoadingDialog.

/**
     * Show loading dialog
     */
public void showLoadingDialog() {
    // Construct dialog
    LoadingDialog loading = LoadingDialog.newInstance(R.string.log_progress_dialog_text, false);
    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction ft = fm.beginTransaction();
    loading.show(ft, DIALOG_WAIT_TAG);
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) LoadingDialog(com.owncloud.android.ui.dialog.LoadingDialog)

Example 49 with FragmentManager

use of android.support.v4.app.FragmentManager in project android by owncloud.

the class FileActivity method showUntrustedCertDialog.

/**
     * Show untrusted cert dialog
     */
public void showUntrustedCertDialog(RemoteOperationResult result) {
    // Show a dialog with the certificate info
    FragmentManager fm = getSupportFragmentManager();
    SslUntrustedCertDialog dialog = (SslUntrustedCertDialog) fm.findFragmentByTag(DIALOG_UNTRUSTED_CERT);
    if (dialog == null) {
        dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException) result.getException());
        FragmentTransaction ft = fm.beginTransaction();
        dialog.show(ft, DIALOG_UNTRUSTED_CERT);
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) SslUntrustedCertDialog(com.owncloud.android.ui.dialog.SslUntrustedCertDialog) CertificateCombinedException(com.owncloud.android.lib.common.network.CertificateCombinedException)

Example 50 with FragmentManager

use of android.support.v4.app.FragmentManager in project android-support-v4-googlemaps by petedoyle.

the class FragmentStackSupport method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_stack);
    // Watch for button clicks.
    Button button = (Button) findViewById(R.id.new_fragment);
    button.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            addFragmentToStack();
        }
    });
    button = (Button) findViewById(R.id.home);
    button.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // If there is a back stack, pop it all.
            FragmentManager fm = getSupportFragmentManager();
            if (fm.getBackStackEntryCount() > 0) {
                fm.popBackStack(fm.getBackStackEntryAt(0).getId(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
            }
        }
    });
    if (savedInstanceState == null) {
        // Do first time initialization -- add initial fragment.
        Fragment newFragment = CountingFragment.newInstance(mStackLevel);
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(R.id.simple_fragment, newFragment).commit();
    } else {
        mStackLevel = savedInstanceState.getInt("level");
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) FragmentTransaction(android.support.v4.app.FragmentTransaction) Button(android.widget.Button) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) View(android.view.View) Fragment(android.support.v4.app.Fragment)

Aggregations

FragmentManager (android.support.v4.app.FragmentManager)265 FragmentTransaction (android.support.v4.app.FragmentTransaction)98 Fragment (android.support.v4.app.Fragment)76 View (android.view.View)46 TextView (android.widget.TextView)34 OnClickListener (android.view.View.OnClickListener)24 Bundle (android.os.Bundle)23 Intent (android.content.Intent)20 ImageView (android.widget.ImageView)15 ScrollView (android.widget.ScrollView)14 DialogFragment (android.support.v4.app.DialogFragment)13 ListFragment (android.support.v4.app.ListFragment)12 Button (android.widget.Button)11 FragmentActivity (android.support.v4.app.FragmentActivity)6 ArrayList (java.util.ArrayList)6 ViewPager (android.support.v4.view.ViewPager)5 UiThreadTest (android.test.UiThreadTest)5 BackStackEntry (android.support.v4.app.FragmentManager.BackStackEntry)4 AppCompatActivity (android.support.v7.app.AppCompatActivity)4 Time (android.text.format.Time)4