public class PdfCard
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private androidx.appcompat.app.AppCompatActivity |
activity
The activity creating the Card
|
private android.view.View |
content
The main view that contains the content for the PDF Card
|
private android.content.Context |
context
The context of the application
|
private java.io.File |
file
The thumbnail file which can be used to get the original PDF File
|
private android.widget.ImageButton |
options
The imagebuttons present on the CardView
|
private android.widget.ImageButton |
share
The imagebuttons present on the CardView
|
private android.widget.ImageView |
thumbnail
The thumbnail icon for the PDF Card
|
private android.widget.TextView |
title
The TextView representing the Title of the PDF
|
private android.widget.ImageButton |
view
The imagebuttons present on the CardView
|
Constructor and Description |
---|
PdfCard(android.content.Context ctx,
java.io.File file,
android.view.LayoutInflater inflater,
androidx.appcompat.app.AppCompatActivity activity)
The constructor of the class to get all the meta-data of the PDF.
|
Modifier and Type | Method and Description |
---|---|
private void |
delete()
A function to delete the file when the user asks to delete it.
|
android.view.View |
getCard()
A function to get the CardView of the PDF.
|
private java.io.File |
getFile(java.io.File file)
A function to get the original PDF file from the name of the thumbnail.
|
private int |
getHeight()
A function to get the optimal height of the thumbnail.
|
private int |
getPercent(int of,
int percent)
A function to get the 'percent' percent of 'of'
|
private int |
getWidth()
A function to get the optimal width of the thumbnail.
|
private void |
init()
The main initialization function of the PdfCard.
|
private void |
rename()
A function to rename the already scanned file.
|
private void |
setTitle()
A function to set the title.
|
private androidx.appcompat.app.AppCompatActivity activity
private android.view.View content
private android.content.Context context
private java.io.File file
private android.widget.ImageButton options
private android.widget.ImageButton share
private android.widget.ImageView thumbnail
private android.widget.TextView title
private android.widget.ImageButton view
public PdfCard(android.content.Context ctx, java.io.File file, android.view.LayoutInflater inflater, androidx.appcompat.app.AppCompatActivity activity)
ctx
- The context of the application.file
- The thumbnail file of hte PDF.inflater
- The LayoutInflater of the activity.private void delete()
public android.view.View getCard()
private java.io.File getFile(java.io.File file)
file
- The image file.private int getHeight()
private int getPercent(int of, int percent)
of
- The percentage to get of.percent
- The percentage to get.private int getWidth()
private void init()
private void rename()
private void setTitle()