-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
3,094 additions
and
356 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ local.properties | |
*.json | ||
*~ | ||
**/build | ||
**/reports | ||
**/reports |
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
168 changes: 0 additions & 168 deletions
168
LifeLine/app/src/main/java/com/example/lifeline/AuthHelloActivity.java
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
LifeLine/app/src/main/java/com/example/lifeline/DashboardActivity.java
This file was deleted.
Oops, something went wrong.
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
73 changes: 73 additions & 0 deletions
73
LifeLine/app/src/main/java/com/example/lifeline/adapters/RecyclerViewParamAdapter.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package com.example.lifeline.adapters; | ||
|
||
import android.content.Context; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.cardview.widget.CardView; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import com.example.lifeline.R; | ||
import com.example.lifeline.models.RecyclerViewModel; | ||
|
||
import java.util.List; | ||
|
||
public class RecyclerViewParamAdapter extends RecyclerView.Adapter<RecyclerViewParamAdapter.paramViewHolder> { | ||
|
||
private final Context context; | ||
private final List<RecyclerViewModel> list; | ||
|
||
public RecyclerViewParamAdapter(Context context, List<RecyclerViewModel> list) { | ||
this.context = context; | ||
this.list = list; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public paramViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||
View view = LayoutInflater.from(context).inflate(R.layout.recycler_view_param_item, parent, false); | ||
return new paramViewHolder(view); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return (int) Math.ceil((float) list.size() / paramViewHolder.numberOfItemsInOneRow); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(@NonNull paramViewHolder holder, int position) { | ||
holder.textView_1.setText(list.get(position * paramViewHolder.numberOfItemsInOneRow).getValue()); | ||
holder.imageView_1.setImageResource(list.get(position * paramViewHolder.numberOfItemsInOneRow).getImage()); | ||
|
||
if (position * paramViewHolder.numberOfItemsInOneRow + 1 < list.size()) { | ||
holder.textView_2.setText(list.get(position * paramViewHolder.numberOfItemsInOneRow + 1).getValue()); | ||
holder.imageView_2.setImageResource(list.get(position * paramViewHolder.numberOfItemsInOneRow + 1).getImage()); | ||
} else { | ||
holder.cardView_2.setVisibility(View.GONE); | ||
} | ||
} | ||
|
||
public static final class paramViewHolder extends RecyclerView.ViewHolder { | ||
|
||
private final TextView textView_1; | ||
private final TextView textView_2; | ||
private final ImageView imageView_1; | ||
private final ImageView imageView_2; | ||
private final CardView cardView_2; | ||
private static final int numberOfItemsInOneRow = 2; | ||
|
||
public paramViewHolder(View view) { | ||
super(view); | ||
|
||
textView_1 = view.findViewById(R.id.textView_1); | ||
textView_2 = view.findViewById(R.id.textView_2); | ||
imageView_1 = view.findViewById(R.id.imageView_1); | ||
imageView_2 = view.findViewById(R.id.imageView_2); | ||
cardView_2 = view.findViewById(R.id.cardView_2); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.