use of android.os.Handler in project barcodescanner by dm77.
the class CameraPreview method init.
public void init(CameraWrapper cameraWrapper, Camera.PreviewCallback previewCallback) {
setCamera(cameraWrapper, previewCallback);
mAutoFocusHandler = new Handler();
getHolder().addCallback(this);
getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
use of android.os.Handler in project android-process-button by dmytrodanylyk.
the class ProgressGenerator method start.
public void start(final ProcessButton button) {
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
mProgress += 10;
button.setProgress(mProgress);
if (mProgress < 100) {
handler.postDelayed(this, generateDelay());
} else {
mListener.onComplete();
}
}
}, generateDelay());
}
use of android.os.Handler 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();
}
use of android.os.Handler in project UltimateRecyclerView by cymcsg.
the class BasicFunctions method enableLoadMore.
protected void enableLoadMore() {
// StickyRecyclerHeadersDecoration headersDecor = new StickyRecyclerHeadersDecoration(simpleRecyclerViewAdapter);
// ultimateRecyclerView.addItemDecoration(headersDecor);
ultimateRecyclerView.setLoadMoreView(R.layout.custom_bottom_progressbar);
ultimateRecyclerView.setOnLoadMoreListener(new UltimateRecyclerView.OnLoadMoreListener() {
@Override
public void loadMore(int itemsCount, final int maxLastVisiblePosition) {
status_progress = true;
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
onLoadmore();
status_progress = false;
}
}, 500);
}
});
}
use of android.os.Handler in project VideoPlayerManager by danylovolokh.
the class HandlerThreadExtension method onLooperPrepared.
@Override
protected void onLooperPrepared() {
if (SHOW_LOGS)
Log.v(TAG, "onLooperPrepared " + this);
mHandler = new Handler();
mHandler.post(new Runnable() {
@Override
public void run() {
synchronized (mStart) {
mStart.notifyAll();
}
}
});
}
Aggregations