This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout 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="wrap_content" | |
android:background="?selectableItemBackground" | |
android:paddingTop="@dimen/item_padding_vertical" | |
android:paddingEnd="@dimen/item_padding_vertical" | |
android:paddingBottom="@dimen/item_padding_vertical" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** imports */ | |
public class SessionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
List<Session> sessions; | |
Context context; | |
@Inject | |
public SessionAdapter(@ApplicationContext Context context) { | |
this.sessions = new ArrayList<>(); | |
this.context = context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import androidx.recyclerview.widget.RecyclerView; | |
import androidx.viewbinding.ViewBinding; | |
public class BaseViewHolder<T extends ViewBinding> extends RecyclerView.ViewHolder { | |
public T binding; | |
public BaseViewHolder(T binding) { | |
super(binding.getRoot()); | |
this.binding = binding; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** imports */ | |
public class SessionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
List<Session> sessions; | |
Context context; | |
@Inject | |
public SessionAdapter(@ApplicationContext Context context) { | |
this.sessions = new ArrayList<>(); | |
this.context = context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** imports */ | |
public class SessionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | |
List<Session> sessions; | |
Context context; | |
@Inject | |
public SessionAdapter(@ApplicationContext Context context) { | |
this.sessions = new ArrayList<>(); | |
this.context = context; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AncientMainActivity extends AppCompatActivity { | |
private ActivityMainBinding binding; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
binding = ActivityMainBinding.inflate(getLayoutInflater()); | |
setContentView(binding.getRoot()); | |
// In "binding" variable we have all the attributes AUTOMATICALLY linked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ButterKnifeActivity extends Activity { | |
@Bind(R.id.main_text) | |
TextView mainText; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.ancient_main); | |
Butterknife.bind(this);. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AncientMainActivity extends Activity { | |
TextView mainText; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.ancient_main); | |
this.mainText = (TextView)findViewById(R.id.main_text); | |
} |