use of android.app.FragmentTransaction in project UltimateAndroid by cymcsg.
the class DisplayItemAdapter method getView.
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
String desc = getItem(position);
if (convertView == null) {
convertView = LayoutInflater.from(getContext()).inflate(R.layout.drive_image_view_item, parent, false);
}
String ftext = "photo number " + (position + 1) + " of " + MainFragment.samplePictures.length;
DriveImageModel m = new DriveImageModel(desc, ftext, MainFragment.samplePictures[position]);
DriveImageView view = (DriveImageView) convertView.findViewById(R.id.driveImageView);
view.setDriveImageModel(m);
view.setBackgroundColor(MainFragment.sampleColours[position]);
view.setCustomFolderSpacing(100f);
view.setAlphaValue(0.7f);
view.setCustomHeight(MainFragment.sampleHeights[position]);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
DetailFragment detailFragment = DetailFragment.newInstance(position);
fragmentTransaction.replace(R.id.fragment_container, detailFragment);
fragmentTransaction.addToBackStack("detail");
fragmentTransaction.commit();
}
});
return convertView;
}
use of android.app.FragmentTransaction in project UltimateAndroid by cymcsg.
the class DriveImageViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.drive_image_view_activity_main_fragment);
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
MainFragment mainFragment = new MainFragment();
fragmentTransaction.replace(R.id.fragment_container, mainFragment);
fragmentTransaction.commit();
// getActionBar().setDisplayHomeAsUpEnabled(false);
}
use of android.app.FragmentTransaction in project jmonkeyengine by jMonkeyEngine.
the class TestActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
fragment = new JmeFragment();
// Supply index input as an argument.
Bundle args = new Bundle();
Bundle bundle = savedInstanceState;
if (bundle == null) {
bundle = getIntent().getExtras();
}
String appClass = bundle.getString(MainActivity.SELECTED_APP_CLASS);
args.putString(MainActivity.SELECTED_APP_CLASS, appClass);
// Log.d(TestActivity.class.getSimpleName(), "AppClass="+appClass);
boolean mouseEnabled = bundle.getBoolean(MainActivity.ENABLE_MOUSE_EVENTS, true);
args.putBoolean(MainActivity.ENABLE_MOUSE_EVENTS, mouseEnabled);
// Log.d(TestActivity.class.getSimpleName(), "MouseEnabled="+mouseEnabled);
boolean joystickEnabled = bundle.getBoolean(MainActivity.ENABLE_JOYSTICK_EVENTS, true);
args.putBoolean(MainActivity.ENABLE_JOYSTICK_EVENTS, joystickEnabled);
// Log.d(TestActivity.class.getSimpleName(), "JoystickEnabled="+joystickEnabled);
boolean keyEnabled = bundle.getBoolean(MainActivity.ENABLE_KEY_EVENTS, true);
args.putBoolean(MainActivity.ENABLE_KEY_EVENTS, keyEnabled);
// Log.d(TestActivity.class.getSimpleName(), "KeyEnabled="+keyEnabled);
boolean verboseLogging = bundle.getBoolean(MainActivity.VERBOSE_LOGGING, true);
args.putBoolean(MainActivity.VERBOSE_LOGGING, verboseLogging);
// Log.d(TestActivity.class.getSimpleName(), "VerboseLogging="+verboseLogging);
fragment.setArguments(args);
FragmentTransaction transaction = getFragmentManager().beginTransaction();
// Replace whatever is in the fragment_container view with this fragment,
// and add the transaction to the back stack so the user can navigate back
transaction.add(R.id.fragmentContainer, fragment);
transaction.addToBackStack(null);
// Commit the transaction
transaction.commit();
}
use of android.app.FragmentTransaction in project SeriesGuide by UweTrottmann.
the class UpcomingEpisodeSettingsActivity method onCreate.
public void onCreate(Bundle savedInstanceState) {
// set a theme based on user preference
setTheme(SeriesGuidePreferences.THEME);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_singlepane);
setupActionBar();
if (savedInstanceState == null) {
Fragment f = new SettingsFragment();
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.add(R.id.content_frame, f);
ft.commit();
}
}
use of android.app.FragmentTransaction in project SeriesGuide by UweTrottmann.
the class SeriesGuidePreferences method switchToSettings.
public void switchToSettings(String settingsId) {
Bundle args = new Bundle();
args.putString(EXTRA_SETTINGS_SCREEN, settingsId);
Fragment f = new SettingsFragment();
f.setArguments(args);
FragmentTransaction ft = getFragmentManager().beginTransaction();
ft.replace(R.id.containerSettings, f);
ft.addToBackStack(null);
ft.commit();
}
Aggregations