Browse Source

updated to 2.3.0

- new full-screen UI
- tweaked icon
- Animations
- better rendering
- better performance in full-screen
- lower battery consumption
- Chinese traditional language added
- Chinese simplified language added
- French Language added
- fixed errors in settings
- fixed errors with bookmarks
- added auto-complete when searching using browser history
- now uses the standard android history
- UI tweaks
- NOTE: you cannot have bookmarks as your homescreen in fullscreen
master
Anthony Restaino 12 years ago
parent
commit
0510d02988
  1. 12
      AndroidManifest.xml
  2. BIN
      ic_launcher-web.png
  3. BIN
      ic_launcher.png
  4. 8
      res/anim/slide_down.xml
  5. 9
      res/anim/slide_up.xml
  6. BIN
      res/drawable-hdpi/ic_launcher.png
  7. BIN
      res/drawable-mdpi/ic_launcher.png
  8. BIN
      res/drawable-xhdpi/bar.9.png
  9. BIN
      res/drawable-xhdpi/bg_inactive.9.png
  10. BIN
      res/drawable-xhdpi/bg_press.9.png
  11. BIN
      res/drawable-xhdpi/ic_launcher.png
  12. 34
      res/layout/activity_main.xml
  13. 12
      res/layout/settings.xml
  14. 29
      res/layout/two_line_autocomplete.xml
  15. 11
      res/menu-fr/menu.xml
  16. 11
      res/menu-it/menu.xml
  17. 12
      res/menu-zh-rCN/menu.xml
  18. 12
      res/menu-zh-rTW/menu.xml
  19. 2
      res/values-es/strings.xml
  20. 20
      res/values-fr/strings.xml
  21. 21
      res/values-it/strings.xml
  22. 21
      res/values-zh-rCN/strings.xml
  23. 21
      res/values-zh-rTW/strings.xml
  24. 13
      res/values/strings.xml
  25. 1242
      src/acr/browser/barebones/Barebones.java
  26. 25
      src/acr/browser/barebones/Bookmarks.java
  27. 91
      src/acr/browser/barebones/Settings.java

12
AndroidManifest.xml

@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="acr.browser.barebones" package="acr.browser.barebones"
android:versionCode="22" android:versionCode="23"
android:versionName="2.2.0" > android:versionName="2.3.0" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"
android:targetSdkVersion="18" /> android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>
<uses-permission android:name="com.android.browser.permission.WRITE_HISTORY_BOOKMARKS"/>
<application <application
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
@ -22,7 +22,7 @@
android:name="acr.browser.barebones.Barebones" android:name="acr.browser.barebones.Barebones"
android:label="@string/app_name" android:label="@string/app_name"
android:configChanges="orientation|screenSize|keyboardHidden" android:configChanges="orientation|screenSize|keyboardHidden"
android:hardwareAccelerated="true"> >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />

BIN
ic_launcher-web.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

BIN
ic_launcher.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

8
res/anim/slide_down.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate android:fromYDelta="-50%p"
android:interpolator="@android:anim/linear_interpolator"
android:toYDelta="0%p" android:duration="500" />
</set>

9
res/anim/slide_up.xml

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate android:fromYDelta="0%p"
android:toYDelta="-50%p"
android:interpolator="@android:anim/linear_interpolator"
android:duration="500" />
</set>

BIN
res/drawable-hdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
res/drawable-mdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 234 B

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 817 B

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 B

After

Width:  |  Height:  |  Size: 710 B

BIN
res/drawable-xhdpi/ic_launcher.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

34
res/layout/activity_main.xml

@ -1,23 +1,22 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".MainActivity" > tools:context=".MainActivity" >
<ScrollView
android:id="@+id/backgroundScroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none" >
<RelativeLayout <RelativeLayout
android:id="@+id/background" android:id="@+id/urlBar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" > android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
>
<HorizontalScrollView <HorizontalScrollView
android:id="@+id/tabScroll" android:id="@+id/tabScroll"
android:layout_width="fill_parent" android:layout_width="match_parent"
android:layout_height="32dp" android:layout_height="32dp"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
@ -111,7 +110,7 @@
android:paddingTop="10dp" android:paddingTop="10dp"
android:src="@drawable/refresh" /> android:src="@drawable/refresh" />
</RelativeLayout> </RelativeLayout>
<EditText <MultiAutoCompleteTextView
android:id="@+id/enterUrl" android:id="@+id/enterUrl"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -125,18 +124,13 @@
android:singleLine="true" /> android:singleLine="true" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout </RelativeLayout>
android:id="@+id/holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/relativeLayout1">
<FrameLayout <FrameLayout
android:id="@+id/webFrame" android:id="@+id/holder"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@+id/relativeLayout1"> android:layout_below="@+id/urlBar" >
</FrameLayout> </FrameLayout>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
</RelativeLayout> </RelativeLayout>

12
res/layout/settings.xml

@ -155,18 +155,6 @@
android:inputType="textUri" android:inputType="textUri"
android:paddingRight="10dp" /> 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 <CheckBox
android:id="@+id/fullScreen" android:id="@+id/fullScreen"
android:layout_width="match_parent" android:layout_width="match_parent"

29
res/layout/two_line_autocomplete.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/button"
android:clickable="false"
>
<TextView
android:id="@+id/title"
android:clickable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#000000"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingLeft="6dip"
android:paddingTop="10dip"/>
<TextView
android:id="@+id/url"
android:clickable="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="@color/dark"
android:paddingLeft="6dip"
android:paddingTop="5dip"
android:paddingBottom="10dip"/>
</LinearLayout>

11
res/menu-fr/menu.xml

@ -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:title="Actualiser" android:titleCondensed="Actualiser" android:orderInCategory="1"></item>
<item android:id="@+id/bookmark" android:title="Ajouter aux favoris" android:titleCondensed="Aj. Favoris" android:orderInCategory="2"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="Favoris" android:title="Favoris" android:orderInCategory="3"></item>
<item android:id="@+id/share" android:title="Partager..." android:titleCondensed="Partager" android:orderInCategory="4"></item>
<item android:id="@+id/settings" android:title="Paramètres" android:titleCondensed="Paramètres" android:orderInCategory="6"></item>
<item android:id="@+id/forward" android:title="Suivant" android:orderInCategory="5" android:titleCondensed="Suivant"></item>
</menu>

11
res/menu-it/menu.xml

@ -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:title="Rinfrescare" android:titleCondensed="Rinfrescare" android:orderInCategory="1"></item>
<item android:id="@+id/bookmark" android:title="Aggiungi ai preferiti" android:titleCondensed="Aggiungi ai preferiti" android:orderInCategory="2"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="Segnalibri" android:title="Segnalibri" android:orderInCategory="3"></item>
<item android:id="@+id/share" android:title="Azione" android:titleCondensed="Azione" android:orderInCategory="4"></item>
<item android:id="@+id/settings" android:title="Impostazioni" android:titleCondensed="Impostazioni" android:orderInCategory="6"></item>
<item android:id="@+id/forward" android:title="Avanti" android:orderInCategory="5" android:titleCondensed="Avanti"></item>
</menu>

12
res/menu-zh-rCN/menu.xml

@ -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:titleCondensed="刷新页面" android:title="刷新" android:orderInCategory="1"></item>
<item android:id="@+id/bookmark" android:titleCondensed="添加书签" android:title="添加书签" android:orderInCategory="2"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="书签列表" android:title="书签" android:orderInCategory="3"></item>
<item android:id="@+id/share" android:titleCondensed="分享页面" android:title="分享" android:orderInCategory="4"></item>
<item android:id="@+id/settings" android:titleCondensed="应用设置" android:title="设置" android:orderInCategory="6"></item>
<item android:id="@+id/tabs" android:titleCondensed="显示以及隐藏标签" android:title="显示/隐藏标签" android:orderInCategory="5"></item>
<item android:id="@+id/forward" android:titleCondensed="前进页面" android:title="前进" android:orderInCategory="7"></item>
</menu>

12
res/menu-zh-rTW/menu.xml

@ -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:titleCondensed="刷新頁面" android:title="刷新" android:orderInCategory="1"></item>
<item android:id="@+id/bookmark" android:titleCondensed="添加書簽" android:title="添加書簽" android:orderInCategory="2"></item>
<item android:id="@+id/allBookmarks" android:titleCondensed="書簽列表" android:title="書簽" android:orderInCategory="3"></item>
<item android:id="@+id/share" android:titleCondensed="分享頁面" android:title="分享" android:orderInCategory="4"></item>
<item android:id="@+id/settings" android:titleCondensed="應用設置" android:title="設置" android:orderInCategory="6"></item>
<item android:id="@+id/tabs" android:titleCondensed="顯示以及隱藏標簽" android:title="顯示/隱藏標簽" android:orderInCategory="5"></item>
<item android:id="@+id/forward" android:titleCondensed="前進頁面" android:title="前進" android:orderInCategory="7"></item>
</menu>

2
res/values-es/strings.xml

@ -6,7 +6,7 @@
<string name="location">Permitir a webs acceder a tu ubicacion</string> <string name="location">Permitir a webs acceder a tu ubicacion</string>
<string name="password">Guardar contrasenas</string> <string name="password">Guardar contrasenas</string>
<string name="agent">Agente de usuario</string> <string name="agent">Agente de usuario</string>
<string name="history">Borrar historial al salir (Auto-borrado de cache)</string> <string name="history">Borrar historial al salir</string>
<string name="email">Enviame un Email</string> <string name="email">Enviame un Email</string>
<string name="flash">Habilitar Adobe Flash (por demanda)</string> <string name="flash">Habilitar Adobe Flash (por demanda)</string>
<string name="mobile">Ver como movil</string> <string name="mobile">Ver como movil</string>

20
res/values-fr/strings.xml

@ -0,0 +1,20 @@
<resources>
<string name="app_name">Lightning</string>
<string name="google">Google</string>
<string name="settings">Paramètres</string>
<string name="location">Autoriser les sites à accéder à ma position</string>
<string name="password">Enregistrer les mots de passe</string>
<string name="agent">User Agent</string>
<string name="history">Effacer l\'historique à la sortie</string>
<string name="email">Contactez moi</string>
<string name="flash">Activer Adobe Flash Player (s\'il est installé)</string>
<string name="mobile">Voir la version Mobile</string>
<string name="desk">Voir la version Ordinateur</string>
<string name="custom">Utiliser un User Agent personnalisé</string>
<string name="home">Au démarrage</string>
<string name="settingshelp">Les paramètres ne s\'appliquerons qu\'au nouveaux onglets</string>
<string name="fullscreen">Activer le mode plein écran</string>
<string name="java">Activer JavaScript</string>
</resources>

21
res/values-it/strings.xml

@ -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">Impostazioni del browser</string>
<string name="location">Consenti ai siti di accedere alla tua posizione</string>
<string name="password">Salva le tue password</string>
<string name="agent">User Agent</string>
<string name="history">Clear history on exit</string>
<string name="email">Email me</string>
<string name="flash">Abilita Adobe Flash</string>
<string name="mobile">Visualizza come mobile</string>
<string name="desk">Visualizza come desktop</string>
<string name="custom">Visualizza come agente utente personalizzata</string>
<string name="home">Homepage</string>
<string name="settingshelp">Impostazioni valgono solo per le nuove schede</string>
<string name="fullscreen">Enable fullscreen mode</string>
<string name="java">Enable JavaScript</string>
</resources>

21
res/values-zh-rCN/strings.xml

@ -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">浏览器设置</string>
<string name="location">允许站点访问您地理位置</string>
<string name="password">保存密码</string>
<string name="agent">User Agent</string>
<string name="history">退出时清空历史记录(缓存将被自动清理)</string>
<string name="email">邮件开发者</string>
<string name="flash">启用 Adobe Flash(若已安装)</string>
<string name="mobile">作为移动设备访问</string>
<string name="desk">作为桌面设备访问</string>
<string name="custom">自定义 User Agent</string>
<string name="home">首页</string>
<string name="settingshelp">设置仅将应用于新标签页</string>
<string name="fullscreen">启用全屏模式</string>
<string name="java">启用 JavaScript</string>
</resources>

21
res/values-zh-rTW/strings.xml

@ -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">浏覽器設置</string>
<string name="location">允許站點訪問您地理位置</string>
<string name="password">保存密碼</string>
<string name="agent">User Agent</string>
<string name="history">退出時清空曆史記錄(緩存將被自動清理)</string>
<string name="email">郵件開發者</string>
<string name="flash">啓用 Adobe Flash(若已安裝)</string>
<string name="mobile">作爲移動設備訪問</string>
<string name="desk">作爲桌面設備訪問</string>
<string name="custom">自定義 User Agent</string>
<string name="home">首頁</string>
<string name="settingshelp">設置僅將應用于新標簽頁</string>
<string name="fullscreen">啓用全屏模式</string>
<string name="java">啓用 JavaScript</string>
</resources>

13
res/values/strings.xml

@ -7,6 +7,7 @@
<string name="location">Autoriser les sites à accéder à ma position</string> <string name="location">Autoriser les sites à accéder à ma position</string>
<string name="password">Enregistrer les mots de passe</string> <string name="password">Enregistrer les mots de passe</string>
<string name="agent">User Agent</string> <string name="agent">User Agent</string>
<<<<<<< HEAD
<string name="history">Effacer l\'historique à la sortie (le cache sera vidé)</string> <string name="history">Effacer l\'historique à la sortie (le cache sera vidé)</string>
<string name="email">Contactez moi</string> <string name="email">Contactez moi</string>
<string name="flash">Activer Adobe Flash Player (s\'il est installé)</string> <string name="flash">Activer Adobe Flash Player (s\'il est installé)</string>
@ -17,5 +18,17 @@
<string name="settingshelp">Les paramètres ne s\'appliquerons qu\'au nouveaux onglets</string> <string name="settingshelp">Les paramètres ne s\'appliquerons qu\'au nouveaux onglets</string>
<string name="fullscreen">Activer le mode plein écran</string> <string name="fullscreen">Activer le mode plein écran</string>
<string name="java">Activer JavaScript</string> <string name="java">Activer JavaScript</string>
=======
<string name="history">Clear history on exit</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>
>>>>>>> 2.3.0 changes added see below
</resources> </resources>

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

File diff suppressed because it is too large Load Diff

25
src/acr/browser/barebones/Bookmarks.java

@ -0,0 +1,25 @@
package acr.browser.barebones;
import android.app.Activity;
import android.database.Cursor;
import android.provider.Browser;
import android.util.Log;
public class Bookmarks extends Activity{
public void GetBookmarks(){
String[] projection = new String[] {
Browser.BookmarkColumns.TITLE
, Browser.BookmarkColumns.URL
};
Cursor mCur = getContentResolver().query(android.provider.Browser.BOOKMARKS_URI, projection, null, null, null);
mCur.moveToFirst();
int titleIdx = mCur.getColumnIndex(Browser.BookmarkColumns.TITLE);
int urlIdx = mCur.getColumnIndex(Browser.BookmarkColumns.URL);
String[] android = (Browser.HISTORY_PROJECTION);
while (mCur.isAfterLast() == false) {
Log.i("Title", mCur.getString(titleIdx));
Log.i("Title",mCur.getString(urlIdx));
mCur.moveToNext();
}
}
}

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

@ -5,7 +5,6 @@ import android.app.AlertDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener; import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import android.view.KeyEvent; import android.view.KeyEvent;
@ -16,27 +15,24 @@ import android.view.View.OnKeyListener;
import android.view.inputmethod.EditorInfo; import android.view.inputmethod.EditorInfo;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView; import android.webkit.WebView;
import android.widget.Button;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.CompoundButton; import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.RadioButton; import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener; import android.widget.TextView.OnEditorActionListener;
public class Settings extends Activity { public class Settings extends Activity {
public static final String preferences = "settings"; public static final String preferences = "settings";
boolean allowLocation, deleteHistory; static boolean allowLocation, deleteHistory;
int enableFlash; static int enableFlash;
boolean savePasswords, fullScreen,java; static boolean savePasswords, fullScreen,java;
String userAgent, homepage; static String userAgent, homepage;
EditText agent,h; static EditText agent,h;
SharedPreferences.Editor edit; static SharedPreferences.Editor edit;
int agentPicker; static int agentPicker;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@ -66,26 +62,67 @@ public class Settings extends Activity {
agent.setText(userAgent); agent.setText(userAgent);
edit = settings.edit(); edit = settings.edit();
RadioButton m = (RadioButton) findViewById(R.id.radioMobile); final RadioButton m = (RadioButton) findViewById(R.id.radioMobile);
RadioButton d = (RadioButton) findViewById(R.id.radioDesktop); final RadioButton d = (RadioButton) findViewById(R.id.radioDesktop);
RadioButton c = (RadioButton) findViewById(R.id.radioCustom); final RadioButton c = (RadioButton) findViewById(R.id.radioCustom);
m.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
d.setChecked(false);
c.setChecked(false);
edit.putInt("agentchoose", 1);
edit.commit();
}
});
d.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
m.setChecked(false);
c.setChecked(false);
edit.putInt("agentchoose", 2);
edit.commit();
}
});
c.setOnClickListener(new OnClickListener(){
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
m.setChecked(false);
d.setChecked(false);
edit.putInt("agentchoose", 3);
edit.commit();
}
});
switch (agentPicker) { switch (agentPicker) {
case 1: case 1:
m.setChecked(true); m.setChecked(true);
d.setChecked(false);
c.setChecked(false);
break; break;
case 2: case 2:
m.setChecked(false);
d.setChecked(true); d.setChecked(true);
c.setChecked(false);
break; break;
case 3: case 3:
m.setChecked(false);
d.setChecked(false);
c.setChecked(true); c.setChecked(true);
break; break;
} }
back(); back();
location(); location();
userAgent();
passwords(); passwords();
clearHistory(); clearHistory();
emailMe();
getText(); getText();
flash(); flash();
getHome(); getHome();
@ -160,18 +197,21 @@ public class Settings extends Activity {
if (checked) { if (checked) {
edit.putInt("agentchoose", 1); edit.putInt("agentchoose", 1);
edit.commit(); edit.commit();
} }
break; break;
case (R.id.radioDesktop): case (R.id.radioDesktop):
if (checked) { if (checked) {
edit.putInt("agentchoose", 2); edit.putInt("agentchoose", 2);
edit.commit(); edit.commit();
} }
break; break;
case (R.id.radioCustom): case (R.id.radioCustom):
if (checked) { if (checked) {
edit.putInt("agentchoose", 3); edit.putInt("agentchoose", 3);
edit.commit(); edit.commit();
} }
break; break;
} }
@ -341,8 +381,6 @@ public void full(){
}); });
} }
public void userAgent() {
}
public void getText() { public void getText() {
agent.setOnKeyListener(new OnKeyListener(){ agent.setOnKeyListener(new OnKeyListener(){
@ -435,23 +473,6 @@ public void full(){
}); });
} }
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 @Override
public void onBackPressed() { public void onBackPressed() {

Loading…
Cancel
Save