This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private ArrayList<imageFolder> getPicturePaths(){ | |
ArrayList<imageFolder> picFolders = new ArrayList<>(); | |
ArrayList<String> picPaths = new ArrayList<>(); | |
Uri allImagesuri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI; | |
String[] projection = { MediaStore.Images.ImageColumns.DATA ,MediaStore.Images.Media.DISPLAY_NAME, | |
MediaStore.Images.Media.BUCKET_DISPLAY_NAME,MediaStore.Images.Media.BUCKET_ID}; | |
Cursor cursor = this.getContentResolver().query(allImagesuri, projection, null, null, null); | |
try { | |
if (cursor != null) { | |
cursor.moveToFirst(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:required="true" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.androidcodeman.simpleimagegallery; | |
import android.Manifest; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.database.Cursor; | |
import android.net.Uri; | |
import android.provider.MediaStore; | |
import androidx.appcompat.app.AppCompatActivity; | |
import android.os.Bundle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.androidcodeman.simpleimagegallery.utils; | |
/** | |
* author CodeBoy722 | |
* | |
* Custom Class that holds information of a folder containing images | |
* on the device external storage, used to populate our RecyclerView of | |
* picture folders | |
*/ | |
public class imageFolder { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.androidcodeman.simpleimagegallery.utils; | |
import java.util.ArrayList; | |
/** | |
* Author CodeBoy722 | |
*/ | |
public interface itemClickListener { | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.androidcodeman.simpleimagegallery.utils; | |
import android.content.Context; | |
import androidx.annotation.NonNull; | |
import androidx.cardview.widget.CardView; | |
import androidx.recyclerview.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ImageView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout 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="match_parent" | |
android:orientation="vertical" | |
tools:context=".MainActivity"> | |
<RelativeLayout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
folderName = findViewById(R.id.foldername); | |
folderName.setText(getIntent().getStringExtra("folderName")); //setting the folder name | |
//this line gets the folderpath from Intent | |
foldePath = getIntent().getStringExtra("folderPath"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ArrayList<pictureFacer> getAllImagesByFolder(String path){ | |
ArrayList<pictureFacer> images = new ArrayList<>(); | |
Uri allVideosuri = android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI; | |
String[] projection = { MediaStore.Images.ImageColumns.DATA ,MediaStore.Images.Media.DISPLAY_NAME, | |
MediaStore.Images.Media.SIZE}; | |
Cursor cursor = ImageDisplay.this.getContentResolver().query( allVideosuri, projection, MediaStore.Images.Media.DATA + " like ? ", new String[] {"%"+path+"%"}, null); | |
try { | |
cursor.moveToFirst(); | |
do{ | |
pictureFacer pic = new pictureFacer(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.androidcodeman.simpleimagegallery.utils; | |
/** | |
* Author CodeBoy722 | |
* | |
* Custom class for holding data of images on the device external storage | |
*/ | |
public class pictureFacer { | |
private String picturName; |
OlderNewer