Skip to content

Instantly share code, notes, and snippets.

View azzumw's full-sized avatar
💭
Building Github Profile

Azzum Waqar azzumw

💭
Building Github Profile
  • Nest Pensions
  • London
View GitHub Profile
package com.example.macintosh.retrofitrecyclercardview.Models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class Recipe {
@SerializedName("id")
@Expose
mport com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Ingredient {
@SerializedName("quantity")
@Expose
private Integer quantity;
@SerializedName("measure")
@Expose
private String measure;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
recyclerView = findViewById(R.id.customRecyclerView);
GetDataService service = RetrofitClientInstance.getRetrofitInstance().create(GetDataService.class);
Call<List<Recipe>> call = service.getAllRecipes();
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rootLinear"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="match_parent"
//Please note I am importing android.support.v4.app.Fragment;
public class FragmentTrailer extends Fragment implements TrailerAdapter.TrailerAdapterOnClickHandler{
private View view;
private RecyclerView mRecyclerView;
private TrailerAdapter mTrailerAdapter;
private LinearLayoutManager linearLayoutManager;
private int movieId;
private final String MOVIE_ID_KEY = "movie_id";
if ( payment_type == STANDARD) {
if(txtField_swiftCode.isEmpty() && txtField_abaRouting.isEmpty()){
/*Please enter ABA routing number*/
}
else if(txtField_abaRouting.isEmpty()){
/*Invalid Payment Type: Please enter the aba routing number or change the payment type to Urgent. */
}
}