Browse Source

Merge branch 'dev' of github.com:anthonycr/Lightning-Browser into experimental_tabs

master
Stefano Pacifici 9 years ago
parent
commit
367f2a09d7
  1. 6
      README.md
  2. 6
      app/build.gradle
  3. 17
      app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java
  4. 2129
      app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java.orig
  5. 9
      app/src/main/java/acr/browser/lightning/bus/NavigationEvents.java
  6. 1
      app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java
  7. 4
      app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java
  8. 19
      app/src/main/res/layout/tab_drawer.xml
  9. 32
      app/src/main/res/values-de/strings.xml

6
README.md

@ -50,12 +50,14 @@
* Please add translations/translation fixes as you see need * Please add translations/translation fixes as you see need
####Contributing ####Contributing
* [The Trello Board](https://trello.com/b/Gwjx8MC3/lightning-browser)
* Contributions are always welcome * Contributions are always welcome
* If you want a feature and can code, feel free to fork and add the change yourself and make a pull request * If you want a feature and can code, feel free to fork and add the change yourself and make a pull request
* PLEASE use the ````dev```` branch when contributing as the ````master```` branch is supposed to be for stable builds. I will not reject your pull request if you make it on master, but it will annoy me and make my life harder. * PLEASE use the ````dev```` branch when contributing as the ````master```` branch is supposed to be for stable builds. I will not reject your pull request if you make it on master, but it will annoy me and make my life harder.
* Code Style * Code Style
* Standard Java camel case * Hungarian Notation
* Member variables are preceded with an 'm' * Prefix member variables with 'm'
* Prefix static member variables with 's'
* Use 4 spaces instead of a tab (\t) * Use 4 spaces instead of a tab (\t)
####Setting Up the Project ####Setting Up the Project

6
app/build.gradle

@ -7,7 +7,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 14 minSdkVersion 14
targetSdkVersion 23 targetSdkVersion 23
versionName "4.2.3a" versionName "4.2.3.1"
} }
sourceSets { sourceSets {
lightningPlus.setRoot('src/LightningPlus') lightningPlus.setRoot('src/LightningPlus')
@ -30,12 +30,12 @@ android {
lightningPlus { lightningPlus {
buildConfigField "boolean", "FULL_VERSION", "true" buildConfigField "boolean", "FULL_VERSION", "true"
applicationId "acr.browser.lightning" applicationId "acr.browser.lightning"
versionCode 84 versionCode 85
} }
lightningLite { lightningLite {
buildConfigField "boolean", "FULL_VERSION", "false" buildConfigField "boolean", "FULL_VERSION", "false"
applicationId "acr.browser.barebones" applicationId "acr.browser.barebones"
versionCode 85 versionCode 86
} }
} }
lintOptions { lintOptions {

17
app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java

@ -890,8 +890,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
// new Handler().postDelayed(new Runnable() { // new Handler().postDelayed(new Runnable() {
// @Override // @Override
// public void run() { // public void run() {
// Remove browser frame background to reduce overdraw // Remove browser frame background to reduce overdraw
//TODO evaluate performance //TODO evaluate performance
// mBrowserFrame.setBackgroundColor(Color.TRANSPARENT); // mBrowserFrame.setBackgroundColor(Color.TRANSPARENT);
// } // }
// }, 300); // }, 300);
@ -950,8 +950,8 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
if (level > TRIM_MEMORY_MODERATE && Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { if (level > TRIM_MEMORY_MODERATE && Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
Log.d(Constants.TAG, "Low Memory, Free Memory"); Log.d(Constants.TAG, "Low Memory, Free Memory");
tabsManager.freeMemory(); tabsManager.freeMemory();
}
} }
}
synchronized boolean newTab(String url, boolean show) { synchronized boolean newTab(String url, boolean show) {
// Limit number of tabs for limited version of app // Limit number of tabs for limited version of app
@ -1755,9 +1755,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
show.setInterpolator(new DecelerateInterpolator()); show.setInterpolator(new DecelerateInterpolator());
if (view != null) { if (view != null) {
view.startAnimation(show); view.startAnimation(show);
}
} }
} }
}
} }
/** /**
@ -2082,6 +2082,15 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements
} }
} }
@Subscribe
public void goHome(final NavigationEvents.GoHome event) {
final LightningView currentTab = tabsManager.getCurrentTab();
if (currentTab != null) {
currentTab.loadHomepage();
closeDrawers();
}
}
/** /**
* The user long pressed the new tab button * The user long pressed the new tab button
* *

2129
app/src/main/java/acr/browser/lightning/activity/BrowserActivity.java.orig

File diff suppressed because it is too large Load Diff

9
app/src/main/java/acr/browser/lightning/bus/NavigationEvents.java

@ -19,9 +19,16 @@ public class NavigationEvents {
} }
/** /**
* Fired by {@link acr.browser.lightning.fragment.TabsFragment} when teh user presses forward * Fired by {@link acr.browser.lightning.fragment.TabsFragment} when the user presses forward
* button. * button.
*/ */
public static class GoForward { public static class GoForward {
} }
/**
* Fired by {@link acr.browser.lightning.fragment.TabsFragment} when the user presses the home
* button.
*/
public static class GoHome {
}
} }

1
app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java

@ -138,7 +138,6 @@ public class GeneralSettingsFragment extends LightningPreferenceFragment impleme
boolean imagesBool = mPreferenceManager.getBlockImagesEnabled(); boolean imagesBool = mPreferenceManager.getBlockImagesEnabled();
boolean enableJSBool = mPreferenceManager.getJavaScriptEnabled(); boolean enableJSBool = mPreferenceManager.getJavaScriptEnabled();
// proxy.setEnabled(Constants.FULL_VERSION);
cbAds.setEnabled(Constants.FULL_VERSION); cbAds.setEnabled(Constants.FULL_VERSION);
cbFlash.setEnabled(API < 19); cbFlash.setEnabled(API < 19);

4
app/src/main/java/acr/browser/lightning/fragment/TabsFragment.java

@ -117,7 +117,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
setupFrameLayoutButton(view, R.id.new_tab_button, R.id.icon_plus); setupFrameLayoutButton(view, R.id.new_tab_button, R.id.icon_plus);
setupFrameLayoutButton(view, R.id.action_back, R.id.icon_back); setupFrameLayoutButton(view, R.id.action_back, R.id.icon_back);
setupFrameLayoutButton(view, R.id.action_forward, R.id.icon_forward); setupFrameLayoutButton(view, R.id.action_forward, R.id.icon_forward);
setupFrameLayoutButton(view, R.id.action_home, R.id.icon_home);
} else { } else {
view = inflater.inflate(R.layout.tab_strip, container, false); view = inflater.inflate(R.layout.tab_strip, container, false);
layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false); layoutManager = new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false);
@ -184,6 +184,8 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
case R.id.action_forward: case R.id.action_forward:
bus.post(new NavigationEvents.GoForward()); bus.post(new NavigationEvents.GoForward());
break; break;
case R.id.action_home:
bus.post(new NavigationEvents.GoHome());
default: default:
break; break;
} }

19
app/src/main/res/layout/tab_drawer.xml

@ -56,7 +56,7 @@
android:background="?attr/dividerColor" android:background="?attr/dividerColor"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal" android:orientation="horizontal"
android:weightSum="3"> android:weightSum="4">
<FrameLayout <FrameLayout
android:id="@+id/action_back" android:id="@+id/action_back"
@ -92,6 +92,23 @@
android:src="@drawable/ic_action_plus" /> android:src="@drawable/ic_action_plus" />
</FrameLayout> </FrameLayout>
<FrameLayout
android:id="@+id/action_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?attr/actionBarItemBackground"
android:clickable="true">
<ImageView
android:id="@+id/icon_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:contentDescription="@string/action_homepage"
android:src="@drawable/ic_action_home" />
</FrameLayout>
<FrameLayout <FrameLayout
android:id="@+id/action_forward" android:id="@+id/action_forward"
android:layout_width="match_parent" android:layout_width="match_parent"

32
app/src/main/res/values-de/strings.xml

@ -183,4 +183,36 @@
<item >URL</item> <item >URL</item>
<item >Titel</item> <item >Titel</item>
</string-array> </string-array>
<string name="action_folder">Ordner</string>
<string name="action_rename">Umbenennen</string>
<string name="black_theme">Schwarzes Design (AMOLED)</string>
<string name="clear_web_storage">Webinhalte leeren</string>
<string name="clear_web_storage_exit">Webinhalte beim Beenden leeren</string>
<string name="dark_theme">Dunkles Design</string>
<string name="dialog_folder">Was möchten Sie mit diesem Ordner tun?</string>
<string name="dialog_history_long_press">Was möchten Sie mit diesem Verlaufs-Eintrag tun?</string>
<string name="folder">Ordnername</string>
<string name="invert_color">Farben invertieren</string>
<string name="light_theme">Helles Design</string>
<string name="manual_proxy">Manueller Proxy</string>
<string name="message_insecure_connection">Die Verbindung zu dieser Seite ist nicht sicher:\n%1$s\nTrotzdem fortfahren?</string>
<string name="message_web_storage_cleared">Webinhalte geleert</string>
<string name="port">Port:</string>
<string name="tabs">Tabs</string>
<string name="theme">App-Design</string>
<string name="title_rename_folder">Ordner umbenennen</string>
<string name="http_proxy">HTTP-Proxy</string>
<string name="i2p_not_running">I2P läuft nicht.</string>
<string name="i2p_tunnels_not_ready">I2P Tunnel sind noch nicht bereit.</string>
<string name="message_certificate_date_invalid">Zertifikats-Datum ungültig</string>
<string name="message_certificate_domain_mismatch">Domain in Zertifikat stimmt nicht mit aktueller Domain überein</string>
<string name="message_certificate_expired">Zertifikat abgelaufen</string>
<string name="message_certificate_invalid">Zertifikat ungültig</string>
<string name="message_certificate_not_yet_valid">Zertifikat noch nicht gültig</string>
<string name="message_certificate_untrusted">Zertifikat wird nicht vertraut</string>
<string name="problem_download">Ungültige Adresse gefunden. Kann nicht herunterladen</string>
<string name="problem_location_download">Kann nicht an den eingestellten Ort herunterladen</string>
<string name="use_i2p_prompt">Es sieht aus, als ob I2P installiert wäre. Möchten Sie es verwenden?</string>
<string name="text_encoding">Textcodierung</string>
<string name="tabs_in_drawer">Tabs in Drawer anzeigen</string>
</resources> </resources>

Loading…
Cancel
Save