use of com.actionbarsherlock.app.ActionBar in project mobile-android by photo.
the class PhotoDetailsFragment method adjustDetailsVisibility.
void adjustDetailsVisibility(final boolean visible) {
detailsVisible = visible;
if (getActivity() == null) {
return;
}
Animation animation = AnimationUtils.loadAnimation(getActivity(), visible ? android.R.anim.fade_in : android.R.anim.fade_out);
long animationDuration = 500;
animation.setDuration(animationDuration);
thumbnailsList.startAnimation(animation);
detailsView.startAnimation(animation);
thumbnailsList.postDelayed(new Runnable() {
@Override
public void run() {
detailsVisible = visible;
thumbnailsList.setVisibility(detailsVisible ? View.VISIBLE : View.GONE);
detailsView.setVisibility(detailsVisible ? View.VISIBLE : View.GONE);
if (detailsVisible && nextPageLoaded.getAndSet(false)) {
ensureThumbVisible(getActivePhoto());
}
}
}, animationDuration);
ActionBar actionBar = ((Activity) getSupportActivity()).getSupportActionBar();
if (visible) {
actionBar.show();
} else {
actionBar.hide();
}
}
use of com.actionbarsherlock.app.ActionBar in project httpclient by pixmob.
the class Issue435 method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout layout = new LinearLayout(this);
layout.setOrientation(LinearLayout.VERTICAL);
TextView t = new TextView(this);
t.setText("Must be on a portrait device where the tabs are stacked. Stacked background will disappear when action mode is triggered.");
layout.addView(t);
Button b = new Button(this);
b.setText("Start ActionMode");
b.setOnClickListener(this);
layout.addView(b);
setContentView(layout);
ActionBar ab = getSupportActionBar();
ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
ab.addTab(ab.newTab().setText("One").setTabListener(this));
ab.addTab(ab.newTab().setText("One").setTabListener(this));
ab.addTab(ab.newTab().setText("One").setTabListener(this));
ab.setBackgroundDrawable(new GradientDrawable(TOP_BOTTOM, new int[] { 0xFF004400, 0xFF002200 }));
ab.setStackedBackgroundDrawable(new GradientDrawable(TOP_BOTTOM, new int[] { 0xFF440000, 0xFF220000 }));
}
use of com.actionbarsherlock.app.ActionBar in project httpclient by pixmob.
the class MainActivity method showTabsNav.
private void showTabsNav() {
ActionBar ab = getSupportActionBar();
if (ab.getNavigationMode() != ActionBar.NAVIGATION_MODE_TABS) {
ab.setDisplayShowTitleEnabled(false);
ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
}
}
use of com.actionbarsherlock.app.ActionBar in project httpclient by pixmob.
the class MainActivity method onCreate.
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final ActionBar ab = getSupportActionBar();
// set defaults for logo & home up
ab.setDisplayHomeAsUpEnabled(showHomeUp);
ab.setDisplayUseLogoEnabled(useLogo);
// set up tabs nav
for (int i = 1; i < 4; i++) {
ab.addTab(ab.newTab().setText("Tab " + i).setTabListener(this));
}
// set up list nav
ab.setListNavigationCallbacks(ArrayAdapter.createFromResource(this, R.array.sections, R.layout.sherlock_spinner_dropdown_item), new OnNavigationListener() {
public boolean onNavigationItemSelected(int itemPosition, long itemId) {
// FIXME add proper implementation
rotateLeftFrag();
return false;
}
});
// default to tab navigation
showTabsNav();
// create a couple of simple fragments as placeholders
final int MARGIN = 16;
leftFrag = new RoundedColourFragment(getResources().getColor(R.color.android_green), 1f, MARGIN, MARGIN / 2, MARGIN, MARGIN);
rightFrag = new RoundedColourFragment(getResources().getColor(R.color.honeycombish_blue), 2f, MARGIN / 2, MARGIN, MARGIN, MARGIN);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.root, leftFrag);
ft.add(R.id.root, rightFrag);
ft.commit();
}
use of com.actionbarsherlock.app.ActionBar in project httpclient by pixmob.
the class MainActivity method showStandardNav.
private void showStandardNav() {
ActionBar ab = getSupportActionBar();
if (ab.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) {
ab.setDisplayShowTitleEnabled(true);
ab.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
}
}
Aggregations