Search in sources :

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

Example 77 with Toolbar

use of android.support.v7.widget.Toolbar in project SpringIndicator by chenupt.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    viewPager = (ScrollerViewPager) findViewById(R.id.view_pager);
    SpringIndicator springIndicator = (SpringIndicator) findViewById(R.id.indicator);
    Toolbar toolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(toolbar);
    PagerModelManager manager = new PagerModelManager();
    manager.addCommonFragment(GuideFragment.class, getBgRes(), getTitles());
    ModelPagerAdapter adapter = new ModelPagerAdapter(getSupportFragmentManager(), manager);
    viewPager.setAdapter(adapter);
    viewPager.fixScrollSpeed();
    // just set viewPager
    springIndicator.setViewPager(viewPager);
}
Also used : PagerModelManager(github.chenupt.multiplemodel.viewpager.PagerModelManager) ModelPagerAdapter(github.chenupt.multiplemodel.viewpager.ModelPagerAdapter) SpringIndicator(github.chenupt.springindicator.SpringIndicator) Toolbar(android.support.v7.widget.Toolbar)

Example 78 with Toolbar

use of android.support.v7.widget.Toolbar in project photo-picker-plus-android by chute.

the class BaseActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        getWindow().setEnterTransition(new Explode());
        getWindow().setExitTransition(new Explode());
    }
    setContentView(getLayoutResource());
    Toolbar toolBar = (Toolbar) findViewById(R.id.toolbar);
    if (toolBar != null) {
        toolBar.bringToFront();
        setSupportActionBar(toolBar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setIcon(new ColorDrawable(android.R.color.transparent));
        getSupportActionBar().setTitle(R.string.choose_service);
        setToolBar(toolBar);
    }
}
Also used : Explode(android.transition.Explode) ColorDrawable(android.graphics.drawable.ColorDrawable) Toolbar(android.support.v7.widget.Toolbar)

Example 79 with Toolbar

use of android.support.v7.widget.Toolbar in project GeekNews by codeestX.

the class NodeListActivity method initEventAndData.

@Override
protected void initEventAndData() {
    nodeName = getIntent().getStringExtra(Constants.IT_VTEX_NODE_NAME);
    setToolBar(toolBar, nodeName);
    mAdapter = new NodeListAdapter(mContext, new ArrayList<NodeListBean>());
    rvContent.setLayoutManager(new LinearLayoutManager(mContext));
    rvContent.setAdapter(mAdapter);
    swipeRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {

        @Override
        public void onRefresh() {
            mPresenter.getContent(nodeName);
        }
    });
    ivProgress.start();
    mPresenter.getContent(nodeName);
    mPresenter.getTopInfo(nodeName);
}
Also used : NodeListAdapter(com.codeest.geeknews.ui.vtex.adapter.NodeListAdapter) ArrayList(java.util.ArrayList) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) SwipeRefreshLayout(android.support.v4.widget.SwipeRefreshLayout)

Example 80 with Toolbar

use of android.support.v7.widget.Toolbar in project PhotoView by chrisbanes.

the class SimpleSampleActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    toolbar.setTitle("Simple Sample");
    toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            onBackPressed();
        }
    });
    toolbar.inflateMenu(R.menu.main_menu);
    toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {

        @Override
        public boolean onMenuItemClick(MenuItem item) {
            switch(item.getItemId()) {
                case R.id.menu_zoom_toggle:
                    mPhotoView.setZoomable(!mPhotoView.isZoomEnabled());
                    item.setTitle(mPhotoView.isZoomEnabled() ? R.string.menu_zoom_disable : R.string.menu_zoom_enable);
                    return true;
                case R.id.menu_scale_fit_center:
                    mPhotoView.setScaleType(ImageView.ScaleType.CENTER);
                    return true;
                case R.id.menu_scale_fit_start:
                    mPhotoView.setScaleType(ImageView.ScaleType.FIT_START);
                    return true;
                case R.id.menu_scale_fit_end:
                    mPhotoView.setScaleType(ImageView.ScaleType.FIT_END);
                    return true;
                case R.id.menu_scale_fit_xy:
                    mPhotoView.setScaleType(ImageView.ScaleType.FIT_XY);
                    return true;
                case R.id.menu_scale_scale_center:
                    mPhotoView.setScaleType(ImageView.ScaleType.CENTER);
                    return true;
                case R.id.menu_scale_scale_center_crop:
                    mPhotoView.setScaleType(ImageView.ScaleType.CENTER_CROP);
                    return true;
                case R.id.menu_scale_scale_center_inside:
                    mPhotoView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
                    return true;
                case R.id.menu_scale_random_animate:
                case R.id.menu_scale_random:
                    Random r = new Random();
                    float minScale = mPhotoView.getMinimumScale();
                    float maxScale = mPhotoView.getMaximumScale();
                    float randomScale = minScale + (r.nextFloat() * (maxScale - minScale));
                    mPhotoView.setScale(randomScale, item.getItemId() == R.id.menu_scale_random_animate);
                    showToast(String.format(SCALE_TOAST_STRING, randomScale));
                    return true;
                case R.id.menu_matrix_restore:
                    if (mCurrentDisplayMatrix == null)
                        showToast("You need to capture display matrix first");
                    else
                        mPhotoView.setDisplayMatrix(mCurrentDisplayMatrix);
                    return true;
                case R.id.menu_matrix_capture:
                    mCurrentDisplayMatrix = new Matrix();
                    mPhotoView.getDisplayMatrix(mCurrentDisplayMatrix);
                    return true;
            }
            return false;
        }
    });
    mPhotoView = (PhotoView) findViewById(R.id.iv_photo);
    mCurrMatrixTv = (TextView) findViewById(R.id.tv_current_matrix);
    Drawable bitmap = ContextCompat.getDrawable(this, R.drawable.wallpaper);
    mPhotoView.setImageDrawable(bitmap);
    // Lets attach some listeners, not required though!
    mPhotoView.setOnMatrixChangeListener(new MatrixChangeListener());
    mPhotoView.setOnPhotoTapListener(new PhotoTapListener());
    mPhotoView.setOnSingleFlingListener(new SingleFlingListener());
}
Also used : Matrix(android.graphics.Matrix) Random(java.util.Random) Drawable(android.graphics.drawable.Drawable) MenuItem(android.view.MenuItem) OnPhotoTapListener(com.github.chrisbanes.photoview.OnPhotoTapListener) OnSingleFlingListener(com.github.chrisbanes.photoview.OnSingleFlingListener) PhotoView(com.github.chrisbanes.photoview.PhotoView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)496 View (android.view.View)358 ActionBar (android.support.v7.app.ActionBar)178 TextView (android.widget.TextView)167 RecyclerView (android.support.v7.widget.RecyclerView)134 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)123 ImageView (android.widget.ImageView)84 Intent (android.content.Intent)75 ActionBarDrawerToggle (android.support.v7.app.ActionBarDrawerToggle)56 ArrayList (java.util.ArrayList)56 BindView (butterknife.BindView)46 AppCompatActivity (android.support.v7.app.AppCompatActivity)41 AdapterView (android.widget.AdapterView)41 NavigationView (android.support.design.widget.NavigationView)39 BarPainter (com.xabber.android.ui.color.BarPainter)36 MenuItem (android.view.MenuItem)35 FloatingActionButton (android.support.design.widget.FloatingActionButton)31 ViewPager (android.support.v4.view.ViewPager)31 ViewGroup (android.view.ViewGroup)31 Bundle (android.os.Bundle)29