Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
package net.javafun.example.atmstatusfsm; | |
import java.awt.BorderLayout; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.util.List; | |
import javax.swing.JButton; | |
import javax.swing.JComboBox; | |
import javax.swing.JFrame; |
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.cardview.widget.CardView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/card_item" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="126dp" | |
android:elevation="3dp" | |
app:cardCornerRadius="20dp" |
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.coordinatorlayout.widget.CoordinatorLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="start" | |
tools:context=".MainActivity"> |
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="oval"> | |
<solid android:color="#ededed"/> | |
<size | |
android:width="250dp" | |
android:height="250dp" /> | |
</shape> |
public class Task implements Serializable { | |
private String name; | |
private int minutes; | |
private long createdOn; | |
private String createdBy; | |
private State state; | |
enum State{ |
SnapHelper snapHelper = new LinearSnapHelper(); | |
snapHelper.attachToRecyclerView(recyclerView); |
CirleLinearAdapter |
public class CircleLayoutManager extends TurnLayoutManager { | |
public CircleLayoutManager(Context context, int gravity, int orientation, int radius, int peekDistance, boolean rotate) { | |
super(context, gravity, orientation, radius, peekDistance, rotate); | |
} | |
public CircleLayoutManager(Context context, int radius, int peekDistance) { | |
super(context, radius, peekDistance); | |
} |
private void onClickItem(int position, View v) { | |
recyclerView.smoothScrollToPosition(position); | |
} |