-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CHORE]: Added first page as preview in pdf lister
- Loading branch information
1 parent
ce0c4e1
commit 099fbe0
Showing
29 changed files
with
528 additions
and
194 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile | ||
-keep class com.shockwave.* |
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
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
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
18 changes: 18 additions & 0 deletions
18
app/src/main/java/com/mjrt/app/allebooks/activities/PdfViewerActivity.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.mjrt.app.allebooks.activities | ||
|
||
import com.mjrt.app.allebooks.databinding.ActivityPdfViewerBinding | ||
|
||
class PdfViewerActivity : BaseActivity() { | ||
private lateinit var binding: ActivityPdfViewerBinding | ||
|
||
override fun initializeActivity(): Boolean { | ||
binding = ActivityPdfViewerBinding.inflate(layoutInflater) | ||
setContentView(binding.root) | ||
return true | ||
} | ||
|
||
override fun initializeAttributes() { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/mjrt/app/allebooks/adapters/PdfDocumentsAdapter.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.mjrt.app.allebooks.adapters | ||
|
||
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.recyclerview.widget.RecyclerView | ||
import com.mjrt.app.allebooks.R | ||
import com.mjrt.app.allebooks.models.PdfDocument | ||
|
||
class PdfDocumentsAdapter( | ||
private val context: Context, | ||
var pdfDocuments: ArrayList<PdfDocument> | ||
) : RecyclerView.Adapter<PdfDocumentsAdapter.ViewHolder>() { | ||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
return ViewHolder( | ||
LayoutInflater.from( | ||
context | ||
).inflate(R.layout.cardview_document, parent, false) | ||
) | ||
} | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
pdfDocuments[position].apply { | ||
holder.also { | ||
it.docName.text = title | ||
it.docSize.text = size.toString() | ||
it.thumbnail.setImageBitmap(thumbnail) | ||
} | ||
} | ||
} | ||
override fun getItemCount(): Int { | ||
return pdfDocuments.size | ||
} | ||
|
||
inner class ViewHolder(view: View?) : RecyclerView.ViewHolder(view!!) { | ||
val docName: TextView | ||
val docSize: TextView | ||
val thumbnail: ImageView | ||
|
||
init { | ||
docName = view!!.findViewById(R.id.doc_name) | ||
docSize = view.findViewById(R.id.doc_size) | ||
thumbnail = view.findViewById(R.id.thumbnail) | ||
} | ||
} | ||
} |
72 changes: 0 additions & 72 deletions
72
app/src/main/java/com/mjrt/app/allebooks/document_manager/DocumentManager.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.