-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Arctosoft/develop
Version 1.7.0
- Loading branch information
Showing
16 changed files
with
234 additions
and
34 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
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
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
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
59 changes: 59 additions & 0 deletions
59
app/src/main/java/se/arctosoft/vault/adapters/ImportListAdapter.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,59 @@ | ||
/* | ||
* Valv-Android | ||
* Copyright (C) 2023 Arctosoft AB | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see https://www.gnu.org/licenses/. | ||
*/ | ||
|
||
package se.arctosoft.vault.adapters; | ||
|
||
import android.view.LayoutInflater; | ||
import android.view.ViewGroup; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import java.util.List; | ||
|
||
import se.arctosoft.vault.adapters.viewholders.ImportListViewHolder; | ||
import se.arctosoft.vault.databinding.AdapterImportListItemBinding; | ||
import se.arctosoft.vault.utils.Dialogs; | ||
|
||
public class ImportListAdapter extends RecyclerView.Adapter<ImportListViewHolder> { | ||
private final List<String> names; | ||
private final Dialogs.IOnPositionSelected onPositionSelected; | ||
|
||
public ImportListAdapter(List<String> names, Dialogs.IOnPositionSelected onPositionSelected) { | ||
this.names = names; | ||
this.onPositionSelected = onPositionSelected; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public ImportListViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { | ||
AdapterImportListItemBinding binding = AdapterImportListItemBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false); | ||
return new ImportListViewHolder(binding); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(@NonNull ImportListViewHolder holder, int position) { | ||
holder.binding.text.setText(names.get(position)); | ||
holder.binding.text.setOnClickListener(v -> onPositionSelected.onSelected(position)); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return names.size(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
app/src/main/java/se/arctosoft/vault/adapters/viewholders/ImportListViewHolder.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,33 @@ | ||
/* | ||
* Valv-Android | ||
* Copyright (C) 2023 Arctosoft AB | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see https://www.gnu.org/licenses/. | ||
*/ | ||
|
||
package se.arctosoft.vault.adapters.viewholders; | ||
|
||
import androidx.annotation.NonNull; | ||
import androidx.recyclerview.widget.RecyclerView; | ||
|
||
import se.arctosoft.vault.databinding.AdapterImportListItemBinding; | ||
|
||
public class ImportListViewHolder extends RecyclerView.ViewHolder { | ||
public final AdapterImportListItemBinding binding; | ||
|
||
public ImportListViewHolder(@NonNull AdapterImportListItemBinding 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
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
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
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
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
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,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Valv-Android | ||
~ Copyright (C) 2023 Arctosoft AB | ||
~ | ||
~ This program is free software: you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation, either version 3 of the License, or | ||
~ (at your option) any later version. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program. If not, see https://www.gnu.org/licenses/. | ||
--> | ||
|
||
<TextView xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:id="@+id/text" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="?attr/selectableItemBackground" | ||
android:ellipsize="marquee" | ||
android:padding="16dp" /> |
Oops, something went wrong.