This file contains hidden or 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
'use strict'; | |
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(); | |
exports.sendNotification = functions.database.ref('/NotificationTest/{buyerId}/{notificationId}').onWrite((change, context) => { | |
const nId = context.params.notificationId; | |
const buyerId = context.params.buyerId; |
This file contains hidden or 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
//String to date convert | |
DateFormat formatter = new SimpleDateFormat("MMM dd, yyyy"); | |
Date strDate = null; | |
try { | |
strDate = (Date) formatter.parse(startDate); | |
} catch (ParseException e1) { | |
e1.printStackTrace(); | |
} | |
This file contains hidden or 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.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> |
This file contains hidden or 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.themebd.pdfreadertutorial; | |
import android.content.Intent; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import es.voghdev.pdfviewpager.library.PDFViewPager; | |
import es.voghdev.pdfviewpager.library.adapter.PDFPagerAdapter; | |
public class PDFReader extends AppCompatActivity { |
This file contains hidden or 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"?> | |
<RelativeLayout 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" | |
tools:context="com.themebd.pdfreadertutorial.PDFReader"> | |
<es.voghdev.pdfviewpager.library.PDFViewPager | |
android:id="@+id/pdf_reader" |
This file contains hidden or 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"?> | |
<RelativeLayout 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:background="#CCCCCC" | |
tools:context="com.themebd.pdfreadertutorial.MainActivity"> | |
<android.support.v7.widget.RecyclerView |
This file contains hidden or 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
@Override | |
public void onBindViewHolder(PDFListAdapter.PDFViewHolder holder, final int position) { | |
holder.mPdfTitle.setText(list.get(position).getName().toString()); | |
holder.mPdfTitle.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
Intent i = new Intent(context,PDFReader.class); | |
i.putExtra("index",position); | |
context.startActivity(i); |
This file contains hidden or 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.themebd.pdfreadertutorial; | |
import android.os.Environment; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.support.v7.widget.LinearLayoutManager; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import java.io.File; |
This file contains hidden or 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"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" android:layout_width="match_parent" | |
android:background="#FFFFFF" | |
android:layout_marginBottom="1dp" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:id="@+id/pdf_file" | |
android:layout_width="match_parent" |
This file contains hidden or 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.themebd.pdfreadertutorial; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.TextView; |
NewerOlder