Merge remote-tracking branch 'refs/remotes/origin/dev'
This commit is contained in:
commit
748775a429
@ -9,7 +9,7 @@ android {
|
|||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 24
|
targetSdkVersion 24
|
||||||
versionName "4.4.0"
|
versionName "4.4.1"
|
||||||
vectorDrawables.useSupportLibrary = true
|
vectorDrawables.useSupportLibrary = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,13 +36,13 @@ android {
|
|||||||
lightningPlus {
|
lightningPlus {
|
||||||
buildConfigField "boolean", "FULL_VERSION", "true"
|
buildConfigField "boolean", "FULL_VERSION", "true"
|
||||||
applicationId "acr.browser.lightning"
|
applicationId "acr.browser.lightning"
|
||||||
versionCode 89
|
versionCode 90
|
||||||
}
|
}
|
||||||
|
|
||||||
lightningLite {
|
lightningLite {
|
||||||
buildConfigField "boolean", "FULL_VERSION", "false"
|
buildConfigField "boolean", "FULL_VERSION", "false"
|
||||||
applicationId "acr.browser.barebones"
|
applicationId "acr.browser.barebones"
|
||||||
versionCode 91
|
versionCode 92
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,11 @@ public class TabsManager {
|
|||||||
if (mPreferenceManager.getRestoreLostTabsEnabled()) {
|
if (mPreferenceManager.getRestoreLostTabsEnabled()) {
|
||||||
restoreLostTabs(url, activity, subscriber);
|
restoreLostTabs(url, activity, subscriber);
|
||||||
} else {
|
} else {
|
||||||
newTab(activity, null, false);
|
if (!TextUtils.isEmpty(url)) {
|
||||||
|
newTab(activity, url, false);
|
||||||
|
} else {
|
||||||
|
newTab(activity, null, false);
|
||||||
|
}
|
||||||
finishInitialization();
|
finishInitialization();
|
||||||
subscriber.onComplete();
|
subscriber.onComplete();
|
||||||
}
|
}
|
||||||
|
@ -127,6 +127,13 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
|
|||||||
ThemeUtils.getIconLightThemeColor(context);
|
ThemeUtils.getIconLightThemeColor(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TabsManager getTabsManager() {
|
||||||
|
if (mTabsManager == null) {
|
||||||
|
mTabsManager = mUiController.getTabModel();
|
||||||
|
}
|
||||||
|
return mTabsManager;
|
||||||
|
}
|
||||||
|
|
||||||
// Handle bookmark click
|
// Handle bookmark click
|
||||||
private final OnItemClickListener mItemClickListener = new OnItemClickListener() {
|
private final OnItemClickListener mItemClickListener = new OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -311,7 +318,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
|
|||||||
mUiController.bookmarkButtonClicked();
|
mUiController.bookmarkButtonClicked();
|
||||||
break;
|
break;
|
||||||
case R.id.action_reading:
|
case R.id.action_reading:
|
||||||
LightningView currentTab = mTabsManager.getCurrentTab();
|
LightningView currentTab = getTabsManager().getCurrentTab();
|
||||||
if (currentTab != null) {
|
if (currentTab != null) {
|
||||||
Intent read = new Intent(getActivity(), ReadingActivity.class);
|
Intent read = new Intent(getActivity(), ReadingActivity.class);
|
||||||
read.putExtra(Constants.LOAD_READING_URL, currentTab.getUrl());
|
read.putExtra(Constants.LOAD_READING_URL, currentTab.getUrl());
|
||||||
@ -319,7 +326,7 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.action_toggle_desktop:
|
case R.id.action_toggle_desktop:
|
||||||
LightningView current = mTabsManager.getCurrentTab();
|
LightningView current = getTabsManager().getCurrentTab();
|
||||||
if (current != null) {
|
if (current != null) {
|
||||||
current.toggleDesktopUA(getActivity());
|
current.toggleDesktopUA(getActivity());
|
||||||
current.reload();
|
current.reload();
|
||||||
|
@ -147,6 +147,13 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
|||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TabsManager getTabsManager() {
|
||||||
|
if (mTabsManager == null) {
|
||||||
|
mTabsManager = mUiController.getTabModel();
|
||||||
|
}
|
||||||
|
return mTabsManager;
|
||||||
|
}
|
||||||
|
|
||||||
private void setupFrameLayoutButton(@NonNull final View root, @IdRes final int buttonId,
|
private void setupFrameLayoutButton(@NonNull final View root, @IdRes final int buttonId,
|
||||||
@IdRes final int imageId) {
|
@IdRes final int imageId) {
|
||||||
final View frameButton = root.findViewById(buttonId);
|
final View frameButton = root.findViewById(buttonId);
|
||||||
@ -210,7 +217,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
|||||||
public void onClick(@NonNull View v) {
|
public void onClick(@NonNull View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.tab_header_button:
|
case R.id.tab_header_button:
|
||||||
mUiController.showCloseDialog(mTabsManager.indexOfCurrentTab());
|
mUiController.showCloseDialog(getTabsManager().indexOfCurrentTab());
|
||||||
break;
|
break;
|
||||||
case R.id.new_tab_button:
|
case R.id.new_tab_button:
|
||||||
mUiController.newTabButtonClicked();
|
mUiController.newTabButtonClicked();
|
||||||
@ -243,7 +250,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
|||||||
@Override
|
@Override
|
||||||
public void tabAdded() {
|
public void tabAdded() {
|
||||||
if (mTabsAdapter != null) {
|
if (mTabsAdapter != null) {
|
||||||
mTabsAdapter.notifyItemInserted(mTabsManager.last());
|
mTabsAdapter.notifyItemInserted(getTabsManager().last());
|
||||||
mRecyclerView.postDelayed(new Runnable() {
|
mRecyclerView.postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@ -315,7 +322,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
|||||||
|
|
||||||
ViewCompat.jumpDrawablesToCurrentState(holder.exitButton);
|
ViewCompat.jumpDrawablesToCurrentState(holder.exitButton);
|
||||||
|
|
||||||
LightningView web = mTabsManager.getTabAtPosition(position);
|
LightningView web = getTabsManager().getTabAtPosition(position);
|
||||||
if (web == null) {
|
if (web == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -360,7 +367,7 @@ public class TabsFragment extends Fragment implements View.OnClickListener, View
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return mTabsManager.size();
|
return getTabsManager().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Bitmap getDesaturatedBitmap(@NonNull Bitmap favicon) {
|
public Bitmap getDesaturatedBitmap(@NonNull Bitmap favicon) {
|
||||||
|
@ -15,6 +15,13 @@ import android.widget.Filterable;
|
|||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.anthonycr.bonsai.Action;
|
||||||
|
import com.anthonycr.bonsai.Observable;
|
||||||
|
import com.anthonycr.bonsai.OnSubscribe;
|
||||||
|
import com.anthonycr.bonsai.Scheduler;
|
||||||
|
import com.anthonycr.bonsai.Schedulers;
|
||||||
|
import com.anthonycr.bonsai.Subscriber;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -33,14 +40,6 @@ import acr.browser.lightning.database.BookmarkManager;
|
|||||||
import acr.browser.lightning.database.HistoryDatabase;
|
import acr.browser.lightning.database.HistoryDatabase;
|
||||||
import acr.browser.lightning.database.HistoryItem;
|
import acr.browser.lightning.database.HistoryItem;
|
||||||
import acr.browser.lightning.preference.PreferenceManager;
|
import acr.browser.lightning.preference.PreferenceManager;
|
||||||
|
|
||||||
import com.anthonycr.bonsai.Action;
|
|
||||||
import com.anthonycr.bonsai.Observable;
|
|
||||||
import com.anthonycr.bonsai.OnSubscribe;
|
|
||||||
import com.anthonycr.bonsai.Scheduler;
|
|
||||||
import com.anthonycr.bonsai.Schedulers;
|
|
||||||
import com.anthonycr.bonsai.Subscriber;
|
|
||||||
|
|
||||||
import acr.browser.lightning.utils.ThemeUtils;
|
import acr.browser.lightning.utils.ThemeUtils;
|
||||||
|
|
||||||
public class SuggestionsAdapter extends BaseAdapter implements Filterable {
|
public class SuggestionsAdapter extends BaseAdapter implements Filterable {
|
||||||
@ -99,8 +98,16 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void refreshBookmarks() {
|
public void refreshBookmarks() {
|
||||||
mAllBookmarks.clear();
|
Observable.create(new Action<Void>() {
|
||||||
mAllBookmarks.addAll(mBookmarkManager.getAllBookmarks(true));
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Subscriber<Void> subscriber) {
|
||||||
|
mAllBookmarks.clear();
|
||||||
|
mAllBookmarks.addAll(mBookmarkManager.getAllBookmarks(true));
|
||||||
|
|
||||||
|
subscriber.onComplete();
|
||||||
|
}
|
||||||
|
}).subscribeOn(Schedulers.io())
|
||||||
|
.subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user