diff --git a/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java b/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java index d17db05..a95b0e1 100644 --- a/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java +++ b/app/src/main/java/org/ntlab/amaryllis/client/MyDialogFragment.java @@ -11,6 +11,8 @@ import android.os.Environment; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.app.Dialog; @@ -37,11 +39,14 @@ import android.view.Window; import android.view.WindowManager; +import org.ntlab.amaryllis.client.MainActivity; import org.ntlab.amaryllis.client.entities.Voicememo; +import org.ntlab.amaryllis.client.entities.Category; import org.ntlab.amaryllis.client.fragment.MapsFragment; import org.ntlab.amaryllis.client.resources.VoicememosRest; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import retrofit2.Call; @@ -73,6 +78,10 @@ private Location latitude; private Location longitude; + //カテゴリを取得する為の変数 + //private Category category; + private ArrayList S_category = new ArrayList<>(); + private double Dlatitude; private double Dlongitude; @@ -85,6 +94,7 @@ //CheckBoxがチェックされているかを確かめる為の配列 int arrayCount = 5; private CheckBox[] Checks = new CheckBox[arrayCount]; + //private List ChecksName = new String[5]; @Override @@ -366,11 +376,27 @@ //Checkboxが一つもチェックがされてない時を判別する為の変数 CheckChange = 0; - + //カテゴリ関連のコード category = new ArrayList<>(); category.add("c01"); category.add("c02"); +/* + HashMap categories = MainActivity.getCategories(); + + + int id=0; + for(Category category : categories.values()){ + String name = category.getName(); + String cid = category.getcId(); + Category category_info = ((MainActivity) getActivity()).getCategory(cid); + //MenuItem newItem = menu.add(Menu.NONE, id, Menu.NONE, name); + //newItem.setCheckable(true); + //newItem.setChecked(true); + id++; + } +*/ + //toastMessage = "タイトルが入力されていません"; ((MainActivity) getActivity()).subscribe(this); @@ -421,6 +447,9 @@ + //String S_category = Category.getName(); + + //final CheckBox Checks[0] = dialog.findViewById(R.id.checkbox_1); //final CheckBox Check[1] = dialog.findViewById(R.id.checkbox_2); //final CheckBox Check[2] = dialog.findViewById(R.id.checkbox_3); @@ -454,6 +483,8 @@ for(int i = 0;i