mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-18 11:55:38 -04:00
Refactor bottom toolbar
This commit is contained in:
parent
5d48ee968e
commit
fefb12abe8
@ -41,33 +41,27 @@ public class BookmarksDao {
|
||||
}
|
||||
|
||||
public ArrayList<String> getBookmarks(String ZimId, String ZimName) {
|
||||
SquidCursor<Bookmarks> bookmarkCursor = mDb.query(
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
try (SquidCursor<Bookmarks> bookmarkCursor = mDb.query(
|
||||
Bookmarks.class,
|
||||
Query.selectDistinct(Bookmarks.BOOKMARK_URL).where(Bookmarks.ZIM_ID.eq(ZimId).or(Bookmarks.ZIM_NAME.eq(ZimName)))
|
||||
.orderBy(Bookmarks.BOOKMARK_TITLE.asc()));
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
try {
|
||||
.orderBy(Bookmarks.BOOKMARK_TITLE.asc()))) {
|
||||
while (bookmarkCursor.moveToNext()) {
|
||||
result.add(bookmarkCursor.get(Bookmarks.BOOKMARK_URL));
|
||||
}
|
||||
} finally {
|
||||
bookmarkCursor.close();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public ArrayList<String> getBookmarkTitles(String ZimId, String ZimName) {
|
||||
SquidCursor<Bookmarks> bookmarkCursor = mDb.query(
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
try (SquidCursor<Bookmarks> bookmarkCursor = mDb.query(
|
||||
Bookmarks.class,
|
||||
Query.selectDistinct(Bookmarks.BOOKMARK_TITLE).where(Bookmarks.ZIM_ID.eq(ZimId).or(Bookmarks.ZIM_NAME.eq(ZimName)))
|
||||
.orderBy(Bookmarks.BOOKMARK_TITLE.asc()));
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
try {
|
||||
.orderBy(Bookmarks.BOOKMARK_TITLE.asc()))) {
|
||||
while (bookmarkCursor.moveToNext()) {
|
||||
result.add(bookmarkCursor.get(Bookmarks.BOOKMARK_TITLE));
|
||||
}
|
||||
} finally {
|
||||
bookmarkCursor.close();
|
||||
}
|
||||
|
||||
|
||||
@ -76,9 +70,9 @@ public class BookmarksDao {
|
||||
|
||||
/**
|
||||
* Save bookmark by:
|
||||
* @param articleUrl
|
||||
* @param articleTitle
|
||||
* @param ZimId
|
||||
* @param articleUrl Url of the article
|
||||
* @param articleTitle Title of the article
|
||||
* @param ZimId Id of zim file containing article
|
||||
*/
|
||||
public void saveBookmark(String articleUrl, String articleTitle, String ZimId, String ZimName) {
|
||||
if (articleUrl != null) {
|
||||
|
@ -41,7 +41,6 @@ import android.provider.Settings;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
@ -60,7 +59,6 @@ import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.ActionMode;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
@ -108,6 +106,8 @@ import javax.inject.Inject;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import butterknife.OnLongClick;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||
@ -149,71 +149,91 @@ import static org.kiwix.kiwixmobile.utils.StyleUtils.dialogStyle;
|
||||
public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
MainContract.View, BooksAdapter.OnItemClickListener {
|
||||
|
||||
public static boolean isFullscreenOpened;
|
||||
private static final int REQUEST_READ_STORAGE_PERMISSION = 2;
|
||||
|
||||
private boolean isBackToTopEnabled = false;
|
||||
|
||||
private boolean wasHideToolbar = true;
|
||||
|
||||
private boolean isHideToolbar = true;
|
||||
|
||||
private boolean isSpeaking = false;
|
||||
|
||||
protected boolean requestClearHistoryAfterLoad = false;
|
||||
|
||||
protected boolean requestInitAllMenuItems = false;
|
||||
|
||||
private boolean isOpenNewTabInBackground;
|
||||
|
||||
private boolean isExternalLinkPopup;
|
||||
|
||||
public static boolean refresh;
|
||||
|
||||
public static boolean wifiOnly;
|
||||
|
||||
private static Uri KIWIX_LOCAL_MARKET_URI;
|
||||
|
||||
private static Uri KIWIX_BROWSER_MARKET_URI;
|
||||
|
||||
private String documentParserJs;
|
||||
|
||||
public static boolean nightMode;
|
||||
|
||||
private DocumentParser documentParser;
|
||||
|
||||
public List<DocumentSection> documentSections;
|
||||
|
||||
public Menu menu;
|
||||
|
||||
private MenuItem menuBookmarks;
|
||||
|
||||
private ArrayList<String> bookmarks;
|
||||
|
||||
private List<KiwixWebView> mWebViews = new ArrayList<>();
|
||||
|
||||
private KiwixTextToSpeech tts;
|
||||
|
||||
private CompatFindActionModeCallback compatCallback;
|
||||
|
||||
private TabDrawerAdapter tabDrawerAdapter;
|
||||
|
||||
private int currentWebViewIndex = 0;
|
||||
|
||||
private File file;
|
||||
|
||||
private ActionMode actionMode = null;
|
||||
|
||||
private KiwixWebView tempForUndo;
|
||||
|
||||
private RateAppCounter visitCounterPref;
|
||||
|
||||
private int tempVisitCount;
|
||||
|
||||
private boolean isFirstRun;
|
||||
|
||||
private static final String NEW_TAB = "NEW_TAB";
|
||||
|
||||
public static boolean isFullscreenOpened;
|
||||
public static boolean refresh;
|
||||
public static boolean wifiOnly;
|
||||
public static boolean nightMode;
|
||||
private static Uri KIWIX_LOCAL_MARKET_URI;
|
||||
private static Uri KIWIX_BROWSER_MARKET_URI;
|
||||
public List<DocumentSection> documentSections;
|
||||
public Menu menu;
|
||||
protected boolean requestClearHistoryAfterLoad = false;
|
||||
protected boolean requestInitAllMenuItems = false;
|
||||
@BindView(R.id.toolbar)
|
||||
Toolbar toolbar;
|
||||
@BindView(R.id.button_backtotop)
|
||||
Button backToTopButton;
|
||||
@BindView(R.id.button_stop_tts)
|
||||
Button stopTTSButton;
|
||||
@BindView(R.id.button_pause_tts)
|
||||
Button pauseTTSButton;
|
||||
@BindView(R.id.tts_controls)
|
||||
LinearLayout TTSControls;
|
||||
@BindView(R.id.toolbar_layout)
|
||||
RelativeLayout toolbarContainer;
|
||||
@BindView(R.id.progress_view)
|
||||
AnimatedProgressBar progressBar;
|
||||
@BindView(R.id.FullscreenControlButton)
|
||||
ImageButton exitFullscreenButton;
|
||||
@BindView(R.id.snackbar_layout)
|
||||
CoordinatorLayout snackbarLayout;
|
||||
@BindView(R.id.new_tab_button)
|
||||
RelativeLayout newTabButton;
|
||||
@BindView(R.id.drawer_layout)
|
||||
DrawerLayout drawerLayout;
|
||||
@BindView(R.id.left_drawer)
|
||||
LinearLayout tabDrawerLeftContainer;
|
||||
@BindView(R.id.right_drawer)
|
||||
LinearLayout tableDrawerRightContainer;
|
||||
@BindView(R.id.left_drawer_list)
|
||||
RecyclerView tabDrawerLeft;
|
||||
@BindView(R.id.right_drawer_list)
|
||||
RecyclerView tableDrawerRight;
|
||||
@BindView(R.id.content_frame)
|
||||
FrameLayout contentFrame;
|
||||
@BindView(R.id.action_back_button)
|
||||
ImageView tabBackButton;
|
||||
@BindView(R.id.action_forward_button)
|
||||
ImageView tabForwardButton;
|
||||
@BindView(R.id.action_back)
|
||||
View tabBackButtonContainer;
|
||||
@BindView(R.id.action_forward)
|
||||
View tabForwardButtonContainer;
|
||||
@BindView(R.id.bottom_toolbar)
|
||||
CardView bottomToolbar;
|
||||
@BindView(R.id.bottom_toolbar_bookmark)
|
||||
ImageView bookmark;
|
||||
@Inject
|
||||
OkHttpClient okHttpClient;
|
||||
@Inject
|
||||
SharedPreferenceUtil sharedPreferenceUtil;
|
||||
@Inject
|
||||
BookmarksDao bookmarksDao;
|
||||
@Inject
|
||||
MainContract.Presenter presenter;
|
||||
private boolean isBackToTopEnabled = false;
|
||||
private boolean wasHideToolbar = true;
|
||||
private boolean isHideToolbar = true;
|
||||
private boolean isSpeaking = false;
|
||||
private boolean isOpenNewTabInBackground;
|
||||
private boolean isExternalLinkPopup;
|
||||
private String documentParserJs;
|
||||
private DocumentParser documentParser;
|
||||
private MenuItem menuBookmarks;
|
||||
private ArrayList<String> bookmarks;
|
||||
private List<KiwixWebView> mWebViews = new ArrayList<>();
|
||||
private KiwixTextToSpeech tts;
|
||||
private CompatFindActionModeCallback compatCallback;
|
||||
private TabDrawerAdapter tabDrawerAdapter;
|
||||
private int currentWebViewIndex = 0;
|
||||
private File file;
|
||||
private ActionMode actionMode = null;
|
||||
private KiwixWebView tempForUndo;
|
||||
private RateAppCounter visitCounterPref;
|
||||
private int tempVisitCount;
|
||||
private boolean isFirstRun;
|
||||
private BooksAdapter booksAdapter;
|
||||
private List<LibraryNetworkEntity.Book> books = new ArrayList<>();
|
||||
private CardView emptyStateCardView;
|
||||
@ -236,58 +256,18 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
});
|
||||
|
||||
@BindView(R.id.toolbar) Toolbar toolbar;
|
||||
|
||||
@BindView(R.id.button_backtotop) Button backToTopButton;
|
||||
|
||||
@BindView(R.id.button_stop_tts) Button stopTTSButton;
|
||||
|
||||
@BindView(R.id.button_pause_tts) Button pauseTTSButton;
|
||||
|
||||
@BindView(R.id.tts_controls) LinearLayout TTSControls;
|
||||
|
||||
@BindView(R.id.toolbar_layout) RelativeLayout toolbarContainer;
|
||||
|
||||
@BindView(R.id.progress_view) AnimatedProgressBar progressBar;
|
||||
|
||||
@BindView(R.id.FullscreenControlButton) ImageButton exitFullscreenButton;
|
||||
|
||||
@BindView(R.id.snackbar_layout) CoordinatorLayout snackbarLayout;
|
||||
|
||||
@BindView(R.id.new_tab_button) RelativeLayout newTabButton;
|
||||
|
||||
@BindView(R.id.drawer_layout) DrawerLayout drawerLayout;
|
||||
|
||||
@BindView(R.id.left_drawer) LinearLayout tabDrawerLeftContainer;
|
||||
|
||||
@BindView(R.id.right_drawer) LinearLayout tableDrawerRightContainer;
|
||||
|
||||
@BindView(R.id.left_drawer_list) RecyclerView tabDrawerLeft;
|
||||
|
||||
@BindView(R.id.right_drawer_list) RecyclerView tableDrawerRight;
|
||||
|
||||
@BindView(R.id.content_frame) FrameLayout contentFrame;
|
||||
|
||||
@BindView(R.id.action_back_button) ImageView tabBackButton;
|
||||
|
||||
@BindView(R.id.action_forward_button) ImageView tabForwardButton;
|
||||
|
||||
@BindView(R.id.action_back) View tabBackButtonContainer;
|
||||
|
||||
@BindView(R.id.action_forward) View tabForwardButtonContainer;
|
||||
|
||||
@BindView(R.id.page_bottom_tab_layout) TabLayout pageBottomTabLayout;
|
||||
|
||||
@Inject OkHttpClient okHttpClient;
|
||||
|
||||
@Inject SharedPreferenceUtil sharedPreferenceUtil;
|
||||
|
||||
@Inject
|
||||
BookmarksDao bookmarksDao;
|
||||
|
||||
@Inject
|
||||
MainContract.Presenter presenter;
|
||||
public static void updateWidgets(Context context) {
|
||||
Intent intent = new Intent(context.getApplicationContext(), KiwixSearchWidget.class);
|
||||
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
|
||||
// Use an array and EXTRA_APPWIDGET_IDS instead of AppWidgetManager.EXTRA_APPWIDGET_ID,
|
||||
// since it seems the onUpdate() is only fired on that:
|
||||
AppWidgetManager widgetManager = AppWidgetManager.getInstance(context);
|
||||
int[] ids = widgetManager.getAppWidgetIds(new ComponentName(context, KiwixSearchWidget.class));
|
||||
|
||||
widgetManager.notifyAppWidgetViewDataChanged(ids, android.R.id.list);
|
||||
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActionModeStarted(ActionMode mode) {
|
||||
@ -320,62 +300,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private final TabLayout.OnTabSelectedListener pageBottomTabListener
|
||||
= new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
PageBottomTab.of(tab.getPosition()).select(pageActionTabsCallback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
onTabSelected(tab);
|
||||
}
|
||||
};
|
||||
|
||||
private PageBottomTab.Callback pageActionTabsCallback = new PageBottomTab.Callback() {
|
||||
@Override
|
||||
public void onHomeTabSelected() {
|
||||
openMainPage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFindInPageTabSelected() {
|
||||
compatCallback.setActive();
|
||||
compatCallback.setWebView(getCurrentWebView());
|
||||
startSupportActionMode(compatCallback);
|
||||
compatCallback.showSoftInput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFullscreenTabSelected() {
|
||||
if (isFullscreenOpened) {
|
||||
closeFullScreen();
|
||||
} else {
|
||||
openFullScreen();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRandomArticleTabSelected() {
|
||||
openRandomArticle();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBookmarkTabSelected() {
|
||||
toggleBookmark();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBookmarkTabLongClicked() {
|
||||
goToBookmarks();
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
@ -428,12 +352,14 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
TableDrawerAdapter tableDrawerAdapter = new TableDrawerAdapter();
|
||||
tableDrawerRight.setAdapter(tableDrawerAdapter);
|
||||
tableDrawerAdapter.setTableClickListener(new TableClickListener() {
|
||||
@Override public void onHeaderClick(View view) {
|
||||
@Override
|
||||
public void onHeaderClick(View view) {
|
||||
getCurrentWebView().setScrollY(0);
|
||||
drawerLayout.closeDrawer(GravityCompat.END);
|
||||
}
|
||||
|
||||
@Override public void onSectionClick(View view, int position) {
|
||||
@Override
|
||||
public void onSectionClick(View view, int position) {
|
||||
getCurrentWebView().loadUrl("javascript:document.getElementById('"
|
||||
+ documentSections.get(position).id
|
||||
+ "').scrollIntoView();");
|
||||
@ -445,7 +371,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
tableDrawerAdapter.notifyDataSetChanged();
|
||||
|
||||
tabDrawerAdapter.setTabClickListener(new TabDrawerAdapter.TabClickListener() {
|
||||
@Override public void onSelectTab(View view, int position) {
|
||||
@Override
|
||||
public void onSelectTab(View view, int position) {
|
||||
selectTab(position);
|
||||
|
||||
/* Bug Fix
|
||||
@ -456,7 +383,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
refreshNavigationButtons();
|
||||
}
|
||||
|
||||
@Override public void onCloseTab(View view, int position) {
|
||||
@Override
|
||||
public void onCloseTab(View view, int position) {
|
||||
closeTab(position);
|
||||
}
|
||||
});
|
||||
@ -479,7 +407,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
tableDrawerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override public void clearSections() {
|
||||
@Override
|
||||
public void clearSections() {
|
||||
documentSections.clear();
|
||||
tableDrawerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
@ -517,18 +446,6 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
startActivity(zimFile);
|
||||
}
|
||||
|
||||
pageBottomTabLayout.addOnTabSelectedListener(pageBottomTabListener);
|
||||
|
||||
View bookmarkTabView = LayoutInflater.from(MainActivity.this)
|
||||
.inflate(R.layout.bookmark_tab, null);
|
||||
bookmarkTabView.setOnClickListener(view -> PageBottomTab.of(4).select(pageActionTabsCallback));
|
||||
bookmarkTabView.setOnLongClickListener(view -> {
|
||||
PageBottomTab.of(4).longClick(pageActionTabsCallback);
|
||||
return true;
|
||||
});
|
||||
|
||||
pageBottomTabLayout.getTabAt(4).setCustomView(bookmarkTabView);
|
||||
|
||||
wasHideToolbar = isHideToolbar;
|
||||
|
||||
if (nightMode) {
|
||||
@ -542,6 +459,25 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
searchFiles();
|
||||
}
|
||||
|
||||
@OnClick(R.id.bottom_toolbar_arrow_back)
|
||||
void goBack() {
|
||||
if (getCurrentWebView().canGoBack()) {
|
||||
getCurrentWebView().goBack();
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.bottom_toolbar_arrow_forward)
|
||||
void goForward() {
|
||||
if (getCurrentWebView().canGoForward()) {
|
||||
getCurrentWebView().goForward();
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.bottom_toolbar_toc)
|
||||
void openToc() {
|
||||
drawerLayout.openDrawer(GravityCompat.END);
|
||||
}
|
||||
|
||||
private void backToTopAppearDaily() {
|
||||
backToTopButton.setAlpha(0.6f);
|
||||
backToTopButton.setBackgroundColor(getResources().getColor(R.color.back_to_top_background));
|
||||
@ -745,7 +681,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
AttributeSet attrs = StyleUtils.getAttributes(this, R.xml.webview);
|
||||
KiwixWebView webView;
|
||||
if (!isHideToolbar) {
|
||||
webView = new ToolbarScrollingKiwixWebView(MainActivity.this, this, toolbarContainer, pageBottomTabLayout , attrs);
|
||||
webView = new ToolbarScrollingKiwixWebView(MainActivity.this, this, toolbarContainer, bottomToolbar, attrs);
|
||||
((ToolbarScrollingKiwixWebView) webView).setOnToolbarVisibilityChangeListener(
|
||||
new ToolbarScrollingKiwixWebView.OnToolbarVisibilityChangeListener() {
|
||||
@Override
|
||||
@ -928,17 +864,19 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
private void goToBookmarks() {
|
||||
@OnLongClick(R.id.bottom_toolbar_bookmark)
|
||||
boolean goToBookmarks() {
|
||||
saveTabStates();
|
||||
Intent intentBookmarks = new Intent(getBaseContext(), BookmarksActivity.class);
|
||||
// FIXME: Looks like EXTRA below isn't used anywhere?
|
||||
intentBookmarks.putExtra(EXTRA_BOOKMARK_CONTENTS, bookmarks);
|
||||
startActivityForResult(intentBookmarks, BOOKMARK_CHOSEN_REQUEST);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void openFullScreen() {
|
||||
toolbarContainer.setVisibility(View.GONE);
|
||||
pageBottomTabLayout.setVisibility(View.GONE);
|
||||
bottomToolbar.setVisibility(View.GONE);
|
||||
if (menuBookmarks != null)
|
||||
menuBookmarks.setVisible(true);
|
||||
exitFullscreenButton.setVisibility(View.VISIBLE);
|
||||
@ -959,7 +897,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
private void closeFullScreen() {
|
||||
toolbarContainer.setVisibility(View.VISIBLE);
|
||||
if (sharedPreferenceUtil.getPrefBottomToolbar()) {
|
||||
pageBottomTabLayout.setVisibility(View.VISIBLE);
|
||||
bottomToolbar.setVisibility(View.VISIBLE);
|
||||
menuBookmarks.setVisible(false);
|
||||
}
|
||||
exitFullscreenButton.setVisibility(View.INVISIBLE);
|
||||
@ -1234,6 +1172,7 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
return false;
|
||||
}
|
||||
|
||||
@OnClick(R.id.bottom_toolbar_bookmark)
|
||||
public void toggleBookmark() {
|
||||
//Check maybe need refresh
|
||||
String article = getCurrentWebView().getUrl();
|
||||
@ -1302,12 +1241,12 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
|
||||
if (sharedPreferenceUtil.getPrefBottomToolbar()) {
|
||||
pageBottomTabLayout.setVisibility(View.VISIBLE);
|
||||
bottomToolbar.setVisibility(View.VISIBLE);
|
||||
if (menuBookmarks != null) {
|
||||
menuBookmarks.setVisible(false);
|
||||
}
|
||||
} else {
|
||||
pageBottomTabLayout.setVisibility(View.GONE);
|
||||
bottomToolbar.setVisibility(View.GONE);
|
||||
if (menuBookmarks != null) {
|
||||
menuBookmarks.setVisible(true);
|
||||
}
|
||||
@ -1390,8 +1329,12 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
|
||||
// TODO: change saving bookbark by zim name not id
|
||||
private void saveBookmark(String articleUrl, String articleTitle) {
|
||||
if (ZimContentProvider.getId() != null) {
|
||||
bookmarksDao.saveBookmark(articleUrl, articleTitle, ZimContentProvider.getId(), ZimContentProvider.getName());
|
||||
refreshBookmarks();
|
||||
} else {
|
||||
Toast.makeText(this, R.string.unable_to_add_to_bookmarks, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteBookmark(String article) {
|
||||
@ -1408,7 +1351,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this, dialogStyle());
|
||||
builder.setMessage(getString(R.string.hint_contents_drawer_message))
|
||||
.setPositiveButton(getString(R.string.got_it), (dialog, id) -> {})
|
||||
.setPositiveButton(getString(R.string.got_it), (dialog, id) -> {
|
||||
})
|
||||
.setTitle(getString(R.string.did_you_know))
|
||||
.setIcon(R.drawable.icon_question);
|
||||
AlertDialog alert = builder.create();
|
||||
@ -1429,28 +1373,16 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
return openArticle(articleUrl);
|
||||
}
|
||||
|
||||
public boolean openMainPage() {
|
||||
@OnClick(R.id.bottom_toolbar_home)
|
||||
public void openMainPage() {
|
||||
String articleUrl = ZimContentProvider.getMainPage();
|
||||
return openArticle(articleUrl);
|
||||
openArticle(articleUrl);
|
||||
}
|
||||
|
||||
public void readAloud() {
|
||||
tts.readAloud(getCurrentWebView());
|
||||
}
|
||||
|
||||
public static void updateWidgets(Context context) {
|
||||
Intent intent = new Intent(context.getApplicationContext(), KiwixSearchWidget.class);
|
||||
intent.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
|
||||
// Use an array and EXTRA_APPWIDGET_IDS instead of AppWidgetManager.EXTRA_APPWIDGET_ID,
|
||||
// since it seems the onUpdate() is only fired on that:
|
||||
AppWidgetManager widgetManager = AppWidgetManager.getInstance(context);
|
||||
int[] ids = widgetManager.getAppWidgetIds(new ComponentName(context, KiwixSearchWidget.class));
|
||||
|
||||
widgetManager.notifyAppWidgetViewDataChanged(ids, android.R.id.list);
|
||||
intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, ids);
|
||||
context.sendBroadcast(intent);
|
||||
}
|
||||
|
||||
private void setUpWebView() {
|
||||
|
||||
getCurrentWebView().getSettings().setJavaScriptEnabled(true);
|
||||
@ -1665,27 +1597,26 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
bookmarks = bookmarksDao.getBookmarks(ZimContentProvider.getId(), ZimContentProvider.getName());
|
||||
}
|
||||
|
||||
TabLayout.Tab bookmarkTab = pageBottomTabLayout.getTabAt(4);
|
||||
|
||||
if (menu.findItem(R.id.menu_bookmarks) != null &&
|
||||
getCurrentWebView().getUrl() != null &&
|
||||
ZimContentProvider.getId() != null &&
|
||||
!getCurrentWebView().getUrl().equals("file:///android_asset/help.html")) {
|
||||
int icon = bookmarks.contains(getCurrentWebView().getUrl()) ? R.drawable.action_bookmark_active : R.drawable.action_bookmark;
|
||||
int icon = bookmarks.contains(getCurrentWebView().getUrl()) ? R.drawable.ic_bookmark_24dp : R.drawable.ic_bookmark_border_24dp;
|
||||
|
||||
menu.findItem(R.id.menu_bookmarks)
|
||||
.setEnabled(true)
|
||||
.setIcon(icon)
|
||||
.getIcon().setAlpha(255);
|
||||
|
||||
bookmarkTab.getCustomView().findViewById(R.id.bookmark_tab_icon).setBackgroundResource(icon);
|
||||
bookmark.setImageResource(icon);
|
||||
} else {
|
||||
menu.findItem(R.id.menu_bookmarks)
|
||||
.setEnabled(false)
|
||||
.setIcon(R.drawable.action_bookmark)
|
||||
.setIcon(R.drawable.ic_bookmark_border_24dp)
|
||||
.getIcon().setAlpha(130);
|
||||
|
||||
bookmarkTab.getCustomView().findViewById(R.id.bookmark_tab_icon).setBackgroundResource(R.drawable.action_bookmark);
|
||||
bookmark.setImageResource(R.drawable.ic_bookmark_border_24dp);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1910,7 +1841,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
Log.d(TAG_KIWIX, "onPause Save currentzimfile to preferences: " + ZimContentProvider.getZimFile());
|
||||
}
|
||||
|
||||
@Override public void webViewUrlLoading() {
|
||||
@Override
|
||||
public void webViewUrlLoading() {
|
||||
if (isFirstRun && !BuildConfig.DEBUG) {
|
||||
contentsDrawerHint();
|
||||
sharedPreferenceUtil.putPrefIsFirstRun(false);// It is no longer the first run
|
||||
@ -1918,7 +1850,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void webViewUrlFinishedLoading() {
|
||||
@Override
|
||||
public void webViewUrlFinishedLoading() {
|
||||
updateTableOfContents();
|
||||
tabDrawerAdapter.notifyDataSetChanged();
|
||||
|
||||
@ -1926,12 +1859,14 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
refreshBookmarkSymbol(menu);
|
||||
}
|
||||
|
||||
@Override public void webViewFailedLoading(String url) {
|
||||
@Override
|
||||
public void webViewFailedLoading(String url) {
|
||||
String error = String.format(getString(R.string.error_articleurlnotfound), url);
|
||||
Toast.makeText(this, error, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override public void webViewProgressChanged(int progress) {
|
||||
@Override
|
||||
public void webViewProgressChanged(int progress) {
|
||||
progressBar.setProgress(progress);
|
||||
if (progress == 100) {
|
||||
if (requestClearHistoryAfterLoad) {
|
||||
@ -1945,12 +1880,14 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void webViewTitleUpdated(String title) {
|
||||
@Override
|
||||
public void webViewTitleUpdated(String title) {
|
||||
tabDrawerAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
|
||||
@Override public void webViewPageChanged(int page, int maxPages) {
|
||||
@Override
|
||||
public void webViewPageChanged(int page, int maxPages) {
|
||||
if (isBackToTopEnabled) {
|
||||
if (getCurrentWebView().getScrollY() > 200) {
|
||||
if (backToTopButton.getVisibility() == View.INVISIBLE && TTSControls.getVisibility() == View.GONE) {
|
||||
@ -1979,7 +1916,8 @@ public class MainActivity extends BaseActivity implements WebViewCallback,
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void webViewLongClick(final String url) {
|
||||
@Override
|
||||
public void webViewLongClick(final String url) {
|
||||
boolean handleEvent = false;
|
||||
if (url.startsWith(ZimContentProvider.CONTENT_URI.toString())) {
|
||||
// This is my web site, so do not override; let my WebView load the page
|
||||
|
@ -1,93 +0,0 @@
|
||||
/*
|
||||
* Kiwix Android
|
||||
* Copyright (C) 2018 Kiwix <android.kiwix.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.main;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
public enum PageBottomTab {
|
||||
HOME() {
|
||||
@Override
|
||||
public void select(@NonNull Callback cb) {
|
||||
cb.onHomeTabSelected();
|
||||
}
|
||||
},
|
||||
FIND_IN_PAGE() {
|
||||
@Override
|
||||
public void select(@NonNull Callback cb) {
|
||||
cb.onFindInPageTabSelected();
|
||||
}
|
||||
},
|
||||
FULL_SCREEN() {
|
||||
@Override
|
||||
public void select(@NonNull Callback cb) {
|
||||
cb.onFullscreenTabSelected();
|
||||
}
|
||||
},
|
||||
RANDOM_ARTICLE() {
|
||||
@Override
|
||||
public void select(@NonNull Callback cb) {
|
||||
cb.onRandomArticleTabSelected();
|
||||
}
|
||||
},
|
||||
|
||||
BOOKMARK() {
|
||||
@Override
|
||||
public void select(@NonNull Callback cb) {
|
||||
cb.onBookmarkTabSelected();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void longClick(@NonNull Callback cb) {
|
||||
cb.onBookmarkTabLongClicked();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@NonNull
|
||||
public static PageBottomTab of(int code) {
|
||||
switch (code) {
|
||||
case 0:
|
||||
return HOME;
|
||||
case 1:
|
||||
return FIND_IN_PAGE;
|
||||
case 2:
|
||||
return FULL_SCREEN;
|
||||
case 3:
|
||||
return RANDOM_ARTICLE;
|
||||
case 4:
|
||||
return BOOKMARK;
|
||||
default:
|
||||
throw new IllegalArgumentException("Tab position is: " + code);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void select(@NonNull Callback cb);
|
||||
|
||||
public void longClick(@NonNull Callback cb) {
|
||||
// Override me
|
||||
}
|
||||
|
||||
public interface Callback {
|
||||
void onHomeTabSelected();
|
||||
void onFindInPageTabSelected();
|
||||
void onFullscreenTabSelected();
|
||||
void onRandomArticleTabSelected();
|
||||
void onBookmarkTabSelected();
|
||||
void onBookmarkTabLongClicked();
|
||||
}
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Kiwix Android
|
||||
* Copyright (C) 2018 Kiwix <android.kiwix.org>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.kiwix.kiwixmobile.main;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import org.kiwix.kiwixmobile.R;
|
||||
|
||||
import butterknife.ButterKnife;
|
||||
|
||||
public class PageBottomTabLayout extends TabLayout {
|
||||
|
||||
public PageBottomTabLayout(Context context) {
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public PageBottomTabLayout(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public PageBottomTabLayout(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
inflate(getContext(), R.layout.page_bottom_tab_layout, this);
|
||||
ButterKnife.bind(this);
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="36dp"
|
||||
android:height="36dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z" />
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="36dp"
|
||||
android:height="36dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z" />
|
||||
</vector>
|
@ -1,9 +1,10 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:tint="#FFFFFF"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M7,14L5,14v5h5v-2L7,17v-3zM5,10h2L7,7h3L10,5L5,5v5zM17,17h-3v2h5v-5h-2v3zM14,5v2h3v3h2L19,5h-5z" />
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z" />
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_bookmark_border_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_bookmark_border_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M17,3L7,3c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3L19,5c0,-1.1 -0.9,-2 -2,-2zM17,18l-5,-2.18L7,18L7,5h10v13z" />
|
||||
</vector>
|
@ -1,12 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:autoMirrored="true"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0"
|
||||
tools:ignore="UnusedAttribute">
|
||||
<path
|
||||
android:fillColor="#FFFFFFFF"
|
||||
android:pathData="M20,19.59V8l-6,-6H6c-1.1,0 -1.99,0.9 -1.99,2L4,20c0,1.1 0.89,2 1.99,2H18c0.45,0 0.85,-0.15 1.19,-0.4l-4.43,-4.43c-0.8,0.52 -1.74,0.83 -2.76,0.83 -2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5c0,1.02 -0.31,1.96 -0.83,2.75L20,19.59zM9,13c0,1.66 1.34,3 3,3s3,-1.34 3,-3 -1.34,-3 -3,-3 -3,1.34 -3,3z" />
|
||||
</vector>
|
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M15.41,16.09l-4.58,-4.59 4.58,-4.59L14,5.5l-6,6 6,6z" />
|
||||
</vector>
|
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M8.59,16.34l4.58,-4.59 -4.58,-4.59L10,5.75l6,6 -6,6z" />
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_toc_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_toc_24dp.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M3,9h14L17,7L3,7v2zM3,13h14v-2L3,11v2zM3,17h14v-2L3,15v2zM19,17h2v-2h-2v2zM19,7v2h2L21,7h-2zM19,13h2v-2h-2v2z" />
|
||||
</vector>
|
@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bookmark_tab_icon"
|
||||
android:layout_width="@dimen/bookmark_tab_icon_width"
|
||||
android:layout_height="@dimen/bookmark_tab_icon_height"
|
||||
android:layout_centerInParent="true"
|
||||
app:srcCompat="@drawable/action_bookmark"
|
||||
android:contentDescription="@string/menu_bookmarks" />
|
||||
</RelativeLayout>
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/snackbar_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@ -44,8 +45,8 @@
|
||||
android:layout_margin="@dimen/fullscreen_control_button_margin"
|
||||
android:background="@color/back_to_top_background"
|
||||
android:hint="@string/menu_exitfullscreen"
|
||||
app:srcCompat="@drawable/fullscreen_exit"
|
||||
android:visibility="invisible" />
|
||||
android:visibility="invisible"
|
||||
app:srcCompat="@drawable/fullscreen_exit" />
|
||||
|
||||
|
||||
<Button
|
||||
@ -101,19 +102,73 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<org.kiwix.kiwixmobile.main.PageBottomTabLayout
|
||||
android:id="@+id/page_bottom_tab_layout"
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/bottom_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/grey"
|
||||
android:visibility="gone"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="@color/grey"
|
||||
app:tabSelectedTextColor="@color/grey" />
|
||||
app:cardElevation="8dp"
|
||||
tools:visibility="visible">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/primary">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_arrow_back"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_arrow_forward"
|
||||
app:layout_constraintHorizontal_chainStyle="spread"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_keyboard_arrow_left_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_arrow_forward"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_home"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_arrow_back"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_keyboard_arrow_right_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_home"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_bookmark"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_arrow_forward"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/action_home" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_bookmark"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/bottom_toolbar_toc"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_home"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_bookmark_border_24dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/bottom_toolbar_toc"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/bottom_toolbar_bookmark"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:srcCompat="@drawable/ic_toc_24dp" />
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/drawer_left" />
|
||||
|
@ -1,32 +0,0 @@
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/menu_home"
|
||||
android:icon="@drawable/action_home" />
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/menu_searchintext"
|
||||
android:icon="@drawable/ic_find_in_page" />
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/menu_fullscreen"
|
||||
android:icon="@drawable/fullscreen" />
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/menu_randomarticle"
|
||||
android:icon="@drawable/action_randomarticle" />
|
||||
|
||||
<android.support.design.widget.TabItem
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/menu_bookmarks"
|
||||
android:icon="@drawable/action_bookmark_active" />
|
||||
</merge>
|
@ -10,7 +10,7 @@
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_bookmarks"
|
||||
android:icon="@drawable/action_bookmark_active"
|
||||
android:icon="@drawable/ic_bookmark_24dp"
|
||||
android:title="@string/menu_bookmarks"
|
||||
android:visible="false"
|
||||
app:showAsAction="always" />
|
||||
|
@ -197,4 +197,5 @@
|
||||
<string name="welcome_to_the_family">Welcome to the family</string>
|
||||
<string name="save_books_offline">Save books offline</string>
|
||||
<string name="download_books_message">Download books and read wherever you are.</string>
|
||||
<string name="unable_to_add_to_bookmarks">Unable to add to bookmarks</string>
|
||||
</resources>
|
||||
|
Loading…
x
Reference in New Issue
Block a user