diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser new file mode 100644 index 0000000..b439ef3 Binary files /dev/null and b/.idea/caches/build_file_checksums.ser differ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..30aa626 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 2c22801..cbd292d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 26 + compileSdkVersion 27 defaultConfig { applicationId "com.gsnathan.pdfviewer" - minSdkVersion 19 + minSdkVersion 21 targetSdkVersion 26 - versionCode 7 - versionName "1.6" + versionCode 8 + versionName "1.7" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true @@ -40,38 +40,42 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'com.android.support.constraint:constraint-layout:1.0.2' - implementation 'com.android.support:support-v4:26.1.0' + implementation 'com.android.support:appcompat-v7:27.1.0' + implementation 'com.android.support:design:27.1.0' + implementation 'com.android.support.constraint:constraint-layout:1.1.0' + implementation 'com.android.support:support-v4:27.1.0' testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' + + //Library for Card View Layout + implementation 'com.android.support:cardview-v7:27.1.0' + + //Ripple Effect Library + implementation 'com.balysv:material-ripple:1.0.2' + + //Rating Library + implementation 'io.github.kobakei:ratethisapp:1.2.0' //Pdf Viewer Library (Proguard config done) - compile 'com.github.barteksc:android-pdf-viewer:3.0.0-beta.5' + implementation 'com.github.barteksc:android-pdf-viewer:3.0.0-beta.5' //Android Annotations Library (Proguard config not needed) - provided 'org.androidannotations:androidannotations:4.4.0' - compile 'org.androidannotations:androidannotations-api:4.4.0' - - //About Page Library (Proguard config not needed) - compile 'com.github.daniel-stoneuk:material-about-library:2.2.3-support26.1.0' + compileOnly 'org.androidannotations:androidannotations:4.4.0' + implementation 'org.androidannotations:androidannotations-api:4.4.0' //Intro Library (Proguard config not needed) - compile 'com.heinrichreimersoftware:material-intro:1.6.2' + implementation 'com.heinrichreimersoftware:material-intro:1.6.2' //License Presenter Library (Proguard config not needed) - compile 'com.github.franmontiel:AttributionPresenter:1.0' + implementation 'com.github.franmontiel:AttributionPresenter:1.0' //View for Privacy Policy (Proguard config not needed) - compile 'org.sufficientlysecure:html-textview:3.5' + implementation 'org.sufficientlysecure:html-textview:3.5' //View for App Licence (Proguard config not needed) - compile 'com.jgabrielfreitas:licensetextview:1.1.2' - - //Material About Page Library (Proguard config not needed) - compile 'com.github.jrvansuita:MaterialAbout:0.2.0' + implementation 'com.jgabrielfreitas:licensetextview:1.1.2' //Changelog Library (Proguard config not needed) - compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' + implementation 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4b862cf..8edee4f 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -68,13 +68,14 @@ + android:label="About" + android:parentActivityName="MainActivity_" + android:theme="@style/AppTheme"> + android:value="MainActivity_" /> @@ -85,7 +86,7 @@ @@ -98,7 +99,7 @@ @@ -106,21 +107,6 @@ android:name="android.support.PARENT_ACTIVITY" android:value=".AboutActivity" /> - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java index 16b35b7..9c83d0e 100644 --- a/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java +++ b/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java @@ -1,196 +1,73 @@ package com.gsnathan.pdfviewer; -import android.content.ClipData; -import android.content.ClipboardManager; -import android.content.Context; -import android.content.Intent; -import android.net.Uri; -import android.support.annotation.NonNull; -import com.danielstone.materialaboutlibrary.MaterialAboutActivity; -import com.danielstone.materialaboutlibrary.items.MaterialAboutActionItem; -import com.danielstone.materialaboutlibrary.items.MaterialAboutItemOnClickAction; -import com.danielstone.materialaboutlibrary.items.MaterialAboutTitleItem; -import com.danielstone.materialaboutlibrary.model.MaterialAboutCard; -import com.danielstone.materialaboutlibrary.model.MaterialAboutList; +import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; +import android.view.View; +import android.widget.TextView; + import com.franmontiel.attributionpresenter.AttributionPresenter; import com.franmontiel.attributionpresenter.entities.Attribution; import com.franmontiel.attributionpresenter.entities.License; /** * Created by Gokul Swaminathan on 2/22/2018. - * - * NOT IN USE - * */ -public class AboutActivity extends MaterialAboutActivity { +public class AboutActivity extends AppCompatActivity{ - private final String EMAIL = "gsnathandev@outlook.com"; + TextView versionView; //shows the version + private final String APP_VERSION_RELEASE = "Version " + Utils.getAppVersion(); //contains Version + the version number + private final String APP_VERSION_DEBUG = "Version " + Utils.getAppVersion() + "-debug"; //contains Version + the version number + debug @Override - @NonNull - protected MaterialAboutList getMaterialAboutList(@NonNull Context context) { - - MaterialAboutCard.Builder appBuilder = new MaterialAboutCard.Builder(); - buildApp(appBuilder, context); - MaterialAboutCard.Builder authorBuilder = new MaterialAboutCard.Builder(); - buildAuthor(authorBuilder, context); - MaterialAboutCard.Builder openBuilder = new MaterialAboutCard.Builder(); - buildOpenLicenses(openBuilder, context); - MaterialAboutCard.Builder rateBuilder = new MaterialAboutCard.Builder(); - buildRateAndReview(rateBuilder, context); - return new MaterialAboutList(appBuilder.build(), authorBuilder.build(), openBuilder.build(), rateBuilder.build()); + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_about); + initUI(); } - private void buildApp(MaterialAboutCard.Builder appBuilder, final Context context){ - appBuilder.addItem(new MaterialAboutTitleItem.Builder() - .text(getString(R.string.app_name)) - .icon(R.mipmap.ic_launcher) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text("Version " + Utils.getAppVersion()) - .icon(R.drawable.info_outline) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.intro) - .icon(R.drawable.arrow_right_drop_circle_outline) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.navIntent(getApplicationContext(), MainIntroActivity.class)); - } - }) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.appChangelog) - .icon(R.drawable.clipboard_alert) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - LogFragment log = new LogFragment(); - log.show(getSupportFragmentManager(), "Log Fragment"); - } - }) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.myLicense) - .icon(R.drawable.document_icon) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.navIntent(getApplicationContext(), LicenseActivity.class)); - } - }) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.privacy) - .icon(R.drawable.file_lock) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.navIntent(getApplicationContext(), PrivacyActivity.class)); - } - }) - .build()); + private void initUI() { + //initialize the textview + versionView = (TextView) findViewById(R.id.text_version); + + // check if app is debug + if (BuildConfig.DEBUG) { + versionView.setText(APP_VERSION_DEBUG); + } else //if app is release + { + versionView.setText(APP_VERSION_RELEASE); + } + } + public void replayIntro(View v) { + //navigate to intro class (replay the intro) + startActivity(Utils.navIntent(getApplicationContext(), MainIntroActivity.class)); } - private void buildAuthor(MaterialAboutCard.Builder appBuilder, final Context context){ - appBuilder.title(R.string.author); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.author_name) - .icon(R.drawable.account_circle) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.linkIntent("https://github.com/JavaCafe01")); - } - }) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.email) - .icon(R.drawable.email) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - Uri uri = Uri.parse("mailto:" + EMAIL); - Intent emailIntent = new Intent(Intent.ACTION_SENDTO, uri); - startActivity(Intent.createChooser(emailIntent, "Email with... ")); - } - }) - .setOnLongClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText("Dev Email", EMAIL); - clipboard.setPrimaryClip(clip); - } - }) - .build()); + public void showLog(View v) + { + LogFragment log = new LogFragment(); + log.show(getSupportFragmentManager(), "Log Fragment"); } + public void showPrivacy(View v) + { + startActivity(Utils.navIntent(getApplicationContext(), PrivacyActivity.class)); + } - private void buildOpenLicenses(MaterialAboutCard.Builder appBuilder, final Context context){ - appBuilder.title(R.string.open_source); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.source_code) - .icon(R.drawable.code_tags) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.linkIntent("https://github.com/JavaCafe01/PdfViewer")); - } - }) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.open_license) - .icon(R.drawable.document_icon) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - showLibs(); - } - }) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.icon) - .icon(R.drawable.favicon_black) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.linkIntent("https://materialdesignicons.com/")); - } - }) - .build()); + public void showMaterial(View v) + { + startActivity(Utils.linkIntent("https://materialdesignicons.com/")); } - private void buildRateAndReview(MaterialAboutCard.Builder appBuilder, final Context context){ - appBuilder.title(R.string.rateReview_title); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.rate) - .icon(R.drawable.star) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.linkIntent("http://play.google.com/store/apps/details?id=com.gsnathan.pdfviewer")); - } - }) - .build()); - appBuilder.addItem(new MaterialAboutActionItem.Builder() - .text(R.string.review) - .icon(R.drawable.message_draw) - .setOnClickAction(new MaterialAboutItemOnClickAction() { - @Override - public void onClick() { - startActivity(Utils.emailIntent(EMAIL,"Pdf Viewer Plus Review", Utils.getAndroidVersion() + "\n\nFeedback:\n", "Send Feedback:")); - } - }) - .build()); + public void showLicense(View v) + { + startActivity(Utils.navIntent(getApplicationContext(), LicenseActivity.class)); } - private void showLibs() + public void showLibraries(View v) { AttributionPresenter attributionPresenter = new AttributionPresenter.Builder(this) .addAttributions( @@ -215,13 +92,6 @@ private void showLibs() .setWebsite("https://github.com/androidannotations/androidannotations") .build() ) - .addAttributions( - new Attribution.Builder("material-about-library") - .addCopyrightNotice("Copyright 2016-2018 Daniel Stone") - .addLicense(License.APACHE) - .setWebsite("https://github.com/daniel-stoneuk/material-about-library") - .build() - ) .addAttributions( new Attribution.Builder("material-intro") .addCopyrightNotice("Copyright 2017 Jan Heinrich Reimer") @@ -265,9 +135,9 @@ private void showLibs() .build() ) .addAttributions( - new Attribution.Builder("Material About") + new Attribution.Builder("Material Design Icons") .addCopyrightNotice("Copyright 2016 Arleu Cezar Vansuita Júnior") - .addLicense(License.MIT) + .addLicense("SIL Open Font", "https://github.com/Templarian/MaterialDesign/blob/master/LICENSE") .setWebsite("https://github.com/jrvansuita/MaterialAbout") .build() ) @@ -284,11 +154,15 @@ private void showLibs() attributionPresenter.showDialog("Open Source Libraries"); } + public void emailDev(View v) { + startActivity(Utils.emailIntent("gokulswaminathan@outlook.com", "Android-Scouter", APP_VERSION_RELEASE, "Send email...")); + } + public void navToGit(View v) { + startActivity(Utils.linkIntent("https://github.com/JavaCafe01")); + } - - @Override - protected CharSequence getActivityTitle() { - return getString(R.string.action_about); + public void navToSourceCode(View v) { + startActivity(Utils.linkIntent("https://github.com/JavaCafe01/TorchLight")); } } \ No newline at end of file diff --git a/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java index f3059c2..40e3a55 100644 --- a/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java +++ b/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java @@ -24,6 +24,7 @@ import com.github.barteksc.pdfviewer.listener.OnPageErrorListener; import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle; import com.github.barteksc.pdfviewer.util.FitPolicy; +import com.kobakei.ratethisapp.RateThisApp; import com.shockwave.pdfium.PdfDocument; import org.androidannotations.annotations.AfterViews; @@ -53,26 +54,45 @@ public class MainActivity extends ProgressActivity implements OnPageChangeListen public static final String SAMPLE_FILE = "pdf_sample.pdf"; public static final String READ_EXTERNAL_STORAGE = "android.permission.READ_EXTERNAL_STORAGE"; - private URL downloadUrl; - - @Override protected void onCreate(Bundle savedInstanceState) { //setFullscreen(true); super.onCreate(savedInstanceState); - onStartUp(); + onFirstInstall(); + onFirstUpdate(); handleIntent(getIntent()); + + // Custom condition: 5 days and 5 launches + RateThisApp.Config config = new RateThisApp.Config(5, 5); + RateThisApp.init(config); + // Monitor launch times and interval from installation + RateThisApp.onCreate(this); + // If the condition is satisfied, "Rate this app" dialog will be shown + RateThisApp.showRateDialogIfNeeded(this); } - private void onStartUp() + private void onFirstInstall() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); - boolean isFirstRun = prefs.getBoolean("FIRSTRUN", true); + boolean isFirstRun = prefs.getBoolean("FIRSTINSTALL", true); if (isFirstRun) { startActivity(new Intent(this, MainIntroActivity.class)); SharedPreferences.Editor editor = prefs.edit(); - editor.putBoolean("FIRSTRUN", false); + editor.putBoolean("FIRSTINSTALL", false); + editor.commit(); + } + } + + private void onFirstUpdate() + { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + boolean isFirstRun = prefs.getBoolean("1.7.0", true); + if (isFirstRun) + { + showLog(); + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("1.7.0", false); editor.commit(); } } @@ -120,6 +140,11 @@ void pickFile() { launchPicker(); } + @OptionsItem(R.id.shareFile) + void shareFile() { + startActivity(Utils.emailIntent(pdfFileName,"","Share File", uri)); + } + void launchPicker() { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType("application/pdf"); @@ -267,12 +292,17 @@ public boolean onCreateOptionsMenu(Menu menu) { public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_about: - startActivity(Utils.navIntent(this, MaterialAboutActivity.class)); + startActivity(Utils.navIntent(this, AboutActivity.class)); return true; default: return super.onOptionsItemSelected(item); } } + private void showLog() + { + LogFragment log = new LogFragment(); + log.show(getSupportFragmentManager(), "Log Fragment"); + } } diff --git a/app/src/main/java/com/gsnathan/pdfviewer/MaterialAboutActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/MaterialAboutActivity.java deleted file mode 100644 index d6b475f..0000000 --- a/app/src/main/java/com/gsnathan/pdfviewer/MaterialAboutActivity.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.gsnathan.pdfviewer; - -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.view.MenuItem; -import android.view.View; - -import com.franmontiel.attributionpresenter.AttributionPresenter; -import com.franmontiel.attributionpresenter.entities.Attribution; -import com.franmontiel.attributionpresenter.entities.License; -import com.vansuita.materialabout.builder.AboutBuilder; -import com.vansuita.materialabout.views.AboutView; - -/** - * Created by Gokul Swaminathan on 2/25/2018. - * - * IN USE - */ - -public class MaterialAboutActivity extends AppCompatActivity{ - - private final String EMAIL = "gsnathandev@outlook.com"; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - AboutView view = AboutBuilder.with(this) - - /* ---Developer Actions--- */ - .setPhoto(R.drawable.myprofile) - .setCover(R.drawable.profile_cover) - .setName(R.string.author_name) - .setSubTitle(R.string.author_job) - .addGitHubLink("JavaCafe01") - .addEmailLink(EMAIL) - /* ---Developer Actions--- */ - - /* ---App Actions--- */ - .setAppIcon(R.drawable.app_icon_with_blank) - .setAppName(R.string.app_name) - .setAppTitle("Version " + Utils.getAppVersion()) - .addAction(Utils.getBitmapFromVectorDrawable(this, R.drawable.arrow_right_drop_circle_outline), R.string.intro, Utils.navIntent(this, MainIntroActivity.class)) - .addAction(com.vansuita.materialabout.R.mipmap.license, R.string.myLicense, Utils.navIntent(this, LicenseActivity.class)) - .addPrivacyPolicyAction(Utils.navIntent(this, PrivacyActivity.class)) - .addAction(Utils.getBitmapFromVectorDrawable(this, R.drawable.code_tags), R.string.source_code, Utils.linkIntent("https://github.com/JavaCafe01/PdfViewer")) - .addAction(Utils.getBitmapFromVectorDrawable(this, R.drawable.document_icon), R.string.open_license2, onLicenseClick) - .addAction(com.vansuita.materialabout.R.mipmap.website, R.string.icon, Utils.linkIntent("https://materialdesignicons.com/")) - .addAction(Utils.getBitmapFromVectorDrawable(this, R.drawable.clipboard_alert), R.string.appChangelog, showLog) - .addShareAction(R.string.app_name) - .addAction(com.vansuita.materialabout.R.mipmap.star, R.string.rate, Utils.linkIntent("http://play.google.com/store/apps/details?id=com.gsnathan.pdfviewer")) - .addAction(com.vansuita.materialabout.R.mipmap.feedback, R.string.review, Utils.emailIntent(EMAIL,"Pdf Viewer Plus Review", Utils.getAndroidVersion() + "\n\nFeedback:\n", "Send Feedback:")) - /* ---App Actions--- */ - - /* ---Behaviours--- */ - .setLinksColumnsCount(2) - .setWrapScrollView(true) - .setLinksAnimated(true) - .setShowAsCard(true) - /* ---Behaviours--- */ - - .build(); - - setContentView(view); - } - - private View.OnClickListener onLicenseClick = new View.OnClickListener() { - public void onClick(View v) { - showLibs(); - } - }; - - private View.OnClickListener showLog = new View.OnClickListener() { - public void onClick(View v) { - LogFragment log = new LogFragment(); - log.show(getSupportFragmentManager(), "Log Fragment"); - - } - }; - - private void showLibs() - { - AttributionPresenter attributionPresenter = new AttributionPresenter.Builder(this) - .addAttributions( - new Attribution.Builder("AttributionPresenter") - .addCopyrightNotice("Copyright 2017 Francisco José Montiel Navarro") - .addLicense(License.APACHE) - .setWebsite("https://github.com/franmontiel/AttributionPresenter") - .build() - ) - .addAttributions( - new Attribution.Builder("Android PdfViewer") - .addCopyrightNotice("Copyright 2017 Bartosz Schiller") - .addLicense(License.APACHE) - .setWebsite("https://github.com/barteksc/AndroidPdfViewer") - .build() - ) - .addAttributions( - new Attribution.Builder("AndroidAnnotations") - .addCopyrightNotice("Copyright 2012-2016 eBusiness Information\n" + - "Copyright 2016-2017 the AndroidAnnotations project") - .addLicense(License.APACHE) - .setWebsite("https://github.com/androidannotations/androidannotations") - .build() - ) - .addAttributions( - new Attribution.Builder("material-about-library") - .addCopyrightNotice("Copyright 2016-2018 Daniel Stone") - .addLicense(License.APACHE) - .setWebsite("https://github.com/daniel-stoneuk/material-about-library") - .build() - ) - .addAttributions( - new Attribution.Builder("material-intro") - .addCopyrightNotice("Copyright 2017 Jan Heinrich Reimer") - .addLicense(License.MIT) - .setWebsite("https://github.com/heinrichreimer/material-intro") - .build() - ) - .addAttributions( - new Attribution.Builder("Android Open Source Project") - .addCopyrightNotice("Copyright 2016 The Android Open Source Project") - .addLicense(License.APACHE) - .setWebsite("http://developer.android.com/tools/support-library/index.html") - .build() - ) - .addAttributions( - new Attribution.Builder("Android Support Libraries") - .addCopyrightNotice("Copyright 2016 The Android Open Source Project") - .addLicense(License.APACHE) - .setWebsite("http://developer.android.com/tools/support-library/index.html") - .build() - ) - .addAttributions( - new Attribution.Builder("HtmlTextView for Android") - .addCopyrightNotice("Copyright 2013 Dominik Schürmann") - .addLicense(License.APACHE) - .setWebsite("https://github.com/PrivacyApps/html-textview") - .build() - ) - .addAttributions( - new Attribution.Builder("LicenseTextView") - .addCopyrightNotice("Copyright 2016 JGabrielFreitas") - .addLicense(License.APACHE) - .setWebsite("https://github.com/jgabrielfreitas/LicenseTextView") - .build() - ) - .addAttributions( - new Attribution.Builder("EasyFeedback") - .addCopyrightNotice("Copyright 2017 Ramankit Singh") - .addLicense(License.APACHE) - .setWebsite("https://github.com/webianks/EasyFeedback") - .build() - ) - .addAttributions( - new Attribution.Builder("Material About") - .addCopyrightNotice("Copyright 2016 Arleu Cezar Vansuita Júnior") - .addLicense(License.MIT) - .setWebsite("https://github.com/jrvansuita/MaterialAbout") - .build() - ) - .addAttributions( - new Attribution.Builder("ChangeLog Library") - .addCopyrightNotice("Copyright 2013-2015 Gabriele Mariotti") - .addLicense(License.APACHE) - .setWebsite("https://github.com/gabrielemariotti/changeloglib") - .build() - ) - .build(); - - //show license dialogue - attributionPresenter.showDialog("Open Source Libraries"); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if (item.getItemId() == android.R.id.home) { - onBackPressed(); - return true; - } - return false; - } -} diff --git a/app/src/main/java/com/gsnathan/pdfviewer/Utils.java b/app/src/main/java/com/gsnathan/pdfviewer/Utils.java index 03c6028..0a55c58 100644 --- a/app/src/main/java/com/gsnathan/pdfviewer/Utils.java +++ b/app/src/main/java/com/gsnathan/pdfviewer/Utils.java @@ -33,6 +33,16 @@ public static Intent emailIntent(String emailAddress, String subject, String tex return Intent.createChooser(email, title); } + public static Intent emailIntent(String subject, String text, String title, Uri filePath) + { + Intent email = new Intent(Intent.ACTION_SEND); + email.setType("text/email"); + email.putExtra(Intent.EXTRA_SUBJECT, subject); + email.putExtra(Intent.EXTRA_TEXT, text); + email.putExtra(Intent.EXTRA_STREAM, filePath); + return Intent.createChooser(email, title); + } + public static Intent linkIntent(String url) { Intent link = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); diff --git a/app/src/main/res/drawable/account_circle.xml b/app/src/main/res/drawable/account_circle.xml deleted file mode 100644 index 2302652..0000000 --- a/app/src/main/res/drawable/account_circle.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/app_icon.png b/app/src/main/res/drawable/app_icon.png deleted file mode 100644 index f83c717..0000000 Binary files a/app/src/main/res/drawable/app_icon.png and /dev/null differ diff --git a/app/src/main/res/drawable/app_icon_with_blank.png b/app/src/main/res/drawable/app_icon_with_blank.png deleted file mode 100644 index 974fe26..0000000 Binary files a/app/src/main/res/drawable/app_icon_with_blank.png and /dev/null differ diff --git a/app/src/main/res/drawable/arrow_right_drop_circle_outline.xml b/app/src/main/res/drawable/arrow_right_drop_circle_outline.xml deleted file mode 100644 index 6d08e52..0000000 --- a/app/src/main/res/drawable/arrow_right_drop_circle_outline.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/code_tags.xml b/app/src/main/res/drawable/code_icon.xml similarity index 83% rename from app/src/main/res/drawable/code_tags.xml rename to app/src/main/res/drawable/code_icon.xml index 25fe39d..a6ac2cc 100644 --- a/app/src/main/res/drawable/code_tags.xml +++ b/app/src/main/res/drawable/code_icon.xml @@ -4,5 +4,5 @@ android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + \ No newline at end of file diff --git a/app/src/main/res/drawable/document_icon.xml b/app/src/main/res/drawable/document_icon.xml deleted file mode 100644 index 4de0acd..0000000 --- a/app/src/main/res/drawable/document_icon.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/email.xml b/app/src/main/res/drawable/email.xml deleted file mode 100644 index 97ed704..0000000 --- a/app/src/main/res/drawable/email.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/email_icon.xml b/app/src/main/res/drawable/email_icon.xml new file mode 100644 index 0000000..e913c0c --- /dev/null +++ b/app/src/main/res/drawable/email_icon.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/favicon.png b/app/src/main/res/drawable/favicon.png deleted file mode 100644 index 8bd8b66..0000000 Binary files a/app/src/main/res/drawable/favicon.png and /dev/null differ diff --git a/app/src/main/res/drawable/favicon_black.png b/app/src/main/res/drawable/favicon_black.png deleted file mode 100644 index 5d2713a..0000000 Binary files a/app/src/main/res/drawable/favicon_black.png and /dev/null differ diff --git a/app/src/main/res/drawable/folder_open.xml b/app/src/main/res/drawable/folder_icon.xml similarity index 100% rename from app/src/main/res/drawable/folder_open.xml rename to app/src/main/res/drawable/folder_icon.xml diff --git a/app/src/main/res/drawable/github_icon.xml b/app/src/main/res/drawable/github_icon.xml new file mode 100644 index 0000000..34c2eb6 --- /dev/null +++ b/app/src/main/res/drawable/github_icon.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc5..0000000 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/icon_background.png b/app/src/main/res/drawable/icon_background.png deleted file mode 100644 index 5efc9a8..0000000 Binary files a/app/src/main/res/drawable/icon_background.png and /dev/null differ diff --git a/app/src/main/res/drawable/lib_icon.xml b/app/src/main/res/drawable/lib_icon.xml new file mode 100644 index 0000000..85d9e1a --- /dev/null +++ b/app/src/main/res/drawable/lib_icon.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/license_icon.xml b/app/src/main/res/drawable/license_icon.xml new file mode 100644 index 0000000..ac00e2e --- /dev/null +++ b/app/src/main/res/drawable/license_icon.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/clipboard_alert.xml b/app/src/main/res/drawable/log_icon.xml similarity index 87% rename from app/src/main/res/drawable/clipboard_alert.xml rename to app/src/main/res/drawable/log_icon.xml index 21ab46c..63f3123 100644 --- a/app/src/main/res/drawable/clipboard_alert.xml +++ b/app/src/main/res/drawable/log_icon.xml @@ -4,5 +4,5 @@ android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + \ No newline at end of file diff --git a/app/src/main/res/drawable/message_draw.xml b/app/src/main/res/drawable/message_draw.xml deleted file mode 100644 index a4f5070..0000000 --- a/app/src/main/res/drawable/message_draw.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/print_icon.xml b/app/src/main/res/drawable/print_icon.xml new file mode 100644 index 0000000..b5abab2 --- /dev/null +++ b/app/src/main/res/drawable/print_icon.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/file_lock.xml b/app/src/main/res/drawable/privacy_icon.xml similarity index 86% rename from app/src/main/res/drawable/file_lock.xml rename to app/src/main/res/drawable/privacy_icon.xml index d5a2e92..de08840 100644 --- a/app/src/main/res/drawable/file_lock.xml +++ b/app/src/main/res/drawable/privacy_icon.xml @@ -4,5 +4,5 @@ android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + \ No newline at end of file diff --git a/app/src/main/res/drawable/profile_cover.jpg b/app/src/main/res/drawable/profile_cover.jpg deleted file mode 100644 index 1c53594..0000000 Binary files a/app/src/main/res/drawable/profile_cover.jpg and /dev/null differ diff --git a/app/src/main/res/drawable/replay_icon.xml b/app/src/main/res/drawable/replay_icon.xml new file mode 100644 index 0000000..1970502 --- /dev/null +++ b/app/src/main/res/drawable/replay_icon.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/share_icon.xml b/app/src/main/res/drawable/share_icon.xml new file mode 100644 index 0000000..a1f9bc7 --- /dev/null +++ b/app/src/main/res/drawable/share_icon.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/star.xml b/app/src/main/res/drawable/star.xml deleted file mode 100644 index eacf681..0000000 --- a/app/src/main/res/drawable/star.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/telegram_new.xml b/app/src/main/res/drawable/telegram_new.xml deleted file mode 100644 index 66026da..0000000 --- a/app/src/main/res/drawable/telegram_new.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/info_outline.xml b/app/src/main/res/drawable/version_icon.xml similarity index 86% rename from app/src/main/res/drawable/info_outline.xml rename to app/src/main/res/drawable/version_icon.xml index 9f1a282..8ab5539 100644 --- a/app/src/main/res/drawable/info_outline.xml +++ b/app/src/main/res/drawable/version_icon.xml @@ -4,5 +4,5 @@ android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> - + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml new file mode 100644 index 0000000..5a59167 --- /dev/null +++ b/app/src/main/res/layout/activity_about.xml @@ -0,0 +1,465 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index f0b8512..60d0efd 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -1,9 +1,10 @@ + \ No newline at end of file diff --git a/app/src/main/res/menu/options.xml b/app/src/main/res/menu/options.xml index c52508b..9c643cb 100644 --- a/app/src/main/res/menu/options.xml +++ b/app/src/main/res/menu/options.xml @@ -1,9 +1,16 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/raw/changelog.xml b/app/src/main/res/raw/changelog.xml index f0a5d6d..11036b6 100644 --- a/app/src/main/res/raw/changelog.xml +++ b/app/src/main/res/raw/changelog.xml @@ -1,6 +1,12 @@ + + [b]New![/b] Share the pdf + [b]New![/b] About page + [b]Fix![/b] Going back to home page and other bugs + + [b]New![/b] A new Intro slide that requires storage permissions diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b28e335..881c5f3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -5,22 +5,14 @@ About Version Replay Intro - Source Code - Github Author - Gokul Swaminathan - Developer Email Of course this app is open source. You always have the privilege to make your own modifications to this app. The source code link is in the about section. Freedom Pdf Viewer Plus A simple Pdf document viewer. - Open Source - Libraries License - MIT License Privacy Policy - More Info MIT License\n\nCopyright (c) 2018 Gokul Swaminathan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy @@ -37,18 +29,16 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - Icons - By Material Design Icons - Rate and Review - Special Thanks - Rate - Review - Libraries Used Change Log Ok - About 2 Storage Permissions Of course this app needs permission to access the phone\'s storage. Please click on the button and allow the app the to read the phone\'s storage. Without it, the app will not work properly. + Open Source Libraries + Github + Source Code + + Share File + Print File diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 04e3007..f5c9cbf 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -8,13 +8,6 @@ @color/colorAccent - - - - - -