Coder Social home page Coder Social logo

link-bubble's Introduction

Brave for Android (formerly Link Bubble)

##Install instructions and setup

git clone [email protected]:brave/browser-android.git

Either install the Crashlytics/Fabric Android Studio plugin or copy Application/LinkBubble/fabric.properties.template to Application/LinkBubble/fabric.properties and fill in the apiSecret.

Copy Application/LinkBubble/src/main/java/com/linkbubble/ConfigAPIs.java.template to Application/LinkBubble/src/main/java/com/linkbubble/ConfigAPIs.java and fill in the youtube apiSecret.

Copy Application/LinkBubble/src/main/AndroidManifest.xml.template to Application/LinkBubble/src/main/AndroidManifest.xml and fill in com.crashlytics.ApiKey and io.fabric.ApiKey with your Crashlytics API key. You can obtain it from logging into your Fabric account and going to: Settings -> Organizations -> Brave (or your organization) then click on API Key at the top.

npm install

##Building

Open ./Application/ in Android Studio and build. You'll need the NDK installed if you don't already have it, instructions below.

##Building release build

Copy build-release.sh.template to build-release.sh.

Modify each of these exported environment variables: LINK_BUBBLE_KEYSTORE_LOCATION, LINK_BUBBLE_KEYSTORE_PASSWORD, and LINK_BUBBLE_KEY_PASSWORD.

If you get an error about similar to:

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

Try uninstalling the application which already exists on your plugged in device.

##Installing the NDK

Android Studio has an easy way to download and link to the NDK.

In the menu navigate to File, Project Structure. Click the 'Download Android NDK' link. This should download and unzip the NDK, as well as link it inside of local.properties.

If you are not using Android Studio, reference this commit: https://github.com/brave/browser-android/commit/0fa9f58286e0679ec5772e19b995d6a508907691

##Telling getlocalization.com about new strings

  1. Periodically upload the file ./Application/LinkBubble/src/main/res/values/strings.xml to getlocalization.com. getlocalization.com will determine which strings are new
  2. When prompted on getlocalization.com, press the mark for retranslation (or keep existing) for changed strings.

##Getting new translated strings from getlocalization.com

  1. Install npm dependencies with npm install.
  2. Run npm run translate <username> <password> to pull down the translated xml files.
  3. Commit and push your change.

Remember to uncomment checkStrings from MainApplication and call it in onCreate to make sure the pulled files don't cause crashes with format specifiers.

##ADB

If you don't have adb in your path add it to your ~/.bash_profile or similar file:

export PATH=/Users/<your-username>/Library/Android/sdk/platform-tools:$PATH

  • Installing an apk onto your device:
    adb install -r ./LinkBubble/build/outputs/apk/LinkBubble-playstore-release.apk
  • Getting a list of devices: adb devices

link-bubble's People

Contributors

bbondy avatar chrislacy avatar craigmichaelmartin avatar davidyen1124 avatar gw3583 avatar kevingrandon avatar sergeyzhukovsky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

link-bubble's Issues

If the user presses the OpenInAppButton for a URL, destroy the Bubble

Note: this will only occur when "Show content when ready" is false.

If 1 Bubble exists: Close the ContentView as currently happens, but instead of animating the bubble back to its previous position, animated it down off screen beneath with the ContentView. Once it is off screen, destroy the Bubble.

If 2 or more Bubbles exist: Animate the bubbles back to their previous position, but destroy the Bubble for the current ContentView.

Adjust positioning of Consume Bubbles.

Ideally the Consume Bubbles will be at the same offset from the top of the screen as the Close Bubble is from the bottom of the screen.
height_diff

Note: Ignore the translucent status/nav bars in this screenshot.

Change animation that expands/shrinks WebView Content.

Change such that:

  • Slide the WebView up from the bottom of the screen instead of scaling out.
  • Slide the WebView up from the bottom of the screen as the bubble is animating to its destination, not after it reaches destination.

Physics for Bubbles

I think the flicking from side to side that's in place currently is pretty decent, and good enough to ship for 1.0.

For me, this biggest points that still need work are:
1). Tractor beam code:. You can really notice when the tractor beam takes over currently. You've mentioned writing a new physics solver to deal with this, so I won't go into detail here. Certainly when in doubt, refer to good old Chatheads.
2). Coming out of Expanded mode: Expanded views are now dismissed by long pressing the Bubble, having the Expanded mode finish, and requiring the user to flick the Bubble to the Exit Target at the bottom of the screen. When this happens, and in the event more than 1 Bubble exists, I think we need to animate the other Bubbles off the top of the screen by sliding them up and at at the same time, slide the Consume Bubbles on screen.

Assert when engaging the app via the LockScreen

To reproduce:

  1. Link Bubble should be active. Doesn't matter whether a Bubble is expanded or not.
  2. Press the power button to turn the screen off.
  3. Press the power button to turn the screen on.
  4. Swipe from right to left to engage the camera (note: this will only work if the device has a camera. The Nexus 7 2012 does not, but N4 does).
  5. Note the following callstack:

12-16 17:09:47.757 8991-8991/com.chrislacy.linkbubble E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.chrislacy.linkbubble, PID: 8991 java.lang.AssertionError: Unknown Error at com.chrislacy.linkbubble.Util.Assert(Util.java:23) at com.chrislacy.linkbubble.Util.Assert(Util.java:18) at com.chrislacy.linkbubble.State_ContentView.OnNewBubble(State_ContentView.java:130) at com.chrislacy.linkbubble.MainController.onOpenUrl(MainController.java:354) at com.chrislacy.linkbubble.MainService.onStartCommand(MainService.java:36) at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2702) at android.app.ActivityThread.access$2100(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1293) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5017) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)

I think in this case, because the device is not actually unlocked, Link Bubble should not work at all. Take a look at KeyguardManager for functions to help here. I think inKeyguardRestrictedInputMode() should do it.

Create LinkBubblePro project

Will need to wire up the communication that checks the DRM status.

I will brings this across from Action Launcher.

Gimp app for Free Version

Limitations include:

  • Only a single Bubble will load at any one time. If a request is made to load another URL, show the Prompt and push people to the Play Store (use the same method as with #309).
  • Only a single app can intercept links. Just use Settings.get().getInterceptLinksFromPackageName()
  • DONE: Show "Upgrade to Pro" in Overflow button.
  • DONE: Show "Upgrade to Pro" on HomeActivity.
  • NOT DOING: Show ad when WebView is displaying (have to think about this. Perhaps a bridge too far).

Fix my broken Bubble ending code

2 points here:
1). In onPageLoaded(), the code beneath the Settings.get().autoLoadContent() is commented out. When enabled, the Bubble animates, but the content view does not.
2). I just noticed things get hairy with Settings.get().autoLoadContent() when an app is automatically loaded. To reproduce, load https://play.google.com/store/apps/details?id=com.actionlauncher.playstore and notice that the Play Store loads as expected. But now if you load another link, the app things 2 Bubbles are active (the one you just loaded and the Play Store link I tried to kill in onRedirectedToApp()).

Many thanks :)

Recents links UI

  • Show URL, title and time link was loaded.
  • Clear all button should be present on this list.

Tweak fading of background tint

When releasing a Bubble after a drag currently, the following happens:

  1. The Bubble animates to its destination.
  2. Once it reaches the destination, the background tint fades from dark to non-visible.

I think it would look better for the background tint to fade in sync with the Bubble animating to its destination rather than as a stop after.

Add and implement HomeActivity

This will be the Activity that is loaded when the app is selected via a Launcher.

Current plan is to display:

  • A giant button if Link Bubble is not the default launcher pressing people to make it so
  • Some very basic stats about how much time the user has saved by using Link Bubble
  • A link to view the history
  • Settings/Help accessible via the action bar

Implement Prompt module

Android allows us to display a Toast from a Service, but the limitation there is we cannot have a button on the Toast. We need this for a few different cases.

I've added a shell Prompt class. This ticket requires that emulate the look and feel of Roman Nurik's UndoBar, but allow this UI element to be rendered via MainController (this code currently relies on the presence of an Activity).

To be clear, all I'm after is the rectangular view rendering for a period then fading out. Don't worry about the code that saves the state and stuff like that.

Assert when loading a link from another app

The SettingsFragment.setIncognitoModeChangedEventHandler() call in MainController.java raises the assert exception because sFragment is null.

This is demonstrated when loading any link from say the Bookmarks widget from a home screen.

Furthermore, I think the usage of sFragment isn't ideal for a few reasons:

  • Clearing sFragment in onDestroy() is error prone. If InstanceA's onDestroy() is called after InstanceB's onCreate(), the pointer will be null.
  • Keeping a static reference is generally not ideal because it often leads to memory leaks.

I think it'd be worthwhile getting rid of that.

Ensure that the Browser list is updated as apps are installed and uninstalled.

Eg, need to handle case where default browser is set to FireFox and FireFox is uninstalled.

I use the following code in Action Launcher to register for package changes:

In MainApplication.onCreate():

IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
filter.addDataScheme("package");
registerReceiver(mPackageBroadcastReceiver, filter);

The receiver:

class PackageBroadcastReciever extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        final String action = intent.getAction();
        if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) {
            Settings.get().updateBrowsers();
            // Add checks such that in the event getDefaultBrowserPackageName() no longer exists, we use a default.
        } else if (Intent.ACTION_PACKAGE_ADDED.equals(action)) {
             Settings.get().updateBrowsers();
        }
}

Configure initial Consume Bubbles.

Order of priority:

  • Pocket, Google Keep, Instapaper,
  • Chrome, Browser

If no default set, code will display the action picker UI first time an item is dragged on the bubble.

Investigate Alternative WebViews

We don't have to have this for the initial release, but I think it's worth spending a few hours slotting the FireFox WebView in and seeing both how it performs and how much it would add to the APK size.

At the same time I think it would be worthwhile grabbing the updated Chromium WebView from the Android 4.4 release and seeing if that slots in easily enough (and what size it is).

The interaction bubbles display when they shouldn't

This occurs in a few cases:

  • The consume bubbles display when the web content is expanded.
  • When you click a closed bubble and the expanded content animates on screen.
  • When you click an open bubble and the bubble animates back to its old position.

2013-12-02 03 11 12

Hook up ContentActivity with MainController

I've added a placeholder ContentActivity in this commit.

I've added this for a few reasons:

  1. By displaying an Activity, we are guaranteed to receive back button presses via Activity.onBackPressed() calls.
  2. Using an Activity allows us to use the API 19's windowTranslucentNavigation and windowTranslucentStatus flags. This is necessary when using Link Bubble directly from a launcher, as it looks broken currently with the shadow not applying over a translucent status/navigation bar.
  3. Using an Activity, the app will be 'paused' by the system in the event of a phone call, the current app changing via a notification. or the Home button being pressed. Not having to add hacks to deal with this is a good thing I think.

I've added a very basic implementation, but the lifecycle of the ContentActivity needs configuring correctly, and I figured it would be faster for your to do that if that's OK.

FYI to kill an activity, just call .finish() on it.

Animate Consume Bubbles like the Close Bubble when Bubble is being dragged

The subtle feedback of slightly moving the Close Bubble works great. So much so, I think it feels somewhat broken by not having the position of the Consume Bubbles subtly shift as the Bubble is dragged.

I don't think the Consume Bubbles should shift as much as the Close Bubble does, but some animation would be good.

Display an Activity when bubbles are visible.

Reasons for doing this:
1). To strongly encourage OS not to terminate the Service.
2). The style of the activity should go full screen on Android 4.4 devices to stop translucent status/nav bars looking wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.