diff --git a/app/src/main/java/com/example/cosmosclient/views/MemberListActivity.java b/app/src/main/java/com/example/cosmosclient/views/MemberListActivity.java index 9c4a2d1..2f968f3 100644 --- a/app/src/main/java/com/example/cosmosclient/views/MemberListActivity.java +++ b/app/src/main/java/com/example/cosmosclient/views/MemberListActivity.java @@ -44,12 +44,14 @@ super.onCreate(savedInstanceState); setContentView(R.layout.activity_member_list); + //メンバー追加ボタン処理 FloatingActionButton fab = findViewById(R.id.addrequest_button); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - - startActivity(new Intent(MemberListActivity.this, AddMemberActivity.class)); + startActivity(new Intent(MemberListActivity.this, + AddMemberActivity.class)); + finish(); } }); @@ -62,12 +64,12 @@ final ListView listView = findViewById(R.id.list_view); //retrofitの処理 - Retrofit retrofit = new Retrofit.Builder() + final Retrofit retrofit = new Retrofit.Builder() .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/cosmos/") .addConverterFactory(JacksonConverterFactory.create()) .build(); //interfaceから実装を取得 - GroupsRest MemberListService = retrofit.create(GroupsRest.class); + final GroupsRest MemberListService = retrofit.create(GroupsRest.class); //API呼び出しのための値入力 Call call = MemberListService.getMemberListByGid(gId,token); @@ -81,13 +83,16 @@ MemberListResponse result = response.body(); // Iterator it = result.member.iterator(); - //int i = 0; - Bitmap icon = BitmapFactory.decodeResource(getResources(),R.drawable.default_icon_image); +// int i = 0; + //画像をBase64に変換 + Bitmap icon = BitmapFactory.decodeResource(getResources(),R.drawable.default_icon_image); ByteArrayOutputStream baos = new ByteArrayOutputStream(); icon.compress(Bitmap.CompressFormat.JPEG,100, baos); byte[] b = baos.toByteArray(); String imageEncoded = Base64.encodeToString(b, Base64.DEFAULT); + + // while(it.hasNext()){ // userName.add(it.next().name); // if(it.next().iconUri != null) { @@ -97,6 +102,8 @@ // } // i++; // } + + //アイコンが未設定ならデフォルト画像を設定 for(int i = 0; i parent, View v, -// int position, long id) { -// -// -// Intent intent = null; -// // clickされたpositionのtextとphotoのID -// String selectedText = scenes[position]; -// if(selectedText.contains("QR")==true){ -// intent = new Intent(this.getApplicationContext(), DisplayQRActivity.class); -// }else if(selectedText.contains("ID")==true){ -// intent = new Intent(this.getApplicationContext(), DisplayQRActivity.class); -// }else{ -//// intent = new Intent(this.getApplicationContext(), DisplayQRActivity.class); -// Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("line://msg/text/?GroupID")); -// startActivity(i); -// } -// -//// Intent intent = new Intent(this.getApplicationContext(), DisplayQRActivity.class); -// // SubActivityへ遷移 -// startActivity(intent); -// } }