Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 25176ecf authored by gokul swaminathan's avatar gokul swaminathan Committed by GitHub
Browse files

Merge pull request #68 from Fs00/fix-icons

Fix some graphical issues with themes that have a light primary color
parents c6aedb03 9b6d6c7c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@
            android:name=".AboutActivity"
            android:label="About"
            android:parentActivityName=".MainActivity_"
            android:theme="@style/Theme.Cyanea.Light.NoActionBar">
            android:theme="@style/Theme.Cyanea.Light.DarkActionBar">

            <!-- The meta-data tag is required if you support API level 15 and lower -->
            <meta-data
+1 −6
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ public class AboutActivity extends CyaneaAppCompatActivity {
    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
    private Toolbar toolbar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
@@ -55,17 +54,13 @@ public class AboutActivity extends CyaneaAppCompatActivity {
    }

    private void setUpToolBar() {
        setSupportActionBar(toolbar);
        final long token = Binder.clearCallingIdentity();
        Binder.clearCallingIdentity();
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

    }

    private void initUI() {
        //initialize the textview
        versionView = (TextView) findViewById(R.id.versionTextView);
        //initialize the toolbar
        toolbar = (Toolbar) findViewById(R.id.toolbar_about);

        // check if app is debug
        if (BuildConfig.DEBUG) {
+43 −48
Original line number Diff line number Diff line
@@ -33,8 +33,6 @@ import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Environment;
import android.os.Handler;
@@ -68,6 +66,7 @@ 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.google.android.material.shape.MaterialShapeDrawable;
import com.jaredrummler.cyanea.prefs.CyaneaSettingsActivity;
import com.kobakei.ratethisapp.RateThisApp;
import com.shockwave.pdfium.PdfDocument;
@@ -77,6 +76,7 @@ import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.NonConfigurationInstance;
import org.androidannotations.annotations.OnActivityResult;
import org.androidannotations.annotations.ViewById;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.io.FileInputStream;
@@ -241,9 +241,49 @@ public class MainActivity extends ProgressActivity implements OnPageChangeListen
        }
        setTitle(pdfFileName);
        hideProgressDialog();
        setBottomBarListeners();
        handler.post(runnable);
    }

    private void setBottomBarListeners() {
        BottomNavigationView bottomView = findViewById(R.id.bottom_navigation);
        bottomView.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem item) {
                switch (item.getItemId()) {
                    case R.id.pickFile:
                        pickFile();
                        break;
                    case R.id.metaFile:
                        if (uri != null)
                            getMeta();
                        break;
                    case R.id.unlockFile:
                        if (uri != null)
                            unlockPDF();
                        break;
                    case R.id.shareFile:
                        if (uri != null)
                            shareFile();
                        break;
                    case R.id.printFile:
                        if (uri != null)
                            print(pdfFileName,
                                    new PdfDocumentAdapter(getApplicationContext()),
                                    new PrintAttributes.Builder().build());
                        break;
                    default:
                        break;

                }
                return false;
            }
        });
        // Workaround for https://issuetracker.google.com/issues/124153644
        MaterialShapeDrawable viewBackground = (MaterialShapeDrawable) bottomView.getBackground();
        viewBackground.setShadowCompatibilityMode(MaterialShapeDrawable.SHADOW_COMPAT_MODE_ALWAYS);
    }

    void setPdfViewConfiguration() {
        pdfView.useBestQuality(prefManager.getBoolean("quality_pref", false));
        pdfView.setMidZoom(2.0f);
@@ -450,53 +490,8 @@ public class MainActivity extends ProgressActivity implements OnPageChangeListen
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    public boolean onCreateOptionsMenu(@NotNull Menu menu) {
        getMenuInflater().inflate(R.menu.menu, menu);

        BottomNavigationView bot_view = (BottomNavigationView) findViewById(R.id.bottom_navigation);
        Menu bottomMenu = bot_view.getMenu();

        for (int i = 0; i < bottomMenu.size() - 1; i++) {
            Drawable drawable = bottomMenu.getItem(i).getIcon();
            if (drawable != null) {
                drawable.mutate();
                drawable.setColorFilter(getResources().getColor(R.color.colorWhite), PorterDuff.Mode.SRC_ATOP);
            }
        }
        bot_view.setOnNavigationItemSelectedListener(new BottomNavigationView.OnNavigationItemSelectedListener() {
            @Override
            public boolean onNavigationItemSelected(@NonNull MenuItem item) {

                switch (item.getItemId()) {
                    case R.id.pickFile:
                        pickFile();
                        break;
                    case R.id.metaFile:
                        if (uri != null)
                            getMeta();
                        break;
                    case R.id.unlockFile:
                        if (uri != null)
                            unlockPDF();
                        break;
                    case R.id.shareFile:
                        if (uri != null)
                            shareFile();
                        break;
                    case R.id.printFile:
                        if (uri != null)
                            print(pdfFileName,
                                    new PdfDocumentAdapter(getApplicationContext()),
                                    new PrintAttributes.Builder().build());
                        break;
                    default:
                        break;

                }

                return false;
            }
        });
        return true;
    }

+4 −3
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import java.io.OutputStream;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;

import io.github.tonnyl.whatsnew.WhatsNew;
import io.github.tonnyl.whatsnew.item.WhatsNewItem;

@@ -56,12 +57,12 @@ public class Utils {
                new WhatsNewItem("File Manager", "Enable on start of the app", R.drawable.star_icon),
                new WhatsNewItem("Zoom", "Changed from 3x to 5x", R.drawable.thumbs_icon)
                );
        log.setTitleColor(ContextCompat.getColor(context, R.color.colorAccent));
        log.setTitleColor(Color.BLACK);
        log.setTitleText(context.getResources().getString(R.string.appChangelog));
        log.setButtonText(context.getResources().getString(R.string.buttonLog));
        log.setButtonBackground(ContextCompat.getColor(context, R.color.colorPrimary));
        log.setButtonTextColor(ContextCompat.getColor(context, R.color.colorAccent));
        log.setItemTitleColor(ContextCompat.getColor(context, R.color.colorAccent));
        log.setButtonTextColor(Color.WHITE);
        log.setItemTitleColor(Color.parseColor("#339999")); // same as icons
        log.setItemContentColor(Color.parseColor("#808080"));

        log.show(context.getSupportFragmentManager(), "Log");
+0 −16
Original line number Diff line number Diff line
@@ -30,22 +30,6 @@
        android:layout_height="match_parent"
        android:orientation="vertical">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/my_app_bar_about"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:elevation="4dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar_about"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    </com.google.android.material.appbar.AppBarLayout>

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
Loading