diff --git a/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen/StoreActivity.java b/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen/StoreActivity.java index 2f8e1f8f2..e76b0001e 100644 --- a/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen/StoreActivity.java +++ b/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen/StoreActivity.java @@ -246,7 +246,7 @@ public void onResultLoaded(int value) { } }); - } else if (storeItemTypeindex == 1) { //clothes + } else if (storeItemTypeindex == TYPE_CLOTHES) { //clothes dataSource.getPurchasedClothes(index, new IDataSource.LoadIntegerCallback() { @Override public void onResultLoaded(int value) { @@ -260,7 +260,7 @@ public void onResultLoaded(int value) { } } }); - } else if (storeItemTypeindex == 2) { //accessories + } else if (storeItemTypeindex == TYPE_ACCESSORIES) { //accessories dataSource.getPurchasedAccessories(index, new IDataSource.LoadIntegerCallback() { @Override public void onResultLoaded(int value) { diff --git a/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen_level2/StoreLevel2Activity.java b/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen_level2/StoreLevel2Activity.java index c36ce8d10..2de753f14 100644 --- a/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen_level2/StoreLevel2Activity.java +++ b/PowerUp/app/src/main/java/powerup/systers/com/ui/store_screen_level2/StoreLevel2Activity.java @@ -72,8 +72,8 @@ protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_store); ButterKnife.bind(this); - init(); + GridView gridView = findViewById(R.id.grid_view); //adapter = new powerup.systers.com.ui.store_screen.StoreLevel2Activity.GridAdapter(this, allDataSet.get(0).subList(0, MAX_ELEMENTS_PER_SCREEN)); adapter = new GridAdapter(this, allDataSet.get(0).subList(0, MAX_ELEMENTS_PER_SCREEN)); @@ -157,8 +157,8 @@ public void updateAvatarAccessory(int accessory) { class GridAdapter extends BaseAdapter { - private List storeItems; - private Context context; + List storeItems; + Context context; GridAdapter(Context context, List list) { this.context = context; @@ -186,8 +186,8 @@ public long getItemId(int position) { } class ViewHolder { - private ImageView itemImage; - private TextView itemPoints; + ImageView itemImage; + TextView itemPoints; ViewHolder(View view) { itemImage = view.findViewById(R.id.item_image); @@ -195,13 +195,13 @@ class ViewHolder { } } - @SuppressLint("ResourceType") +// @SuppressLint("ResourceType") @TargetApi(Build.VERSION_CODES.JELLY_BEAN) @Override public View getView(final int position, View convertView, ViewGroup parent) { View storeItem = convertView; - GridAdapter.ViewHolder holder; + ViewHolder holder; if (storeItem == null) { // inflating the store_selection_view layout LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); @@ -211,10 +211,10 @@ public View getView(final int position, View convertView, ViewGroup parent) { int itemHeight = (int) ((screenHeight / 51.428f) * 18); storeItem.setLayoutParams(new AbsListView.LayoutParams(itemWidth, itemHeight)); - holder = new GridAdapter.ViewHolder(storeItem); + holder = new ViewHolder(storeItem); storeItem.setTag(holder); } else { - holder = (GridAdapter.ViewHolder) storeItem.getTag(); + holder = (ViewHolder) storeItem.getTag(); } storeItem.setOnClickListener(new View.OnClickListener() { @Override @@ -358,8 +358,8 @@ public void onClick(DialogInterface dialog, int id) { dataSource.setCurrentAccessoriesValue(index); presenter.calculateAccessoryValue(index); break; - default: - throw new IllegalArgumentException("Invalid store type index"); +// default: +// throw new IllegalArgumentException("Invalid store type index"); } adapter.refresh(adapter.storeItems); // will update change the background if any is not available showSuccessPurchaseDialog(); @@ -393,21 +393,21 @@ public void onClick(DialogInterface dialog, int id) { public int getPurchasedStatus(int index) { final int[] returnValue = new int[1]; switch(storeItemTypeindex) { - case 0: dataSource.getPurchasedHair(index, new IDataSource.LoadIntegerCallback() { + case TYPE_HAIR: dataSource.getPurchasedHair(index, new IDataSource.LoadIntegerCallback() { @Override public void onResultLoaded(int value) { returnValue[0] = value; } }); // hair return returnValue[0]; - case 1: dataSource.getPurchasedClothes(index, new IDataSource.LoadIntegerCallback() { + case TYPE_CLOTHES: dataSource.getPurchasedClothes(index, new IDataSource.LoadIntegerCallback() { @Override public void onResultLoaded(int value) { returnValue[0] = value; } }); // clothes return returnValue[0]; - case 2: dataSource.getPurchasedAccessories(index, new IDataSource.LoadIntegerCallback() { + case TYPE_ACCESSORIES: dataSource.getPurchasedAccessories(index, new IDataSource.LoadIntegerCallback() { @Override public void onResultLoaded(int value) { returnValue[0] = value; diff --git a/PowerUp/app/src/main/java/powerup/systers/com/utils/PowerUpUtils.java b/PowerUp/app/src/main/java/powerup/systers/com/utils/PowerUpUtils.java index 2d802653e..a194abab6 100644 --- a/PowerUp/app/src/main/java/powerup/systers/com/utils/PowerUpUtils.java +++ b/PowerUp/app/src/main/java/powerup/systers/com/utils/PowerUpUtils.java @@ -345,18 +345,18 @@ public class PowerUpUtils { public static int[] SAVE_BLOOD_ANSWER_COUNT = {0,2,2,2,3,3,2,6}; - public static int[] HS_CLOTHES_IMAGES = { - R.drawable.hs_dress_avatar1, - R.drawable.hs_dress_avatar2, - R.drawable.hs_dress_avatar3, - R.drawable.hs_dress_avatar4, - R.drawable.hs_dress_avatar5, - R.drawable.hs_dress_avatar6, - R.drawable.hs_dress_avatar7, - R.drawable.hs_dress_avatar8 + public static final int[] HS_CLOTHES_IMAGES = { + R.drawable.dress1_level2, + R.drawable.dress2_level2, + R.drawable.dress3_level2, + R.drawable.dress4_level2, + R.drawable.dress5_level2, + R.drawable.dress6_level2, + R.drawable.dress7_level2, + R.drawable.dress8_level2 }; - public static String[] HS_CLOTHES_POINTS_TEXTS = {"5", "5", "5", "5", "10", "10", "10", "10" }; + public static final String[] HS_CLOTHES_POINTS_TEXTS = {"5", "5", "5", "5", "10", "10", "10", "10" }; public static final String questionCSV = "Question.csv"; public static final String answerCSV = "Answer.csv"; diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress10_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress10_level2.webp new file mode 100644 index 000000000..51f61c0d1 Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress10_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress11_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress11_level2.webp new file mode 100644 index 000000000..4464ad4fa Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress11_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress1_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress1_level2.webp new file mode 100644 index 000000000..d6d09d60e Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress1_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress2_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress2_level2.webp new file mode 100644 index 000000000..53132230a Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress2_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress3_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress3_level2.webp new file mode 100644 index 000000000..9b094e78c Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress3_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress4_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress4_level2.webp new file mode 100644 index 000000000..f7b99885e Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress4_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress5_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress5_level2.webp new file mode 100644 index 000000000..3c3c6ef83 Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress5_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress6_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress6_level2.webp new file mode 100644 index 000000000..34db54bb0 Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress6_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress7_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress7_level2.webp new file mode 100644 index 000000000..718c23ee9 Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress7_level2.webp differ diff --git a/PowerUp/app/src/main/res/drawable-xxxhdpi/dress8_level2.webp b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress8_level2.webp new file mode 100644 index 000000000..8b9544ddc Binary files /dev/null and b/PowerUp/app/src/main/res/drawable-xxxhdpi/dress8_level2.webp differ diff --git a/PowerUp/app/src/main/res/layout/activity_store.xml b/PowerUp/app/src/main/res/layout/activity_store.xml index 575047786..81d2dae5e 100644 --- a/PowerUp/app/src/main/res/layout/activity_store.xml +++ b/PowerUp/app/src/main/res/layout/activity_store.xml @@ -118,7 +118,7 @@ android:layout_weight="3" android:numColumns="3" android:horizontalSpacing="10dp" - android:verticalSpacing="10dp"> + android:verticalSpacing="20dp">