Tabnine Logo
SnappyLinearLayoutManager
Code IndexAdd Tabnine to your IDE (free)

How to use
SnappyLinearLayoutManager
in
com.nshmura.snappysmoothscroller

Best Java code snippets using com.nshmura.snappysmoothscroller.SnappyLinearLayoutManager (Showing top 7 results out of 315)

origin: nshmura/SnappySmoothScroller

public SnappyLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
  super(context, orientation, reverseLayout);
  init();
}
origin: nshmura/SnappySmoothScroller

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_demo);
  imageView = (GLSurfaceView) findViewById(R.id.filtered_image);
  setupActionBar(DemoType.Demo);
  adapter = new DemoAdapter(getApplicationContext());
  adapter.setListener(new DemoAdapter.OnItemClickListener() {
    @Override
    public void onClickItem(DemoAdapter.ViewHolder holder) {
      changeFilter(holder.getAdapterPosition());
    }
  });
  SnappyLinearLayoutManager layoutManager = new SnappyLinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
  layoutManager.setSnapType(SnapType.CENTER);
  layoutManager.setSnapPadding(getResources().getDimensionPixelSize(R.dimen.demo_snap_padding));
  layoutManager.setSnapInterpolator(new OvershootInterpolator());
  recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
  recyclerView.setLayoutManager(layoutManager);
  recyclerView.setAdapter(adapter);
  BitmapFactory.Options opts = new BitmapFactory.Options();
  opts.inSampleSize = 2;
  srcBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.sample, opts);
  gpuImage = new GPUImage(this);
  gpuImage.setImage(srcBitmap);
  gpuImage.setGLSurfaceView(imageView);
}
origin: nshmura/SnappySmoothScroller

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_basic);
  setupActionBar(DemoType.Basic);
  adapter = new BasicAdapter();
  adapter.setListener(new BasicAdapter.OnItemClickListener() {
    @Override
    public void onClickItem(BasicAdapter.ViewHolder holder) {
      moveTo(holder.getAdapterPosition());
    }
  });
  SnappyLinearLayoutManager layoutManager = new SnappyLinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
  layoutManager.setSnapType(SnapType.CENTER);
  recyclerView = (RecyclerView) findViewById(R.id.recycler_view);
  recyclerView.setLayoutManager(layoutManager);
  recyclerView.setAdapter(adapter);
}
origin: nshmura/SnappySmoothScroller

@Override
public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) {
  SnappySmoothScroller scroller = builder
      .setPosition(position)
      .setScrollVectorDetector(new LinearLayoutScrollVectorDetector(this))
      .build(recyclerView.getContext());
  startSmoothScroll(scroller);
}
origin: nshmura/SnappySmoothScroller

switch (demoType) {
  case LinearVertical:
    layoutManager = new SnappyLinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
    adapter.setVertical(true);
    break;
    layoutManager = new SnappyLinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);
    adapter.setVertical(false);
    break;
origin: nshmura/SnappySmoothScroller

public SnappyLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
  super(context, attrs, defStyleAttr, defStyleRes);
  init();
}
origin: nshmura/SnappySmoothScroller

public SnappyLinearLayoutManager(Context context) {
  super(context);
  init();
}
com.nshmura.snappysmoothscrollerSnappyLinearLayoutManager

Most used methods

  • <init>
  • init
  • setSnapInterpolator
  • setSnapPadding
  • setSnapType
  • startSmoothScroll

Popular in Java

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JFileChooser (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now