mirror of
https://github.com/xoureldeen/Vectras-VM-Android.git
synced 2026-04-30 07:19:58 +00:00
Update
This commit is contained in:
parent
b47ad75d95
commit
afea81dfbe
12 changed files with 249 additions and 147 deletions
|
|
@ -19,6 +19,7 @@ import android.widget.RadioButton;
|
|||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.content.res.AppCompatResources;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
|
@ -79,38 +80,38 @@ public class AdapterRoms extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
|||
// Get current position of item in recyclerview to bind data and assign values from list
|
||||
final MyHolder myHolder = (MyHolder) holder;
|
||||
final DataRoms current = data.get(position);
|
||||
Glide.with(RomsManagerActivity.activity).load(current.itemIcon).placeholder(R.drawable.no_machine_image).error(R.drawable.no_machine_image).into(myHolder.ivIcon);
|
||||
Glide.with(RomsManagerActivity.activity).load(current.itemIcon).placeholder(R.drawable.ic_computer_180dp_with_padding).error(R.drawable.ic_computer_180dp_with_padding).into(myHolder.ivIcon);
|
||||
myHolder.textName.setText(current.itemName);
|
||||
myHolder.textSize.setText(current.itemSize);
|
||||
myHolder.textSize.setText(current.itemArch + " - " + current.itemSize);
|
||||
//myHolder.checkBox.setChecked(position == mSelectedItem);
|
||||
if (current.itemAvail) {
|
||||
if (FileUtils.fileValid(RomsManagerActivity.activity, AppConfig.maindirpath + current.itemPath)) {
|
||||
//myHolder.checkBox.setEnabled(false);
|
||||
myHolder.textAvail.setTextColor(Color.BLUE);
|
||||
myHolder.textAvail.setText(RomsManagerActivity.sInstalled);
|
||||
} else {
|
||||
//myHolder.checkBox.setEnabled(true);
|
||||
myHolder.textAvail.setTextColor(Color.GREEN);
|
||||
myHolder.textAvail.setText(RomsManagerActivity.sAvailable);
|
||||
}
|
||||
// if (FileUtils.fileValid(RomsManagerActivity.activity, AppConfig.maindirpath + current.itemPath)) {
|
||||
// //myHolder.checkBox.setEnabled(false);
|
||||
// myHolder.textAvail.setTextColor(Color.BLUE);
|
||||
// myHolder.textAvail.setText(RomsManagerActivity.sInstalled);
|
||||
// } else {
|
||||
// //myHolder.checkBox.setEnabled(true);
|
||||
// myHolder.textAvail.setTextColor(Color.GREEN);
|
||||
// myHolder.textAvail.setText(RomsManagerActivity.sAvailable);
|
||||
// }
|
||||
myHolder.linearItem.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mSelectedItem = position;
|
||||
notifyItemRangeChanged(0, data.size());
|
||||
RomsManagerActivity.selected = true;
|
||||
RomsManagerActivity.selectedPath = current.itemPath;
|
||||
RomsManagerActivity.selectedFinalRomFileName = current.itemFinalRomFileName;
|
||||
RomsManagerActivity.selectedExtra = current.itemExtra;
|
||||
RomsManagerActivity.selectedName = current.itemName;
|
||||
RomsManagerActivity.selectedLink = current.itemUrl;
|
||||
RomsManagerActivity.selectedIcon = current.itemIcon;
|
||||
RomsManagerActivity.selectedArch = current.itemArch;
|
||||
// RomsManagerActivity.selected = true;
|
||||
// RomsManagerActivity.selectedPath = current.itemPath;
|
||||
// RomsManagerActivity.selectedFinalRomFileName = current.itemFinalRomFileName;
|
||||
// RomsManagerActivity.selectedExtra = current.itemExtra;
|
||||
// RomsManagerActivity.selectedName = current.itemName;
|
||||
// RomsManagerActivity.selectedLink = current.itemUrl;
|
||||
// RomsManagerActivity.selectedIcon = current.itemIcon;
|
||||
// RomsManagerActivity.selectedArch = current.itemArch;
|
||||
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(RomsManagerActivity.activity, RomInfo.class);
|
||||
intent.putExtra("title", current.itemName);
|
||||
intent.putExtra("shortdesc", current.itemSize);
|
||||
intent.putExtra("shortdesc", current.itemArch + " - " + current.itemSize);
|
||||
intent.putExtra("getrom", current.itemUrl);
|
||||
intent.putExtra("desc", current.itemDesc);
|
||||
intent.putExtra("icon", current.itemIcon);
|
||||
|
|
@ -151,6 +152,13 @@ public class AdapterRoms extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
|
|||
//myHolder.checkBox.setEnabled(false);
|
||||
}
|
||||
|
||||
if (position == 0) {
|
||||
myHolder.linearItem.setBackground(AppCompatResources.getDrawable(RomsManagerActivity.activity, R.drawable.object_shape_top));
|
||||
} else if (position == data.size() - 1) {
|
||||
myHolder.linearItem.setBackground(AppCompatResources.getDrawable(RomsManagerActivity.activity, R.drawable.object_shape_bottom));
|
||||
} else {
|
||||
myHolder.linearItem.setBackground(AppCompatResources.getDrawable(RomsManagerActivity.activity, R.drawable.object_shape_middle));
|
||||
}
|
||||
}
|
||||
|
||||
// return total item from List
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue