FileDocCategorySizeDatePackage
PickFragment.javaAPI DocAndroid 5.1 API2976Thu Mar 12 22:22:40 GMT 2015com.android.documentsui

PickFragment

public class PickFragment extends android.app.Fragment
Display pick confirmation bar, usually for selecting a directory.

Fields Summary
public static final String
TAG
private com.android.documentsui.model.DocumentInfo
mPickTarget
private android.view.View
mContainer
private android.widget.Button
mPick
private View.OnClickListener
mPickListener
Constructors Summary
Methods Summary
public static com.android.documentsui.PickFragmentget(android.app.FragmentManager fm)

        return (PickFragment) fm.findFragmentByTag(TAG);
    
public android.view.ViewonCreateView(android.view.LayoutInflater inflater, android.view.ViewGroup container, android.os.Bundle savedInstanceState)

        mContainer = inflater.inflate(R.layout.fragment_pick, container, false);

        mPick = (Button) mContainer.findViewById(android.R.id.button1);
        mPick.setOnClickListener(mPickListener);

        setPickTarget(null, null);

        return mContainer;
    
public voidsetPickTarget(com.android.documentsui.model.DocumentInfo pickTarget, java.lang.CharSequence displayName)


          
        mPickTarget = pickTarget;

        if (mContainer != null) {
            if (mPickTarget != null) {
                mContainer.setVisibility(View.VISIBLE);
                final Locale locale = getResources().getConfiguration().locale;
                final String raw = getString(R.string.menu_select).toUpperCase(locale);
                mPick.setText(TextUtils.expandTemplate(raw, displayName));
            } else {
                mContainer.setVisibility(View.GONE);
            }
        }
    
public static voidshow(android.app.FragmentManager fm)


         
        final PickFragment fragment = new PickFragment();

        final FragmentTransaction ft = fm.beginTransaction();
        ft.replace(R.id.container_save, fragment, TAG);
        ft.commitAllowingStateLoss();