├── .gitignore ├── README.md ├── app ├── app.iml ├── build.gradle ├── build │ ├── generated │ │ └── source │ │ │ ├── buildConfig │ │ │ ├── debug │ │ │ │ └── com │ │ │ │ │ └── zupilupi │ │ │ │ │ └── sourcecodeviewer │ │ │ │ │ └── BuildConfig.java │ │ │ └── test │ │ │ │ └── debug │ │ │ │ └── com │ │ │ │ └── zupilupi │ │ │ │ └── sourcecodeviewer │ │ │ │ └── test │ │ │ │ └── BuildConfig.java │ │ │ └── r │ │ │ └── debug │ │ │ └── com │ │ │ ├── sbstrm │ │ │ └── appirater │ │ │ │ └── R.java │ │ │ └── zupilupi │ │ │ └── sourcecodeviewer │ │ │ └── R.java │ ├── intermediates │ │ ├── assets │ │ │ └── debug │ │ │ │ ├── doc │ │ │ │ └── docs.css │ │ │ │ ├── html_source.html │ │ │ │ ├── img │ │ │ │ ├── error.png │ │ │ │ └── spinner.gif │ │ │ │ ├── lib │ │ │ │ ├── codemirror.css │ │ │ │ └── codemirror.js │ │ │ │ └── mode │ │ │ │ └── xml.js │ │ ├── incremental │ │ │ ├── aidl │ │ │ │ ├── debug │ │ │ │ │ └── dependency.store │ │ │ │ └── test │ │ │ │ │ └── debug │ │ │ │ │ └── dependency.store │ │ │ ├── mergeAssets │ │ │ │ ├── debug │ │ │ │ │ └── merger.xml │ │ │ │ └── test │ │ │ │ │ └── debug │ │ │ │ │ └── merger.xml │ │ │ └── mergeResources │ │ │ │ ├── debug │ │ │ │ └── merger.xml │ │ │ │ └── test │ │ │ │ └── debug │ │ │ │ └── merger.xml │ │ ├── manifests │ │ │ ├── full │ │ │ │ └── debug │ │ │ │ │ └── AndroidManifest.xml │ │ │ └── test │ │ │ │ └── debug │ │ │ │ └── AndroidManifest.xml │ │ ├── res │ │ │ ├── debug │ │ │ │ ├── color │ │ │ │ │ └── splash.xml │ │ │ │ ├── drawable-hdpi-v4 │ │ │ │ │ ├── button_find.xml │ │ │ │ │ ├── button_search.xml │ │ │ │ │ ├── edit_text_find.xml │ │ │ │ │ ├── edit_text_home.xml │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-mdpi-v4 │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-xhdpi-v4 │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-xxhdpi-v4 │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable │ │ │ │ │ └── button_appirator.xml │ │ │ │ ├── layout │ │ │ │ │ ├── activity_main.xml │ │ │ │ │ ├── activity_type_url.xml │ │ │ │ │ ├── appirater.xml │ │ │ │ │ ├── fragment_enter_url.xml │ │ │ │ │ ├── fragment_html_resource.xml │ │ │ │ │ ├── fragment_preview.xml │ │ │ │ │ ├── fragment_source_code.xml │ │ │ │ │ └── row_html_resources.xml │ │ │ │ ├── menu │ │ │ │ │ ├── main.xml │ │ │ │ │ ├── test.xml │ │ │ │ │ └── type_url.xml │ │ │ │ ├── values-ar │ │ │ │ │ └── values.xml │ │ │ │ ├── values-ca │ │ │ │ │ └── values.xml │ │ │ │ ├── values-cs │ │ │ │ │ └── values.xml │ │ │ │ ├── values-da │ │ │ │ │ └── values.xml │ │ │ │ ├── values-de │ │ │ │ │ └── values.xml │ │ │ │ ├── values-el │ │ │ │ │ └── values.xml │ │ │ │ ├── values-es │ │ │ │ │ └── values.xml │ │ │ │ ├── values-fi │ │ │ │ │ └── values.xml │ │ │ │ ├── values-fr │ │ │ │ │ └── values.xml │ │ │ │ ├── values-he │ │ │ │ │ └── values.xml │ │ │ │ ├── values-hu │ │ │ │ │ └── values.xml │ │ │ │ ├── values-id │ │ │ │ │ └── values.xml │ │ │ │ ├── values-it │ │ │ │ │ └── values.xml │ │ │ │ ├── values-ja │ │ │ │ │ └── values.xml │ │ │ │ ├── values-ko │ │ │ │ │ └── values.xml │ │ │ │ ├── values-ms │ │ │ │ │ └── values.xml │ │ │ │ ├── values-nb │ │ │ │ │ └── values.xml │ │ │ │ ├── values-nl │ │ │ │ │ └── values.xml │ │ │ │ ├── values-pl │ │ │ │ │ └── values.xml │ │ │ │ ├── values-pt │ │ │ │ │ └── values.xml │ │ │ │ ├── values-ru │ │ │ │ │ └── values.xml │ │ │ │ ├── values-sk │ │ │ │ │ └── values.xml │ │ │ │ ├── values-sv │ │ │ │ │ └── values.xml │ │ │ │ ├── values-sw720dp-land-v13 │ │ │ │ │ └── values.xml │ │ │ │ ├── values-th │ │ │ │ │ └── values.xml │ │ │ │ ├── values-tr │ │ │ │ │ └── values.xml │ │ │ │ ├── values-v11 │ │ │ │ │ └── values.xml │ │ │ │ ├── values-v14 │ │ │ │ │ └── values.xml │ │ │ │ ├── values-vi │ │ │ │ │ └── values.xml │ │ │ │ ├── values-zh-rCN │ │ │ │ │ └── values.xml │ │ │ │ ├── values-zh-rTW │ │ │ │ │ └── values.xml │ │ │ │ └── values │ │ │ │ │ └── values.xml │ │ │ ├── resources-debug-test.ap_ │ │ │ └── resources-debug.ap_ │ │ └── symbols │ │ │ └── debug │ │ │ └── R.txt │ └── outputs │ │ └── apk │ │ └── manifest-merger-debug-report.txt ├── libs │ └── jsoup-1.7.2.jar ├── lint.xml └── src │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── doc │ │ └── docs.css │ ├── html_source.html │ ├── img │ │ ├── error.png │ │ └── spinner.gif │ ├── lib │ │ ├── codemirror.css │ │ └── codemirror.js │ └── mode │ │ └── xml.js │ ├── java │ └── com │ │ └── zupilupi │ │ └── sourcecodeviewer │ │ ├── MainActivity.java │ │ ├── MyApp.java │ │ ├── SectionsPagerAdapter.java │ │ ├── TypeUrlActivity.java │ │ └── fragments │ │ ├── EnterUrlFragment.java │ │ ├── HtmlResourcesFragment.java │ │ ├── PreviewFragment.java │ │ ├── SourceCodeFragment.java │ │ ├── WebViewFragment.java │ │ └── utils │ │ ├── ChromeClient.java │ │ ├── JsInterface.java │ │ ├── ListRow.java │ │ ├── ResourcesArrayAdapter.java │ │ ├── SourceCodeLoader.java │ │ ├── WebClient.java │ │ └── WebUtils.java │ └── res │ ├── color │ └── splash.xml │ ├── drawable-hdpi │ ├── button_find.xml │ ├── button_search.xml │ ├── edit_text_find.xml │ ├── edit_text_home.xml │ └── ic_launcher.png │ ├── drawable-mdpi │ └── ic_launcher.png │ ├── drawable-xhdpi │ └── ic_launcher.png │ ├── drawable-xxhdpi │ └── ic_launcher.png │ ├── layout │ ├── activity_main.xml │ ├── activity_type_url.xml │ ├── fragment_enter_url.xml │ ├── fragment_html_resource.xml │ ├── fragment_preview.xml │ ├── fragment_source_code.xml │ └── row_html_resources.xml │ ├── menu │ └── main.xml │ ├── values-sw600dp │ └── dimens.xml │ ├── values-sw720dp-land │ └── dimens.xml │ ├── values-v11 │ └── styles.xml │ ├── values-v14 │ └── styles.xml │ └── values │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── appirater ├── README.md ├── app.iml ├── appirater.iml ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── sbstrm │ │ └── appirater │ │ └── Appirater.java │ └── res │ ├── drawable │ └── button_appirator.xml │ ├── layout │ └── appirater.xml │ ├── values-ar │ └── strings.xml │ ├── values-ca │ └── strings.xml │ ├── values-cs │ └── strings.xml │ ├── values-da │ └── strings.xml │ ├── values-de │ └── strings.xml │ ├── values-el │ └── strings.xml │ ├── values-es │ └── strings.xml │ ├── values-fi │ └── strings.xml │ ├── values-fr │ └── strings.xml │ ├── values-he │ └── strings.xml │ ├── values-hu │ └── strings.xml │ ├── values-id │ └── strings.xml │ ├── values-it │ └── strings.xml │ ├── values-ja │ └── strings.xml │ ├── values-ko │ └── strings.xml │ ├── values-ms │ └── strings.xml │ ├── values-nb │ └── strings.xml │ ├── values-nl │ └── strings.xml │ ├── values-pl │ └── strings.xml │ ├── values-pt │ └── strings.xml │ ├── values-ru │ └── strings.xml │ ├── values-sk │ └── strings.xml │ ├── values-sv │ └── strings.xml │ ├── values-th │ └── strings.xml │ ├── values-tr │ └── strings.xml │ ├── values-vi │ └── strings.xml │ ├── values-zh-rCN │ └── strings.xml │ ├── values-zh-rTW │ └── strings.xml │ └── values │ ├── appirater-settings.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradlew ├── gradlew.bat ├── local.properties ├── settings.gradle └── sourcecodeviewer.iml /.gitignore: -------------------------------------------------------------------------------- 1 | #built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Windows thumbnail db 19 | Thumbs.db 20 | 21 | # OSX files 22 | .DS_Store 23 | 24 | # Eclipse project files 25 | .classpath 26 | .project 27 | 28 | # Android Studio 29 | .idea/ 30 | #.idea/workspace.xml - remove # and delete .idea if it better suit your needs. 31 | build/ 32 | .gradle/ 33 | gradle -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HTMLSourceCodeViewer 2 | HTML Source Code viewer app for Android 3 | 4 | HTMLSourceCodeViewer is a simple Android app, he can fetch the source code of any website and show 5 | it with its resources (JS and CSS). 6 | 7 | This soruce code of the app is contained in the 'app' folder in the root of the repository 8 | 9 | ## Dependencies 10 | -[Appirater] v1.3.1 11 | 12 | ## Leave your feedback/bug report 13 | Track improvements proposals or bug reports using github issues, you will make my day! 14 | 15 | ## Want to contribute? 16 | Fork the repo and send your pull request, we are open to ideas! 17 | 18 | ## License 19 | 20 | Copyright (c) 2011-2014 GitHub, Inc. See the LICENSE file for license rights and 21 | limitations (MIT). 22 | 23 | 24 | [Appirater]:https://github.com/drewjw81/appirater-android 25 | -------------------------------------------------------------------------------- /app/app.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 18 5 | buildToolsVersion "21.1.2" 6 | 7 | defaultConfig { 8 | applicationId "com.zupilupi.sourcecodeviewer" 9 | minSdkVersion 8 10 | targetSdkVersion 18 11 | versionCode 5 12 | versionName "3.2" 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | compile 'com.android.support:support-v4:18.0.0' 25 | compile files('libs/jsoup-1.7.2.jar') 26 | compile project(':appirater') 27 | } 28 | -------------------------------------------------------------------------------- /app/build/generated/source/buildConfig/debug/com/zupilupi/sourcecodeviewer/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Automatically generated file. DO NOT MODIFY 3 | */ 4 | package com.zupilupi.sourcecodeviewer; 5 | 6 | public final class BuildConfig { 7 | public static final boolean DEBUG = Boolean.parseBoolean("true"); 8 | public static final String APPLICATION_ID = "com.zupilupi.sourcecodeviewer"; 9 | public static final String BUILD_TYPE = "debug"; 10 | public static final String FLAVOR = ""; 11 | public static final int VERSION_CODE = 5; 12 | public static final String VERSION_NAME = "3.2"; 13 | } 14 | -------------------------------------------------------------------------------- /app/build/generated/source/buildConfig/test/debug/com/zupilupi/sourcecodeviewer/test/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Automatically generated file. DO NOT MODIFY 3 | */ 4 | package com.zupilupi.sourcecodeviewer.test; 5 | 6 | public final class BuildConfig { 7 | public static final boolean DEBUG = Boolean.parseBoolean("true"); 8 | public static final String APPLICATION_ID = "com.zupilupi.sourcecodeviewer.test"; 9 | public static final String BUILD_TYPE = "debug"; 10 | public static final String FLAVOR = ""; 11 | public static final int VERSION_CODE = 5; 12 | public static final String VERSION_NAME = "3.2"; 13 | } 14 | -------------------------------------------------------------------------------- /app/build/generated/source/r/debug/com/sbstrm/appirater/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | package com.sbstrm.appirater; 8 | 9 | public final class R { 10 | public static final class bool { 11 | public static final int appirator_test_mode = 0x7f040000; 12 | } 13 | public static final class color { 14 | public static final int appirator_button_end_color = 0x7f050000; 15 | public static final int appirator_button_start_color = 0x7f050001; 16 | public static final int appirator_button_text_color = 0x7f050002; 17 | } 18 | public static final class drawable { 19 | public static final int button_appirator = 0x7f020000; 20 | } 21 | public static final class id { 22 | public static final int cancel = 0x7f0b0007; 23 | public static final int message = 0x7f0b0004; 24 | public static final int rate = 0x7f0b0005; 25 | public static final int rateLater = 0x7f0b0006; 26 | } 27 | public static final class integer { 28 | public static final int appirator_days_before_reminding = 0x7f070000; 29 | public static final int appirator_days_until_prompt = 0x7f070001; 30 | public static final int appirator_delay_until_prompt = 0x7f070002; 31 | public static final int appirator_events_until_prompt = 0x7f070003; 32 | public static final int appirator_launches_until_prompt = 0x7f070004; 33 | } 34 | public static final class layout { 35 | public static final int appirater = 0x7f030002; 36 | } 37 | public static final class string { 38 | public static final int appirator_app_title = 0x7f080003; 39 | public static final int appirator_market_url = 0x7f080004; 40 | public static final int rate = 0x7f08000b; 41 | public static final int rate_cancel = 0x7f08000c; 42 | public static final int rate_later = 0x7f08000d; 43 | public static final int rate_message = 0x7f08000e; 44 | public static final int rate_title = 0x7f08000f; 45 | } 46 | public static final class style { 47 | public static final int appiratorButton = 0x7f090002; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/build/generated/source/r/debug/com/zupilupi/sourcecodeviewer/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.zupilupi.sourcecodeviewer; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class bool { 14 | public static final int appirator_test_mode=0x7f040000; 15 | } 16 | public static final class color { 17 | public static final int appirator_button_end_color=0x7f050000; 18 | public static final int appirator_button_start_color=0x7f050001; 19 | public static final int appirator_button_text_color=0x7f050002; 20 | public static final int splash=0x7f050003; 21 | } 22 | public static final class dimen { 23 | public static final int activity_horizontal_margin=0x7f060000; 24 | public static final int activity_vertical_margin=0x7f060001; 25 | } 26 | public static final class drawable { 27 | public static final int button_appirator=0x7f020000; 28 | public static final int button_find=0x7f020001; 29 | public static final int button_search=0x7f020002; 30 | public static final int edit_text_find=0x7f020003; 31 | public static final int edit_text_home=0x7f020004; 32 | public static final int ic_launcher=0x7f020005; 33 | } 34 | public static final class id { 35 | public static final int action_settings=0x7f0b0011; 36 | public static final int button_find=0x7f0b000c; 37 | public static final int button_show_source=0x7f0b0002; 38 | public static final int cancel=0x7f0b0007; 39 | public static final int field_find=0x7f0b000b; 40 | public static final int field_url=0x7f0b0003; 41 | public static final int firstLine=0x7f0b000f; 42 | public static final int listView=0x7f0b0008; 43 | public static final int message=0x7f0b0004; 44 | public static final int pager=0x7f0b0000; 45 | public static final int pager_title_strip=0x7f0b0001; 46 | public static final int rate=0x7f0b0005; 47 | public static final int rateLater=0x7f0b0006; 48 | public static final int rate_app=0x7f0b0010; 49 | public static final int res_type=0x7f0b000d; 50 | public static final int secondLine=0x7f0b000e; 51 | public static final int site_preview=0x7f0b0009; 52 | public static final int source_code=0x7f0b000a; 53 | } 54 | public static final class integer { 55 | public static final int appirator_days_before_reminding=0x7f070000; 56 | public static final int appirator_days_until_prompt=0x7f070001; 57 | public static final int appirator_delay_until_prompt=0x7f070002; 58 | public static final int appirator_events_until_prompt=0x7f070003; 59 | public static final int appirator_launches_until_prompt=0x7f070004; 60 | } 61 | public static final class layout { 62 | public static final int activity_main=0x7f030000; 63 | public static final int activity_type_url=0x7f030001; 64 | public static final int appirater=0x7f030002; 65 | public static final int fragment_enter_url=0x7f030003; 66 | public static final int fragment_html_resource=0x7f030004; 67 | public static final int fragment_preview=0x7f030005; 68 | public static final int fragment_source_code=0x7f030006; 69 | public static final int row_html_resources=0x7f030007; 70 | } 71 | public static final class menu { 72 | public static final int main=0x7f0a0000; 73 | public static final int test=0x7f0a0001; 74 | public static final int type_url=0x7f0a0002; 75 | } 76 | public static final class string { 77 | public static final int action_settings=0x7f080000; 78 | public static final int alert_url_invalid=0x7f080001; 79 | public static final int app_name=0x7f080002; 80 | public static final int appirator_app_title=0x7f080003; 81 | public static final int appirator_market_url=0x7f080004; 82 | public static final int button_find=0x7f080005; 83 | public static final int button_text=0x7f080006; 84 | public static final int field_find_hint=0x7f080007; 85 | public static final int field_url_hint=0x7f080008; 86 | public static final int hello_world=0x7f080009; 87 | public static final int menu_rateApp=0x7f08000a; 88 | public static final int rate=0x7f08000b; 89 | public static final int rate_cancel=0x7f08000c; 90 | public static final int rate_later=0x7f08000d; 91 | public static final int rate_message=0x7f08000e; 92 | public static final int rate_title=0x7f08000f; 93 | public static final int title_activity_type_url=0x7f080010; 94 | public static final int title_section1=0x7f080011; 95 | public static final int title_section2=0x7f080012; 96 | public static final int title_section3=0x7f080013; 97 | } 98 | public static final class style { 99 | /** 100 | Theme customizations available in newer API levels can go in 101 | res/values-vXX/styles.xml, while customizations related to 102 | backward-compatibility can go here. 103 | 104 | API 11 theme customizations can go here. 105 | API 14 theme customizations can go here. 106 | */ 107 | public static final int AppBaseTheme=0x7f090000; 108 | /** All customizations that are NOT specific to a particular API-level can go here. 109 | */ 110 | public static final int AppTheme=0x7f090001; 111 | public static final int appiratorButton=0x7f090002; 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /app/build/intermediates/assets/debug/doc/docs.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'Source Sans Pro'; 3 | font-style: normal; 4 | font-weight: 400; 5 | src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(http://themes.googleusercontent.com/static/fonts/sourcesanspro/v5/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff'); 6 | } 7 | 8 | body, html { margin: 0; padding: 0; height: 100%; } 9 | section, article { display: block; padding: 0; } 10 | 11 | body { 12 | background: #f8f8f8; 13 | font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif; 14 | line-height: 1.5; 15 | } 16 | 17 | p { margin-top: 0; } 18 | 19 | h2, h3 { 20 | font-weight: normal; 21 | text-decoration: underline; 22 | margin-bottom: .7em; 23 | } 24 | h2 { font-size: 120%; } 25 | h3 { font-size: 110%; } 26 | article > h2:first-child, section:first-child > h2 { margin-top: 0; } 27 | 28 | a, a:visited, a:link, .quasilink { 29 | color: #A21313; 30 | text-decoration: none; 31 | } 32 | 33 | .quasilink { 34 | cursor: pointer; 35 | } 36 | 37 | article { 38 | max-width: 700px; 39 | margin: 0 auto; 40 | border-left: 2px solid #E30808; 41 | border-right: 1px solid #ddd; 42 | padding: 30px 50px 100px 50px; 43 | background: white; 44 | z-index: 2; 45 | position: relative; 46 | min-height: 100%; 47 | box-sizing: border-box; 48 | -moz-box-sizing: border-box; 49 | } 50 | 51 | #nav { 52 | position: fixed; 53 | top: 30px; 54 | right: 50%; 55 | padding-right: 350px; 56 | text-align: right; 57 | z-index: 1; 58 | } 59 | 60 | @media screen and (max-width: 1000px) { 61 | article { 62 | margin: 0 0 0 160px; 63 | } 64 | #nav { 65 | left: 0; right: none; 66 | width: 160px; 67 | } 68 | } 69 | 70 | #nav ul { 71 | display: block; 72 | margin: 0; padding: 0; 73 | margin-bottom: 32px; 74 | } 75 | 76 | #nav li { 77 | display: block; 78 | margin-bottom: 4px; 79 | } 80 | 81 | #nav li ul { 82 | font-size: 80%; 83 | margin-bottom: 0; 84 | display: none; 85 | } 86 | 87 | #nav li.active ul { 88 | display: block; 89 | } 90 | 91 | #nav li li a { 92 | padding-right: 20px; 93 | } 94 | 95 | #nav ul a { 96 | color: black; 97 | padding: 0 7px 1px 11px; 98 | } 99 | 100 | #nav ul a.active, #nav ul a:hover { 101 | border-bottom: 1px solid #E30808; 102 | color: #E30808; 103 | } 104 | 105 | #logo { 106 | border: 0; 107 | margin-right: 7px; 108 | margin-bottom: 25px; 109 | } 110 | 111 | section { 112 | border-top: 1px solid #E30808; 113 | margin: 1.5em 0; 114 | } 115 | 116 | section.first { 117 | border: none; 118 | margin-top: 0; 119 | } 120 | 121 | #demo { 122 | position: relative; 123 | } 124 | 125 | #demolist { 126 | position: absolute; 127 | right: 5px; 128 | top: 5px; 129 | z-index: 25; 130 | } 131 | 132 | #bankinfo { 133 | text-align: left; 134 | display: none; 135 | padding: 0 .5em; 136 | position: absolute; 137 | border: 2px solid #aaa; 138 | border-radius: 5px; 139 | background: #eee; 140 | top: 10px; 141 | left: 30px; 142 | } 143 | 144 | #bankinfo_close { 145 | position: absolute; 146 | top: 0; right: 6px; 147 | font-weight: bold; 148 | cursor: pointer; 149 | } 150 | 151 | .bigbutton { 152 | cursor: pointer; 153 | text-align: center; 154 | padding: 0 1em; 155 | display: inline-block; 156 | color: white; 157 | position: relative; 158 | line-height: 1.9; 159 | color: white !important; 160 | background: #A21313; 161 | } 162 | 163 | .bigbutton.right { 164 | border-bottom-left-radius: 100px; 165 | border-top-left-radius: 100px; 166 | } 167 | 168 | .bigbutton.left { 169 | border-bottom-right-radius: 100px; 170 | border-top-right-radius: 100px; 171 | } 172 | 173 | .bigbutton:hover { 174 | background: #E30808; 175 | } 176 | 177 | th { 178 | text-decoration: underline; 179 | font-weight: normal; 180 | text-align: left; 181 | } 182 | 183 | #features ul { 184 | list-style: none; 185 | margin: 0 0 1em; 186 | padding: 0 0 0 1.2em; 187 | } 188 | 189 | #features li:before { 190 | content: "-"; 191 | width: 1em; 192 | display: inline-block; 193 | padding: 0; 194 | margin: 0; 195 | margin-left: -1em; 196 | } 197 | 198 | .rel { 199 | margin-bottom: 0; 200 | } 201 | .rel-note { 202 | margin-top: 0; 203 | color: #555; 204 | } 205 | 206 | pre { 207 | padding-left: 15px; 208 | border-left: 2px solid #ddd; 209 | } 210 | 211 | code { 212 | padding: 0 2px; 213 | } 214 | 215 | strong { 216 | text-decoration: underline; 217 | font-weight: normal; 218 | } 219 | 220 | .field { 221 | border: 1px solid #A21313; 222 | } 223 | -------------------------------------------------------------------------------- /app/build/intermediates/assets/debug/html_source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 53 | 54 | 55 |
56 |
57 | 58 |
59 |
60 |
61 | spinner 62 |

Hold on...

63 |

I am making the HTML code nice and colored

64 |
65 |
66 | error 67 |
Unable to get the source code from

68 | 69 |
70 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /app/build/intermediates/assets/debug/img/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/build/intermediates/assets/debug/img/error.png -------------------------------------------------------------------------------- /app/build/intermediates/assets/debug/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/build/intermediates/assets/debug/img/spinner.gif -------------------------------------------------------------------------------- /app/build/intermediates/assets/debug/lib/codemirror.css: -------------------------------------------------------------------------------- 1 | /* BASICS */ 2 | 3 | .CodeMirror { 4 | /* Set height, width, borders, and global font properties here */ 5 | font-family: monospace; 6 | /* height: 300px; */ 7 | } 8 | .CodeMirror-scroll { 9 | /* Set scrolling behaviour here */ 10 | overflow: auto; 11 | } 12 | 13 | /* PADDING */ 14 | 15 | .CodeMirror-lines { 16 | padding: 4px 0; /* Vertical padding around content */ 17 | } 18 | .CodeMirror pre { 19 | padding: 0 4px; /* Horizontal padding of content */ 20 | } 21 | 22 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 23 | background-color: white; /* The little square between H and V scrollbars */ 24 | } 25 | 26 | /* GUTTER */ 27 | 28 | .CodeMirror-gutters { 29 | border-right: 1px solid #ddd; 30 | background-color: #f7f7f7; 31 | white-space: nowrap; 32 | } 33 | .CodeMirror-linenumbers {} 34 | .CodeMirror-linenumber { 35 | padding: 0 3px 0 5px; 36 | min-width: 20px; 37 | text-align: right; 38 | color: #999; 39 | } 40 | 41 | /* CURSOR */ 42 | 43 | .CodeMirror div.CodeMirror-cursor { 44 | border-left: 1px solid black; 45 | z-index: 3; 46 | } 47 | /* Shown when moving in bi-directional text */ 48 | .CodeMirror div.CodeMirror-secondarycursor { 49 | border-left: 1px solid silver; 50 | } 51 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { 52 | width: auto; 53 | border: 0; 54 | background: #7e7; 55 | z-index: 1; 56 | } 57 | /* Can style cursor different in overwrite (non-insert) mode */ 58 | .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} 59 | 60 | .cm-tab { display: inline-block; } 61 | 62 | /* DEFAULT THEME */ 63 | 64 | .cm-s-default .cm-keyword {color: #708;} 65 | .cm-s-default .cm-atom {color: #219;} 66 | .cm-s-default .cm-number {color: #164;} 67 | .cm-s-default .cm-def {color: #00f;} 68 | .cm-s-default .cm-variable {color: black;} 69 | .cm-s-default .cm-variable-2 {color: #05a;} 70 | .cm-s-default .cm-variable-3 {color: #085;} 71 | .cm-s-default .cm-property {color: black;} 72 | .cm-s-default .cm-operator {color: black;} 73 | .cm-s-default .cm-comment {color: #a50;} 74 | .cm-s-default .cm-string {color: #a11;} 75 | .cm-s-default .cm-string-2 {color: #f50;} 76 | .cm-s-default .cm-meta {color: #555;} 77 | .cm-s-default .cm-error {color: #f00;} 78 | .cm-s-default .cm-qualifier {color: #555;} 79 | .cm-s-default .cm-builtin {color: #30a;} 80 | .cm-s-default .cm-bracket {color: #997;} 81 | .cm-s-default .cm-tag {color: #170;} 82 | .cm-s-default .cm-attribute {color: #00c;} 83 | .cm-s-default .cm-header {color: blue;} 84 | .cm-s-default .cm-quote {color: #090;} 85 | .cm-s-default .cm-hr {color: #999;} 86 | .cm-s-default .cm-link {color: #00c;} 87 | 88 | .cm-negative {color: #d44;} 89 | .cm-positive {color: #292;} 90 | .cm-header, .cm-strong {font-weight: bold;} 91 | .cm-em {font-style: italic;} 92 | .cm-link {text-decoration: underline;} 93 | 94 | .cm-invalidchar {color: #f00;} 95 | 96 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 97 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 98 | .CodeMirror-activeline-background {background: #e8f2ff;} 99 | 100 | /* STOP */ 101 | 102 | /* The rest of this file contains styles related to the mechanics of 103 | the editor. You probably shouldn't touch them. */ 104 | 105 | .CodeMirror { 106 | line-height: 1; 107 | position: relative; 108 | overflow: hidden; 109 | background: white; 110 | color: black; 111 | } 112 | 113 | .CodeMirror-scroll { 114 | /* 30px is the magic margin used to hide the element's real scrollbars */ 115 | /* See overflow: hidden in .CodeMirror */ 116 | margin-bottom: -30px; margin-right: -30px; 117 | padding-bottom: 30px; padding-right: 30px; 118 | height: 100%; 119 | outline: none; /* Prevent dragging from highlighting the element */ 120 | position: relative; 121 | -moz-box-sizing: content-box; 122 | box-sizing: content-box; 123 | } 124 | .CodeMirror-sizer { 125 | position: relative; 126 | } 127 | 128 | /* The fake, visible scrollbars. Used to force redraw during scrolling 129 | before actuall scrolling happens, thus preventing shaking and 130 | flickering artifacts. */ 131 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 132 | position: absolute; 133 | z-index: 6; 134 | display: none; 135 | } 136 | .CodeMirror-vscrollbar { 137 | right: 0; top: 0; 138 | overflow-x: hidden; 139 | overflow-y: scroll; 140 | } 141 | .CodeMirror-hscrollbar { 142 | bottom: 0; left: 0; 143 | overflow-y: hidden; 144 | overflow-x: scroll; 145 | } 146 | .CodeMirror-scrollbar-filler { 147 | right: 0; bottom: 0; 148 | } 149 | .CodeMirror-gutter-filler { 150 | left: 0; bottom: 0; 151 | } 152 | 153 | .CodeMirror-gutters { 154 | position: absolute; left: 0; top: 0; 155 | padding-bottom: 30px; 156 | z-index: 3; 157 | } 158 | .CodeMirror-gutter { 159 | white-space: normal; 160 | height: 100%; 161 | -moz-box-sizing: content-box; 162 | box-sizing: content-box; 163 | padding-bottom: 30px; 164 | margin-bottom: -32px; 165 | display: inline-block; 166 | /* Hack to make IE7 behave */ 167 | *zoom:1; 168 | *display:inline; 169 | } 170 | .CodeMirror-gutter-elt { 171 | position: absolute; 172 | cursor: default; 173 | z-index: 4; 174 | } 175 | 176 | .CodeMirror-lines { 177 | cursor: text; 178 | } 179 | .CodeMirror pre { 180 | /* Reset some styles that the rest of the page might have set */ 181 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; 182 | border-width: 0; 183 | background: transparent; 184 | font-family: inherit; 185 | font-size: inherit; 186 | margin: 0; 187 | white-space: pre; 188 | word-wrap: normal; 189 | line-height: inherit; 190 | color: inherit; 191 | z-index: 2; 192 | position: relative; 193 | overflow: visible; 194 | } 195 | .CodeMirror-wrap pre { 196 | word-wrap: break-word; 197 | white-space: pre-wrap; 198 | word-break: normal; 199 | } 200 | .CodeMirror-code pre { 201 | border-right: 30px solid transparent; 202 | width: -webkit-fit-content; 203 | width: -moz-fit-content; 204 | width: fit-content; 205 | } 206 | .CodeMirror-wrap .CodeMirror-code pre { 207 | border-right: none; 208 | width: auto; 209 | } 210 | .CodeMirror-linebackground { 211 | position: absolute; 212 | left: 0; right: 0; top: 0; bottom: 0; 213 | z-index: 0; 214 | } 215 | 216 | .CodeMirror-linewidget { 217 | position: relative; 218 | z-index: 2; 219 | overflow: auto; 220 | } 221 | 222 | .CodeMirror-widget {} 223 | 224 | .CodeMirror-wrap .CodeMirror-scroll { 225 | overflow-x: hidden; 226 | } 227 | 228 | .CodeMirror-measure { 229 | position: absolute; 230 | width: 100%; 231 | height: 0; 232 | overflow: hidden; 233 | visibility: hidden; 234 | } 235 | .CodeMirror-measure pre { position: static; } 236 | 237 | .CodeMirror div.CodeMirror-cursor { 238 | position: absolute; 239 | visibility: hidden; 240 | border-right: none; 241 | width: 0; 242 | } 243 | .CodeMirror-focused div.CodeMirror-cursor { 244 | visibility: visible; 245 | } 246 | 247 | .CodeMirror-selected { background: #d9d9d9; } 248 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } 249 | 250 | .cm-searching { 251 | background: #ffa; 252 | background: rgba(255, 255, 0, .4); 253 | } 254 | 255 | /* IE7 hack to prevent it from returning funny offsetTops on the spans */ 256 | .CodeMirror span { *vertical-align: text-bottom; } 257 | 258 | @media print { 259 | /* Hide the cursor when printing */ 260 | .CodeMirror div.CodeMirror-cursor { 261 | visibility: hidden; 262 | } 263 | } 264 | -------------------------------------------------------------------------------- /app/build/intermediates/incremental/aidl/debug/dependency.store: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /app/build/intermediates/incremental/aidl/test/debug/dependency.store: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /app/build/intermediates/incremental/mergeAssets/debug/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/build/intermediates/incremental/mergeAssets/test/debug/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/build/intermediates/incremental/mergeResources/test/debug/merger.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/build/intermediates/manifests/full/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/build/intermediates/manifests/test/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/color/splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-hdpi-v4/button_find.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-hdpi-v4/button_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-hdpi-v4/edit_text_find.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 13 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-hdpi-v4/edit_text_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-hdpi-v4/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/build/intermediates/res/debug/drawable-hdpi-v4/ic_launcher.png -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-mdpi-v4/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/build/intermediates/res/debug/drawable-mdpi-v4/ic_launcher.png -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-xhdpi-v4/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/build/intermediates/res/debug/drawable-xhdpi-v4/ic_launcher.png -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable-xxhdpi-v4/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/build/intermediates/res/debug/drawable-xxhdpi-v4/ic_launcher.png -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/drawable/button_appirator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 10 | 12 | 17 | 18 | 19 | 20 | 21 | 25 | 28 | 30 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 22 | 23 | -------------------------------------------------------------------------------- /app/build/intermediates/res/debug/layout/activity_type_url.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 69 | 70 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /app/src/main/assets/img/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/src/main/assets/img/error.png -------------------------------------------------------------------------------- /app/src/main/assets/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/src/main/assets/img/spinner.gif -------------------------------------------------------------------------------- /app/src/main/assets/lib/codemirror.css: -------------------------------------------------------------------------------- 1 | /* BASICS */ 2 | 3 | .CodeMirror { 4 | /* Set height, width, borders, and global font properties here */ 5 | font-family: monospace; 6 | /* height: 300px; */ 7 | } 8 | .CodeMirror-scroll { 9 | /* Set scrolling behaviour here */ 10 | overflow: auto; 11 | } 12 | 13 | /* PADDING */ 14 | 15 | .CodeMirror-lines { 16 | padding: 4px 0; /* Vertical padding around content */ 17 | } 18 | .CodeMirror pre { 19 | padding: 0 4px; /* Horizontal padding of content */ 20 | } 21 | 22 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 23 | background-color: white; /* The little square between H and V scrollbars */ 24 | } 25 | 26 | /* GUTTER */ 27 | 28 | .CodeMirror-gutters { 29 | border-right: 1px solid #ddd; 30 | background-color: #f7f7f7; 31 | white-space: nowrap; 32 | } 33 | .CodeMirror-linenumbers {} 34 | .CodeMirror-linenumber { 35 | padding: 0 3px 0 5px; 36 | min-width: 20px; 37 | text-align: right; 38 | color: #999; 39 | } 40 | 41 | /* CURSOR */ 42 | 43 | .CodeMirror div.CodeMirror-cursor { 44 | border-left: 1px solid black; 45 | z-index: 3; 46 | } 47 | /* Shown when moving in bi-directional text */ 48 | .CodeMirror div.CodeMirror-secondarycursor { 49 | border-left: 1px solid silver; 50 | } 51 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { 52 | width: auto; 53 | border: 0; 54 | background: #7e7; 55 | z-index: 1; 56 | } 57 | /* Can style cursor different in overwrite (non-insert) mode */ 58 | .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} 59 | 60 | .cm-tab { display: inline-block; } 61 | 62 | /* DEFAULT THEME */ 63 | 64 | .cm-s-default .cm-keyword {color: #708;} 65 | .cm-s-default .cm-atom {color: #219;} 66 | .cm-s-default .cm-number {color: #164;} 67 | .cm-s-default .cm-def {color: #00f;} 68 | .cm-s-default .cm-variable {color: black;} 69 | .cm-s-default .cm-variable-2 {color: #05a;} 70 | .cm-s-default .cm-variable-3 {color: #085;} 71 | .cm-s-default .cm-property {color: black;} 72 | .cm-s-default .cm-operator {color: black;} 73 | .cm-s-default .cm-comment {color: #a50;} 74 | .cm-s-default .cm-string {color: #a11;} 75 | .cm-s-default .cm-string-2 {color: #f50;} 76 | .cm-s-default .cm-meta {color: #555;} 77 | .cm-s-default .cm-error {color: #f00;} 78 | .cm-s-default .cm-qualifier {color: #555;} 79 | .cm-s-default .cm-builtin {color: #30a;} 80 | .cm-s-default .cm-bracket {color: #997;} 81 | .cm-s-default .cm-tag {color: #170;} 82 | .cm-s-default .cm-attribute {color: #00c;} 83 | .cm-s-default .cm-header {color: blue;} 84 | .cm-s-default .cm-quote {color: #090;} 85 | .cm-s-default .cm-hr {color: #999;} 86 | .cm-s-default .cm-link {color: #00c;} 87 | 88 | .cm-negative {color: #d44;} 89 | .cm-positive {color: #292;} 90 | .cm-header, .cm-strong {font-weight: bold;} 91 | .cm-em {font-style: italic;} 92 | .cm-link {text-decoration: underline;} 93 | 94 | .cm-invalidchar {color: #f00;} 95 | 96 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 97 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 98 | .CodeMirror-activeline-background {background: #e8f2ff;} 99 | 100 | /* STOP */ 101 | 102 | /* The rest of this file contains styles related to the mechanics of 103 | the editor. You probably shouldn't touch them. */ 104 | 105 | .CodeMirror { 106 | line-height: 1; 107 | position: relative; 108 | overflow: hidden; 109 | background: white; 110 | color: black; 111 | } 112 | 113 | .CodeMirror-scroll { 114 | /* 30px is the magic margin used to hide the element's real scrollbars */ 115 | /* See overflow: hidden in .CodeMirror */ 116 | margin-bottom: -30px; margin-right: -30px; 117 | padding-bottom: 30px; padding-right: 30px; 118 | height: 100%; 119 | outline: none; /* Prevent dragging from highlighting the element */ 120 | position: relative; 121 | -moz-box-sizing: content-box; 122 | box-sizing: content-box; 123 | } 124 | .CodeMirror-sizer { 125 | position: relative; 126 | } 127 | 128 | /* The fake, visible scrollbars. Used to force redraw during scrolling 129 | before actuall scrolling happens, thus preventing shaking and 130 | flickering artifacts. */ 131 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 132 | position: absolute; 133 | z-index: 6; 134 | display: none; 135 | } 136 | .CodeMirror-vscrollbar { 137 | right: 0; top: 0; 138 | overflow-x: hidden; 139 | overflow-y: scroll; 140 | } 141 | .CodeMirror-hscrollbar { 142 | bottom: 0; left: 0; 143 | overflow-y: hidden; 144 | overflow-x: scroll; 145 | } 146 | .CodeMirror-scrollbar-filler { 147 | right: 0; bottom: 0; 148 | } 149 | .CodeMirror-gutter-filler { 150 | left: 0; bottom: 0; 151 | } 152 | 153 | .CodeMirror-gutters { 154 | position: absolute; left: 0; top: 0; 155 | padding-bottom: 30px; 156 | z-index: 3; 157 | } 158 | .CodeMirror-gutter { 159 | white-space: normal; 160 | height: 100%; 161 | -moz-box-sizing: content-box; 162 | box-sizing: content-box; 163 | padding-bottom: 30px; 164 | margin-bottom: -32px; 165 | display: inline-block; 166 | /* Hack to make IE7 behave */ 167 | *zoom:1; 168 | *display:inline; 169 | } 170 | .CodeMirror-gutter-elt { 171 | position: absolute; 172 | cursor: default; 173 | z-index: 4; 174 | } 175 | 176 | .CodeMirror-lines { 177 | cursor: text; 178 | } 179 | .CodeMirror pre { 180 | /* Reset some styles that the rest of the page might have set */ 181 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; 182 | border-width: 0; 183 | background: transparent; 184 | font-family: inherit; 185 | font-size: inherit; 186 | margin: 0; 187 | white-space: pre; 188 | word-wrap: normal; 189 | line-height: inherit; 190 | color: inherit; 191 | z-index: 2; 192 | position: relative; 193 | overflow: visible; 194 | } 195 | .CodeMirror-wrap pre { 196 | word-wrap: break-word; 197 | white-space: pre-wrap; 198 | word-break: normal; 199 | } 200 | .CodeMirror-code pre { 201 | border-right: 30px solid transparent; 202 | width: -webkit-fit-content; 203 | width: -moz-fit-content; 204 | width: fit-content; 205 | } 206 | .CodeMirror-wrap .CodeMirror-code pre { 207 | border-right: none; 208 | width: auto; 209 | } 210 | .CodeMirror-linebackground { 211 | position: absolute; 212 | left: 0; right: 0; top: 0; bottom: 0; 213 | z-index: 0; 214 | } 215 | 216 | .CodeMirror-linewidget { 217 | position: relative; 218 | z-index: 2; 219 | overflow: auto; 220 | } 221 | 222 | .CodeMirror-widget {} 223 | 224 | .CodeMirror-wrap .CodeMirror-scroll { 225 | overflow-x: hidden; 226 | } 227 | 228 | .CodeMirror-measure { 229 | position: absolute; 230 | width: 100%; 231 | height: 0; 232 | overflow: hidden; 233 | visibility: hidden; 234 | } 235 | .CodeMirror-measure pre { position: static; } 236 | 237 | .CodeMirror div.CodeMirror-cursor { 238 | position: absolute; 239 | visibility: hidden; 240 | border-right: none; 241 | width: 0; 242 | } 243 | .CodeMirror-focused div.CodeMirror-cursor { 244 | visibility: visible; 245 | } 246 | 247 | .CodeMirror-selected { background: #d9d9d9; } 248 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } 249 | 250 | .cm-searching { 251 | background: #ffa; 252 | background: rgba(255, 255, 0, .4); 253 | } 254 | 255 | /* IE7 hack to prevent it from returning funny offsetTops on the spans */ 256 | .CodeMirror span { *vertical-align: text-bottom; } 257 | 258 | @media print { 259 | /* Hide the cursor when printing */ 260 | .CodeMirror div.CodeMirror-cursor { 261 | visibility: hidden; 262 | } 263 | } 264 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer; 2 | 3 | import android.os.Bundle; 4 | import android.support.v4.app.FragmentActivity; 5 | import android.support.v4.view.ViewPager; 6 | import android.view.Menu; 7 | import android.view.MenuItem; 8 | 9 | import com.sbstrm.appirater.Appirater; 10 | import com.zupilupi.sourcecodeviewer.fragments.utils.WebUtils; 11 | 12 | import java.util.ArrayList; 13 | import java.util.HashMap; 14 | 15 | public class MainActivity extends FragmentActivity { 16 | 17 | private int numActiveFragments = 3; 18 | 19 | /* 20 | * Properties used by fragments 21 | */ 22 | public String enteredUrl = ""; 23 | public String htmlResult = ""; 24 | public String escapedHtmlResult = ""; 25 | public HashMap> htmlResources; 26 | 27 | /** 28 | * The {@link android.support.v4.view.PagerAdapter} that will provide 29 | * fragments for each of the sections. We use a 30 | * {@link android.support.v4.app.FragmentPagerAdapter} derivative, which 31 | * will keep every loaded fragment in memory. If this becomes too memory 32 | * intensive, it may be best to switch to a 33 | * {@link android.support.v4.app.FragmentStatePagerAdapter}. 34 | */ 35 | SectionsPagerAdapter mSectionsPagerAdapter; 36 | 37 | /** 38 | * The {@link ViewPager} that will host the section contents. 39 | */ 40 | ViewPager mViewPager; 41 | 42 | @Override 43 | protected void onCreate(Bundle savedInstanceState) { 44 | super.onCreate(savedInstanceState); 45 | 46 | setContentView(R.layout.activity_main); 47 | ((MyApp) this.getApplication()).appLaunched(this); 48 | 49 | Bundle bundle = this.getIntent().getExtras(); 50 | this.enteredUrl = bundle.getString(MyApp.URL); 51 | this.htmlResult = ((MyApp)getApplication()).HTML_CODE; 52 | this.escapedHtmlResult = ((MyApp)getApplication()).HTML_CODE_ESCAPED; 53 | 54 | this.htmlResources = WebUtils.getHtmlResources(this.htmlResult, 55 | this.enteredUrl); 56 | 57 | //show a descriptive title on the action bar 58 | setTitle("HTML: "+this.enteredUrl); 59 | 60 | // Create the adapter that will return a fragment for each of the three 61 | // primary sections of the app. 62 | mSectionsPagerAdapter = new SectionsPagerAdapter( 63 | getSupportFragmentManager(), numActiveFragments); 64 | 65 | // Set up the ViewPager with the sections adapter. 66 | mViewPager = (ViewPager) findViewById(R.id.pager); 67 | mViewPager.setAdapter(mSectionsPagerAdapter); 68 | } 69 | 70 | public void goToPage(int index) { 71 | mViewPager.setCurrentItem(index); 72 | } 73 | 74 | @Override 75 | public boolean onCreateOptionsMenu(Menu menu) { 76 | // Inflate the menu; this adds items to the action bar if it is present. 77 | getMenuInflater().inflate(R.menu.main, menu); 78 | return true; 79 | } 80 | 81 | @Override 82 | public boolean onOptionsItemSelected(MenuItem item) { 83 | // Handle item selection 84 | switch (item.getItemId()) { 85 | case R.id.rate_app: 86 | Appirater.rateApp(this); 87 | return true; 88 | default: 89 | return super.onOptionsItemSelected(item); 90 | } 91 | } 92 | 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/MyApp.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.sbstrm.appirater.Appirater; 7 | 8 | public class MyApp extends Application { 9 | 10 | public static String CACHE = "MYCACHE"; 11 | public static String LAST_URL = "LAST_URL"; 12 | public String HTML_CODE = "HTML_CODE"; 13 | public String HTML_CODE_ESCAPED = "HTML_CODE_ESCAPED"; 14 | public static String RETRY = "RETRY"; 15 | public static String URL = "URL"; 16 | public static String JS = "JS"; 17 | public static String CSS = "CSS"; 18 | public static String UKHOST = "UKHOST"; 19 | 20 | @Override 21 | public void onCreate() { 22 | super.onCreate(); 23 | Log.d("MyApp", "onCreate"); 24 | } 25 | 26 | public void appLaunched(MainActivity activity) { 27 | //init App Rater 28 | Appirater.appLaunched(activity); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/SectionsPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | 7 | import com.zupilupi.sourcecodeviewer.fragments.HtmlResourcesFragment; 8 | import com.zupilupi.sourcecodeviewer.fragments.PreviewFragment; 9 | import com.zupilupi.sourcecodeviewer.fragments.SourceCodeFragment; 10 | 11 | 12 | public class SectionsPagerAdapter extends FragmentPagerAdapter { 13 | 14 | int activeFragments; 15 | 16 | public SectionsPagerAdapter(FragmentManager fm, int activeFragments) { 17 | super(fm); 18 | this.activeFragments = activeFragments; 19 | } 20 | 21 | @Override 22 | public Fragment getItem(int position) { 23 | 24 | Fragment fragment; 25 | switch (position) { 26 | default: 27 | case 0: 28 | fragment = new SourceCodeFragment(); 29 | break; 30 | case 1: 31 | fragment = new HtmlResourcesFragment(); 32 | break; 33 | case 2: 34 | fragment = new PreviewFragment(); 35 | break; 36 | } 37 | return fragment; 38 | } 39 | 40 | @Override 41 | public int getCount() { 42 | return this.activeFragments; 43 | } 44 | 45 | @Override 46 | public CharSequence getPageTitle(int position) { 47 | switch (position) { 48 | case 0: 49 | return "source-code"; 50 | case 1: 51 | return "resources"; 52 | case 2: 53 | return "preview"; 54 | default: 55 | return ""; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/TypeUrlActivity.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer; 2 | 3 | import android.app.Activity; 4 | import android.app.AlertDialog; 5 | import android.app.ProgressDialog; 6 | import android.app.Service; 7 | import android.content.DialogInterface; 8 | import android.content.Intent; 9 | import android.content.SharedPreferences; 10 | import android.os.Bundle; 11 | import android.util.Log; 12 | import android.util.Patterns; 13 | import android.view.View; 14 | import android.view.View.OnClickListener; 15 | import android.view.inputmethod.InputMethodManager; 16 | import android.widget.Button; 17 | import android.widget.EditText; 18 | 19 | import com.zupilupi.sourcecodeviewer.fragments.utils.SourceCodeLoader; 20 | import com.zupilupi.sourcecodeviewer.fragments.utils.WebUtils; 21 | 22 | public class TypeUrlActivity extends Activity { 23 | 24 | ProgressDialog progress; 25 | String enteredUrl; 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_type_url); 31 | 32 | EditText textField = (EditText) findViewById(R.id.field_url); 33 | setLastUrl(textField); 34 | 35 | Button buttonSendRequest = (Button) findViewById(R.id.button_show_source); 36 | buttonSendRequest.setOnClickListener(sendRequestAct); 37 | } 38 | 39 | @Override 40 | protected void onResume() { 41 | super.onResume(); 42 | 43 | EditText textField = (EditText) findViewById(R.id.field_url); 44 | setLastUrl(textField); 45 | InputMethodManager imm = (InputMethodManager)this.getSystemService(Service.INPUT_METHOD_SERVICE); 46 | imm.showSoftInput(textField, 0); 47 | } 48 | 49 | private String setLastUrl(EditText textField) { 50 | //Get the last entered URL from cache if any 51 | SharedPreferences prefs = getSharedPreferences(MyApp.CACHE, Activity.MODE_PRIVATE); 52 | String lastUrl = prefs.getString(MyApp.LAST_URL, ""); 53 | 54 | if(!"".equalsIgnoreCase(lastUrl)) { 55 | textField.setText(lastUrl); 56 | } 57 | 58 | return lastUrl; 59 | } 60 | 61 | public void showSourceCode(String contentFromNetwork) { 62 | Log.d("ZUPILUPI", contentFromNetwork); 63 | 64 | Intent intent = new Intent(TypeUrlActivity.this, MainActivity.class); 65 | ((MyApp)this.getApplication()).HTML_CODE = contentFromNetwork; 66 | ((MyApp)this.getApplication()).HTML_CODE_ESCAPED = WebUtils.escapeForJs(contentFromNetwork); 67 | 68 | Bundle b = new Bundle(); 69 | b.putString(MyApp.URL, this.enteredUrl); 70 | intent.putExtras(b); 71 | startActivity(intent); 72 | 73 | if(progress != null) { 74 | progress.dismiss(); 75 | } 76 | } 77 | 78 | public void triggerSourceCodeLoader() { 79 | //start service to fetch the url's source code 80 | SourceCodeLoader loader = new SourceCodeLoader(this); 81 | loader.execute(WebUtils.checkHttpPrefix(enteredUrl)); 82 | //calls showSourceCode when done 83 | } 84 | 85 | private OnClickListener sendRequestAct = new OnClickListener() { 86 | 87 | public void onClick(View v) { 88 | EditText textField = (EditText) findViewById(R.id.field_url); 89 | TypeUrlActivity.this.enteredUrl = textField.getText().toString(); 90 | if (Patterns.WEB_URL.matcher(enteredUrl).matches()) { 91 | 92 | progress = ProgressDialog.show(TypeUrlActivity.this, "Please wait", 93 | "Retrieving data from the server", true); 94 | 95 | triggerSourceCodeLoader(); 96 | 97 | //Put the URL in cache 98 | SharedPreferences prefs = getSharedPreferences(MyApp.CACHE, Activity.MODE_PRIVATE); 99 | SharedPreferences.Editor editor = prefs.edit(); 100 | editor.putString(MyApp.LAST_URL, enteredUrl); 101 | editor.commit(); 102 | 103 | TypeUrlActivity.this.enteredUrl = enteredUrl; 104 | 105 | } else { 106 | new AlertDialog.Builder(TypeUrlActivity.this) 107 | .setMessage(R.string.alert_url_invalid) 108 | .setNegativeButton("Ok", new DialogInterface.OnClickListener() { 109 | public void onClick(DialogInterface dialog, int which) { 110 | // do nothing 111 | } 112 | }) 113 | .show(); 114 | } 115 | } 116 | }; 117 | 118 | } 119 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/EnterUrlFragment.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments; 2 | 3 | import android.app.AlertDialog; 4 | import android.content.DialogInterface; 5 | import android.os.Bundle; 6 | import android.support.v4.app.Fragment; 7 | import android.util.Patterns; 8 | import android.view.LayoutInflater; 9 | import android.view.View; 10 | import android.view.View.OnClickListener; 11 | import android.view.ViewGroup; 12 | import android.widget.Button; 13 | import android.widget.EditText; 14 | 15 | import com.zupilupi.sourcecodeviewer.MainActivity; 16 | import com.zupilupi.sourcecodeviewer.R; 17 | 18 | public class EnterUrlFragment extends Fragment{ 19 | 20 | View rootView; 21 | 22 | public EnterUrlFragment() { 23 | } 24 | 25 | @Override 26 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 27 | Bundle savedInstanceState) { 28 | rootView = inflater.inflate(R.layout.fragment_enter_url, 29 | container, false); 30 | 31 | Button buttonSendRequest = (Button) rootView.findViewById(R.id.button_show_source); 32 | buttonSendRequest.setOnClickListener(sendRequestAct); 33 | return rootView; 34 | } 35 | 36 | private OnClickListener sendRequestAct = new OnClickListener() { 37 | public void onClick(View v) { 38 | 39 | EditText textField = (EditText) rootView.findViewById(R.id.field_url); 40 | String enteredUrl = textField.getText().toString(); 41 | if (Patterns.WEB_URL.matcher(enteredUrl).matches()) { 42 | ((MainActivity) EnterUrlFragment.this.getActivity()).enteredUrl = enteredUrl; 43 | ((MainActivity) EnterUrlFragment.this.getActivity()).goToPage(1); 44 | 45 | } else { 46 | new AlertDialog.Builder(EnterUrlFragment.this.getActivity()) 47 | .setMessage(R.string.alert_url_invalid) 48 | .setNegativeButton("Ok", new DialogInterface.OnClickListener() { 49 | public void onClick(DialogInterface dialog, int which) { 50 | // do nothing 51 | } 52 | }) 53 | .show(); 54 | } 55 | 56 | 57 | } 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/HtmlResourcesFragment.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.support.v4.app.ListFragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.ListView; 11 | import android.widget.Toast; 12 | 13 | import com.zupilupi.sourcecodeviewer.MainActivity; 14 | import com.zupilupi.sourcecodeviewer.MyApp; 15 | import com.zupilupi.sourcecodeviewer.fragments.utils.ListRow; 16 | import com.zupilupi.sourcecodeviewer.fragments.utils.ResourcesArrayAdapter; 17 | import com.zupilupi.sourcecodeviewer.fragments.utils.WebUtils; 18 | 19 | import java.util.ArrayList; 20 | 21 | public class HtmlResourcesFragment extends ListFragment { 22 | 23 | public HtmlResourcesFragment() {} 24 | 25 | @Override 26 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 27 | Bundle savedInstanceState) { 28 | 29 | MainActivity mainActivity = (MainActivity) this.getActivity(); 30 | 31 | ArrayList jsResources = mainActivity.htmlResources.get(MyApp.JS); 32 | ArrayList cssResources = mainActivity.htmlResources.get(MyApp.CSS); 33 | 34 | ArrayList result = new ArrayList(); 35 | 36 | for(int i=0; i adapter = new ResourcesArrayAdapter( 45 | this.getActivity(), result); 46 | setListAdapter(adapter); 47 | 48 | return super.onCreateView(inflater, container, savedInstanceState); 49 | } 50 | 51 | @Override 52 | public void onListItemClick(ListView l, View v, int position, long id) { 53 | ListRow item = (ListRow) getListAdapter().getItem(position); 54 | Toast.makeText(this.getActivity(), item.getResUrl(), 55 | Toast.LENGTH_LONG).show(); 56 | 57 | String url = item.getResUrl(); 58 | Intent i = new Intent(Intent.ACTION_VIEW); 59 | i.setData(Uri.parse(url)); 60 | startActivity(i); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/PreviewFragment.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.webkit.WebView; 8 | 9 | import com.zupilupi.sourcecodeviewer.MainActivity; 10 | import com.zupilupi.sourcecodeviewer.R; 11 | import com.zupilupi.sourcecodeviewer.fragments.utils.WebClient; 12 | import com.zupilupi.sourcecodeviewer.fragments.utils.WebUtils; 13 | 14 | 15 | public class PreviewFragment extends WebViewFragment { 16 | 17 | public PreviewFragment() { 18 | 19 | } 20 | 21 | @Override 22 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 23 | Bundle savedInstanceState) { 24 | rootView = inflater.inflate(R.layout.fragment_preview, 25 | container, false); 26 | 27 | MainActivity mainActivity = (MainActivity)this.getActivity(); 28 | 29 | webView = (WebView) rootView.findViewById(R.id.site_preview); 30 | webView.loadUrl(WebUtils.checkHttpPrefix(mainActivity.enteredUrl)); 31 | webView.getSettings().setJavaScriptEnabled(true); 32 | webView.setWebViewClient(new WebClient(this)); 33 | 34 | return rootView; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/SourceCodeFragment.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.util.Log; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.webkit.WebView; 9 | import android.widget.Button; 10 | import android.widget.EditText; 11 | 12 | import com.zupilupi.sourcecodeviewer.MainActivity; 13 | import com.zupilupi.sourcecodeviewer.R; 14 | import com.zupilupi.sourcecodeviewer.fragments.utils.ChromeClient; 15 | import com.zupilupi.sourcecodeviewer.fragments.utils.JsInterface; 16 | import com.zupilupi.sourcecodeviewer.fragments.utils.WebClient; 17 | import com.zupilupi.sourcecodeviewer.fragments.utils.WebUtils; 18 | 19 | public class SourceCodeFragment extends WebViewFragment{ 20 | 21 | public Button find; 22 | public EditText text; 23 | public String htmlResult = ""; 24 | public String escapedHtmlResult = ""; 25 | public String enteredUrl = ""; 26 | 27 | public SourceCodeFragment() { 28 | } 29 | 30 | @Override 31 | public View onCreateView(LayoutInflater inflater, ViewGroup container, 32 | Bundle savedInstanceState) { 33 | this.rootView = inflater.inflate(R.layout.fragment_source_code, 34 | container, false); 35 | 36 | initView(); 37 | return rootView; 38 | } 39 | 40 | public void initView() { 41 | MainActivity mainActivity = (MainActivity)this.getActivity(); 42 | 43 | this.enteredUrl = mainActivity.enteredUrl; 44 | this.htmlResult = mainActivity.htmlResult; 45 | 46 | this.find = (Button) rootView.findViewById(R.id.button_find); 47 | this.find.setOnClickListener(buttonSearchOnClickListener); 48 | this.text = (EditText) rootView.findViewById(R.id.field_find); 49 | 50 | webView = (WebView) rootView.findViewById(R.id.source_code); 51 | webView.loadUrl("file:///android_asset/html_source.html"); 52 | webView.getSettings().setJavaScriptEnabled(true); 53 | webView.setWebViewClient(new WebClient(this)); 54 | webView.setWebChromeClient(new ChromeClient(mainActivity)); 55 | webView.addJavascriptInterface(new JsInterface(this), "Android"); 56 | 57 | this.escapedHtmlResult = mainActivity.escapedHtmlResult; 58 | } 59 | 60 | @Override 61 | public void onResume() { 62 | super.onResume(); 63 | Log.d("SourceCodeFragment", "onResume"); 64 | this.webWiewReady = false; 65 | initView(); 66 | } 67 | 68 | @Override 69 | public void onDestroyView() { 70 | super.onDestroyView(); 71 | Log.d("SourceCodeFragment", "onDestroy"); 72 | this.webWiewReady = false; 73 | } 74 | 75 | @Override 76 | public void onPause() { 77 | super.onPause(); 78 | Log.d("SourceCodeFragment", "onPause"); 79 | this.webWiewReady = false; 80 | } 81 | 82 | @Override 83 | public void onStop() { 84 | super.onStop(); 85 | Log.d("SourceCodeFragment", "onStop"); 86 | this.webWiewReady = false; 87 | } 88 | 89 | public void showEmptySourceOnView() { 90 | webView.loadUrl("javascript:setTimeout(function(){ showEmptySource('"+WebUtils.escapeForJs(this.enteredUrl)+"'); }, 500)"); 91 | } 92 | 93 | public void showSourceOnView() { 94 | Log.d("ESCAPED HTML ******************************************", this.escapedHtmlResult); 95 | webView.loadUrl("javascript:setTimeout(function(){ setHtmlSource('"+this.escapedHtmlResult+"'); }, 500)"); 96 | } 97 | 98 | public void showFindBar() { 99 | this.text.setVisibility(View.VISIBLE); 100 | this.find.setVisibility(View.VISIBLE); 101 | } 102 | 103 | Button.OnClickListener buttonSearchOnClickListener = new Button.OnClickListener() { 104 | @Override 105 | public void onClick(View v) { 106 | String findMe = text.getText().toString(); 107 | if (!"".equalsIgnoreCase(findMe)) { 108 | find.setOnClickListener(buttonSearchOnClickListener); 109 | webView.loadUrl("javascript:findString('" + WebUtils.escapeForJs(findMe) + "')"); 110 | } 111 | } 112 | }; 113 | } 114 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/WebViewFragment.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.view.View; 5 | import android.webkit.WebView; 6 | 7 | public class WebViewFragment extends Fragment{ 8 | 9 | protected View rootView; 10 | protected WebView webView; 11 | public boolean webWiewReady = false; 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/utils/ChromeClient.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments.utils; 2 | 3 | import android.webkit.WebChromeClient; 4 | 5 | import com.zupilupi.sourcecodeviewer.MainActivity; 6 | 7 | public class ChromeClient extends WebChromeClient{ 8 | 9 | private final String TAG = "EvChromeClient"; 10 | private MainActivity currentActivity; 11 | 12 | public ChromeClient(MainActivity webViewActivity) { 13 | this.currentActivity = webViewActivity; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/utils/JsInterface.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments.utils; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.webkit.JavascriptInterface; 6 | 7 | import com.zupilupi.sourcecodeviewer.MyApp; 8 | import com.zupilupi.sourcecodeviewer.TypeUrlActivity; 9 | import com.zupilupi.sourcecodeviewer.fragments.SourceCodeFragment; 10 | 11 | public class JsInterface { 12 | SourceCodeFragment frgCaller; 13 | 14 | /** Instantiate the interface and set the context */ 15 | public JsInterface(SourceCodeFragment f) { 16 | frgCaller = f; 17 | } 18 | 19 | @JavascriptInterface 20 | public void showFindBar() { 21 | frgCaller.showFindBar(); 22 | } 23 | 24 | @JavascriptInterface 25 | public void tryAgain() { 26 | Intent intent = new Intent(frgCaller.getActivity(), TypeUrlActivity.class); 27 | frgCaller.webWiewReady = false; 28 | Bundle b = new Bundle(); 29 | b.putBoolean(MyApp.RETRY, true); 30 | intent.putExtras(b); 31 | frgCaller.getActivity().startActivity(intent); 32 | frgCaller.getActivity().finish(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/utils/ListRow.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments.utils; 2 | 3 | public class ListRow { 4 | 5 | private String resType; 6 | private String resName; 7 | private String resUrl; 8 | 9 | public ListRow (String type, String name, String url) { 10 | this.resType = type; 11 | this.resName = name; 12 | this.resUrl = url; 13 | } 14 | 15 | public String getResType() { 16 | return resType; 17 | } 18 | public void setResType(String resType) { 19 | this.resType = resType; 20 | } 21 | public String getResName() { 22 | return resName; 23 | } 24 | public void setResName(String resName) { 25 | this.resName = resName; 26 | } 27 | public String getResUrl() { 28 | return resUrl; 29 | } 30 | public void setResUrl(String resUrl) { 31 | this.resUrl = resUrl; 32 | } 33 | 34 | public String toString() { 35 | return this.resUrl; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/utils/ResourcesArrayAdapter.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments.utils; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ArrayAdapter; 8 | import android.widget.TextView; 9 | 10 | import com.zupilupi.sourcecodeviewer.R; 11 | 12 | import java.util.ArrayList; 13 | 14 | public class ResourcesArrayAdapter extends ArrayAdapter{ 15 | 16 | private final Context context; 17 | private final ArrayList values; 18 | 19 | public ResourcesArrayAdapter(Context context, ArrayList values) { 20 | super(context, R.layout.row_html_resources, values); 21 | this.context = context; 22 | this.values = values; 23 | } 24 | 25 | @Override 26 | public View getView(int position, View convertView, ViewGroup parent) { 27 | LayoutInflater inflater = (LayoutInflater) context 28 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); 29 | View rowView = inflater.inflate(R.layout.row_html_resources, parent, false); 30 | 31 | TextView resType = (TextView) rowView.findViewById(R.id.res_type); 32 | TextView firstLine = (TextView) rowView.findViewById(R.id.firstLine); 33 | TextView secondLine = (TextView) rowView.findViewById(R.id.secondLine); 34 | 35 | resType.setText(values.get(position).getResType()); 36 | firstLine.setText(values.get(position).getResName()); 37 | secondLine.setText(values.get(position).getResUrl()); 38 | 39 | return rowView; 40 | } 41 | } -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/utils/SourceCodeLoader.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments.utils; 2 | 3 | import android.os.AsyncTask; 4 | 5 | import com.zupilupi.sourcecodeviewer.MyApp; 6 | import com.zupilupi.sourcecodeviewer.TypeUrlActivity; 7 | 8 | import org.apache.http.HttpResponse; 9 | import org.apache.http.client.methods.HttpPost; 10 | import org.apache.http.impl.client.DefaultHttpClient; 11 | 12 | import java.io.BufferedReader; 13 | import java.io.InputStream; 14 | import java.io.InputStreamReader; 15 | 16 | public class SourceCodeLoader extends AsyncTask { 17 | 18 | private TypeUrlActivity myFragment; 19 | private String encoding = "UTF-8"; 20 | 21 | public SourceCodeLoader(TypeUrlActivity webViewActivity) { 22 | this.myFragment = webViewActivity; 23 | } 24 | 25 | @Override 26 | protected String doInBackground(String... url) { 27 | 28 | StringBuilder sb = new StringBuilder(); 29 | String result = ""; 30 | try { 31 | DefaultHttpClient httpClient = new DefaultHttpClient(); 32 | HttpPost httpPost = new HttpPost(url[0]); //serve http 33 | HttpResponse httpResponse; 34 | httpResponse = httpClient.execute(httpPost); 35 | 36 | if (httpResponse != null) { 37 | // Get the data in the entity 38 | InputStream in = httpResponse.getEntity().getContent(); 39 | 40 | BufferedReader reader = new BufferedReader( 41 | new InputStreamReader(in, this.encoding)); 42 | String line = null; 43 | while ((line = reader.readLine()) != null) { 44 | sb.append(line + "\n"); 45 | } 46 | in.close(); 47 | } 48 | result = sb.toString(); 49 | } catch (Throwable e) { 50 | e.printStackTrace(); 51 | result = MyApp.UKHOST; 52 | } 53 | return result; 54 | } 55 | 56 | protected void onPostExecute(String content) { 57 | this.myFragment.showSourceCode(content); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/utils/WebClient.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments.utils; 2 | 3 | import android.webkit.WebView; 4 | import android.webkit.WebViewClient; 5 | 6 | import com.zupilupi.sourcecodeviewer.MyApp; 7 | import com.zupilupi.sourcecodeviewer.fragments.SourceCodeFragment; 8 | import com.zupilupi.sourcecodeviewer.fragments.WebViewFragment; 9 | 10 | public class WebClient extends WebViewClient{ 11 | 12 | private WebViewFragment fragment; 13 | 14 | public WebClient (WebViewFragment myFragment) { 15 | this.fragment = myFragment; 16 | } 17 | 18 | @Override 19 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 20 | view.loadUrl(url); 21 | return true; 22 | } 23 | 24 | @Override 25 | public void onReceivedError(WebView webView, int errorCode, String description, String failingUrl) { 26 | super.onReceivedError(webView, errorCode, description, failingUrl); 27 | } 28 | 29 | @Override 30 | public void onPageFinished(WebView view, String url) { 31 | this.fragment.webWiewReady = true; 32 | super.onPageFinished(view, url); 33 | 34 | if(fragment instanceof SourceCodeFragment) { 35 | SourceCodeFragment f = (SourceCodeFragment) fragment; 36 | if (f.escapedHtmlResult.equals(MyApp.UKHOST)) { 37 | f.showEmptySourceOnView(); 38 | } else { 39 | f.showSourceOnView(); 40 | } 41 | } 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/zupilupi/sourcecodeviewer/fragments/utils/WebUtils.java: -------------------------------------------------------------------------------- 1 | package com.zupilupi.sourcecodeviewer.fragments.utils; 2 | 3 | import android.util.Log; 4 | 5 | import com.zupilupi.sourcecodeviewer.MyApp; 6 | 7 | import org.jsoup.Jsoup; 8 | import org.jsoup.nodes.Document; 9 | import org.jsoup.nodes.Element; 10 | import org.jsoup.select.Elements; 11 | 12 | import java.util.ArrayList; 13 | import java.util.HashMap; 14 | 15 | public class WebUtils { 16 | 17 | public static HashMap> getHtmlResources(String html, String enteredUrl) { 18 | 19 | Document doc; 20 | doc = Jsoup.parse(html); 21 | 22 | ArrayList cssLinks = new ArrayList(); 23 | Elements allCss = doc.select("link[href$=.css]"); // CSS 24 | for (Element css : allCss) { 25 | cssLinks.add(returnValidUrl(css.attr("href"), enteredUrl)); 26 | } 27 | 28 | ArrayList jsLinks = new ArrayList(); 29 | Elements allJs = doc.select("script[src]"); // JS 30 | for (Element js : allJs) { 31 | jsLinks.add(returnValidUrl(js.attr("src"), enteredUrl)); 32 | } 33 | 34 | HashMap> result = new HashMap>(); 35 | result.put(MyApp.CSS, cssLinks); 36 | result.put(MyApp.JS, jsLinks); 37 | 38 | Log.d("MAP RESULTS JS/CSS", result.toString()); 39 | 40 | return result; 41 | } 42 | 43 | public static String returnValidUrl(String partialUrl, String enteredUrl) { 44 | 45 | if (partialUrl.startsWith("http") || partialUrl.startsWith("https") || partialUrl.startsWith("www")) { 46 | return partialUrl; 47 | } else { 48 | String prefix = "http://"; 49 | if(enteredUrl.startsWith("https://")) { 50 | prefix = "https://"; 51 | } 52 | String host = getBaseDomain(enteredUrl); 53 | if(partialUrl.startsWith("/")) { 54 | return prefix + host + partialUrl; 55 | } else { 56 | return prefix + host + "/" + partialUrl; 57 | } 58 | } 59 | } 60 | 61 | public static String getHost(String url){ 62 | if(url == null || url.length() == 0) 63 | return ""; 64 | 65 | int doubleslash = url.indexOf("//"); 66 | if(doubleslash == -1) 67 | doubleslash = 0; 68 | else 69 | doubleslash += 2; 70 | 71 | int end = url.indexOf('/', doubleslash); 72 | end = end >= 0 ? end : url.length(); 73 | 74 | return url.substring(doubleslash, end); 75 | } 76 | 77 | public static String getBaseDomain(String url) { 78 | String host = getHost(url); 79 | 80 | int startIndex = 0; 81 | int nextIndex = host.indexOf('.'); 82 | int lastIndex = host.lastIndexOf('.'); 83 | while (nextIndex < lastIndex) { 84 | startIndex = nextIndex + 1; 85 | nextIndex = host.indexOf('.', startIndex); 86 | } 87 | if (startIndex > 0) { 88 | return host.substring(startIndex); 89 | } else { 90 | return host; 91 | } 92 | } 93 | 94 | public static String checkHttpPrefix(String url) { 95 | if (!url.startsWith("http") && !url.startsWith("https")) { 96 | url = "http://" + url; 97 | } 98 | return url; 99 | } 100 | 101 | public static String escapeForJs(String origin) { 102 | origin = origin.replaceAll("&", "&"); 103 | origin = origin.replaceAll("\"", """); 104 | origin = origin.replaceAll("'", "'"); 105 | origin = origin.replaceAll("<", "<"); 106 | origin = origin.replaceAll(">", ">"); 107 | origin = origin.replaceAll("\n", " "); 108 | origin = origin.replaceAll("/", "/"); 109 | return origin; 110 | } 111 | 112 | public static String getResourceName(String resourceUrl) { 113 | String[] splitted = resourceUrl.split("/"); 114 | return splitted[splitted.length-1]; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /app/src/main/res/color/splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/button_find.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/button_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/edit_text_find.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 13 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/edit_text_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 13 | 14 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/antonio83franco/HTMLSourceCodeViewer/8df7838cf4aa584e89678f0c475f88800e3ddde6/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_type_url.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 |