diff --git a/app/src/main/java/asgardius/page/s3manager/Adapter.java b/app/src/main/java/asgardius/page/s3manager/Adapter.java index 92dfb7c..6ac1f2a 100644 --- a/app/src/main/java/asgardius/page/s3manager/Adapter.java +++ b/app/src/main/java/asgardius/page/s3manager/Adapter.java @@ -1,5 +1,6 @@ package asgardius.page.s3manager; +import android.annotation.SuppressLint; import android.content.Context; import android.view.LayoutInflater; import android.view.View; @@ -30,10 +31,16 @@ public class Adapter extends RecyclerView.Adapter{ return viewHolder; } @Override - public void onBindViewHolder(@NonNull Adapter.ViewHolder holder, int position) { + public void onBindViewHolder(@NonNull Adapter.ViewHolder holder, @SuppressLint("RecyclerView") int position) { int res = (int) Img.get(position); holder.images.setImageResource(res); holder.text.setText((CharSequence) Name.get(position)); + holder.text.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + System.out.println("Click on "+Integer.toString(position)); + } + }); } @Override public int getItemCount() { diff --git a/app/src/main/java/asgardius/page/s3manager/BucketSelect.java b/app/src/main/java/asgardius/page/s3manager/BucketSelect.java index c41623e..2778a7a 100644 --- a/app/src/main/java/asgardius/page/s3manager/BucketSelect.java +++ b/app/src/main/java/asgardius/page/s3manager/BucketSelect.java @@ -8,6 +8,7 @@ import androidx.recyclerview.widget.RecyclerView; import android.os.AsyncTask; import android.os.Bundle; +import android.widget.Toast; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.BasicAWSCredentials; @@ -83,6 +84,15 @@ public class BucketSelect extends AppCompatActivity { } catch (Exception e) { e.printStackTrace(); + runOnUiThread(new Runnable() { + + @Override + public void run() { + Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); + } + }); + //Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_list_fail), Toast.LENGTH_SHORT).show(); + finish(); } } }); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 073f182..0c116b3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -10,6 +10,7 @@ File Explorer Test Video Test Cannot load media file + Cannot connect to server Dummy Button DUMMY\nCONTENT \ No newline at end of file