Back to project page nxt-remote-controller.
The source code is released under:
MIT License
If you think the Android project nxt-remote-controller listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.andexert.rippleeffect; //from w w w . j av a2 s . com import android.app.Activity; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.RelativeLayout; import android.widget.TextView; import com.andexert.library.RippleView; import java.util.ArrayList; public class MainActivity extends Activity { private ArrayList<String> sourcesArrayList = new ArrayList<String>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final RippleView rippleView = (RippleView) findViewById(R.id.rect); final TextView textView = (TextView) findViewById(R.id.rect_child); rippleView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.e("Sample", "Click Rect !"); } }); textView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.e("Sample", "Click rect child !"); } }); sourcesArrayList.add("Samsung"); sourcesArrayList.add("Android"); sourcesArrayList.add("Google"); sourcesArrayList.add("Asus"); sourcesArrayList.add("Apple"); sourcesArrayList.add("Samsung"); sourcesArrayList.add("Android"); sourcesArrayList.add("Google"); sourcesArrayList.add("Asus"); sourcesArrayList.add("Apple"); sourcesArrayList.add("Samsung"); sourcesArrayList.add("Android"); sourcesArrayList.add("Google"); sourcesArrayList.add("Asus"); sourcesArrayList.add("Apple"); RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recycler_view); recyclerView.setHasFixedSize(true); RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this); recyclerView.setLayoutManager(layoutManager); CustomAdapter customAdapter = new CustomAdapter(); customAdapter.updateList(sourcesArrayList); customAdapter.setOnTapListener(new OnTapListener() { @Override public void onTapView(int position) { Log.e("MainActivity", "Tap item : " + position); } }); recyclerView.setAdapter(customAdapter); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }