use of android.support.v7.widget.Toolbar in project PhotoPicker by donglua.
the class PhotoPickerActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
boolean showCamera = getIntent().getBooleanExtra(EXTRA_SHOW_CAMERA, true);
boolean showGif = getIntent().getBooleanExtra(EXTRA_SHOW_GIF, false);
boolean previewEnabled = getIntent().getBooleanExtra(EXTRA_PREVIEW_ENABLED, true);
setShowGif(showGif);
setContentView(R.layout.__picker_activity_photo_picker);
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
setTitle(R.string.__picker_title);
ActionBar actionBar = getSupportActionBar();
assert actionBar != null;
actionBar.setDisplayHomeAsUpEnabled(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
actionBar.setElevation(25);
}
maxCount = getIntent().getIntExtra(EXTRA_MAX_COUNT, DEFAULT_MAX_COUNT);
columnNumber = getIntent().getIntExtra(EXTRA_GRID_COLUMN, DEFAULT_COLUMN_NUMBER);
originalPhotos = getIntent().getStringArrayListExtra(EXTRA_ORIGINAL_PHOTOS);
pickerFragment = (PhotoPickerFragment) getSupportFragmentManager().findFragmentByTag("tag");
if (pickerFragment == null) {
pickerFragment = PhotoPickerFragment.newInstance(showCamera, showGif, previewEnabled, columnNumber, maxCount, originalPhotos);
getSupportFragmentManager().beginTransaction().replace(R.id.container, pickerFragment, "tag").commit();
getSupportFragmentManager().executePendingTransactions();
}
pickerFragment.getPhotoGridAdapter().setOnItemCheckListener(new OnItemCheckListener() {
@Override
public boolean onItemCheck(int position, Photo photo, final int selectedItemCount) {
menuDoneItem.setEnabled(selectedItemCount > 0);
if (maxCount <= 1) {
List<String> photos = pickerFragment.getPhotoGridAdapter().getSelectedPhotos();
if (!photos.contains(photo.getPath())) {
photos.clear();
pickerFragment.getPhotoGridAdapter().notifyDataSetChanged();
}
return true;
}
if (selectedItemCount > maxCount) {
Toast.makeText(getActivity(), getString(R.string.__picker_over_max_count_tips, maxCount), LENGTH_LONG).show();
return false;
}
menuDoneItem.setTitle(getString(R.string.__picker_done_with_count, selectedItemCount, maxCount));
return true;
}
});
}
use of android.support.v7.widget.Toolbar in project barcodescanner by dm77.
the class MainActivity method setupToolbar.
public void setupToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
use of android.support.v7.widget.Toolbar in project barcodescanner by dm77.
the class BaseScannerActivity method setupToolbar.
public void setupToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
final ActionBar ab = getSupportActionBar();
if (ab != null) {
ab.setDisplayHomeAsUpEnabled(true);
}
}
use of android.support.v7.widget.Toolbar in project barcodescanner by dm77.
the class MainActivity method setupToolbar.
public void setupToolbar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
}
use of android.support.v7.widget.Toolbar in project UltimateRecyclerView by cymcsg.
the class GridLayoutRVTest method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(getMainLayout());
mToolbar = (Toolbar) findViewById(R.id.tool_bar);
setSupportActionBar(mToolbar);
getSupportActionBar().setDisplayShowTitleEnabled(true);
listuv = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);
mGridAdapter = new GridJRAdapter(getJRList());
mGridAdapter.setSpanColumns(columns);
mGridLayoutManager = new BasicGridLayoutManager(this, columns, mGridAdapter);
listuv.setLayoutManager(mGridLayoutManager);
listuv.setHasFixedSize(true);
listuv.setSaveEnabled(true);
listuv.setClipToPadding(false);
// mGridAdapter.setCustomLoadMoreView(LayoutInflater.from(this).inflate(R.layout.custom_bottom_progressbar, null));
listuv.setNormalHeader(setupHeaderView());
final Handler f = new Handler();
listuv.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
@Override
public void loadMore(int itemsCount, int maxLastVisiblePosition) {
// Log.d(TAG, itemsCount + " :: " + itemsCount);
f.postDelayed(new Runnable() {
@Override
public void run() {
mGridAdapter.insert(SampleDataboxset.genJRList(5));
afterAdd();
}
}, 2000);
}
});
// listuv.enableLoadmore();
// listuv.disableLoadmore();
listuv.setLoadMoreView(R.layout.custom_bottom_progressbar);
listuv.setAdapter(mGridAdapter);
listuv.setItemAnimator(new DefaultItemAnimator());
harness_control();
}
Aggregations