Browse Source

First push to github

master
Anthony Restaino 11 years ago
commit
ea4d85e630
  1. 22
      .gitattributes
  2. 163
      .gitignore
  3. 87
      AndroidManifest.xml
  4. 10
      res/anim/rotate.xml
  5. BIN
      res/drawable-hdpi/back.png
  6. BIN
      res/drawable-hdpi/exit.png
  7. BIN
      res/drawable-hdpi/forward.png
  8. BIN
      res/drawable-hdpi/ic_launcher.png
  9. BIN
      res/drawable-hdpi/loading.png
  10. BIN
      res/drawable-hdpi/new_tab.png
  11. BIN
      res/drawable-hdpi/options.png
  12. BIN
      res/drawable-hdpi/plus.png
  13. BIN
      res/drawable-hdpi/refresh.png
  14. BIN
      res/drawable-hdpi/stop.png
  15. BIN
      res/drawable-hdpi/webpage.png
  16. BIN
      res/drawable-mdpi/back.png
  17. BIN
      res/drawable-mdpi/exit.png
  18. BIN
      res/drawable-mdpi/forward.png
  19. BIN
      res/drawable-mdpi/ic_launcher.png
  20. BIN
      res/drawable-mdpi/loading.png
  21. BIN
      res/drawable-mdpi/new_tab.png
  22. BIN
      res/drawable-mdpi/options.png
  23. BIN
      res/drawable-mdpi/plus.png
  24. BIN
      res/drawable-mdpi/refresh.png
  25. BIN
      res/drawable-mdpi/stop.png
  26. BIN
      res/drawable-mdpi/webpage.png
  27. BIN
      res/drawable-xhdpi/back.png
  28. BIN
      res/drawable-xhdpi/bar.9.png
  29. BIN
      res/drawable-xhdpi/bg_inactive.9.png
  30. BIN
      res/drawable-xhdpi/bg_press.9.png
  31. BIN
      res/drawable-xhdpi/exit.png
  32. BIN
      res/drawable-xhdpi/forward.png
  33. BIN
      res/drawable-xhdpi/ic_launcher.png
  34. BIN
      res/drawable-xhdpi/line.9.png
  35. BIN
      res/drawable-xhdpi/loading.png
  36. BIN
      res/drawable-xhdpi/new_tab.png
  37. BIN
      res/drawable-xhdpi/options.png
  38. BIN
      res/drawable-xhdpi/refresh.png
  39. BIN
      res/drawable-xhdpi/stop.png
  40. BIN
      res/drawable-xhdpi/webpage.png
  41. 5
      res/drawable/bookmark.xml
  42. 5
      res/drawable/button.xml
  43. 142
      res/layout/activity_main.xml
  44. 308
      res/layout/settings.xml
  45. 11
      res/menu-es/menu.xml
  46. 12
      res/menu/menu.xml
  47. 19
      res/values-es/strings.xml
  48. 11
      res/values-v11/styles.xml
  49. 12
      res/values-v14/styles.xml
  50. 9
      res/values/colors.xml
  51. 21
      res/values/strings.xml
  52. 20
      res/values/styles.xml
  53. 1653
      src/acr/browser/barebones/Barebones.java
  54. 473
      src/acr/browser/barebones/Settings.java

22
.gitattributes vendored

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

163
.gitignore vendored

@ -0,0 +1,163 @@ @@ -0,0 +1,163 @@
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
*.dotCover
## TODO: If you have NuGet Package Restore enabled, uncomment this
#packages/
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
# ReSharper is a .NET coding add-in
_ReSharper*
# Installshield output folder
[Ee]xpress
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish
# Others
[Bb]in
[Oo]bj
sql
TestResults
*.Cache
ClientBin
stylecop.*
~$*
*.dbmdl
Generated_Code #added for RIA/Silverlight projects
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
############
## Windows
############
# Windows image file caches
Thumbs.db
# Folder config file
Desktop.ini
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
# Mac crap
.DS_Store

87
AndroidManifest.xml

@ -0,0 +1,87 @@ @@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="acr.browser.barebones"
android:versionCode="22"
android:versionName="2.2.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="acr.browser.barebones.Barebones"
android:label="@string/app_name"
android:configChanges="orientation|screenSize|keyboardHidden"
android:hardwareAccelerated="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.APP_BROWSER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="about" />
<data android:scheme="javascript" />
</intent-filter>
<!-- For these schemes where any of these particular MIME types
have been supplied, we are a good candidate. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="inline" />
<data android:mimeType="text/html"/>
<data android:mimeType="text/plain"/>
<data android:mimeType="application/xhtml+xml"/>
<data android:mimeType="application/vnd.wap.xhtml+xml"/>
</intent-filter>
<!-- For viewing saved web archives. -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="file" />
<data android:mimeType="application/x-webarchive-xml"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.WEB_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="" />
<data android:scheme="http" />
<data android:scheme="https" />
</intent-filter>
</activity>
<activity
android:name="acr.browser.barebones.Settings"
android:configChanges="orientation|screenSize|keyboard"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.BAREBONESSETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>

10
res/anim/rotate.xml

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:repeatCount="infinite"
android:duration="1200"
android:interpolator="@android:anim/linear_interpolator"/>

BIN
res/drawable-hdpi/back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

BIN
res/drawable-hdpi/exit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

BIN
res/drawable-hdpi/forward.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

BIN
res/drawable-hdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
res/drawable-hdpi/loading.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

BIN
res/drawable-hdpi/new_tab.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

BIN
res/drawable-hdpi/options.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
res/drawable-hdpi/plus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

BIN
res/drawable-hdpi/refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B

BIN
res/drawable-hdpi/stop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

BIN
res/drawable-hdpi/webpage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
res/drawable-mdpi/back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

BIN
res/drawable-mdpi/exit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

BIN
res/drawable-mdpi/forward.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

BIN
res/drawable-mdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
res/drawable-mdpi/loading.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 B

BIN
res/drawable-mdpi/new_tab.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 B

BIN
res/drawable-mdpi/options.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

BIN
res/drawable-mdpi/plus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

BIN
res/drawable-mdpi/refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

BIN
res/drawable-mdpi/stop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

BIN
res/drawable-mdpi/webpage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

BIN
res/drawable-xhdpi/back.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

BIN
res/drawable-xhdpi/bar.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
res/drawable-xhdpi/bg_inactive.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

BIN
res/drawable-xhdpi/bg_press.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

BIN
res/drawable-xhdpi/exit.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 B

BIN
res/drawable-xhdpi/forward.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

BIN
res/drawable-xhdpi/ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
res/drawable-xhdpi/line.9.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

BIN
res/drawable-xhdpi/loading.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

BIN
res/drawable-xhdpi/new_tab.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

BIN
res/drawable-xhdpi/options.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

BIN
res/drawable-xhdpi/refresh.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
res/drawable-xhdpi/stop.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
res/drawable-xhdpi/webpage.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

5
res/drawable/bookmark.xml

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@color/press"/>
<item android:state_pressed="true" android:drawable="@color/blue" />
<item android:drawable="@drawable/line" />
</selector>

5
res/drawable/button.xml

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:drawable="@color/press"/>
<item android:state_pressed="true" android:drawable="@color/blue" />
<item android:drawable="@color/clear" />
</selector>

142
res/layout/activity_main.xml

@ -0,0 +1,142 @@ @@ -0,0 +1,142 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<ScrollView
android:id="@+id/backgroundScroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none" >
<RelativeLayout
android:id="@+id/background"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<HorizontalScrollView
android:id="@+id/tabScroll"
android:layout_width="fill_parent"
android:layout_height="32dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:scrollbars="horizontal|none"
android:fadingEdge="none">
<LinearLayout
android:id="@+id/Layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:id="@+id/tabLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent" >
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/newTab"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/new_tab" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_below="@id/tabScroll"
android:background="@drawable/bar" >
<ImageView
android:id="@+id/options"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:src="@drawable/options" />
<ImageView
android:id="@+id/exit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:src="@drawable/exit" />
<ImageView
android:id="@+id/forward"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/exit"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:src="@drawable/forward" />
<RelativeLayout
android:id="@+id/refreshLayout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/forward">
<ImageView
android:id="@+id/refresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/forward"
android:paddingBottom="10dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:src="@drawable/refresh" />
</RelativeLayout>
<EditText
android:id="@+id/enterUrl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/options"
android:layout_toRightOf="@+id/refreshLayout"
android:ems="10"
android:hint="@string/google"
android:imeOptions="actionGo"
android:inputType="textUri"
android:singleLine="true" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/relativeLayout1">
<FrameLayout
android:id="@+id/webFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/relativeLayout1">
</FrameLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout>

308
res/layout/settings.xml

@ -0,0 +1,308 @@ @@ -0,0 +1,308 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:id="@+id/relativeLayout1"
android:layout_width="wrap_content"
android:layout_height="48dp"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="@drawable/bar" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/settings"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ImageView
android:id="@+id/back"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:paddingBottom="5dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="5dp"
android:src="@drawable/back" />
</RelativeLayout>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/relativeLayout1" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/textView4"
android:layout_width="match_parent"
android:textColor="#ffffffff"
android:layout_height="56dp"
android:layout_below="@+id/relativeLayout1"
android:layout_centerHorizontal="true"
android:background="#ff0099cc"
android:gravity="center_vertical|center_horizontal"
android:text="@string/settingshelp"
android:textAppearance="?android:attr/textAppearanceLarge" />
<CheckBox
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignLeft="@+id/location"
android:layout_alignParentRight="true"
android:layout_below="@+id/location"
android:paddingRight="20dp" />
<EditText
android:id="@+id/agent"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/textView2"
android:layout_toRightOf="@+id/textView2"
android:ems="10"
android:inputType="textUri"
android:paddingRight="10dp"
android:singleLine="true" >
</EditText>
<CheckBox
android:id="@+id/flash"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentRight="true"
android:layout_below="@+id/password"
android:paddingRight="20dp" />
<CheckBox
android:id="@+id/historyClear"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentRight="true"
android:layout_below="@+id/flash"
android:paddingRight="20dp" />
<RadioButton
android:id="@+id/radioMobile"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignLeft="@+id/java"
android:layout_below="@+id/java"
android:marqueeRepeatLimit="20"
android:onClick="radioAgent" />
<RadioButton
android:id="@+id/radioDesktop"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignLeft="@+id/radioMobile"
android:layout_below="@+id/radioMobile"
android:onClick="radioAgent"
android:paddingRight="20dp" />
<RadioButton
android:id="@+id/radioCustom"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignLeft="@+id/radioDesktop"
android:layout_below="@+id/radioDesktop"
android:onClick="radioAgent"
android:paddingRight="20dp" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/radioCustom"
android:gravity="center_vertical|center_horizontal"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:text="@string/agent" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView2"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:text="@string/home" />
<EditText
android:id="@+id/homePage"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignLeft="@+id/agent"
android:layout_alignRight="@+id/agent"
android:layout_below="@+id/agent"
android:ems="10"
android:inputType="textUri"
android:paddingRight="10dp" />
<Button
android:id="@+id/email"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_below="@+id/homePage"
android:layout_centerHorizontal="true"
android:gravity="center_vertical|center_horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:text="@string/email"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
android:id="@+id/fullScreen"
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_alignLeft="@+id/historyClear"
android:layout_alignParentRight="true"
android:layout_below="@+id/historyClear"
android:paddingRight="20dp" />
<CheckBox
android:id="@+id/java"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentRight="true"
android:layout_below="@+id/fullScreen"
android:paddingRight="20dp" />
<CheckBox
android:id="@+id/location"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentRight="true"
android:layout_below="@+id/textView4"
android:paddingRight="20dp" />
<TextView
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/location"
android:layout_toLeftOf="@+id/location"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/location"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView5"
android:layout_toLeftOf="@+id/password"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/password"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView7"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/flash"
android:layout_toLeftOf="@+id/flash"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/flash"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView8"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView7"
android:layout_alignTop="@+id/historyClear"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/history"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView9"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView8"
android:layout_alignTop="@+id/fullScreen"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/fullscreen"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView9"
android:layout_alignTop="@+id/java"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/java"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView11"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView10"
android:layout_alignTop="@+id/radioMobile"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/mobile"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView12"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView11"
android:layout_below="@+id/textView11"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/desk"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/textView13"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_above="@+id/agent"
android:layout_alignParentLeft="true"
android:layout_alignRight="@+id/textView12"
android:gravity="center_vertical"
android:paddingLeft="20dp"
android:text="@string/custom"
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>

11
res/menu-es/menu.xml

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@id/refresh" android:orderInCategory="1" android:title="Actualizar" android:titleCondensed="Actualizar" />
<item android:id="@id/bookmark" android:orderInCategory="2" android:title="Anadir a Marcadores" android:titleCondensed="Anadir a Marcadores" />
<item android:id="@id/allBookmarks" android:orderInCategory="3" android:title="Marcadores" android:titleCondensed="Marcadores" />
<item android:id="@id/share" android:orderInCategory="4" android:title="Compartir" android:titleCondensed="Compartir" />
<item android:id="@id/settings" android:orderInCategory="5" android:title="Ajustes" android:titleCondensed="Ajustes" />
<item android:id="@+id/tabs" android:title="Mostrar/ocultar pestanas" android:orderInCategory="5" android:titleCondensed="Mostrar/ocultar"></item>
<item android:id="@+id/forward" android:title="Adelante" android:orderInCategory="7" android:titleCondensed="Adelante"></item>
</menu>

12
res/menu/menu.xml

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:id="@+id/refresh" android:title="Refresh" android:titleCondensed="Refresh" android:orderInCategory="1"></item>
<item android:id="@+id/bookmark" android:title="Add to bookmarks" android:titleCondensed="Add bookmark" android:orderInCategory="2"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="Bookmarks" android:title="Bookmarks" android:orderInCategory="3"></item>
<item android:id="@+id/share" android:title="Share" android:titleCondensed="Share" android:orderInCategory="4"></item>
<item android:id="@+id/settings" android:title="Settings" android:titleCondensed="Settings" android:orderInCategory="6"></item>
<item android:id="@+id/tabs" android:title="Show/hide tabs" android:orderInCategory="5" android:titleCondensed="Show/hide tabs"></item>
<item android:id="@+id/forward" android:title="Forward" android:orderInCategory="7" android:titleCondensed="Forward"></item>
</menu>

19
res/values-es/strings.xml

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">Ajustes del navegador</string>
<string name="location">Permitir a webs acceder a tu ubicacion</string>
<string name="password">Guardar contrasenas</string>
<string name="agent">Agente de usuario</string>
<string name="history">Borrar historial al salir (Auto-borrado de cache)</string>
<string name="email">Enviame un Email</string>
<string name="flash">Habilitar Adobe Flash (por demanda)</string>
<string name="mobile">Ver como movil</string>
<string name="desk">Ver como ordenador</string>
<string name="custom">Ver con agente de usuario distinto</string>
<string name="home">Pagina principal</string>
<string name="settingshelp">Solo aplicados a nuevas pestanas</string>
<string name="fullscreen">Enable fullscreen mode</string>
<string name="java">Enable JavaScript</string>
</resources>

11
res/values-v11/styles.xml

@ -0,0 +1,11 @@ @@ -0,0 +1,11 @@
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.NoActionBar">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>

12
res/values-v14/styles.xml

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.NoActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>

9
res/values/colors.xml

@ -0,0 +1,9 @@ @@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="clear">#00000000</color>
<color name="blue">#b40099cc</color>
<color name="press">#330099cc</color>
<color name="black">#ff000000</color>
<color name="dark">#ff3f3f3f</color>
</resources>

21
res/values/strings.xml

@ -0,0 +1,21 @@ @@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">Browser Settings</string>
<string name="location">Allow sites to access your location</string>
<string name="password">Save your passwords</string>
<string name="agent">User Agent</string>
<string name="history">Clear history on exit (cache is auto-cleared)</string>
<string name="email">Email me</string>
<string name="flash">Enable Adobe Flash (if it\'s installed)</string>
<string name="mobile">View as Mobile</string>
<string name="desk">View as Desktop</string>
<string name="custom">View as custom user agent</string>
<string name="home">Homepage</string>
<string name="settingshelp">Settings only apply to new tabs</string>
<string name="fullscreen">Enable fullscreen mode</string>
<string name="java">Enable JavaScript</string>
</resources>

20
res/values/styles.xml

@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light.NoTitleBar">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>

1653
src/acr/browser/barebones/Barebones.java

File diff suppressed because it is too large Load Diff

473
src/acr/browser/barebones/Settings.java

@ -0,0 +1,473 @@ @@ -0,0 +1,473 @@
package acr.browser.barebones;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.WindowManager;
import android.view.View.OnClickListener;
import android.view.View.OnKeyListener;
import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
public class Settings extends Activity {
public static final String preferences = "settings";
boolean allowLocation, deleteHistory;
int enableFlash;
boolean savePasswords, fullScreen,java;
String userAgent, homepage;
EditText agent,h;
SharedPreferences.Editor edit;
int agentPicker;
@Override
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.settings);
TextView it = (TextView) findViewById(R.id.textView1);
agent = (EditText) findViewById(R.id.agent);
agent.setSelectAllOnFocus(true);
this.getWindow().setSoftInputMode(
WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
SharedPreferences settings = getSharedPreferences(preferences, 0);
WebView test = new WebView(Settings.this);
String user = test.getSettings().getUserAgentString();
test.destroy();
it.requestFocus();
allowLocation = settings.getBoolean("location", false);
savePasswords = settings.getBoolean("passwords", false);
deleteHistory = settings.getBoolean("history", false);
fullScreen = settings.getBoolean("fullscreen", false);
enableFlash = settings.getInt("enableflash", 0);
agentPicker = settings.getInt("agentchoose", 1);
userAgent = settings.getString("agent", user);
java = settings.getBoolean("java", true);
homepage = settings.getString("home", "http://www.google.com");
agent.setText(userAgent);
edit = settings.edit();
RadioButton m = (RadioButton) findViewById(R.id.radioMobile);
RadioButton d = (RadioButton) findViewById(R.id.radioDesktop);
RadioButton c = (RadioButton) findViewById(R.id.radioCustom);
switch (agentPicker) {
case 1:
m.setChecked(true);
break;
case 2:
d.setChecked(true);
break;
case 3:
c.setChecked(true);
break;
}
back();
location();
userAgent();
passwords();
clearHistory();
emailMe();
getText();
flash();
getHome();
full();
java();
}
public void getHome() {
h = (EditText) findViewById(R.id.homePage);
TextView t = (TextView) findViewById(R.id.textView3);
t.setBackgroundResource(R.drawable.button);
TextView a = (TextView) findViewById(R.id.textView2);
a.setBackgroundResource(R.drawable.button);
h.setSelectAllOnFocus(true);
h.setText(homepage);
h.setSingleLine(true);
h.setOnKeyListener(new OnKeyListener(){
@Override
public boolean onKey(View arg0, int arg1, KeyEvent arg2) {
// TODO Auto-generated method stub
switch(arg1){
case KeyEvent.KEYCODE_ENTER:
String home;
home = h.getText().toString();
if(!home.contains("about:blank")&&!home.contains("about:home")){
if(home.contains("http://")==false){
home = "http://"+home;
}}
edit.putString("home", home);
edit.commit();
return true;
default: break;
}
return false;
}
});
h.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
// TODO Auto-generated method stub
if (actionId == EditorInfo.IME_ACTION_GO
|| actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_ACTION_NEXT
|| actionId == EditorInfo.IME_ACTION_SEND||actionId==EditorInfo.IME_ACTION_SEARCH||event.getAction()==KeyEvent.KEYCODE_ENTER) {
String home = h.getText().toString();
if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){
if(h.getText().toString().contains("http://")==false){
home = "http://"+h.getText().toString();
}}
edit.putString("home", home);
edit.commit();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(agent.getWindowToken(), 0);
return true;
}
return false;
}
});
}
public void radioAgent(View v) {
boolean checked = ((RadioButton) v).isChecked();
switch (v.getId()) {
case (R.id.radioMobile):
if (checked) {
edit.putInt("agentchoose", 1);
edit.commit();
}
break;
case (R.id.radioDesktop):
if (checked) {
edit.putInt("agentchoose", 2);
edit.commit();
}
break;
case (R.id.radioCustom):
if (checked) {
edit.putInt("agentchoose", 3);
edit.commit();
}
break;
}
}
public void back() {
ImageView back = (ImageView) findViewById(R.id.back);
back.setBackgroundResource(R.drawable.button);
back.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (agentPicker == 3) {
userAgent = agent.getText().toString();
edit.putString("agent", userAgent);
edit.commit();
}
String home = h.getText().toString();
if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){
if(h.getText().toString().contains("http://")==false){
home = "http://"+h.getText().toString();
}}
edit.putString("home", home);
edit.commit();
finish();
}
});
}
public void java(){
final CheckBox full = (CheckBox)findViewById(R.id.java);
if(java){
full.setChecked(true);
}else{
full.setChecked(false);
}
full.setOnCheckedChangeListener(new OnCheckedChangeListener(){
@Override
public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
// TODO Auto-generated method stub
if(arg1){
edit.putBoolean("java", true);
edit.commit();
}else{
edit.putBoolean("java", false);
edit.commit();
}
}
});
}
public void full(){
final CheckBox full = (CheckBox)findViewById(R.id.fullScreen);
if(fullScreen){
full.setChecked(true);
}else{
full.setChecked(false);
}
full.setOnCheckedChangeListener(new OnCheckedChangeListener(){
@Override
public void onCheckedChanged(CompoundButton arg0, boolean arg1) {
// TODO Auto-generated method stub
if(arg1){
edit.putBoolean("fullscreen", true);
edit.commit();
}else{
edit.putBoolean("fullscreen", false);
edit.commit();
}
}
});
}
public void flash() {
final CheckBox fla = (CheckBox) findViewById(R.id.flash);
if (enableFlash == 1||enableFlash==2) {
fla.setChecked(true);
} else {
fla.setChecked(false);
}
fla.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean isChecked) {
// TODO Auto-generated method stub
if (isChecked) {
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int which) {
switch (which) {
case DialogInterface.BUTTON_POSITIVE: {
edit.putInt("enableflash", 1);
edit.commit();
break;
}
case DialogInterface.BUTTON_NEGATIVE: {
edit.putInt("enableflash", 2);
edit.commit();
break;
}
default:
fla.setChecked(false);
edit.putInt("enableflash", 0);
break;
}
}
};
AlertDialog.Builder builder = new AlertDialog.Builder(
Settings.this); // dialog
builder.setMessage(
"How do you want Flash enabled?")
.setPositiveButton("Load on-demand",
dialogClickListener)
.setNegativeButton("Always load",
dialogClickListener).show();
builder.setOnCancelListener(new OnCancelListener(){
@Override
public void onCancel(DialogInterface arg0) {
// TODO Auto-generated method stub
edit.putInt("enableflash", 0);
edit.commit();
fla.setChecked(false);
}
});
} else {
edit.putInt("enableflash", 0);
edit.commit();
}
}
});
}
public void location() {
CheckBox loc = (CheckBox) findViewById(R.id.location);
if (allowLocation == true) {
loc.setChecked(true);
} else {
loc.setChecked(false);
}
loc.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean isChecked) {
// TODO Auto-generated method stub
if (isChecked) {
edit.putBoolean("location", true);
edit.commit();
} else {
edit.putBoolean("location", false);
edit.commit();
}
}
});
}
public void userAgent() {
}
public void getText() {
agent.setOnKeyListener(new OnKeyListener(){
@Override
public boolean onKey(View arg0, int arg1, KeyEvent arg2) {
// TODO Auto-generated method stub
switch(arg1){
case KeyEvent.KEYCODE_ENTER:
userAgent = agent.getText().toString();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(agent.getWindowToken(), 0);
edit.putString("agent", userAgent);
edit.commit();
return true;
default: break;
}
return false;
}
});
agent.setOnEditorActionListener(new OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
// TODO Auto-generated method stub
if (actionId == EditorInfo.IME_ACTION_GO
|| actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_ACTION_NEXT
|| actionId == EditorInfo.IME_ACTION_SEND||actionId==EditorInfo.IME_ACTION_SEARCH||event.getAction()==KeyEvent.KEYCODE_ENTER) {
userAgent = agent.getText().toString();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(agent.getWindowToken(), 0);
edit.putString("agent", userAgent);
edit.commit();
return true;
}
return false;
}
});
}
public void passwords() {
CheckBox pass = (CheckBox) findViewById(R.id.password);
if (savePasswords == true) {
pass.setChecked(true);
} else {
pass.setChecked(false);
}
pass.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean isChecked) {
// TODO Auto-generated method stub
if (isChecked) {
edit.putBoolean("passwords", true);
edit.commit();
} else {
edit.putBoolean("passwords", false);
edit.commit();
}
}
});
}
public void clearHistory() {
CheckBox clearHist = (CheckBox) findViewById(R.id.historyClear);
if (deleteHistory == true) {
clearHist.setChecked(true);
} else {
clearHist.setChecked(false);
}
clearHist.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton arg0, boolean isChecked) {
// TODO Auto-generated method stub
if (isChecked) {
edit.putBoolean("history", true);
edit.commit();
} else {
edit.putBoolean("history", false);
edit.commit();
}
}
});
}
public void emailMe() {
Button mailMe = (Button) findViewById(R.id.email);
mailMe.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("plain/text");
intent.putExtra(Intent.EXTRA_EMAIL,
new String[] { "anthonyrestaino11@gmail.com" });
intent.putExtra(Intent.EXTRA_SUBJECT, "Lightning Browser");
startActivity(Intent.createChooser(intent, ""));
}
});
}
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
if (agentPicker == 3) {
userAgent = agent.getText().toString();
edit.putString("agent", userAgent);
edit.commit();
}
String home = h.getText().toString();
if(!h.getText().toString().contains("about:blank")&&!h.getText().toString().contains("about:home")){
if(h.getText().toString().contains("http://")==false){
home = "http://"+h.getText().toString();
}}
edit.putString("home", home);
edit.commit();
super.onBackPressed();
}
}
Loading…
Cancel
Save