本文整理匯總了Java中com.actionbarsherlock.app.SherlockFragment類的典型用法代碼示例。如果您正苦於以下問題:Java SherlockFragment類的具體用法?Java SherlockFragment怎麽用?Java SherlockFragment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SherlockFragment類屬於com.actionbarsherlock.app包,在下文中一共展示了SherlockFragment類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
repository = getSerializableExtra(EXTRA_REPOSITORY);
setContentView(layout.commit_compare);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setSubtitle(repository.generateId());
avatars.bind(actionBar, repository.getOwner());
fragment = (SherlockFragment) getSupportFragmentManager()
.findFragmentById(android.R.id.list);
}
示例2: getItem
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
public Fragment getItem(int position) {
SherlockFragment fragment = null;
if (position == 0) {
fragment = new PSettingsOptionsFragment();
} else if (position == 1) {
fragment = new PAboutFragment();
}
return fragment;
}
示例3: getFragment
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
/**
* Get selected fragment
*
* @return fragment
*/
protected SherlockFragment getFragment() {
FragmentProvider provider = getProvider();
if (provider != null)
return provider.getSelected();
else
return null;
}
示例4: onOptionsItemSelected
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
public boolean onOptionsItemSelected(final MenuItem item) {
SherlockFragment fragment = getFragment();
if (fragment != null)
return fragment.onOptionsItemSelected(item);
return super.onOptionsItemSelected(item);
}
示例5: onCreateOptionsMenu
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
public boolean onCreateOptionsMenu(Menu menu) {
SherlockFragment fragment = getFragment();
if (fragment != null)
fragment.onCreateOptionsMenu(menu, getSupportMenuInflater());
boolean created = super.onCreateOptionsMenu(menu);
menuCreated = true;
return created;
}
示例6: onTabSelected
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
public void onTabSelected(Tab tab, FragmentTransaction ft) {
SherlockFragment toShow = null;
if (tab.getPosition() == 0){
toShow = new LoginFragment();
}else{
toShow = new RegisterFragment();
}
ft.replace(android.R.id.content, toShow); // <----- Content view is set here
}
示例7: onOptionsItemSelected
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case MENU_REFRESH:
SherlockFragment fragment = getFragmentByPosition(viewPager
.getCurrentItem());
if (fragment != null) {
fragment.onOptionsItemSelected(item);
}
return true;
default:
return super.onOptionsItemSelected(item);
}
}
示例8: createStartGameFragment
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
private SherlockFragment createStartGameFragment() {
SherlockFragment f = new StartGameFragment();
if (getIntent().hasExtra("cards")) {
f.setArguments(getIntent().getExtras());
}
return f;
}
示例9: PhotoHandler
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
public PhotoHandler(Context context, BaseRawContactEditorView editor, int photoMode, RawContactDeltaList state,
SherlockFragment fragment) {
super(context, editor.getPhotoEditor(), photoMode, false, state, fragment);
mEditor = editor;
mRawContactId = editor.getRawContactId();
mPhotoEditorListener = new PhotoEditorListener();
}
示例10: PhotoHandler19
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
public PhotoHandler19(Context context, BaseRawContactEditorView editor, int photoMode, RawContactDeltaList state,
SherlockFragment fragment) {
super(context, editor.getPhotoEditor(), photoMode, false, state, fragment);
mEditor = editor;
mRawContactId = editor.getRawContactId();
mPhotoEditorListener = new PhotoEditorListener();
}
示例11: PhotoSelectionHandler19
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
public PhotoSelectionHandler19(Context context, View photoView, int photoMode, boolean isDirectoryContact,
RawContactDeltaList state, SherlockFragment fragment) {
mContext = context;
mPhotoView = photoView;
mPhotoMode = photoMode;
mTempPhotoUri = ContactPhotoUtils19.generateTempImageUri(context);
mCroppedPhotoUri = ContactPhotoUtils19.generateTempCroppedImageUri(mContext);
mIsDirectoryContact = isDirectoryContact;
mState = state;
mPhotoPickSize = getPhotoPickSize();
parentFragment = fragment;
}
示例12: PhotoSelectionHandler
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
public PhotoSelectionHandler(Context context, View photoView, int photoMode, boolean isDirectoryContact,
RawContactDeltaList state, SherlockFragment fragment) {
mContext = context;
mPhotoView = photoView;
mPhotoMode = photoMode;
mIsDirectoryContact = isDirectoryContact;
mState = state;
mPhotoPickSize = getPhotoPickSize();
parentFragment = fragment;
}
示例13: getItem
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
public SherlockFragment getItem(int position) {
if (Images.imageUrls[position].endsWith("audio")) {
return ImageDetailFragment.newInstance(position+1);
}
if (galleryReference == -1) {
Log.d(TAG, "SEtting IDF.id");
return ImageDetailFragment.newInstance(position);
} else {
Log.d(TAG, "SEtting IDF.id and IDF.galleryref");
return ImageDetailFragment.newInstance(position, galleryReference);
}
}
示例14: getFragment
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
public SherlockFragment getFragment(int position) {
switch (position) {
case 0:
return new GuidesFragment();
case 1:
return new GuidesFragment();
case 2:
return new GuidesFragment();
}
return null;
}
示例15: getItem
import com.actionbarsherlock.app.SherlockFragment; //導入依賴的package包/類
@Override
public SherlockFragment getItem(int position) {
if (galleryReference == -1) {
Log.d(TAG, "Setting IDF.id");
return ImageDetailFragment.newInstance(position);
} else {
Log.d(TAG, "Setting IDF.id and IDF.galleryref");
return ImageDetailFragment.newInstance(position, galleryReference);
}
}