@ -634,7 +634,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -634,7 +634,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
}
}
public void initializePreferences ( ) {
private void initializePreferences ( ) {
if ( mPreferences = = null ) {
mPreferences = PreferenceManager . getInstance ( ) ;
}
@ -1012,7 +1012,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1012,7 +1012,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
* @param id
* which id in the list was chosen
* /
public synchronized void editBookmark ( final int id ) {
private synchronized void editBookmark ( final int id ) {
final AlertDialog . Builder homePicker = new AlertDialog . Builder ( mActivity ) ;
homePicker . setTitle ( getResources ( ) . getString ( R . string . title_edit_bookmark ) ) ;
final EditText getTitle = new EditText ( mActivity ) ;
@ -1287,7 +1287,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1287,7 +1287,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
}
@SuppressWarnings ( "deprecation" )
public void clearHistory ( ) {
private void clearHistory ( ) {
this . deleteDatabase ( HistoryDatabase . DATABASE_NAME ) ;
WebViewDatabase m = WebViewDatabase . getInstance ( this ) ;
m . clearFormData ( ) ;
@ -1307,7 +1307,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1307,7 +1307,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@SuppressLint ( "NewApi" )
@SuppressWarnings ( "deprecation" )
public void clearCookies ( ) {
private void clearCookies ( ) {
// TODO Break out web storage deletion into its own option/action
// TODO clear web storage for all sites that are visited in Incognito mode
WebStorage storage = WebStorage . getInstance ( ) ;
@ -1413,7 +1413,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1413,7 +1413,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
* searches the web for the query fixing any and all problems with the input
* checks if it is a search , url , etc .
* /
void searchTheWeb ( String query ) {
private void searchTheWeb ( String query ) {
if ( query . equals ( "" ) ) {
return ;
}
@ -1556,8 +1556,8 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1556,8 +1556,8 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
int finalColor ; // Lighten up the dark color if it is
// too dark
if ( isColorTooDark ( color ) ) {
finalColor = mixTwoColors (
if ( Utils . isColorTooDark ( color ) ) {
finalColor = Utils . mixTwoColors (
mActivity . getResources ( ) . getColor ( R . color . primary_color ) ,
color , 0 . 25f ) ;
} else {
@ -1586,35 +1586,6 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1586,35 +1586,6 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
} ) ;
}
public static boolean isColorTooDark ( int color ) {
final byte RED_CHANNEL = 16 ;
final byte GREEN_CHANNEL = 8 ;
//final byte BLUE_CHANNEL = 0;
int r = ( ( int ) ( ( float ) ( color > > RED_CHANNEL & 0xff ) * 0 . 3f ) ) & 0xff ;
int g = ( ( int ) ( ( float ) ( color > > GREEN_CHANNEL & 0xff ) * 0 . 59 ) ) & 0xff ;
int b = ( ( int ) ( ( float ) ( color & 0xff ) * 0 . 11 ) ) & 0xff ;
int gr = ( r + g + b ) & 0xff ;
int gray = gr + ( gr < < GREEN_CHANNEL ) + ( gr < < RED_CHANNEL ) ;
return gray < 0x727272 ;
}
public static int mixTwoColors ( int color1 , int color2 , float amount ) {
final byte ALPHA_CHANNEL = 24 ;
final byte RED_CHANNEL = 16 ;
final byte GREEN_CHANNEL = 8 ;
//final byte BLUE_CHANNEL = 0;
final float inverseAmount = 1 . 0f - amount ;
int r = ( ( int ) ( ( ( float ) ( color1 > > RED_CHANNEL & 0xff ) * amount ) + ( ( float ) ( color2 > > RED_CHANNEL & 0xff ) * inverseAmount ) ) ) & 0xff ;
int g = ( ( int ) ( ( ( float ) ( color1 > > GREEN_CHANNEL & 0xff ) * amount ) + ( ( float ) ( color2 > > GREEN_CHANNEL & 0xff ) * inverseAmount ) ) ) & 0xff ;
int b = ( ( int ) ( ( ( float ) ( color1 & 0xff ) * amount ) + ( ( float ) ( color2 & 0xff ) * inverseAmount ) ) ) & 0xff ;
return 0xff < < ALPHA_CHANNEL | r < < RED_CHANNEL | g < < GREEN_CHANNEL | b ;
}
public class BookmarkViewAdapter extends ArrayAdapter < HistoryItem > {
final Context context ;
@ -1758,7 +1729,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1758,7 +1729,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
}
}
static String getDomainName ( String url ) throws URISyntaxException {
private static String getDomainName ( String url ) throws URISyntaxException {
URI uri = new URI ( url ) ;
String domain = uri . getHost ( ) ;
if ( domain = = null ) {
@ -1843,11 +1814,11 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -1843,11 +1814,11 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
}
}
public boolean isSystemBrowserAvailable ( ) {
private boolean isSystemBrowserAvailable ( ) {
return mSystemBrowser ;
}
public boolean getSystemBrowser ( ) {
private boolean getSystemBrowser ( ) {
Cursor c = null ;
String [ ] columns = new String [ ] { "url" , "title" } ;
boolean browserFlag ;
@ -2194,7 +2165,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -2194,7 +2165,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
* @param enabled
* whether to enable fullscreen or not
* /
public void setFullscreen ( boolean enabled ) {
private void setFullscreen ( boolean enabled ) {
Window win = getWindow ( ) ;
WindowManager . LayoutParams winParams = win . getAttributes ( ) ;
final int bits = WindowManager . LayoutParams . FLAG_FULLSCREEN ;
@ -2559,7 +2530,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -2559,7 +2530,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
* and that it should display the stop icon to indicate to the user that
* pressing it stops the page from loading
* /
public void setIsLoading ( ) {
private void setIsLoading ( ) {
if ( ! mSearch . hasFocus ( ) ) {
mIcon = mDeleteIcon ;
mSearch . setCompoundDrawables ( null , null , mDeleteIcon , null ) ;
@ -2570,7 +2541,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -2570,7 +2541,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
* This tells the search bar that the page is finished loading and it should
* display the refresh icon
* /
public void setIsFinishedLoading ( ) {
private void setIsFinishedLoading ( ) {
if ( ! mSearch . hasFocus ( ) ) {
mIcon = mRefreshIcon ;
mSearch . setCompoundDrawables ( null , null , mRefreshIcon , null ) ;
@ -2583,7 +2554,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -2583,7 +2554,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
*
* See setIsFinishedLoading and setIsLoading for displaying the correct icon
* /
public void refreshOrStop ( ) {
private void refreshOrStop ( ) {
if ( mCurrentView ! = null ) {
if ( mCurrentView . getProgress ( ) < 100 ) {
mCurrentView . stopLoading ( ) ;
@ -2598,7 +2569,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
@@ -2598,7 +2569,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
finish ( ) ;
}
public class SortIgnoreCase implements Comparator < HistoryItem > {
private class SortIgnoreCase implements Comparator < HistoryItem > {
public int compare ( HistoryItem o1 , HistoryItem o2 ) {
return o1 . getTitle ( ) . toLowerCase ( Locale . getDefault ( ) )