Search in sources :

Example 16 with Handler

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);
}
Also used : Handler(android.os.Handler)

Example 17 with Handler

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());
}
Also used : Handler(android.os.Handler)

Example 18 with Handler

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();
}
Also used : BasicGridLayoutManager(com.marshalchen.ultimaterecyclerview.grid.BasicGridLayoutManager) UltimateRecyclerView(com.marshalchen.ultimaterecyclerview.UltimateRecyclerView) Handler(android.os.Handler) DefaultItemAnimator(android.support.v7.widget.DefaultItemAnimator)

Example 19 with Handler

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);
        }
    });
}
Also used : UltimateRecyclerView(com.marshalchen.ultimaterecyclerview.UltimateRecyclerView) Handler(android.os.Handler)

Example 20 with Handler

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();
            }
        }
    });
}
Also used : Handler(android.os.Handler)

Aggregations

Handler (android.os.Handler)1843 Message (android.os.Message)253 View (android.view.View)201 Intent (android.content.Intent)165 HandlerThread (android.os.HandlerThread)135 MediumTest (android.test.suitebuilder.annotation.MediumTest)116 TextView (android.widget.TextView)114 ArrayList (java.util.ArrayList)95 Test (org.junit.Test)80 Context (android.content.Context)67 RemoteException (android.os.RemoteException)63 IOException (java.io.IOException)61 IntentFilter (android.content.IntentFilter)57 ComponentName (android.content.ComponentName)56 ImageView (android.widget.ImageView)55 RecyclerView (android.support.v7.widget.RecyclerView)52 Bundle (android.os.Bundle)51 Looper (android.os.Looper)51 File (java.io.File)45 HashMap (java.util.HashMap)44