diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index 0b9500b6..00000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-# These are supported funding model platforms
-
-github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
-open_collective: # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-custom: https://www.paypal.me/gsnathan
diff --git a/README.md b/README.md
index f9cb1190..6b66cfc6 100755
--- a/README.md
+++ b/README.md
@@ -1,22 +1,26 @@
-# Pdf Viewer Plus
+
+
+
+
+
Pdf Viewer Plus
+
+
+
[//]: # (Shields)
[![Travis Build Status](https://travis-ci.com/JavaCafe01/PdfViewer.svg?branch=master)](https://travis-ci.com/JavaCafe01/PdfViewer)
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/JavaCafe01/PdfViewer/blob/master/LICENSE)
-## Download
-
-
+
## Screenshots
-| Main Page |
-|:-:|
-| |
-| [`MainActivity.java`](https://github.com/JavaCafe01/PdfViewer/blob/master/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java) |
+| Main Page | Main Page | Cyanea |
+|:-:|:-:|:-:|
+| | | |
## Contribute
@@ -24,17 +28,13 @@ You can contribute to this project in many ways:
* Fork and make pull requests (please target dev branch)
* Help to translate the application (By making PR)
-### Special Thanks!
+### Contributors
-| Github Users |
-| ------------- |
-| [Fs00](https://github.com/Fs00) |
-| [Etamuk](https://github.com/Etamuk) |
-| [Raspbeguy](https://github.com/raspbeguy) |
-| [Greynar](https://github.com/Greynar) |
-| [ORelio](https://github.com/ORelio) |
-| [PFayoux](https://github.com/PFayoux) |
+
+
+
+Made with [contributors-img](https://contrib.rocks)
## License
diff --git a/app/build.gradle b/app/build.gradle
index 47556624..db2cd0cd 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -31,14 +31,14 @@ android {
abortOnError false
}
- buildToolsVersion "29.0.2"
+ buildToolsVersion "30.0.3"
compileSdkVersion 30
defaultConfig {
applicationId "com.gsnathan.pdfviewer"
minSdkVersion 21
targetSdkVersion 30
- versionCode 26
- versionName "3.5"
+ versionCode 27
+ versionName "3.6"
vectorDrawables.useSupportLibrary = true
javaCompileOptions {
@@ -51,6 +51,10 @@ android {
}
}
+ buildFeatures {
+ viewBinding true
+ }
+
buildTypes {
release {
debuggable false
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index c46e6776..d0ee64d9 100755
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -70,7 +70,7 @@
-
+
diff --git a/app/src/main/assets/themes/cyanea_themes.json b/app/src/main/assets/themes/cyanea_themes.json
index d42b0385..a7fb4cfa 100755
--- a/app/src/main/assets/themes/cyanea_themes.json
+++ b/app/src/main/assets/themes/cyanea_themes.json
@@ -3,7 +3,7 @@
"theme_name": "Pdf Viewer Plus",
"base_theme": "LIGHT",
"primary": "#2481a1",
- "primary_dark": "#1a5e76",
+ "primary_dark": "#2481a1",
"primary_light": "#2481a1",
"accent": "#00cc99",
"accent_dark": "#029873",
diff --git a/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java
index 561f97d0..80e3d8ca 100755
--- a/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java
+++ b/app/src/main/java/com/gsnathan/pdfviewer/AboutActivity.java
@@ -24,50 +24,38 @@
package com.gsnathan.pdfviewer;
-import android.os.Binder;
import android.os.Bundle;
-import androidx.appcompat.app.AppCompatActivity;
-import androidx.appcompat.widget.Toolbar;
-
import android.view.MenuItem;
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;
+import com.gsnathan.pdfviewer.databinding.ActivityAboutBinding;
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
public class AboutActivity extends CyaneaAppCompatActivity {
- TextView versionView; //shows the version
+ private ActivityAboutBinding viewBinding;
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
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_about);
- initUI();
- setUpToolBar();
- }
-
- private void setUpToolBar() {
- Binder.clearCallingIdentity();
+ viewBinding = ActivityAboutBinding.inflate(getLayoutInflater());
+ setContentView(viewBinding.getRoot());
+ setVersionText();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
- private void initUI() {
- //initialize the textview
- versionView = (TextView) findViewById(R.id.versionTextView);
-
+ private void setVersionText() {
// check if app is debug
if (BuildConfig.DEBUG) {
- versionView.setText(APP_VERSION_DEBUG);
- } else //if app is release
- {
- versionView.setText(APP_VERSION_RELEASE);
+ viewBinding.versionTextView.setText(APP_VERSION_DEBUG);
+ } else { //if app is release
+ viewBinding.versionTextView.setText(APP_VERSION_RELEASE);
}
}
diff --git a/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java
index b581aa1b..505ef0ab 100755
--- a/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java
+++ b/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java
@@ -34,94 +34,97 @@
import android.database.Cursor;
import android.graphics.Color;
import android.net.Uri;
+import android.os.Bundle;
import android.os.Environment;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.print.PrintManager;
import android.provider.OpenableColumns;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.Toast;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts.OpenDocument;
+import androidx.activity.result.contract.ActivityResultContracts.RequestPermission;
+import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AlertDialog;
-import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.DialogFragment;
-import android.os.Bundle;
-
-import android.text.InputType;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.EditText;
-import android.widget.ProgressBar;
-import android.widget.Toast;
-
import com.github.barteksc.pdfviewer.PDFView;
import com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle;
import com.github.barteksc.pdfviewer.util.Constants;
import com.github.barteksc.pdfviewer.util.FitPolicy;
-import com.google.android.material.bottomnavigation.BottomNavigationView;
+import com.gsnathan.pdfviewer.databinding.ActivityMainBinding;
+import com.gsnathan.pdfviewer.databinding.PasswordDialogBinding;
import com.jaredrummler.cyanea.app.CyaneaAppCompatActivity;
import com.jaredrummler.cyanea.prefs.CyaneaSettingsActivity;
import com.shockwave.pdfium.PdfDocument;
+import com.shockwave.pdfium.PdfPasswordException;
-import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.NonConfigurationInstance;
-import org.androidannotations.annotations.ViewById;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
-import java.util.Arrays;
import static android.content.pm.PackageManager.PERMISSION_DENIED;
-@EActivity(R.layout.activity_main)
+@EActivity
public class MainActivity extends CyaneaAppCompatActivity {
private static final String TAG = MainActivity.class.getSimpleName();
- private PrintManager mgr = null;
-
- private final static int PERMISSION_WRITE = 42041;
-
+ private PrintManager mgr;
private SharedPreferences prefManager;
private boolean isBottomNavigationHidden = false;
- @ViewById PDFView pdfView;
- @ViewById BottomNavigationView bottomNavigation;
- @ViewById ProgressBar progressBar;
+ private ActivityMainBinding viewBinding;
private final ActivityResultLauncher documentPickerLauncher = registerForActivityResult(
new OpenDocument(),
this::openSelectedDocument
);
+ private final ActivityResultLauncher saveToDownloadPermissionLauncher = registerForActivityResult(
+ new RequestPermission(),
+ this::saveDownloadedFileAfterPermissionRequest
+ );
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ viewBinding = ActivityMainBinding.inflate(getLayoutInflater());
+ setContentView(viewBinding.getRoot());
+
+ Constants.THUMBNAIL_RATIO = 1f;
+ setBottomBarListeners();
// Workaround for https://stackoverflow.com/questions/38200282/
StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build());
prefManager = PreferenceManager.getDefaultSharedPreferences(this);
+
+ mgr = (PrintManager) getSystemService(PRINT_SERVICE);
onFirstInstall();
onFirstUpdate();
- uri = readUriFromIntent(getIntent());
+ readUriFromIntent(getIntent());
if (uri == null) {
pickFile();
+ setTitle("");
+ } else {
+ displayFromUri(uri);
}
-
- mgr = (PrintManager) getSystemService(PRINT_SERVICE);
}
private void onFirstInstall() {
@@ -144,20 +147,21 @@ private void onFirstUpdate() {
}
}
- private Uri readUriFromIntent(Intent intent) {
- Uri uri = intent.getData();
- if (uri == null) {
- return null;
+ private void readUriFromIntent(Intent intent) {
+ Uri intentUri = intent.getData();
+ if (intentUri == null) {
+ return;
}
// Happens when the content provider URI used to open the document expires
- if ("content".equals(uri.getScheme()) &&
- checkCallingOrSelfUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION) == PERMISSION_DENIED) {
- Log.w(TAG, "No read permission for URI " + uri);
- return null;
+ if ("content".equals(intentUri.getScheme()) &&
+ checkCallingOrSelfUriPermission(intentUri, Intent.FLAG_GRANT_READ_URI_PERMISSION) == PERMISSION_DENIED) {
+ Log.w(TAG, "No read permission for URI " + intentUri);
+ uri = null;
+ return;
}
- return uri;
+ uri = intentUri;
}
@NonConfigurationInstance
@@ -173,6 +177,14 @@ private Uri readUriFromIntent(Intent intent) {
private byte[] downloadedPdfFileContent;
+ private final ActivityResultLauncher settingsLauncher = registerForActivityResult(
+ new StartActivityForResult(),
+ result -> {
+ if (uri != null)
+ displayFromUri(uri);
+ }
+ );
+
void shareFile() {
startActivity(Utils.emailIntent(pdfFileName, "", getResources().getString(R.string.share), uri));
}
@@ -182,7 +194,7 @@ private void openSelectedDocument(Uri selectedDocumentUri) {
return;
}
- if (uri == null) {
+ if (uri == null || selectedDocumentUri.equals(uri)) {
uri = selectedDocumentUri;
displayFromUri(uri);
} else {
@@ -201,19 +213,8 @@ private void pickFile() {
}
}
- @AfterViews
- void afterViews() {
- pdfView.setBackgroundColor(Color.LTGRAY);
- Constants.THUMBNAIL_RATIO = 1f;
- if (uri != null) {
- displayFromUri(uri);
- }
- setTitle(pdfFileName);
- setBottomBarListeners();
- }
-
private void setBottomBarListeners() {
- bottomNavigation.setOnNavigationItemSelectedListener(item -> {
+ viewBinding.bottomNavigation.setOnNavigationItemSelectedListener(item -> {
switch (item.getItemId()) {
case R.id.pickFile:
pickFile();
@@ -222,10 +223,6 @@ private void setBottomBarListeners() {
if (uri != null)
showPdfMetaDialog();
break;
- case R.id.unlockFile:
- if (uri != null)
- unlockPDF();
- break;
case R.id.shareFile:
if (uri != null)
shareFile();
@@ -242,10 +239,15 @@ private void setBottomBarListeners() {
}
void configurePdfViewAndLoad(PDFView.Configurator viewConfigurator) {
- pdfView.useBestQuality(prefManager.getBoolean("quality_pref", false));
- pdfView.setMinZoom(0.5f);
- pdfView.setMidZoom(2.0f);
- pdfView.setMaxZoom(5.0f);
+ if (!prefManager.getBoolean("pdftheme_pref", false)) {
+ viewBinding.pdfView.setBackgroundColor(Color.LTGRAY);
+ } else {
+ viewBinding.pdfView.setBackgroundColor(0xFF212121);
+ }
+ viewBinding.pdfView.useBestQuality(prefManager.getBoolean("quality_pref", false));
+ viewBinding.pdfView.setMinZoom(0.5f);
+ viewBinding.pdfView.setMidZoom(2.0f);
+ viewBinding.pdfView.setMaxZoom(5.0f);
viewConfigurator
.defaultPage(pageNumber)
.onPageChange(this::setCurrentPage)
@@ -255,6 +257,7 @@ void configurePdfViewAndLoad(PDFView.Configurator viewConfigurator) {
.onPageScroll(this::toggleBottomNavigationAccordingToPosition)
.scrollHandle(new DefaultScrollHandle(this))
.spacing(10) // in dp
+ .onError(this::handleFileOpeningError)
.onPageError((page, err) -> Log.e(TAG, "Cannot load page " + page, err))
.pageFitPolicy(FitPolicy.WIDTH)
.password(pdfPassword)
@@ -262,9 +265,23 @@ void configurePdfViewAndLoad(PDFView.Configurator viewConfigurator) {
.autoSpacing(prefManager.getBoolean("scroll_pref", false))
.pageSnap(prefManager.getBoolean("snap_pref", false))
.pageFling(prefManager.getBoolean("fling_pref", false))
+ .nightMode(prefManager.getBoolean("pdftheme_pref", false))
.load();
}
+ private void handleFileOpeningError(Throwable exception) {
+ if (exception instanceof PdfPasswordException) {
+ if (pdfPassword != null) {
+ Toast.makeText(this, R.string.wrong_password, Toast.LENGTH_SHORT).show();
+ pdfPassword = null; // prevent the toast from being shown again if the user rotates the screen
+ }
+ askForPdfPassword();
+ } else {
+ Toast.makeText(this, R.string.file_opening_error, Toast.LENGTH_LONG).show();
+ Log.e(TAG, "Error when opening file", exception);
+ }
+ }
+
private void toggleBottomNavigationAccordingToPosition(int page, float positionOffset) {
if (positionOffset == 0) {
showBottomNavigationView();
@@ -284,48 +301,49 @@ private boolean toggleBottomNavigationVisibility(MotionEvent e) {
private void hideBottomNavigationView() {
isBottomNavigationHidden = true;
- bottomNavigation.animate().translationY(bottomNavigation.getHeight()).setDuration(100);
+ viewBinding.bottomNavigation.animate()
+ .translationY(viewBinding.bottomNavigation.getHeight())
+ .setDuration(100);
}
private void showBottomNavigationView() {
isBottomNavigationHidden = false;
- bottomNavigation.animate().translationY(0).setDuration(100);
+ viewBinding.bottomNavigation.animate()
+ .translationY(0)
+ .setDuration(100);
}
void displayFromUri(Uri uri) {
pdfFileName = getFileName(uri);
+ setTitle(pdfFileName);
setTaskDescription(new ActivityManager.TaskDescription(pdfFileName));
String scheme = uri.getScheme();
if (scheme != null && scheme.contains("http")) {
// we will get the pdf asynchronously with the DownloadPDFFile object
- progressBar.setVisibility(View.VISIBLE);
+ viewBinding.progressBar.setVisibility(View.VISIBLE);
DownloadPDFFile downloadPDFFile = new DownloadPDFFile(this);
downloadPDFFile.execute(uri.toString());
} else {
- configurePdfViewAndLoad(pdfView.fromUri(uri));
+ configurePdfViewAndLoad(viewBinding.pdfView.fromUri(uri));
}
}
public void hideProgressBar() {
- progressBar.setVisibility(View.GONE);
+ viewBinding.progressBar.setVisibility(View.GONE);
}
void saveToFileAndDisplay(byte[] pdfFileContent) {
downloadedPdfFileContent = pdfFileContent;
saveToDownloadFolderIfAllowed(pdfFileContent);
- configurePdfViewAndLoad(pdfView.fromBytes(pdfFileContent));
+ configurePdfViewAndLoad(viewBinding.pdfView.fromBytes(pdfFileContent));
}
private void saveToDownloadFolderIfAllowed(byte[] fileContent) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
trySaveToDownloadFolder(fileContent, false);
} else {
- ActivityCompat.requestPermissions(
- this,
- new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE },
- PERMISSION_WRITE
- );
+ saveToDownloadPermissionLauncher.launch(Manifest.permission.WRITE_EXTERNAL_STORAGE);
}
}
@@ -342,10 +360,16 @@ private void trySaveToDownloadFolder(byte[] fileContent, boolean showSuccessMess
}
}
+ private void saveDownloadedFileAfterPermissionRequest(boolean isPermissionGranted) {
+ if (isPermissionGranted) {
+ trySaveToDownloadFolder(downloadedPdfFileContent, true);
+ } else {
+ Toast.makeText(this, R.string.save_to_download_failed, Toast.LENGTH_SHORT).show();
+ }
+ }
+
void navToSettings() {
- Intent intent = new Intent(this, SettingsActivity.class);
- intent.setData(uri);
- startActivity(intent);
+ settingsLauncher.launch(new Intent(this, SettingsActivity.class));
}
private void setCurrentPage(int page, int pageCount) {
@@ -375,26 +399,23 @@ private void printDocument() {
mgr.print(pdfFileName, new PdfDocumentAdapter(this, uri), null);
}
- void unlockPDF() {
-
- final EditText input = new EditText(this);
- input.setPadding(19, 19, 19, 19);
- input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
-
- new AlertDialog.Builder(this)
- .setTitle(R.string.password)
- .setView(input)
+ void askForPdfPassword() {
+ PasswordDialogBinding dialogBinding = PasswordDialogBinding.inflate(getLayoutInflater());
+ AlertDialog alert = new AlertDialog.Builder(this)
+ .setTitle(R.string.protected_pdf)
+ .setView(dialogBinding.getRoot())
.setPositiveButton(R.string.ok, (dialog, which) -> {
- pdfPassword = input.getText().toString();
- if (uri != null)
- displayFromUri(uri);
+ pdfPassword = dialogBinding.passwordInput.getText().toString();
+ displayFromUri(uri);
})
.setIcon(R.drawable.lock_icon)
- .show();
+ .create();
+ alert.setCanceledOnTouchOutside(false);
+ alert.show();
}
void showPdfMetaDialog() {
- PdfDocument.Meta meta = pdfView.getDocumentMeta();
+ PdfDocument.Meta meta = viewBinding.pdfView.getDocumentMeta();
if (meta != null) {
Bundle dialogArgs = new Bundle();
dialogArgs.putString(PdfMetaDialog.TITLE_ARGUMENT, meta.getTitle());
@@ -406,24 +427,6 @@ void showPdfMetaDialog() {
}
}
- @Override
- public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
- @NonNull int[] grantResults) {
- if (grantResults.length == 0) {
- return;
- }
- switch (requestCode) {
- case PERMISSION_WRITE:
- int indexPermission = Arrays.asList(permissions).indexOf(Manifest.permission.WRITE_EXTERNAL_STORAGE);
- if (grantResults[indexPermission] == PackageManager.PERMISSION_GRANTED) {
- trySaveToDownloadFolder(downloadedPdfFileContent, true);
- } else {
- Toast.makeText(this, R.string.save_to_download_failed, Toast.LENGTH_SHORT).show();
- }
- break;
- }
- }
-
@Override
public boolean onCreateOptionsMenu(@NotNull Menu menu) {
getMenuInflater().inflate(R.menu.menu, menu);
diff --git a/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java
index 9163254a..2a004c5b 100644
--- a/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java
+++ b/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java
@@ -3,6 +3,7 @@
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.preference.Preference;
import android.util.Log;
@@ -30,39 +31,26 @@ protected void onCreate(Bundle savedInstanceState) {
setupActionBar();
addPreferencesFromResource(R.xml.preferences);
- setOptionsListTopMargin();
+ setupShowInLauncherPreference();
+ }
- Preference reloadPref = findPreference("reload_pref");
- Uri documentUri = getIntent().getData();
- if (documentUri == null) {
- getPreferenceScreen().removePreference(reloadPref);
+ private void setupShowInLauncherPreference() {
+ Preference showInLauncherPref = findPreference("show_in_launcher");
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ // Starting from Android Q it is not possible anymore to hide the app from launcher
+ // See https://developer.android.com/reference/android/content/pm/LauncherApps#getActivityList(java.lang.String,%20android.os.UserHandle)
+ getPreferenceScreen().removePreference(showInLauncherPref);
} else {
- reloadPref.setOnPreferenceClickListener(preference -> {
- reopenDocumentInNewTask();
- return true;
+ setOptionsListTopMargin();
+ showInLauncherPref.setOnPreferenceChangeListener((preference, newValue) -> {
+ try {
+ setLauncherAliasState((boolean) newValue);
+ return true;
+ } catch (Exception ignored) {
+ return false;
+ }
});
}
-
- findPreference("show_in_launcher").setOnPreferenceChangeListener((preference, newValue) -> {
- try {
- setLauncherAliasState((boolean) newValue);
- return true;
- } catch (Exception ignored) {
- return false;
- }
- });
- }
-
- private void reopenDocumentInNewTask() {
- try {
- Uri documentUri = getIntent().getData();
- Intent intent = new Intent(this, MainActivity_.class);
- intent.setData(documentUri);
- intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK | Intent.FLAG_ACTIVITY_TASK_ON_HOME);
- startActivity(intent);
- } catch (Exception e) {
- Log.e("SettingsActivity", "Reloading PDF failed", e);
- }
}
private void setOptionsListTopMargin() {
diff --git a/app/src/main/java/com/gsnathan/pdfviewer/Utils.java b/app/src/main/java/com/gsnathan/pdfviewer/Utils.java
index 97a4b5b2..152038b0 100755
--- a/app/src/main/java/com/gsnathan/pdfviewer/Utils.java
+++ b/app/src/main/java/com/gsnathan/pdfviewer/Utils.java
@@ -45,9 +45,11 @@ public class Utils {
static void showLog(AppCompatActivity context) {
WhatsNew log = WhatsNew.newInstance(
- new WhatsNewItem("Bugs", "A bunch of bug fixes.", R.drawable.star_icon),
- new WhatsNewItem("Scroll", "Lots of scrolling improvements", R.drawable.star_icon)
- );
+ new WhatsNewItem("Multi-document mode", "You can now open multiple documents at the same time!", R.drawable.star_icon),
+ new WhatsNewItem("Pdf Night Mode", "PDFs can now be viewed in night mode! (Look in settings)", R.drawable.star_icon),
+ new WhatsNewItem("Optimizations and UI improvements", "Especially when opening files from the Internet.", R.drawable.star_icon),
+ new WhatsNewItem("Bugs", "A bunch of bug fixes.", R.drawable.star_icon)
+ );
log.setTitleColor(Color.BLACK);
log.setTitleText(context.getResources().getString(R.string.appChangelog));
log.setButtonText(context.getResources().getString(R.string.buttonLog));
diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml
index edc1ae87..e20f285d 100755
--- a/app/src/main/res/layout/activity_about.xml
+++ b/app/src/main/res/layout/activity_about.xml
@@ -46,7 +46,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="?android:dividerHorizontal"
- android:background="#f5f5f5"
+
android:orientation="vertical">
+ android:textSize="26sp" />
+ android:textSize="16sp" />
diff --git a/app/src/main/res/layout/password_dialog.xml b/app/src/main/res/layout/password_dialog.xml
new file mode 100644
index 00000000..8ac895ed
--- /dev/null
+++ b/app/src/main/res/layout/password_dialog.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/menu/fab_menu.xml b/app/src/main/res/menu/fab_menu.xml
index 5e2be162..c71d429e 100644
--- a/app/src/main/res/menu/fab_menu.xml
+++ b/app/src/main/res/menu/fab_menu.xml
@@ -16,13 +16,6 @@
android:orderInCategory="4"
app:showAsAction="always" />
-
-
-
-
- Drazí uživatelé,\n\nPdf Viewer Plus je nyní k dispozici i přes F-Droid!
-
-
Změnové záznamy
Ok
Oprávnění k úložišti
@@ -92,8 +88,6 @@
Barva navigační lišty
Primární barva navigační lišty
- Heslo
- Odemknout Zabezpečený soubor
Informace o souboru
Vysoká kvalita vykreslování
Nastavení
@@ -104,8 +98,6 @@
Kvalita
Pohyb v dokumentu
Nastavení
- Znovu-načtení PDF
- Pro uplatnění změn je nutno soubor znovu načíst.
Pokračovat
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 33fc776f..4c0d97fd 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -12,7 +12,6 @@
Ein einfacher Dokumentenbetrachter für Pdf-Dateien.
Lizenz
Datenschutz-Bestimmungen
- Liebe Nutzer, Pdf Viewer Plus ist nun auch in F-Droid verfügbar!
Änderungshistorie
Ok
Speicherberechtigungen
@@ -38,8 +37,6 @@
Erscheinungsbild
Farbe der Navigationsleiste
Hauptfarbe auf die Navigationsleiste anwenden
- Passwort
- Gesicherte PDF-Datei entsperren
Dateiinfo
Wiedergabe in hoher Qualität
Einstellungen
@@ -49,7 +46,5 @@
Seitenumbruch
Qualität
Scrollen
- PDF-Datei neu laden
- Um die Änderungen anzuwenden, muss die PDF-Datei neu geladen werden.
Weiter
\ No newline at end of file
diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml
new file mode 100644
index 00000000..84461286
--- /dev/null
+++ b/app/src/main/res/values-es-rES/strings.xml
@@ -0,0 +1,114 @@
+
+
+
+ Pdf Viewer Plus
+ Abrir
+ No se pudo abrir el archivo, verifique el estado del administrador de archivos.
+ El servidor remoto respondió con un error.
+ Por alguna razón, no se pudo descargar este archivo.
+ Conexión segura fallida.
+ Archivo guardado a la carpeta de descargas.
+ No se pudo guardar el archivo a la carpeta de descargas.
+ Acerca de
+ Versión
+ Repetir introducción
+ Gokul Swaminathan
+ Email
+ Por supuesto, esta aplicación es de código abierto. Usted siempre tiene el privilegio de realizar sus propias modificaciones a esta aplicación. El enlace del código fuente se encuentra en la sección Acerca de.
+ Libre
+ Pdf Viewer Plus
+ Un visor de documentos PDF simple.
+ Licencia
+ Política de privacidad
+
+
+ MIT License\n\nCopyright (©) 2018 Gokul Swaminathan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
+
+ Registro de cambios
+ Ok
+ Permisos de almacenamiento
+ Esta aplicación necesita permiso para acceder al almacenamiento del dispositivo. Sin él, la aplicación no funcionará correctamente.
+
+ Librerías de código abierto
+ Github
+ Código fuente
+
+ Compartir
+ Imprimir
+ Aviso del desarrollador
+ Cambiar tema
+ Información de la aplicación
+ Información del autor
+ Colaboradores
+
+ Selector de temas
+
+ Temas
+ Selecciona un tema preinstalado
+
+ Color primario
+ El color más común de la interfaz.
+
+ Color de acentuación
+ Acentúa algunas partes de la interfaz.
+
+ Color de fondo
+ El color de fondo de la interfaz.
+ Apariencia
+
+ Color de la barra de navegación
+ Aplica el color primario a la barra de navegación.
+ Información
+ Renderizado de alta calidad
+ Configuración
+ Anti-Aliasing
+ Deslizamiento horizontal
+ Ajuste de página
+ Centra la vista en la página actual después de cada deslizamiento
+ Salto de página
+ Realiza un deslizamiento rápido para saltar a la siguiente página
+ Calidad
+ Deslizamiento
+ Configuración
+ Continuar
+ Mostrar aplicación en su lanzador de aplicaciones
+ Puede que necesite reiniciar su lanzador para que esta opción se aplique
+ Título: %1$s
+ Autor: %1$s
+ Fecha de creación: %1$s
+
\ No newline at end of file
diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml
index fa051c71..dfd63616 100644
--- a/app/src/main/res/values-fr/strings.xml
+++ b/app/src/main/res/values-fr/strings.xml
@@ -16,7 +16,6 @@
Un lecteur PDF simple.
Licence
Politique de confidentialité
- Chers utilisateurs,\n\nPdf Viewer Plus est désormais disponible sur F-Droid !
Journal des modifications
Ok
Autorisation de stockage
@@ -42,8 +41,6 @@
Apparence
Couleur de la barre de navigation
Appliquer la couleur principale à la barre de navigation
- Mot de passe
- Déverrouiller un PDF sécurisé
Info sur le fichier
Rendu en haute qualité
Préférences
@@ -56,8 +53,6 @@
Qualité
Défilement
Préférences
- Recharger le PDF
- Pour que les changements soient appliqués, le PDF doit être rechargé.
Continuer
Afficher l\'application dans le lanceur
Vous devrez peut-être redémarrer votre lanceur pour que cette option prenne effet
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
new file mode 100644
index 00000000..713d6296
--- /dev/null
+++ b/app/src/main/res/values-it/strings.xml
@@ -0,0 +1,75 @@
+
+ Apri file
+ Impossibile aprire il file. Controlla lo stato del gestore di file.
+ Il server remoto ha risposto con un errore.
+ Per qualche motivo non è stato possibile scaricare il file.
+ Connessione sicura fallita.
+ Il file è stato salvato nella cartella dei download.
+ Non è stato possibile salvare il file nella cartella dei download.
+ Informazioni
+ Versione
+ Ripeti l\'introduzione
+ Email
+ Ovviamente quest\'app è open source. Puoi dare il tuo contributo quando vuoi. Il link al codice sorgente è nella sezione Informazioni.
+ Libertà
+ Un semplice visualizzatore di documenti PDF.
+ Licenza
+ Informativa sulla privacy
+
+ Novità
+ Ok
+ Permessi di archiviazione
+ Quest\'app necessita dei permessi di lettura nell\'archivio. Premi il pulsante per consentire l\'accesso all\'archivio del telefono, altrimenti l\'app non funzionerà correttamente.
+
+ Librerie open source
+ Codice sorgente
+
+ Condividi file
+ Stampa file
+ Avviso dello sviluppatore
+ Cambia tema
+ Informazioni sull\'app
+ Informazioni sull\'autore
+ Collaboratori
+
+ Selettore del tema
+
+ Temi
+ Scegli un tema preinstallato
+
+ Colore primario
+ Il colore principale dell\'app.
+
+ Colore secondario
+ Mette in risalto alcune parti dell\'interfaccia.
+
+ Colore di sfondo
+ Il colore sottostante al contenuto dell\'app.
+ Aspetto
+
+ Colore della barra di navigazione
+ Applica il colore primario alla barra di navigazione
+ Informazioni sul file
+ Rendering di alta qualità
+ Impostazioni
+ Anti-aliasing
+ Scorrimento orizzontale
+ Mantieni visuale centrata
+ Centra la visuale sulla pagina corrente dopo ogni scorrimento
+ Scorrimento rapido
+ Passa direttamente alla pagina successiva con uno scorrimento rapido
+ Visualizzazione
+ Scorrimento
+ Impostazioni
+ Continua
+ Mostra l\'applicazione nel launcher
+ Potrebbe essere necessario riavviare il launcher affinché la modifica abbia effetto
+ Titolo: %1$s
+ Autore: %1$s
+ Data di creazione: %1$s
+ Si è verificato un errore durante l\'apertura del file.
+ PDF protetto
+ Inserisci la password corretta per aprire il documento:
+ Password errata.
+ Modalità scura per il PDF
+
\ No newline at end of file
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 5a1ad605..4198ccbc 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -55,10 +55,6 @@
SOFTWARE.
-
- Olá usuários,\n\nO Pdf Viewer Plus agora também está no F-Droid!
-
-
Registro de mudanças
Ok
Permissão de armazenamento
@@ -93,8 +89,6 @@
Cor da barra de navegação
Aplicar a cor primária à barra de navegação
- Senha
- Desbloquear PDF seguro
Informações do arquivo
Renderização em alta qualidade
Configurações
@@ -105,8 +99,6 @@
Qualidade
Rolagem
Configurações
- Recarregar PDF
- Para aplicar as mudanças, o PDF deve ser recarregado.
Continuar
diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml
index 82e5ca4e..8be357d0 100644
--- a/app/src/main/res/values-ru-rRU/strings.xml
+++ b/app/src/main/res/values-ru-rRU/strings.xml
@@ -13,8 +13,6 @@
Невозможно выбрать файл. Проверьте ваш файловый менеджер.
Не удалось установить защищённое соединение.
Поделиться
- Разблокировать защищенный PDF
- Пароль
Информация о файле
Печать
@@ -42,8 +40,6 @@
Прокрутка
Горизонтальная прокрутка
Перелистывание страниц
- Перезагрузить PDF файл
- Чтобы внести изменения, необходимо перезагрузить PDF файл.
О приложении
@@ -60,7 +56,6 @@
Авторы
ОК
- Уважаемые пользователи, Pdf Viewer Plus теперь также доступен в F-Droid!
Версия
Уведомление разработчика
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 47d049e8..911d0053 100755
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -25,7 +25,7 @@
#2481a1
- #1a5e76
+ #2481a1
#00cc99
#ffffff
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 443365a5..bc8a3699 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -59,10 +59,6 @@
SOFTWARE.
-
- Hello Users,\n\nPdf Viewer Plus is now also on F-Droid!
-
-
Change Log
Ok
Storage Permissions
@@ -97,8 +93,6 @@
Navigation bar color
Apply the primary color to the navigation bar
- Password
- Unlock Secure PDF
File Info
High Quality Rendering
Settings
@@ -108,15 +102,21 @@
Center the view on the current page after each swipe
Page Fling
Perform a quick swipe to jump directly to the next page
- Quality
+ Visual
Scrolling
Settings
- Reload PDF
- In order to make changes, the PDF must be reloaded.
Continue
Show app in launcher
You may need to restart your launcher for this option to take effect
Title: %1$s
Author: %1$s
Creation Date: %1$s
+
+ An error occurred while opening the file.
+ Protected PDF
+ Enter the correct password to open the document:
+ Wrong password.
+
+
+ Dark theme for PDF
\ No newline at end of file
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index 5c8e5e6c..4b1a3546 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -18,6 +18,10 @@
android:defaultValue="true"
android:title="@string/alias" android:key="alias_pref"/>
+
+
-
-
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 8ae5a202..1971eb58 100755
--- a/build.gradle
+++ b/build.gradle
@@ -32,7 +32,7 @@ buildscript {
maven { url "https://maven.google.com" }
}
dependencies {
- classpath 'com.android.tools.build:gradle:4.1.1'
+ classpath 'com.android.tools.build:gradle:4.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png
new file mode 100644
index 00000000..6655b4b5
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png
new file mode 100644
index 00000000..784589e7
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png
new file mode 100644
index 00000000..e219506b
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/mainpage.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/mainpage.png
deleted file mode 100755
index c91de94e..00000000
Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/mainpage.png and /dev/null differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/mainpage2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/mainpage2.png
deleted file mode 100755
index 175b722b..00000000
Binary files a/fastlane/metadata/android/en-US/images/phoneScreenshots/mainpage2.png and /dev/null differ
diff --git a/images/feature_graphic.png b/images/feature_graphic.png
deleted file mode 100755
index 24d5f0bd..00000000
Binary files a/images/feature_graphic.png and /dev/null differ
diff --git a/images/mainpage.png b/images/mainpage.png
deleted file mode 100755
index c91de94e..00000000
Binary files a/images/mainpage.png and /dev/null differ
diff --git a/images/mainpage2.png b/images/mainpage2.png
deleted file mode 100755
index 175b722b..00000000
Binary files a/images/mainpage2.png and /dev/null differ