Browse Source

Merge pull request #83 from DF1E/master

clean code
master
Anthony Restaino 11 years ago
parent
commit
3647f0b424
  1. BIN
      res/drawable-hdpi/action_search.png
  2. BIN
      res/drawable-mdpi/action_search.png
  3. BIN
      res/drawable-xhdpi/action_search.png
  4. BIN
      res/drawable-xhdpi/edit_text_bg.9.png
  5. 5
      res/layout-large/activity_main.xml
  6. 5
      res/layout-xlarge/activity_main.xml
  7. 5
      res/layout/activity_main.xml
  8. 12
      res/layout/advanced_settings.xml
  9. 4
      res/values-de/strings.xml
  10. 8
      res/values-sw600dp/dimens.xml
  11. 9
      res/values-sw720dp-land/dimens.xml
  12. 6
      res/values/colors.xml
  13. 55
      src/acr/browser/lightning/BrowserActivity.java
  14. 43
      src/acr/browser/lightning/IncognitoActivity.java
  15. 8
      src/acr/browser/lightning/Utils.java

BIN
res/drawable-hdpi/action_search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

BIN
res/drawable-mdpi/action_search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/drawable-xhdpi/action_search.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 B

5
res/layout-large/activity_main.xml

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_medium"
android:orientation="vertical" >
<LinearLayout
@ -58,7 +57,7 @@ @@ -58,7 +57,7 @@
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#e4e4e4"
android:background="@color/drawer_background"
android:clickable="true"
android:orientation="vertical" >
@ -161,7 +160,7 @@ @@ -161,7 +160,7 @@
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="#e4e4e4"
android:background="@color/drawer_background"
android:clickable="true"
android:orientation="vertical" >

5
res/layout-xlarge/activity_main.xml

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_medium"
android:orientation="vertical" >
<LinearLayout
@ -58,7 +57,7 @@ @@ -58,7 +57,7 @@
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#e4e4e4"
android:background="@color/drawer_background"
android:clickable="true"
android:orientation="vertical" >
@ -161,7 +160,7 @@ @@ -161,7 +160,7 @@
android:layout_width="300dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="#e4e4e4"
android:background="@color/drawer_background"
android:clickable="true"
android:orientation="vertical" >

5
res/layout/activity_main.xml

@ -5,7 +5,6 @@ @@ -5,7 +5,6 @@
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray_medium"
android:orientation="vertical" >
<LinearLayout
@ -58,7 +57,7 @@ @@ -58,7 +57,7 @@
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:background="#e4e4e4"
android:background="@color/drawer_background"
android:clickable="true"
android:orientation="vertical" >
@ -161,7 +160,7 @@ @@ -161,7 +160,7 @@
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="end"
android:background="#e4e4e4"
android:background="@color/drawer_background"
android:clickable="true"
android:orientation="vertical" >

12
res/layout/advanced_settings.xml

@ -1,10 +1,5 @@ @@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
@ -151,9 +146,9 @@ @@ -151,9 +146,9 @@
android:id="@+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:text="@string/reflow"
android:layout_centerVertical="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<CheckBox
@ -656,6 +651,5 @@ @@ -656,6 +651,5 @@
android:textAppearance="?android:attr/textAppearanceMedium" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
</ScrollView>

4
res/values-de/strings.xml

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
<string name="app_name">Lightning</string>
<string name="drawer_open">Navigation-Drawer öffnen</string>
<string name="drawer_close">Navigation-Drawer schliessen</string>
<string name="drawer_close">Navigation-Drawer schließen</string>
<string name="action_websearch">Websuche</string>
<string name="action_refresh">Aktualisieren</string>
<string name="action_new_tab">Neuer Tab</string>
@ -145,7 +145,7 @@ @@ -145,7 +145,7 @@
<string name="licenses">Open Source-Lizenzen</string>
<string name="suggestion">Suche nach</string>
<string name="block_ads">Werbung blockieren</string>
<string name="message_untrusted_certificate">Das Zertifikat dieser Webseite ist nicht vertrauenswürdig. Trozdem fortsetzen?</string>
<string name="message_untrusted_certificate">Das Zertifikat dieser Webseite ist nicht vertrauenswürdig. Trotzdem fortsetzen?</string>
<string name="title_form_resubmission">Formularneuzustellung</string>
<string name="message_form_resubmission">Daten erneut senden?</string>
<string name="message_location">\nMeine Position verwenden?</string>

8
res/values-sw600dp/dimens.xml

@ -1,8 +0,0 @@ @@ -1,8 +0,0 @@
<resources>
<!--
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw600dp devices (e.g. 7" tablets) here.
-->
</resources>

9
res/values-sw720dp-land/dimens.xml

@ -1,9 +0,0 @@ @@ -1,9 +0,0 @@
<resources>
<!--
Customize dimensions originally defined in res/values/dimens.xml (such as
screen margins) for sw720dp devices (e.g. 10" tablets) in landscape here.
-->
<dimen name="activity_horizontal_margin">128dp</dimen>
</resources>

6
res/values/colors.xml

@ -1,10 +1,8 @@ @@ -1,10 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="clear">#00000000</color>
<color name="blue">#b433b5e5</color>
<color name="press">#3333b5e5</color>
<color name="drawer_background">#e4e4e4</color>
<color name="black">#ff000000</color>
<color name="dark">#ff3f3f3f</color>
<color name="light">#ffa0a0a0</color>
<color name="gray_dark">#222222</color>
<color name="gray_light">#dddddd</color>

55
src/acr/browser/lightning/BrowserActivity.java

@ -422,12 +422,6 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -422,12 +422,6 @@ public class BrowserActivity extends Activity implements BrowserController {
}
}
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
}
};
mNewTab.setOnClickListener(new OnClickListener() {
@ -456,18 +450,15 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -456,18 +450,15 @@ public class BrowserActivity extends Activity implements BrowserController {
else
checkForTor();
}
/*
* If Orbot/Tor is installed, prompt the user if they want to enable proxying for this session
*/
public boolean checkForTor ()
{
public boolean checkForTor () {
OrbotHelper oh = new OrbotHelper(this);
if (oh.isOrbotInstalled())
{
if (oh.isOrbotInstalled()) {
DialogInterface.OnClickListener dialogClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
@ -501,8 +492,7 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -501,8 +492,7 @@ public class BrowserActivity extends Activity implements BrowserController {
/*
* Initialize WebKit Proxying for Tor
*/
public void initializeTor ()
{
public void initializeTor() {
OrbotHelper oh = new OrbotHelper(this);
if (!oh.isOrbotRunning())
@ -539,7 +529,7 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -539,7 +529,7 @@ public class BrowserActivity extends Activity implements BrowserController {
String mem = mPreferences.getString(PreferenceConstants.URL_MEMORY,
"");
mEditPrefs.putString(PreferenceConstants.URL_MEMORY, "");
String[] array = getArray(mem);
String[] array = Utils.getArray(mem);
int count = 0;
for (int n = 0; n < array.length; n++) {
if (array[n].length() > 0) {
@ -558,10 +548,6 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -558,10 +548,6 @@ public class BrowserActivity extends Activity implements BrowserController {
}
public static String[] getArray(String input) {
return input.split("\\|\\$\\|SEPARATOR\\|\\$\\|");
}
public void initializePreferences() {
if (mPreferences == null) {
mPreferences = getSharedPreferences(
@ -640,15 +626,6 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -640,15 +626,6 @@ public class BrowserActivity extends Activity implements BrowserController {
return super.onCreateOptionsMenu(menu);
}
/* Called whenever we call invalidateOptionsMenu() */
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// If the nav drawer is open, hide action items related to the content
// view
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// The action bar home/up action should open or close the drawer.
@ -1190,30 +1167,6 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -1190,30 +1167,6 @@ public class BrowserActivity extends Activity implements BrowserController {
super.onDestroy();
}
@Override
protected void onPostResume() {
Log.i("Lightning", "onPostResume");
super.onPostResume();
}
@Override
protected void onRestart() {
Log.i("Lightning", "onRestart");
super.onRestart();
}
@Override
protected void onStart() {
Log.i("Lightning", "onStart");
super.onStart();
}
@Override
protected void onStop() {
Log.i("Lightning", "onStop");
super.onStop();
}
@Override
protected void onResume() {
super.onResume();

43
src/acr/browser/lightning/IncognitoActivity.java

@ -417,12 +417,6 @@ public class IncognitoActivity extends Activity implements BrowserController { @@ -417,12 +417,6 @@ public class IncognitoActivity extends Activity implements BrowserController {
}
}
@Override
public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset);
}
};
mNewTab.setOnClickListener(new OnClickListener() {
@ -454,10 +448,6 @@ public class IncognitoActivity extends Activity implements BrowserController { @@ -454,10 +448,6 @@ public class IncognitoActivity extends Activity implements BrowserController {
}
public static String[] getArray(String input) {
return input.split("\\|\\$\\|SEPARATOR\\|\\$\\|");
}
public void initializePreferences() {
if (mPreferences == null) {
mPreferences = getSharedPreferences(
@ -536,15 +526,6 @@ public class IncognitoActivity extends Activity implements BrowserController { @@ -536,15 +526,6 @@ public class IncognitoActivity extends Activity implements BrowserController {
return super.onCreateOptionsMenu(menu);
}
/* Called whenever we call invalidateOptionsMenu() */
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// If the nav drawer is open, hide action items related to the content
// view
return super.onPrepareOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// The action bar home/up action should open or close the drawer.
@ -1071,30 +1052,6 @@ public class IncognitoActivity extends Activity implements BrowserController { @@ -1071,30 +1052,6 @@ public class IncognitoActivity extends Activity implements BrowserController {
super.onDestroy();
}
@Override
protected void onPostResume() {
Log.i("Lightning", "onPostResume");
super.onPostResume();
}
@Override
protected void onRestart() {
Log.i("Lightning", "onRestart");
super.onRestart();
}
@Override
protected void onStart() {
Log.i("Lightning", "onStart");
super.onStart();
}
@Override
protected void onStop() {
Log.i("Lightning", "onStop");
super.onStop();
}
@Override
protected void onResume() {
super.onResume();

8
src/acr/browser/lightning/Utils.java

@ -26,10 +26,6 @@ import android.widget.Toast; @@ -26,10 +26,6 @@ import android.widget.Toast;
public class Utils {
public Utils() {
// TODO Auto-generated constructor stub
}
public static void downloadFile(final Activity activity, final String url, final String userAgent, final String contentDisposition, final boolean privateBrowsing){
String fileName = URLUtil.guessFileName(url, null,
null);
@ -146,4 +142,8 @@ public class Utils { @@ -146,4 +142,8 @@ public class Utils {
}
return bookmarks;
}
public static String[] getArray(String input) {
return input.split("\\|\\$\\|SEPARATOR\\|\\$\\|");
}
}

Loading…
Cancel
Save