Back to project page android_device.
The source code is released under:
[Apache License](http://www.apache.org/licenses/): Version 2.0, January 2004 =============== ## TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ## ### 1. Definitions. ### "License" sha...
If you think the Android project android_device listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * ================================================================================================= * Copyright (C) 2013 - 2014 Martin Albedinsky [Wolf-ITechnologies] * ================================================================================================= * Licensed under the Apache License, Version 2.0 or later (further "License" only). * ------------------------------------------------------------------------------------------------- * You may use this file only in compliance with the License. More details and copy of this License * you may obtain at/*from w w w . jav a 2s . com*/ * * http://www.apache.org/licenses/LICENSE-2.0 * * You can redistribute, modify or publish any part of the code written within this file but as it * is described in the License, the software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES or CONDITIONS OF ANY KIND. * * See the License for the specific language governing permissions and limitations under the License. * ================================================================================================= */ package com.wit.android.device.examples.fragment; import android.app.Fragment; import android.os.Bundle; import com.wit.android.device.AndroidDevice; import com.wit.android.device.Storage; import com.wit.android.examples.libs.fragment.annotation.ExFactoryFragment; import com.wit.android.examples.libs.fragment.manage.ExBaseFragmentFactory; import com.wit.android.examples.libs.fragment.manage.ExFragmentController; import com.wit.android.examples.libs.fragment.manage.ExFragmentTransition; /** * <p> * Fragments factory for examples application. Provides all fragments which are showing in this * application. * </p> * * @author Martin Albedinsky */ public class FragmentsFactory extends ExBaseFragmentFactory { /** * Log TAG. */ // private static final String TAG = FragmentsFactory.class.getSimpleName(); @ExFactoryFragment(type = DeviceInfoFragment.class) public static final int DEVICE_INFO = 0x01; @ExFactoryFragment(type = ScreenInfoFragment.class) public static final int SCREEN_INFO = 0x03; @ExFactoryFragment(type = ScreenInterfaceFragment.class) public static final int SCREEN_INTERFACE = 0x04; @ExFactoryFragment(type = ConnectionInfoFragment.class) public static final int NETWORK_CONNECTION_INFO = 0x05; @ExFactoryFragment(type = BatteryInfoFragment.class) public static final int BATTERY_INFO = 0x06; @ExFactoryFragment(type = StorageInfoFragment.class) public static final int STORAGE_INFO = 0x07; @ExFactoryFragment(type = StorageInterfaceFragment.class) public static final int STORAGE_INTERFACE = 0x08; @ExFactoryFragment(type = StorageFilesFragment.class) public static final int FILES = 0x09; @ExFactoryFragment public static final int NFC = 0x0b; /** */ @Override protected Fragment onCreateFragmentInstance(int fragmentId, Bundle params) { switch (fragmentId) { case FILES: if (params == null) { params = StorageFilesFragment.createParams( AndroidDevice.getInstance(null).getStorage().getStoragePath(Storage.EXTERNAL_PACKAGE) ); } } return super.onCreateFragmentInstance(fragmentId, params); } /** */ @Override protected ExFragmentController.ExTransactionOptions onGetFragmentTransactionOptions(int fragmentId, Bundle params) { switch (fragmentId) { case FILES: return new ExFragmentController.ExTransactionOptions() .tag(super.getFragmentTag(fragmentId)) .transition(ExFragmentTransition.FADE_IN) .addToBackStack(true); } return super.onGetFragmentTransactionOptions(fragmentId, params); } }