set recycler view
This commit is contained in:
parent
4ba71f9e45
commit
f9a38c607d
7 changed files with 112 additions and 3 deletions
|
@ -4,8 +4,10 @@
|
|||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="app/src/main/res/layout/activity_bucket_select.xml" value="0.2" />
|
||||
<entry key="app/src/main/res/layout/activity_list_item.xml" value="0.19610507246376813" />
|
||||
<entry key="app/src/main/res/layout/activity_main.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/layout/activity_video_player.xml" value="0.1" />
|
||||
<entry key="app/src/main/res/layout/list_buckets.xml" value="0.19610507246376813" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
|
|
|
@ -36,6 +36,7 @@ dependencies {
|
|||
implementation 'com.google.android.material:material:1.4.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||
implementation 'com.google.android.exoplayer:exoplayer:2.18.1'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1'
|
||||
// BEGIN AWS DEPENDENCIES
|
||||
def aws_version = "2.16.+"
|
||||
implementation "com.amazonaws:aws-android-sdk-s3:$aws_version"
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.AsgardiusS3Manager"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".list_item"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".BucketSelect"
|
||||
android:exported="false" />
|
||||
|
|
52
app/src/main/java/asgardius/page/s3manager/Adapter.java
Normal file
52
app/src/main/java/asgardius/page/s3manager/Adapter.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
package asgardius.page.s3manager;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Adapter extends RecyclerView.Adapter<Adapter.ViewHolder>{
|
||||
ArrayList Img, Name;
|
||||
Context context;
|
||||
|
||||
// Constructor for initialization
|
||||
public Adapter(Context context, ArrayList Img, ArrayList Name) {
|
||||
this.context = context;
|
||||
this.Img = Img;
|
||||
this.Name = Name;
|
||||
}
|
||||
@NonNull
|
||||
@Override
|
||||
public Adapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.activity_list_item, parent, false);
|
||||
|
||||
// Passing view to ViewHolder
|
||||
Adapter.ViewHolder viewHolder = new Adapter.ViewHolder(view);
|
||||
return viewHolder;
|
||||
}
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull Adapter.ViewHolder holder, int position) {
|
||||
int res = (int) Img.get(position);
|
||||
holder.images.setImageResource(res);
|
||||
holder.text.setText((Integer) Name.get(position));
|
||||
}
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return Img.size();
|
||||
}
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
ImageView images;
|
||||
TextView text;
|
||||
|
||||
public ViewHolder(View view) {
|
||||
super(view);
|
||||
images = itemView.findViewById(R.id.image);
|
||||
text = itemView.findViewById(R.id.imageinfo);
|
||||
}
|
||||
}
|
||||
}
|
14
app/src/main/java/asgardius/page/s3manager/list_item.java
Normal file
14
app/src/main/java/asgardius/page/s3manager/list_item.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package asgardius.page.s3manager;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
public class list_item extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_list_item);
|
||||
}
|
||||
}
|
|
@ -7,9 +7,11 @@
|
|||
tools:context=".BucketSelect">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/blist"
|
||||
android:id="@+id/recyclerview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:layout_editor_absoluteX="1dp"
|
||||
tools:layout_editor_absoluteY="1dp" />
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
tools:layout_editor_absoluteX="-27dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
35
app/src/main/res/layout/activity_list_item.xml
Normal file
35
app/src/main/res/layout/activity_list_item.xml
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
tools:context=".list_item">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/imageinfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="192dp"
|
||||
android:text="TextView"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.101"
|
||||
app:layout_constraintStart_toEndOf="@+id/image"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Reference in a new issue