dimtion / Shaarlier

Simple Android app for sharing links on Shaarli.
GNU General Public License v3.0
97 stars 11 forks source link

Add an option to handle HTTP scheme #23

Closed di72nn closed 8 years ago

di72nn commented 8 years ago

Useful when you want to save a link from an app which opens links in web browsers by default. The option is disabled by default.

di72nn commented 8 years ago

If the method used in this PR is acceptable, it is also possible to add a work-around option to fix #19.

dimtion commented 8 years ago

Thanks for the PR, I'll try to review within the next few days.

dimtion commented 8 years ago

So first of all thanks a lot for the PR, and sorry for the late response.

I have a few remarks :

di72nn commented 8 years ago

I don't really understand the reason why you need this propriety. Why not simply use the method isHandlingHttpScheme() to check the current state ?

I thought PackageManager should not be called on a whim (saveSattings() is invoked from onPause() so it may be called multiple times in an activity's lifetime), but I guess it doesn't really matter. Changed.

move this business logic ... into the method setHandleHttpScheme()

Done.

french translation

Added.

android:checked="false"

Done.

dimtion commented 8 years ago

I don't think the overhead introduced in getPackageManager() is high since the package manager is already loaded in the application context, it might need further check but it seems alright to call it multiple time this method.