diff --git a/app/build.gradle b/app/build.gradle index c03aace7937974b50e747735796a582b698ea104..c03f615f09c53617f3463457fbead1168ed132c7 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -86,4 +86,6 @@ dependencies { //Theme Engine implementation 'com.jaredrummler:cyanea:1.0.2' + + implementation 'foundation.e:elib:0.0.1-alpha11' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 85ad8f3a82384bb8c6e72c1a08123beecc884173..a907548a7e0cf712cf77b07c0ecb136eef76c07a 100755 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,7 +15,7 @@ android:supportsRtl="true" android:requestLegacyExternalStorage="true" android:usesCleartextTraffic="true" - android:theme="@style/Theme.Cyanea.Light.DarkActionBar"> + android:theme="@style/AppTheme"> . +*/ +package com.gsnathan.pdfviewer; + +import android.content.res.Configuration; +import android.os.Bundle; +import android.preference.PreferenceActivity; +import android.view.MenuInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.LayoutRes; +import androidx.annotation.Nullable; +import androidx.appcompat.app.ActionBar; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.appcompat.widget.Toolbar; + +public abstract class AppCompatPreferenceActivity extends PreferenceActivity { + + private AppCompatDelegate mDelegate; + + @Override + protected void onCreate(Bundle savedInstanceState) { + getDelegate().installViewFactory(); + getDelegate().onCreate(savedInstanceState); + super.onCreate(savedInstanceState); + } + + @Override + protected void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + getDelegate().onPostCreate(savedInstanceState); + } + + public ActionBar getSupportActionBar() { + return getDelegate().getSupportActionBar(); + } + + public void setSupportActionBar(@Nullable Toolbar toolbar) { + getDelegate().setSupportActionBar(toolbar); + } + + @Override + public MenuInflater getMenuInflater() { + return getDelegate().getMenuInflater(); + } + + @Override + public void setContentView(@LayoutRes int layoutResID) { + getDelegate().setContentView(layoutResID); + } + + @Override + public void setContentView(View view) { + getDelegate().setContentView(view); + } + + @Override + public void setContentView(View view, ViewGroup.LayoutParams params) { + getDelegate().setContentView(view, params); + } + + @Override + public void addContentView(View view, ViewGroup.LayoutParams params) { + getDelegate().addContentView(view, params); + } + + @Override + protected void onPostResume() { + super.onPostResume(); + getDelegate().onPostResume(); + } + + @Override + protected void onTitleChanged(CharSequence title, int color) { + super.onTitleChanged(title, color); + getDelegate().setTitle(title); + } + + @Override + public void onConfigurationChanged(Configuration newConfig) { + super.onConfigurationChanged(newConfig); + getDelegate().onConfigurationChanged(newConfig); + } + + @Override + protected void onStop() { + super.onStop(); + getDelegate().onStop(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + getDelegate().onDestroy(); + } + + AppCompatDelegate getDelegate() { + if (mDelegate == null) { + mDelegate = AppCompatDelegate.create(this, null); + } + return mDelegate; + } + + public void invalidateOptionsMenu() { + getDelegate().invalidateOptionsMenu(); + } + +} diff --git a/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java index 8b62c55777714d1512165bfbe5581b283adb3a90..a589195629035e98bbb9c5655f5f287be8169810 100755 --- a/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java +++ b/app/src/main/java/com/gsnathan/pdfviewer/MainActivity.java @@ -55,6 +55,7 @@ import androidx.activity.result.contract.ActivityResultContracts.StartActivityFo import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; +import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; import androidx.fragment.app.DialogFragment; @@ -78,7 +79,7 @@ import java.io.IOException; import static android.content.pm.PackageManager.PERMISSION_GRANTED; -public class MainActivity extends CyaneaAppCompatActivity { +public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; @@ -133,8 +134,6 @@ public class MainActivity extends CyaneaAppCompatActivity { prefManager = PreferenceManager.getDefaultSharedPreferences(this); mgr = (PrintManager) getSystemService(PRINT_SERVICE); - onFirstInstall(); - onFirstUpdate(); if (savedInstanceState != null) { restoreInstanceState(savedInstanceState); @@ -157,26 +156,6 @@ public class MainActivity extends CyaneaAppCompatActivity { viewBinding.bottomNavigation.setBackgroundColor(Cyanea.getInstance().getPrimary()); } - private void onFirstInstall() { - boolean isFirstRun = prefManager.getBoolean("FIRSTINSTALL", true); - if (isFirstRun) { - startActivity(new Intent(this, MainIntroActivity.class)); - SharedPreferences.Editor editor = prefManager.edit(); - editor.putBoolean("FIRSTINSTALL", false); - editor.apply(); - } - } - - private void onFirstUpdate() { - boolean isFirstRun = prefManager.getBoolean(Utils.getAppVersion(), true); - if (isFirstRun) { - Utils.showLog(this); - SharedPreferences.Editor editor = prefManager.edit(); - editor.putBoolean(Utils.getAppVersion(), false); - editor.apply(); - } - } - @Override protected void onSaveInstanceState(@NonNull Bundle outState) { outState.putParcelable("uri", uri); diff --git a/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java b/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java index 2a004c5b74f1b8417761e304dc4afa18578636db..8dc8722c395c5fc5d988f4776c1db1d519712c2a 100644 --- a/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java +++ b/app/src/main/java/com/gsnathan/pdfviewer/SettingsActivity.java @@ -23,7 +23,7 @@ import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_ENABLED; import static android.content.pm.PackageManager.DONT_KILL_APP; import static android.util.TypedValue.COMPLEX_UNIT_DIP; -public class SettingsActivity extends CyaneaPreferenceActivity { +public class SettingsActivity extends AppCompatPreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/app/src/main/res/drawable/lock_icon.xml b/app/src/main/res/drawable/lock_icon.xml index 94f568ff4b79149abf401100cd5671b1f62c6bf0..65a62a524473b17cdcbbc85bd99d7eba483c5c9e 100644 --- a/app/src/main/res/drawable/lock_icon.xml +++ b/app/src/main/res/drawable/lock_icon.xml @@ -5,6 +5,6 @@ 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 index e20f285d26f0213c97b768edb571d8ea403b9982..de60180a838f55957757258fdca479a4f45ab545 100755 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -84,7 +84,8 @@ android:padding="16sp" android:text="@string/app_info" android:fontFamily="@font/roboto_medium" - android:textSize="16sp" /> + android:textSize="16sp" + android:textColor="@color/e_accent"/> + android:textSize="16sp" + android:visibility="gone"/> + android:textSize="16sp" + android:visibility="gone"/> + android:textSize="16sp" + android:textColor="@color/e_accent"/> diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index 9005768f06fa6fe1a9ea79e58e752078f22867b9..06a40dc05f1de3a1fab533cc0f9deafe7afcace2 100755 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -42,5 +42,6 @@ android:id="@+id/theme" android:orderInCategory="1" android:title="@string/theme_picker" - app:showAsAction="never" /> + app:showAsAction="never" + android:visible="false"/> \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 32b3c5e4cd1be712765b5b8dae706256756e0c79..dfd912f3f455b7ece43180f288269a29d352f4f3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -122,4 +122,8 @@ Dark theme for PDF Keep the screen on This app does not collect any data.\nThe following permissions are required to provide specific features in the app:\n- Internet: open PDFs through links\n- Storage: open files from storage, save PDFs opened through links + + https://gitlab.e.foundation/ + https://gitlab.e.foundation/e/os/pdfviewer/ + https://gitlab.e.foundation/e/os/pdfviewer/-/blob/main/LICENSE \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100755 index 0000000000000000000000000000000000000000..bbbd876b37dc703ec2e20ed6c5aef170ecc3ffd0 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,41 @@ + + + + + + + + + diff --git a/build.gradle b/build.gradle index 1971eb582dc5da5fc1db3ec5096be02c509fcd68..b2ecd603a6b3f341c71dd241f8bf603f281a9ff0 100755 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,7 @@ buildscript { allprojects { repositories { + maven { url 'https://gitlab.e.foundation/api/v4/groups/9/-/packages/maven'} maven { url "https://jitpack.io" } google() jcenter()