Example usage for android.widget FrameLayout FrameLayout

List of usage examples for android.widget FrameLayout FrameLayout

Introduction

In this page you can find the example usage for android.widget FrameLayout FrameLayout.

Prototype

public FrameLayout(@NonNull Context context) 

Source Link

Usage

From source file:com.codebutler.farebot.activities.FragmentWrapperActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    FrameLayout container = new FrameLayout(this);
    container.setLayoutParams(new LinearLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT));
    container.setId(R.id.content);//from w  w  w  .  ja va2s.com
    setContentView(container);

    if (getFragment() == null) {
        FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
        transaction.add(R.id.content, createFragment(), "fragment");
        transaction.commit();
    }
}

From source file:com.dwdesign.tweetings.activity.BrowserActivity.java

@Override
public void onCreate(final Bundle savedInstanceState) {
    requestSupportWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(new FrameLayout(this));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mUri = getIntent().getData();/*from   w ww . j  a  va2 s  .com*/
    if (mUri == null) {
        Toast.makeText(this, R.string.error_occurred, Toast.LENGTH_SHORT).show();
        finish();
        return;
    }
    final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    final Fragment fragment = Fragment.instantiate(this, WebViewFragment.class.getName());
    final Bundle bundle = new Bundle();
    bundle.putString(INTENT_KEY_URI, mUri.toString());
    fragment.setArguments(bundle);
    ft.replace(android.R.id.content, fragment);
    ft.commit();
}

From source file:org.deviceconnect.android.manager.setting.OpenSourceLicenseFragment.java

@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    mLogger.entering(getClass().getName(), "onCreateView",
            new Object[] { inflater, container, savedInstanceState });

    FrameLayout lframe = new FrameLayout(getActivity());

    ListView lv = new ListView(getActivity());
    lv.setId(android.R.id.list);/*from   ww w  .  ja  v a 2  s . c  o m*/
    lv.setDrawSelectorOnTop(false);
    lframe.addView(lv, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));
    lframe.setBackgroundColor(getResources().getColor(android.R.color.background_light));

    ArrayAdapter<Parcelable> adapter = new SoftwareArrayAdapter(getActivity(),
            R.layout.item_open_source_licenses);
    if (getArguments() != null && getArguments().containsKey(EXTRA_OSS)) {
        adapter.addAll(getArguments().getParcelableArrayList(EXTRA_OSS));
    }

    ListView listView = (ListView) lframe.findViewById(android.R.id.list);
    listView.setAdapter(adapter);

    getDialog().setTitle(R.string.activity_settings_open_source_licenses);

    mLogger.exiting(getClass().getName(), "onCreateView", lframe);
    return lframe;
}

From source file:com.commonsware.android.arXiv.DownloadsActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    FrameLayout fl = new FrameLayout(this);
    fl.setId(android.R.id.content);//from  w w w .  j ava2s.  c om
    setContentView(fl);

    ActionBar ab = getSupportActionBar();
    ab.setTitle("History");
    ab.setDisplayHomeAsUpEnabled(true);
    ab.setHomeButtonEnabled(true);

    downloadsFragment = new DownloadsFragment();
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.add(android.R.id.content, downloadsFragment);
    ft.commit();
}

From source file:org.bitbucket.ntakimura.android.support.fragment.OpenSourceLicenseFragment.java

@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
        final Bundle savedInstanceState) {
    mLogger.entering(getClass().getName(), "onCreateView",
            new Object[] { inflater, container, savedInstanceState });

    FrameLayout lframe = new FrameLayout(getActivity());

    ListView lv = new ListView(getActivity());
    lv.setId(android.R.id.list);//from  ww w  .  j  a v a 2s.  c  om
    lv.setDrawSelectorOnTop(false);
    lframe.addView(lv, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT));
    lframe.setBackgroundColor(getResources().getColor(android.R.color.background_light));

    ArrayAdapter<Parcelable> adapter = new SoftwareArrayAdapter(getActivity(), R.layout.card_item);
    if (getArguments() != null && getArguments().containsKey(EXTRA_OSS)) {
        adapter.addAll(getArguments().getParcelableArrayList(EXTRA_OSS));
    }

    ListView listView = (ListView) lframe.findViewById(android.R.id.list);
    listView.setAdapter(adapter);

    getDialog().setTitle(R.string.open_source_licenses);

    mLogger.exiting(getClass().getName(), "onCreateView", lframe);
    return lframe;
}

From source file:info.ipeanut.youngsamples.supportv4.app.FragmentReceiveResultSupport.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
            ViewGroup.LayoutParams.FILL_PARENT);
    FrameLayout frame = new FrameLayout(this);
    frame.setId(R.id.simple_fragment);/*  w  w  w  .  j a  va  2s.c o m*/
    setContentView(frame, lp);

    if (savedInstanceState == null) {
        // Do first time initialization -- add fragment.
        Fragment newFragment = new ReceiveResultFragment();
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(R.id.simple_fragment, newFragment).commit();
    }
}

From source file:com.actionbarsherlock.sample.demos.app.FragmentReceiveResultSupport.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.MATCH_PARENT);
    FrameLayout frame = new FrameLayout(this);
    frame.setId(R.id.simple_fragment);/*from  w  ww.  j  a va 2s  .c o  m*/
    setContentView(frame, lp);

    if (savedInstanceState == null) {
        // Do first time initialization -- add fragment.
        Fragment newFragment = new ReceiveResultFragment();
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(R.id.simple_fragment, newFragment).commit();
    }
}

From source file:com.lithidsw.wallbox.app.wallsnap.WallSnapActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    prefs = getSharedPreferences(C.PREF, MODE_PRIVATE);
    String themeSty = prefs.getString(C.PREF_THEME, null);
    if (themeSty != null) {
        setTheme(getResources().getIdentifier(themeSty, "style", C.THIS));
    } else {/*  w ww  . ja va 2  s. c om*/
        setTheme(C.DEFAULT_THEME);
    }
    FrameLayout fl = new FrameLayout(this);
    LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    setContentView(fl, lp);

    if (savedInstanceState == null) {
        Fragment newFragment = new WallSnapFragment();
        newFragment.setArguments(getIntent().getExtras());
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.replace(android.R.id.content, newFragment);
        ft.commit();
    }

    setupActionBar();
}

From source file:android.arch.lifecycle.testapp.CollectingSupportActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    FrameLayout layout = new FrameLayout(this);
    layout.setId(R.id.fragment_container);
    setContentView(layout);/*from  w w  w  .j  a v  a 2s.c o  m*/
    mCollectedEvents.add(new Pair<>(OWNER_CALLBACK, Event.ON_CREATE));
    getLifecycle().addObserver(mTestObserver);
}

From source file:com.actionbarsherlock.sample.fragments.FragmentReceiveResultSupport.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(SampleList.THEME); //Used for theme switching in samples
    super.onCreate(savedInstanceState);
    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT,
            ViewGroup.LayoutParams.FILL_PARENT);
    FrameLayout frame = new FrameLayout(this);
    frame.setId(R.id.simple_fragment);/*from www .ja va2s  .  co m*/
    setContentView(frame, lp);

    if (savedInstanceState == null) {
        // Do first time initialization -- add fragment.
        Fragment newFragment = new ReceiveResultFragment();
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(R.id.simple_fragment, newFragment).commit();
    }
}