Dar9586 / NClientV2

An unofficial NHentai android client
Apache License 2.0
1.93k stars 102 forks source link

Update SimpleGallery.java #756

Open Heluojiang opened 1 week ago

Heluojiang commented 1 week ago

Try to Fix nullException

Kronos2308 commented 6 days ago

the chrash get fixed with that the images are not show UnsignedBuild for test

Heluojiang commented 6 days ago

@Kronos2308 It performs very well. When I use a proxy, the installation package you upload to the mega can log in correctly and load the image correctly. It passed my test.

Kronos2308 commented 6 days ago

whass a litle hell because one of the libraries got deprected and deleted multiline-collapsingtoolbar-release.zip

Heluojiang commented 6 days ago

I am a web application developer, so it seems that I may not be able to fully understand and solve this problem; but I believe you can solve this problem, come on

Kronos2308 commented 6 days ago


done app-debug.zip

Kronos2308 commented 6 days ago

Page.java

    public static String extToString(ImageExt ext) {
        switch (ext) {
            case GIF:
                return "gif";
            case PNG:
                return "png";
            case JPG:
                return "jpg";
            case WEBP:
                return "webp";
        }
        return null;
    }

    public static char extToChar(ImageExt imageExt) {
        switch (imageExt) {
            case GIF:
                return 'g';
            case PNG:
                return 'p';
            case JPG:
                return 'j';
            case WEBP:
                return 'w';
        }
        return '\0';
    }

    public static ImageExt charToExt(int ext) {
        switch (ext) {
            case 'g':
                return ImageExt.GIF;
            case 'p':
                return ImageExt.PNG;
            case 'j':
                return ImageExt.JPG;
            case 'w':
                return ImageExt.WEBP;
        }
        return null;
    }
Kronos2308 commented 6 days ago

It is an interesting application. I only have Notepad++, so I work with that. you just need to add one more extension WEBP("webp") but the app is programmed to work with extensions of 3 characters jpg png gif, webp has 4 characters so I just touched the part that arbitrarily takes the final 3 characters for something more flexible and then you just have to modify the regex, with which you search the files and the functions that converted the extension into a character and the character into an extension simply follow the functions from the inside out

Heluojiang commented 6 days ago

Well done, so excited.