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
1 parent
123d933
commit 0e027a4
Showing
116 changed files
with
1,483 additions
and
385 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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
|
||
# Created by https://www.gitignore.io/api/android | ||
|
||
### Android ### | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# IntelliJ | ||
*.iml | ||
.idea/workspace.xml | ||
.idea/tasks.xml | ||
.idea/gradle.xml | ||
.idea/assetWizardSettings.xml | ||
.idea/dictionaries | ||
.idea/libraries | ||
.idea/caches | ||
|
||
# Keystore files | ||
# Uncomment the following line if you do not want to check your keystore files in. | ||
#*.jks | ||
|
||
# External native build folder generated in Android Studio 2.2 and later | ||
.externalNativeBuild | ||
|
||
# Google Services (e.g. APIs or Firebase) | ||
google-services.json | ||
|
||
# Freeline | ||
freeline.py | ||
freeline/ | ||
freeline_project_description.json | ||
|
||
# fastlane | ||
fastlane/report.xml | ||
fastlane/Preview.html | ||
fastlane/screenshots | ||
fastlane/test_output | ||
fastlane/readme.md | ||
|
||
### Android Patch ### | ||
gen-external-apklibs | ||
|
||
|
||
# End of https://www.gitignore.io/api/android |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Binary file not shown.
75 changes: 75 additions & 0 deletions
75
app/src/main/java/com/mts/fategocardmaker/adapters/ClassIconAdapter.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,75 @@ | ||
package com.mts.fategocardmaker.adapters; | ||
|
||
import android.support.v7.widget.RecyclerView; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ImageView; | ||
import android.widget.TextView; | ||
|
||
import com.mts.fategocardmaker.R; | ||
import com.mts.fategocardmaker.model.ServantSpinnerItem; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class ClassIconAdapter extends RecyclerView.Adapter<ClassIconAdapter.RarityVH> { | ||
|
||
private ArrayList<ServantSpinnerItem> items; | ||
private ClassIconItemCallback itemCallback; | ||
|
||
public interface ClassIconItemCallback { | ||
void onItemClicked(int itemIndex, String iconName); | ||
} | ||
|
||
public void setItemCallback(ClassIconItemCallback itemCallback) { | ||
this.itemCallback = itemCallback; | ||
} | ||
|
||
public ClassIconAdapter(ArrayList<ServantSpinnerItem> items) { | ||
this.items = items; | ||
} | ||
|
||
@Override | ||
public RarityVH onCreateViewHolder(ViewGroup parent, int viewType) { | ||
final View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_class_icon, parent, false); | ||
return new RarityVH(view, this); | ||
} | ||
|
||
@Override | ||
public void onBindViewHolder(RarityVH holder, int position) { | ||
ServantSpinnerItem item = items.get(position); | ||
holder.tvTitle.setText(item.getName()); | ||
holder.ivIcon.setImageResource(item.getId()); | ||
} | ||
|
||
@Override | ||
public int getItemCount() { | ||
return items.size(); | ||
} | ||
|
||
static class RarityVH extends RecyclerView.ViewHolder implements View.OnClickListener{ | ||
|
||
final TextView tvTitle; | ||
final ImageView ivIcon; | ||
final ClassIconAdapter adapter; | ||
|
||
RarityVH(View itemView, ClassIconAdapter adapter) { | ||
super(itemView); | ||
tvTitle = (TextView)itemView.findViewById(R.id.tvTitle); | ||
ivIcon = (ImageView)itemView.findViewById(R.id.ivIcon); | ||
|
||
this.adapter = adapter; | ||
itemView.setOnClickListener(this); | ||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
if (adapter.itemCallback == null){ | ||
return; | ||
}else{ | ||
adapter.itemCallback.onItemClicked(getAdapterPosition(),adapter.items.get(getAdapterPosition()).getName()); | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.