|
|
@ -38,6 +38,7 @@ import android.provider.MediaStore; |
|
|
|
import android.support.annotation.IdRes; |
|
|
|
import android.support.annotation.IdRes; |
|
|
|
import android.support.annotation.NonNull; |
|
|
|
import android.support.annotation.NonNull; |
|
|
|
import android.support.annotation.Nullable; |
|
|
|
import android.support.annotation.Nullable; |
|
|
|
|
|
|
|
import android.support.v4.content.ContextCompat; |
|
|
|
import android.support.v4.view.GravityCompat; |
|
|
|
import android.support.v4.view.GravityCompat; |
|
|
|
import android.support.v4.view.ViewCompat; |
|
|
|
import android.support.v4.view.ViewCompat; |
|
|
|
import android.support.v4.widget.DrawerLayout; |
|
|
|
import android.support.v4.widget.DrawerLayout; |
|
|
@ -125,26 +126,49 @@ import acr.browser.lightning.utils.Utils; |
|
|
|
import acr.browser.lightning.utils.WebUtils; |
|
|
|
import acr.browser.lightning.utils.WebUtils; |
|
|
|
import acr.browser.lightning.view.AnimatedProgressBar; |
|
|
|
import acr.browser.lightning.view.AnimatedProgressBar; |
|
|
|
import acr.browser.lightning.view.LightningView; |
|
|
|
import acr.browser.lightning.view.LightningView; |
|
|
|
|
|
|
|
import butterknife.Bind; |
|
|
|
|
|
|
|
import butterknife.ButterKnife; |
|
|
|
|
|
|
|
|
|
|
|
public abstract class BrowserActivity extends ThemableBrowserActivity implements BrowserController, OnClickListener, OnLongClickListener { |
|
|
|
public abstract class BrowserActivity extends ThemableBrowserActivity implements BrowserController, OnClickListener, OnLongClickListener { |
|
|
|
|
|
|
|
|
|
|
|
// Layout
|
|
|
|
// Static Layout
|
|
|
|
private DrawerLayout mDrawerLayout; |
|
|
|
@Bind(R.id.drawer_layout) |
|
|
|
private FrameLayout mBrowserFrame; |
|
|
|
DrawerLayout mDrawerLayout; |
|
|
|
private FullscreenHolder mFullscreenContainer; |
|
|
|
|
|
|
|
private RecyclerView mDrawerListLeft; |
|
|
|
@Bind(R.id.content_frame) |
|
|
|
private ViewGroup mDrawerLeft, mDrawerRight, mUiLayout, mToolbarLayout; |
|
|
|
FrameLayout mBrowserFrame; |
|
|
|
private RelativeLayout mSearchBar; |
|
|
|
|
|
|
|
|
|
|
|
@Bind(R.id.left_drawer) |
|
|
|
|
|
|
|
ViewGroup mDrawerLeft; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bind(R.id.right_drawer) |
|
|
|
|
|
|
|
ViewGroup mDrawerRight; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bind(R.id.ui_layout) |
|
|
|
|
|
|
|
ViewGroup mUiLayout; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bind(R.id.toolbar_layout) |
|
|
|
|
|
|
|
ViewGroup mToolbarLayout; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bind(R.id.progress_view) |
|
|
|
|
|
|
|
AnimatedProgressBar mProgressBar; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Bind(R.id.search_bar) |
|
|
|
|
|
|
|
RelativeLayout mSearchBar; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// List
|
|
|
|
// Browser Views
|
|
|
|
private final List<LightningView> mWebViewList = new ArrayList<>(); |
|
|
|
private final List<LightningView> mWebViewList = new ArrayList<>(); |
|
|
|
private LightningView mCurrentView; |
|
|
|
private LightningView mCurrentView; |
|
|
|
private WebView mWebView; |
|
|
|
private WebView mWebView; |
|
|
|
|
|
|
|
private RecyclerView mTabListView; |
|
|
|
|
|
|
|
|
|
|
|
// Views
|
|
|
|
// Toolbar Views
|
|
|
|
private AnimatedProgressBar mProgressBar; |
|
|
|
|
|
|
|
private AutoCompleteTextView mSearch; |
|
|
|
private AutoCompleteTextView mSearch; |
|
|
|
private ImageView mArrowImage; |
|
|
|
private ImageView mArrowImage; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Full Screen Video Views
|
|
|
|
|
|
|
|
private FullscreenHolder mFullscreenContainer; |
|
|
|
private VideoView mVideoView; |
|
|
|
private VideoView mVideoView; |
|
|
|
private View mCustomView; |
|
|
|
private View mCustomView; |
|
|
|
|
|
|
|
|
|
|
@ -158,9 +182,6 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
private ValueCallback<Uri> mUploadMessage; |
|
|
|
private ValueCallback<Uri> mUploadMessage; |
|
|
|
private ValueCallback<Uri[]> mFilePathCallback; |
|
|
|
private ValueCallback<Uri[]> mFilePathCallback; |
|
|
|
|
|
|
|
|
|
|
|
// Context
|
|
|
|
|
|
|
|
private Activity mActivity; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Primatives
|
|
|
|
// Primatives
|
|
|
|
private boolean mFullScreen, mColorMode, mDarkTheme, |
|
|
|
private boolean mFullScreen, mColorMode, mDarkTheme, |
|
|
|
mIsNewIntent = false, |
|
|
|
mIsNewIntent = false, |
|
|
@ -173,7 +194,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
// Storage
|
|
|
|
// Storage
|
|
|
|
private HistoryDatabase mHistoryDatabase; |
|
|
|
private HistoryDatabase mHistoryDatabase; |
|
|
|
private PreferenceManager mPreferences; |
|
|
|
private PreferenceManager mPreferences = PreferenceManager.getInstance(); |
|
|
|
|
|
|
|
|
|
|
|
// The singleton BookmarkManager
|
|
|
|
// The singleton BookmarkManager
|
|
|
|
@Inject |
|
|
|
@Inject |
|
|
@ -221,38 +242,30 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
BrowserApp.getAppComponent().inject(this); |
|
|
|
BrowserApp.getAppComponent().inject(this); |
|
|
|
|
|
|
|
setContentView(R.layout.activity_main); |
|
|
|
|
|
|
|
ButterKnife.bind(this); |
|
|
|
initialize(); |
|
|
|
initialize(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private synchronized void initialize() { |
|
|
|
private synchronized void initialize() { |
|
|
|
setContentView(R.layout.activity_main); |
|
|
|
|
|
|
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); |
|
|
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); |
|
|
|
setSupportActionBar(toolbar); |
|
|
|
setSupportActionBar(toolbar); |
|
|
|
ActionBar actionBar = getSupportActionBar(); |
|
|
|
ActionBar actionBar = getSupportActionBar(); |
|
|
|
|
|
|
|
|
|
|
|
mPreferences = PreferenceManager.getInstance(); |
|
|
|
|
|
|
|
//TODO make sure dark theme flag gets set correctly
|
|
|
|
//TODO make sure dark theme flag gets set correctly
|
|
|
|
mDarkTheme = mPreferences.getUseTheme() != 0 || isIncognito(); |
|
|
|
mDarkTheme = mPreferences.getUseTheme() != 0 || isIncognito(); |
|
|
|
mIconColor = mDarkTheme ? ThemeUtils.getIconDarkThemeColor(this) : ThemeUtils.getIconLightThemeColor(this); |
|
|
|
mIconColor = mDarkTheme ? ThemeUtils.getIconDarkThemeColor(this) : ThemeUtils.getIconLightThemeColor(this); |
|
|
|
mShowTabsInDrawer = mPreferences.getShowTabsInDrawer(!isTablet()); |
|
|
|
mShowTabsInDrawer = mPreferences.getShowTabsInDrawer(!isTablet()); |
|
|
|
|
|
|
|
|
|
|
|
mActivity = this; |
|
|
|
|
|
|
|
mWebViewList.clear(); |
|
|
|
mWebViewList.clear(); |
|
|
|
|
|
|
|
|
|
|
|
mClickHandler = new ClickHandler(this); |
|
|
|
mClickHandler = new ClickHandler(this); |
|
|
|
mBrowserFrame = (FrameLayout) findViewById(R.id.content_frame); |
|
|
|
|
|
|
|
mToolbarLayout = (LinearLayout) findViewById(R.id.toolbar_layout); |
|
|
|
|
|
|
|
// initialize background ColorDrawable
|
|
|
|
// initialize background ColorDrawable
|
|
|
|
mBackground.setColor(((ColorDrawable) mToolbarLayout.getBackground()).getColor()); |
|
|
|
mBackground.setColor(((ColorDrawable) mToolbarLayout.getBackground()).getColor()); |
|
|
|
|
|
|
|
|
|
|
|
mUiLayout = (LinearLayout) findViewById(R.id.ui_layout); |
|
|
|
|
|
|
|
mProgressBar = (AnimatedProgressBar) findViewById(R.id.progress_view); |
|
|
|
|
|
|
|
setupFrameLayoutButton(R.id.new_tab_button, R.id.icon_plus); |
|
|
|
setupFrameLayoutButton(R.id.new_tab_button, R.id.icon_plus); |
|
|
|
mDrawerLeft = (LinearLayout) findViewById(R.id.left_drawer); |
|
|
|
|
|
|
|
// Drawer stutters otherwise
|
|
|
|
// Drawer stutters otherwise
|
|
|
|
mDrawerLeft.setLayerType(View.LAYER_TYPE_HARDWARE, null); |
|
|
|
mDrawerLeft.setLayerType(View.LAYER_TYPE_HARDWARE, null); |
|
|
|
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); |
|
|
|
|
|
|
|
mDrawerRight = (ViewGroup) findViewById(R.id.right_drawer); |
|
|
|
|
|
|
|
mDrawerRight.setLayerType(View.LAYER_TYPE_HARDWARE, null); |
|
|
|
mDrawerRight.setLayerType(View.LAYER_TYPE_HARDWARE, null); |
|
|
|
ImageView tabTitleImage = (ImageView) findViewById(R.id.plusIcon); |
|
|
|
ImageView tabTitleImage = (ImageView) findViewById(R.id.plusIcon); |
|
|
|
tabTitleImage.setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN); |
|
|
|
tabTitleImage.setColorFilter(mIconColor, PorterDuff.Mode.SRC_IN); |
|
|
@ -273,23 +286,23 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
if (mShowTabsInDrawer) { |
|
|
|
if (mShowTabsInDrawer) { |
|
|
|
mTabAdapter = new LightningViewAdapter(this, R.layout.tab_list_item, mWebViewList); |
|
|
|
mTabAdapter = new LightningViewAdapter(this, R.layout.tab_list_item, mWebViewList); |
|
|
|
mDrawerListLeft = (RecyclerView) findViewById(R.id.left_drawer_list); |
|
|
|
mTabListView = (RecyclerView) findViewById(R.id.left_drawer_list); |
|
|
|
mDrawerListLeft.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS); |
|
|
|
mTabListView.setOverScrollMode(View.OVER_SCROLL_IF_CONTENT_SCROLLS); |
|
|
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); |
|
|
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false); |
|
|
|
mDrawerListLeft.setLayoutManager(layoutManager); |
|
|
|
mTabListView.setLayoutManager(layoutManager); |
|
|
|
mDrawerListLeft.setHasFixedSize(true); |
|
|
|
mTabListView.setHasFixedSize(true); |
|
|
|
mToolbarLayout.removeView(horizontalListView); |
|
|
|
mToolbarLayout.removeView(horizontalListView); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
mTabAdapter = new LightningViewAdapter(this, R.layout.tab_list_item_horizontal, mWebViewList); |
|
|
|
mTabAdapter = new LightningViewAdapter(this, R.layout.tab_list_item_horizontal, mWebViewList); |
|
|
|
mDrawerListLeft = horizontalListView; |
|
|
|
mTabListView = horizontalListView; |
|
|
|
mDrawerListLeft.setOverScrollMode(View.OVER_SCROLL_NEVER); |
|
|
|
mTabListView.setOverScrollMode(View.OVER_SCROLL_NEVER); |
|
|
|
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, mDrawerLeft); |
|
|
|
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, mDrawerLeft); |
|
|
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); |
|
|
|
RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false); |
|
|
|
mDrawerListLeft.setLayoutManager(layoutManager); |
|
|
|
mTabListView.setLayoutManager(layoutManager); |
|
|
|
mDrawerListLeft.setHasFixedSize(true); |
|
|
|
mTabListView.setHasFixedSize(true); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mDrawerListLeft.setAdapter(mTabAdapter); |
|
|
|
mTabListView.setAdapter(mTabAdapter); |
|
|
|
|
|
|
|
|
|
|
|
mHistoryDatabase = HistoryDatabase.getInstance(); |
|
|
|
mHistoryDatabase = HistoryDatabase.getInstance(); |
|
|
|
|
|
|
|
|
|
|
@ -302,15 +315,14 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
actionBar.setDisplayShowCustomEnabled(true); |
|
|
|
actionBar.setDisplayShowCustomEnabled(true); |
|
|
|
actionBar.setCustomView(R.layout.toolbar_content); |
|
|
|
actionBar.setCustomView(R.layout.toolbar_content); |
|
|
|
|
|
|
|
|
|
|
|
View v = actionBar.getCustomView(); |
|
|
|
View customView = actionBar.getCustomView(); |
|
|
|
LayoutParams lp = v.getLayoutParams(); |
|
|
|
LayoutParams lp = customView.getLayoutParams(); |
|
|
|
lp.width = LayoutParams.MATCH_PARENT; |
|
|
|
lp.width = LayoutParams.MATCH_PARENT; |
|
|
|
lp.height = LayoutParams.MATCH_PARENT; |
|
|
|
lp.height = LayoutParams.MATCH_PARENT; |
|
|
|
v.setLayoutParams(lp); |
|
|
|
customView.setLayoutParams(lp); |
|
|
|
|
|
|
|
|
|
|
|
mArrowImage = (ImageView) actionBar.getCustomView().findViewById(R.id.arrow); |
|
|
|
mArrowImage = (ImageView) customView.findViewById(R.id.arrow); |
|
|
|
FrameLayout arrowButton = (FrameLayout) actionBar.getCustomView().findViewById( |
|
|
|
FrameLayout arrowButton = (FrameLayout) customView.findViewById(R.id.arrow_button); |
|
|
|
R.id.arrow_button); |
|
|
|
|
|
|
|
if (mShowTabsInDrawer) { |
|
|
|
if (mShowTabsInDrawer) { |
|
|
|
// Use hardware acceleration for the animation
|
|
|
|
// Use hardware acceleration for the animation
|
|
|
|
mArrowDrawable = new DrawerArrowDrawable(this); |
|
|
|
mArrowDrawable = new DrawerArrowDrawable(this); |
|
|
@ -330,13 +342,9 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
setupFrameLayoutButton(R.id.action_reading, R.id.icon_reading); |
|
|
|
setupFrameLayoutButton(R.id.action_reading, R.id.icon_reading); |
|
|
|
|
|
|
|
|
|
|
|
// create the search EditText in the ToolBar
|
|
|
|
// create the search EditText in the ToolBar
|
|
|
|
mSearch = (AutoCompleteTextView) actionBar.getCustomView().findViewById(R.id.search); |
|
|
|
mSearch = (AutoCompleteTextView) customView.findViewById(R.id.search); |
|
|
|
mUntitledTitle = getString(R.string.untitled); |
|
|
|
mUntitledTitle = getString(R.string.untitled); |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
|
|
mBackgroundColor = ContextCompat.getColor(this, R.color.primary_color); |
|
|
|
mBackgroundColor = getColor(R.color.primary_color); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
mBackgroundColor = getResources().getColor(R.color.primary_color); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mDeleteIcon = ThemeUtils.getLightThemedDrawable(this, R.drawable.ic_action_delete); |
|
|
|
mDeleteIcon = ThemeUtils.getLightThemedDrawable(this, R.drawable.ic_action_delete); |
|
|
|
mRefreshIcon = ThemeUtils.getLightThemedDrawable(this, R.drawable.ic_action_refresh); |
|
|
|
mRefreshIcon = ThemeUtils.getLightThemedDrawable(this, R.drawable.ic_action_refresh); |
|
|
|
mClearIcon = ThemeUtils.getLightThemedDrawable(this, R.drawable.ic_action_delete); |
|
|
|
mClearIcon = ThemeUtils.getLightThemedDrawable(this, R.drawable.ic_action_delete); |
|
|
@ -417,11 +425,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onFocusChange(View v, final boolean hasFocus) { |
|
|
|
public void onFocusChange(View v, final boolean hasFocus) { |
|
|
|
if (!hasFocus && mCurrentView != null) { |
|
|
|
if (!hasFocus && mCurrentView != null) { |
|
|
|
if (mCurrentView.getProgress() < 100) { |
|
|
|
setIsLoading(mCurrentView.getProgress() < 100); |
|
|
|
setIsLoading(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setIsFinishedLoading(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
updateUrl(mCurrentView.getUrl(), true); |
|
|
|
updateUrl(mCurrentView.getUrl(), true); |
|
|
|
} else if (hasFocus) { |
|
|
|
} else if (hasFocus) { |
|
|
|
String url = mCurrentView.getUrl(); |
|
|
|
String url = mCurrentView.getUrl(); |
|
|
@ -613,9 +617,6 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initializePreferences() { |
|
|
|
private void initializePreferences() { |
|
|
|
if (mPreferences == null) { |
|
|
|
|
|
|
|
mPreferences = PreferenceManager.getInstance(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mFullScreen = mPreferences.getFullScreenEnabled(); |
|
|
|
mFullScreen = mPreferences.getFullScreenEnabled(); |
|
|
|
mColorMode = mPreferences.getColorModeEnabled(); |
|
|
|
mColorMode = mPreferences.getColorModeEnabled(); |
|
|
|
mColorMode &= !mDarkTheme; |
|
|
|
mColorMode &= !mDarkTheme; |
|
|
@ -767,7 +768,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); |
|
|
|
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); |
|
|
|
ClipData clip = ClipData.newPlainText("label", mCurrentView.getUrl()); |
|
|
|
ClipData clip = ClipData.newPlainText("label", mCurrentView.getUrl()); |
|
|
|
clipboard.setPrimaryClip(clip); |
|
|
|
clipboard.setPrimaryClip(clip); |
|
|
|
Utils.showSnackbar(mActivity, R.string.message_link_copied); |
|
|
|
Utils.showSnackbar(this, R.string.message_link_copied); |
|
|
|
} |
|
|
|
} |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
case R.id.action_settings: |
|
|
|
case R.id.action_settings: |
|
|
@ -800,7 +801,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
* for. It highlights the text entered. |
|
|
|
* for. It highlights the text entered. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void findInPage() { |
|
|
|
private void findInPage() { |
|
|
|
final AlertDialog.Builder finder = new AlertDialog.Builder(mActivity); |
|
|
|
final AlertDialog.Builder finder = new AlertDialog.Builder(this); |
|
|
|
finder.setTitle(getResources().getString(R.string.action_find)); |
|
|
|
finder.setTitle(getResources().getString(R.string.action_find)); |
|
|
|
final EditText getHome = new EditText(this); |
|
|
|
final EditText getHome = new EditText(this); |
|
|
|
getHome.setHint(getResources().getString(R.string.search_hint)); |
|
|
|
getHome.setHint(getResources().getString(R.string.search_hint)); |
|
|
@ -822,7 +823,6 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
if (mCurrentView != null) { |
|
|
|
if (mCurrentView != null) { |
|
|
|
mCurrentView.find(text); |
|
|
|
mCurrentView.find(text); |
|
|
|
} |
|
|
|
} |
|
|
|
mSearchBar = (RelativeLayout) findViewById(R.id.search_bar); |
|
|
|
|
|
|
|
mSearchBar.setVisibility(View.VISIBLE); |
|
|
|
mSearchBar.setVisibility(View.VISIBLE); |
|
|
|
|
|
|
|
|
|
|
|
TextView tw = (TextView) findViewById(R.id.search_query); |
|
|
|
TextView tw = (TextView) findViewById(R.id.search_query); |
|
|
@ -842,11 +842,11 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
if (position < 0) { |
|
|
|
if (position < 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); |
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|
|
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(mActivity, |
|
|
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(this, |
|
|
|
android.R.layout.simple_dropdown_item_1line); |
|
|
|
android.R.layout.simple_dropdown_item_1line); |
|
|
|
adapter.add(mActivity.getString(R.string.close_tab)); |
|
|
|
adapter.add(this.getString(R.string.close_tab)); |
|
|
|
adapter.add(mActivity.getString(R.string.close_all_tabs)); |
|
|
|
adapter.add(this.getString(R.string.close_all_tabs)); |
|
|
|
builder.setAdapter(adapter, new DialogInterface.OnClickListener() { |
|
|
|
builder.setAdapter(adapter, new DialogInterface.OnClickListener() { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -873,7 +873,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onClick(View v) { |
|
|
|
public void onClick(View v) { |
|
|
|
int position = mDrawerListLeft.getChildAdapterPosition(v); |
|
|
|
int position = mTabListView.getChildAdapterPosition(v); |
|
|
|
if (mCurrentView != mWebViewList.get(position)) { |
|
|
|
if (mCurrentView != mWebViewList.get(position)) { |
|
|
|
mIsNewIntent = false; |
|
|
|
mIsNewIntent = false; |
|
|
|
showTab(mWebViewList.get(position)); |
|
|
|
showTab(mWebViewList.get(position)); |
|
|
@ -888,7 +888,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean onLongClick(View v) { |
|
|
|
public boolean onLongClick(View v) { |
|
|
|
int position = mDrawerListLeft.getChildAdapterPosition(v); |
|
|
|
int position = mTabListView.getChildAdapterPosition(v); |
|
|
|
showCloseDialog(position); |
|
|
|
showCloseDialog(position); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
@ -995,7 +995,6 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
private void loadUrlInCurrentView(final String url) { |
|
|
|
private void loadUrlInCurrentView(final String url) { |
|
|
|
if (mCurrentView == null) { |
|
|
|
if (mCurrentView == null) { |
|
|
|
// This is a problem, probably an assert will be better than a return
|
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1031,7 +1030,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
mIsNewIntent = false; |
|
|
|
mIsNewIntent = false; |
|
|
|
LightningView startingTab = new LightningView(mActivity, url, mDarkTheme, isIncognito(), this); |
|
|
|
LightningView startingTab = new LightningView(this, url, mDarkTheme, isIncognito(), this); |
|
|
|
if (mIdGenerator == 0) { |
|
|
|
if (mIdGenerator == 0) { |
|
|
|
startingTab.resumeTimers(); |
|
|
|
startingTab.resumeTimers(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1045,7 +1044,7 @@ 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() { |
|
|
|
mDrawerListLeft.smoothScrollToPosition(mWebViewList.size() - 1); |
|
|
|
mTabListView.smoothScrollToPosition(mWebViewList.size() - 1); |
|
|
|
} |
|
|
|
} |
|
|
|
}, 300); |
|
|
|
}, 300); |
|
|
|
|
|
|
|
|
|
|
@ -1124,17 +1123,14 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
if (mPreferences.getClearCacheExit() && mCurrentView != null && !isIncognito()) { |
|
|
|
if (mPreferences.getClearCacheExit() && mCurrentView != null && !isIncognito()) { |
|
|
|
WebUtils.clearCache(mCurrentView.getWebView()); |
|
|
|
WebUtils.clearCache(mCurrentView.getWebView()); |
|
|
|
Log.d(Constants.TAG, "Cache Cleared"); |
|
|
|
Log.d(Constants.TAG, "Cache Cleared"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (mPreferences.getClearHistoryExitEnabled() && !isIncognito()) { |
|
|
|
if (mPreferences.getClearHistoryExitEnabled() && !isIncognito()) { |
|
|
|
WebUtils.clearHistory(this); |
|
|
|
WebUtils.clearHistory(this); |
|
|
|
Log.d(Constants.TAG, "History Cleared"); |
|
|
|
Log.d(Constants.TAG, "History Cleared"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (mPreferences.getClearCookiesExitEnabled() && !isIncognito()) { |
|
|
|
if (mPreferences.getClearCookiesExitEnabled() && !isIncognito()) { |
|
|
|
WebUtils.clearCookies(this); |
|
|
|
WebUtils.clearCookies(this); |
|
|
|
Log.d(Constants.TAG, "Cookies Cleared"); |
|
|
|
Log.d(Constants.TAG, "Cookies Cleared"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (mPreferences.getClearWebStorageExitEnabled() && !isIncognito()) { |
|
|
|
if (mPreferences.getClearWebStorageExitEnabled() && !isIncognito()) { |
|
|
|
WebUtils.clearWebStorage(); |
|
|
|
WebUtils.clearWebStorage(); |
|
|
@ -1325,7 +1321,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
mForegroundTabBitmap = null; |
|
|
|
mForegroundTabBitmap = null; |
|
|
|
mForegroundTabDrawable = ThemeUtils.getSelectedBackground(context, mDarkTheme); |
|
|
|
mForegroundTabDrawable = ThemeUtils.getSelectedBackground(context, mDarkTheme); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
int backgroundColor = Utils.mixTwoColors(ThemeUtils.getPrimaryColor(mActivity), Color.BLACK, 0.75f); |
|
|
|
int backgroundColor = Utils.mixTwoColors(ThemeUtils.getPrimaryColor(context), Color.BLACK, 0.75f); |
|
|
|
Bitmap backgroundTabBitmap = Bitmap.createBitmap(Utils.dpToPx(175), Utils.dpToPx(30), Bitmap.Config.ARGB_8888); |
|
|
|
Bitmap backgroundTabBitmap = Bitmap.createBitmap(Utils.dpToPx(175), Utils.dpToPx(30), Bitmap.Config.ARGB_8888); |
|
|
|
Utils.drawTrapezoid(new Canvas(backgroundTabBitmap), backgroundColor, true); |
|
|
|
Utils.drawTrapezoid(new Canvas(backgroundTabBitmap), backgroundColor, true); |
|
|
|
mBackgroundTabDrawable = new BitmapDrawable(getResources(), backgroundTabBitmap); |
|
|
|
mBackgroundTabDrawable = new BitmapDrawable(getResources(), backgroundTabBitmap); |
|
|
@ -1392,6 +1388,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
holder.layout.setBackgroundDrawable(mBackgroundTabDrawable); |
|
|
|
holder.layout.setBackgroundDrawable(mBackgroundTabDrawable); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
holder.favicon.setImageBitmap(getDesaturatedBitmap(favicon)); |
|
|
|
holder.favicon.setImageBitmap(getDesaturatedBitmap(favicon)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1542,11 +1539,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void updateProgress(int n) { |
|
|
|
public void updateProgress(int n) { |
|
|
|
if (n >= 100) { |
|
|
|
setIsLoading(n < 100); |
|
|
|
setIsFinishedLoading(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setIsLoading(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mProgressBar.setProgress(n); |
|
|
|
mProgressBar.setProgress(n); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1589,7 +1582,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
try { |
|
|
|
try { |
|
|
|
String url; |
|
|
|
String url; |
|
|
|
url = ((TextView) arg1.findViewById(R.id.url)).getText().toString(); |
|
|
|
url = ((TextView) arg1.findViewById(R.id.url)).getText().toString(); |
|
|
|
if (url.startsWith(mActivity.getString(R.string.suggestion))) { |
|
|
|
if (url.startsWith(BrowserActivity.this.getString(R.string.suggestion))) { |
|
|
|
url = ((TextView) arg1.findViewById(R.id.title)).getText().toString(); |
|
|
|
url = ((TextView) arg1.findViewById(R.id.title)).getText().toString(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
getUrl.setText(url); |
|
|
|
getUrl.setText(url); |
|
|
@ -1608,7 +1601,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
getUrl.setSelectAllOnFocus(true); |
|
|
|
getUrl.setSelectAllOnFocus(true); |
|
|
|
mSearchAdapter = new SearchAdapter(mActivity, mDarkTheme, isIncognito()); |
|
|
|
mSearchAdapter = new SearchAdapter(this, mDarkTheme, isIncognito()); |
|
|
|
getUrl.setAdapter(mSearchAdapter); |
|
|
|
getUrl.setAdapter(mSearchAdapter); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1626,7 +1619,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
loadUrlInCurrentView(HistoryPage.getHistoryPage(mActivity)); |
|
|
|
loadUrlInCurrentView(HistoryPage.getHistoryPage(BrowserActivity.this)); |
|
|
|
mSearch.setText(""); |
|
|
|
mSearch.setText(""); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1668,7 +1661,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
return; |
|
|
|
return; |
|
|
|
Bitmap folderIcon = ThemeUtils.getThemedBitmap(this, R.drawable.ic_folder, false); |
|
|
|
Bitmap folderIcon = ThemeUtils.getThemedBitmap(this, R.drawable.ic_folder, false); |
|
|
|
FileOutputStream outputStream = null; |
|
|
|
FileOutputStream outputStream = null; |
|
|
|
File image = new File(mActivity.getCacheDir(), "folder.png"); |
|
|
|
File image = new File(this.getCacheDir(), "folder.png"); |
|
|
|
try { |
|
|
|
try { |
|
|
|
outputStream = new FileOutputStream(image); |
|
|
|
outputStream = new FileOutputStream(image); |
|
|
|
folderIcon.compress(Bitmap.CompressFormat.PNG, 100, outputStream); |
|
|
|
folderIcon.compress(Bitmap.CompressFormat.PNG, 100, outputStream); |
|
|
@ -1678,7 +1671,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
Utils.close(outputStream); |
|
|
|
Utils.close(outputStream); |
|
|
|
} |
|
|
|
} |
|
|
|
File bookmarkWebPage = new File(mActivity.getFilesDir(), Constants.BOOKMARKS_FILENAME); |
|
|
|
File bookmarkWebPage = new File(this.getFilesDir(), Constants.BOOKMARKS_FILENAME); |
|
|
|
|
|
|
|
|
|
|
|
mBookmarkPage.buildBookmarkPage(null, mBookmarkManager.getBookmarksFromFolder(null, true)); |
|
|
|
mBookmarkPage.buildBookmarkPage(null, mBookmarkManager.getBookmarksFromFolder(null, true)); |
|
|
|
view.loadUrl(Constants.FILE + bookmarkWebPage); |
|
|
|
view.loadUrl(Constants.FILE + bookmarkWebPage); |
|
|
@ -1754,7 +1747,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
mFilePathCallback = filePathCallback; |
|
|
|
mFilePathCallback = filePathCallback; |
|
|
|
|
|
|
|
|
|
|
|
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
|
|
|
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); |
|
|
|
if (takePictureIntent.resolveActivity(mActivity.getPackageManager()) != null) { |
|
|
|
if (takePictureIntent.resolveActivity(this.getPackageManager()) != null) { |
|
|
|
// Create the File where the photo should go
|
|
|
|
// Create the File where the photo should go
|
|
|
|
File photoFile = null; |
|
|
|
File photoFile = null; |
|
|
|
try { |
|
|
|
try { |
|
|
@ -1776,7 +1769,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT); |
|
|
|
Intent contentSelectionIntent = new Intent(Intent.ACTION_GET_CONTENT); |
|
|
|
contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE); |
|
|
|
contentSelectionIntent.addCategory(Intent.CATEGORY_OPENABLE); |
|
|
|
contentSelectionIntent.setType("image/*"); |
|
|
|
contentSelectionIntent.setType("*/*"); |
|
|
|
|
|
|
|
|
|
|
|
Intent[] intentArray; |
|
|
|
Intent[] intentArray; |
|
|
|
if (takePictureIntent != null) { |
|
|
|
if (takePictureIntent != null) { |
|
|
@ -1790,7 +1783,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser"); |
|
|
|
chooserIntent.putExtra(Intent.EXTRA_TITLE, "Image Chooser"); |
|
|
|
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray); |
|
|
|
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, intentArray); |
|
|
|
|
|
|
|
|
|
|
|
mActivity.startActivityForResult(chooserIntent, 1); |
|
|
|
this.startActivityForResult(chooserIntent, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -1801,7 +1794,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onLongPress() { |
|
|
|
public void onLongPress() { |
|
|
|
if (mClickHandler == null) { |
|
|
|
if (mClickHandler == null) { |
|
|
|
mClickHandler = new ClickHandler(mActivity); |
|
|
|
mClickHandler = new ClickHandler(this); |
|
|
|
} |
|
|
|
} |
|
|
|
Message click = mClickHandler.obtainMessage(); |
|
|
|
Message click = mClickHandler.obtainMessage(); |
|
|
|
if (click != null) { |
|
|
|
if (click != null) { |
|
|
@ -1934,11 +1927,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
|
|
|
|
|
|
|
|
public FullscreenHolder(Context ctx) { |
|
|
|
public FullscreenHolder(Context ctx) { |
|
|
|
super(ctx); |
|
|
|
super(ctx); |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { |
|
|
|
setBackgroundColor(ContextCompat.getColor(ctx, android.R.color.black)); |
|
|
|
setBackgroundColor(ctx.getColor(android.R.color.black)); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setBackgroundColor(ctx.getResources().getColor(android.R.color.black)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -1990,7 +1979,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Activity getActivity() { |
|
|
|
public Activity getActivity() { |
|
|
|
return mActivity; |
|
|
|
return this; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -2024,7 +2013,6 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
}; |
|
|
|
}; |
|
|
|
show.setDuration(250); |
|
|
|
show.setDuration(250); |
|
|
|
show.setInterpolator(new DecelerateInterpolator()); |
|
|
|
show.setInterpolator(new DecelerateInterpolator()); |
|
|
|
// show.setFillAfter(true);
|
|
|
|
|
|
|
|
mWebView.startAnimation(show); |
|
|
|
mWebView.startAnimation(show); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -2072,7 +2060,6 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
}; |
|
|
|
}; |
|
|
|
show.setDuration(250); |
|
|
|
show.setDuration(250); |
|
|
|
show.setInterpolator(new DecelerateInterpolator()); |
|
|
|
show.setInterpolator(new DecelerateInterpolator()); |
|
|
|
// show.setFillAfter(true);
|
|
|
|
|
|
|
|
mWebView.startAnimation(show); |
|
|
|
mWebView.startAnimation(show); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -2153,7 +2140,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); |
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|
|
|
builder.setTitle(R.string.action_history) |
|
|
|
builder.setTitle(R.string.action_history) |
|
|
|
.setMessage(R.string.dialog_history_long_press) |
|
|
|
.setMessage(R.string.dialog_history_long_press) |
|
|
|
.setCancelable(true) |
|
|
|
.setCancelable(true) |
|
|
@ -2177,16 +2164,14 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case DialogInterface.BUTTON_NEUTRAL: |
|
|
|
case DialogInterface.BUTTON_NEUTRAL: |
|
|
|
if (API > 8) { |
|
|
|
Utils.downloadFile(BrowserActivity.this, url, |
|
|
|
Utils.downloadFile(mActivity, url, |
|
|
|
mCurrentView.getUserAgent(), "attachment"); |
|
|
|
mCurrentView.getUserAgent(), "attachment"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); |
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this); |
|
|
|
builder.setTitle(url.replace(Constants.HTTP, "")) |
|
|
|
builder.setTitle(url.replace(Constants.HTTP, "")) |
|
|
|
.setCancelable(true) |
|
|
|
.setCancelable(true) |
|
|
|
.setMessage(R.string.dialog_image) |
|
|
|
.setMessage(R.string.dialog_image) |
|
|
@ -2218,7 +2203,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(mActivity); // dialog
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(this); // dialog
|
|
|
|
builder.setTitle(url) |
|
|
|
builder.setTitle(url) |
|
|
|
.setCancelable(true) |
|
|
|
.setCancelable(true) |
|
|
|
.setMessage(R.string.dialog_link) |
|
|
|
.setMessage(R.string.dialog_link) |
|
|
@ -2233,21 +2218,10 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
* and that it should display the stop icon to indicate to the user that |
|
|
|
* and that it should display the stop icon to indicate to the user that |
|
|
|
* pressing it stops the page from loading |
|
|
|
* pressing it stops the page from loading |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void setIsLoading() { |
|
|
|
private void setIsLoading(boolean isLoading) { |
|
|
|
if (!mSearch.hasFocus()) { |
|
|
|
|
|
|
|
mIcon = mDeleteIcon; |
|
|
|
|
|
|
|
mSearch.setCompoundDrawables(null, null, mDeleteIcon, null); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* This tells the search bar that the page is finished loading and it should |
|
|
|
|
|
|
|
* display the refresh icon |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void setIsFinishedLoading() { |
|
|
|
|
|
|
|
if (!mSearch.hasFocus()) { |
|
|
|
if (!mSearch.hasFocus()) { |
|
|
|
mIcon = mRefreshIcon; |
|
|
|
mIcon = isLoading ? mDeleteIcon : mRefreshIcon; |
|
|
|
mSearch.setCompoundDrawables(null, null, mRefreshIcon, null); |
|
|
|
mSearch.setCompoundDrawables(null, null, mIcon, null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2328,7 +2302,7 @@ public abstract class BrowserActivity extends ThemableBrowserActivity implements |
|
|
|
String url = mPreferences.getSavedUrl(); |
|
|
|
String url = mPreferences.getSavedUrl(); |
|
|
|
if (url != null) { |
|
|
|
if (url != null) { |
|
|
|
newTab(url, true); |
|
|
|
newTab(url, true); |
|
|
|
Utils.showSnackbar(mActivity, R.string.deleted_tab); |
|
|
|
Utils.showSnackbar(this, R.string.deleted_tab); |
|
|
|
} |
|
|
|
} |
|
|
|
mPreferences.setSavedUrl(null); |
|
|
|
mPreferences.setSavedUrl(null); |
|
|
|
break; |
|
|
|
break; |
|
|
|