Change Navigation Drawer layout slightly, fix dark theme for drawer
This commit is contained in:
parent
5dafd6f815
commit
d9e888e8a9
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="acr.browser.lightning"
|
package="acr.browser.lightning"
|
||||||
android:versionCode="72"
|
android:versionCode="74"
|
||||||
android:versionName="4.0.4a" >
|
android:versionName="4.0.6a" >
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
|
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />
|
||||||
|
BIN
res/drawable-hdpi/ic_action_tabs_dark.png
Normal file
BIN
res/drawable-hdpi/ic_action_tabs_dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 165 B |
BIN
res/drawable-hdpi/ic_action_tabs_light.png
Normal file
BIN
res/drawable-hdpi/ic_action_tabs_light.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 178 B |
BIN
res/drawable-xhdpi/ic_action_tabs_dark.png
Normal file
BIN
res/drawable-xhdpi/ic_action_tabs_dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 177 B |
BIN
res/drawable-xhdpi/ic_action_tabs_light.png
Normal file
BIN
res/drawable-xhdpi/ic_action_tabs_light.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 193 B |
BIN
res/drawable-xxhdpi/ic_action_tabs_dark.png
Normal file
BIN
res/drawable-xxhdpi/ic_action_tabs_dark.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 235 B |
BIN
res/drawable-xxhdpi/ic_action_tabs_light.png
Normal file
BIN
res/drawable-xxhdpi/ic_action_tabs_light.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 252 B |
7
res/drawable/list_bg_dark.xml
Normal file
7
res/drawable/list_bg_dark.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:drawable="@color/selected_dark" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/selected_dark" android:state_activated="true"/>
|
||||||
|
|
||||||
|
</selector>
|
7
res/drawable/list_bg_light.xml
Normal file
7
res/drawable/list_bg_light.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item android:drawable="@color/selected_light" android:state_pressed="true"/>
|
||||||
|
<item android:drawable="@color/selected_light" android:state_activated="true"/>
|
||||||
|
|
||||||
|
</selector>
|
@ -13,35 +13,35 @@
|
|||||||
android:id="@+id/bookmark_title"
|
android:id="@+id/bookmark_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:background="?attr/listBackground"
|
android:background="?attr/dividerColor"
|
||||||
android:clickable="true"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/starIcon"
|
android:id="@+id/starIcon"
|
||||||
android:layout_width="24dp"
|
android:layout_width="26dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="26dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="15dp"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="15dp"
|
||||||
android:contentDescription="Favicon"
|
android:contentDescription="Favicon"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:src="?attr/starDrawable" >
|
android:src="?attr/starDrawable" >
|
||||||
</ImageView>
|
</ImageView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text2"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_toRightOf="@+id/starIcon"
|
android:layout_toRightOf="@+id/starIcon"
|
||||||
|
android:fontFamily="sans-serif-light"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
android:text="@string/action_bookmarks"
|
android:text="@string/action_bookmarks"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItemSmall" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:background="@drawable/list_bg"
|
android:background="?attr/selectedBackground"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
@ -20,12 +20,13 @@
|
|||||||
android:id="@+id/textBookmark"
|
android:id="@+id/textBookmark"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:fontFamily="sans-serif-light"
|
android:fontFamily="sans-serif-light"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
||||||
android:paddingRight="16dp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItemSmall" />
|
android:textAppearance="?android:attr/textAppearanceListItemSmall" />
|
||||||
|
|
||||||
|
@ -10,37 +10,37 @@
|
|||||||
android:orientation="vertical" >
|
android:orientation="vertical" >
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/new_tab_button"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
android:background="?attr/listBackground"
|
android:background="?attr/dividerColor"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/plusIcon"
|
android:id="@+id/plusIcon"
|
||||||
android:layout_width="24dp"
|
android:layout_width="26dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="26dp"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="15dp"
|
||||||
android:layout_marginRight="16dp"
|
android:layout_marginRight="15dp"
|
||||||
android:contentDescription="@string/action_new_tab"
|
android:contentDescription="@string/action_new_tab"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:src="?attr/plusDrawable" >
|
android:src="?attr/tabDrawable" >
|
||||||
</ImageView>
|
</ImageView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/text1"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_toRightOf="@+id/plusIcon"
|
android:layout_toRightOf="@+id/plusIcon"
|
||||||
|
android:fontFamily="sans-serif-light"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:maxLines="1"
|
android:maxLines="1"
|
||||||
android:minHeight="?android:attr/listPreferredItemHeightSmall"
|
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||||
android:text="@string/action_new_tab"
|
android:text="@string/tabs"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItemSmall" />
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
@ -65,12 +65,12 @@
|
|||||||
android:background="?attr/dividerColor" />
|
android:background="?attr/dividerColor" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/linearLayout1"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="?attr/actionBarSize"
|
android:layout_height="?attr/actionBarSize"
|
||||||
|
android:background="?attr/dividerColor"
|
||||||
android:baselineAligned="false"
|
android:baselineAligned="false"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:weightSum="2" >
|
android:weightSum="3" >
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/action_back"
|
android:id="@+id/action_back"
|
||||||
@ -92,6 +92,27 @@
|
|||||||
android:src="?attr/arrowBackDrawable" />
|
android:src="?attr/arrowBackDrawable" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/new_tab_button"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="?attr/listBackground"
|
||||||
|
android:clickable="true" >
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:contentDescription="@string/action_new_tab"
|
||||||
|
android:paddingBottom="4dp"
|
||||||
|
android:paddingLeft="4dp"
|
||||||
|
android:paddingRight="4dp"
|
||||||
|
android:paddingTop="4dp"
|
||||||
|
android:src="?attr/plusDrawable" >
|
||||||
|
</ImageView>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/action_forward"
|
android:id="@+id/action_forward"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:background="@drawable/list_bg"
|
android:background="?attr/selectedBackground"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
|
|
||||||
@ -23,6 +23,8 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
android:layout_toLeftOf="@+id/deleteButton"
|
android:layout_toLeftOf="@+id/deleteButton"
|
||||||
android:layout_toRightOf="@+id/faviconTab"
|
android:layout_toRightOf="@+id/faviconTab"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
@ -35,16 +37,15 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/deleteButton"
|
android:id="@+id/deleteButton"
|
||||||
android:layout_width="30dp"
|
android:layout_width="48dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="48dp"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginRight="13dp"
|
android:layout_marginRight="4dp"
|
||||||
android:alpha="0.5"
|
|
||||||
android:background="?attr/actionBarItemBackground"
|
android:background="?attr/actionBarItemBackground"
|
||||||
android:contentDescription="Delete Tab"
|
android:contentDescription="Delete Tab"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:padding="3dp"
|
android:padding="12dp"
|
||||||
android:src="?attr/deleteDrawable" >
|
android:src="?attr/deleteDrawable" >
|
||||||
</ImageView>
|
</ImageView>
|
||||||
|
|
||||||
|
@ -57,6 +57,8 @@
|
|||||||
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
||||||
<item name="starDrawable">@drawable/ic_action_star</item>
|
<item name="starDrawable">@drawable/ic_action_star</item>
|
||||||
<item name="dividerColor">@color/divider_light</item>
|
<item name="dividerColor">@color/divider_light</item>
|
||||||
|
<item name="tabDrawable">@drawable/ic_action_tabs_light</item>
|
||||||
|
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.DarkTheme" parent="Theme.AppCompat">
|
<style name="Theme.DarkTheme" parent="Theme.AppCompat">
|
||||||
@ -83,6 +85,8 @@
|
|||||||
<item name="deleteDrawable">@drawable/ic_action_delete_dark</item>
|
<item name="deleteDrawable">@drawable/ic_action_delete_dark</item>
|
||||||
<item name="starDrawable">@drawable/ic_action_star_dark</item>
|
<item name="starDrawable">@drawable/ic_action_star_dark</item>
|
||||||
<item name="dividerColor">@color/divider_dark</item>
|
<item name="dividerColor">@color/divider_dark</item>
|
||||||
|
<item name="tabDrawable">@drawable/ic_action_tabs_dark</item>
|
||||||
|
<item name="selectedBackground">@drawable/list_bg_dark</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -16,7 +16,9 @@
|
|||||||
<attr name="plusDrawable" format="reference|color" />
|
<attr name="plusDrawable" format="reference|color" />
|
||||||
<attr name="deleteDrawable" format="reference|color" />
|
<attr name="deleteDrawable" format="reference|color" />
|
||||||
<attr name="starDrawable" format="reference|color" />
|
<attr name="starDrawable" format="reference|color" />
|
||||||
|
<attr name="tabDrawable" format="reference|color" />
|
||||||
<attr name="dividerColor" format="reference|color" />
|
<attr name="dividerColor" format="reference|color" />
|
||||||
|
<attr name="selectedBackground" format="reference|color" />
|
||||||
|
|
||||||
<declare-styleable name="AnimatedProgressBar">
|
<declare-styleable name="AnimatedProgressBar">
|
||||||
<attr name="progressColor" format="color" />
|
<attr name="progressColor" format="color" />
|
||||||
|
@ -28,4 +28,8 @@
|
|||||||
<color name="divider_dark">#1EFFFFFF</color>
|
<color name="divider_dark">#1EFFFFFF</color>
|
||||||
<color name="divider_light">#1E000000</color>
|
<color name="divider_light">#1E000000</color>
|
||||||
|
|
||||||
|
|
||||||
|
<color name="selected_dark">#0FFFFFFF</color>
|
||||||
|
<color name="selected_light">#0F000000</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
@ -213,4 +213,5 @@
|
|||||||
<string name="invert_color">Invert color</string>
|
<string name="invert_color">Invert color</string>
|
||||||
<string name="dark_theme">Use Dark Theme</string>
|
<string name="dark_theme">Use Dark Theme</string>
|
||||||
<string name="change_after_restart">The theme change will take effect after you restart the browser.</string>
|
<string name="change_after_restart">The theme change will take effect after you restart the browser.</string>
|
||||||
|
<string name="tabs">Tabs</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -56,7 +56,9 @@
|
|||||||
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
||||||
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
||||||
<item name="starDrawable">@drawable/ic_action_star</item>
|
<item name="starDrawable">@drawable/ic_action_star</item>
|
||||||
|
<item name="tabDrawable">@drawable/ic_action_tabs_light</item>
|
||||||
<item name="dividerColor">@color/divider_light</item>
|
<item name="dividerColor">@color/divider_light</item>
|
||||||
|
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.DarkTheme" parent="Theme.AppCompat">
|
<style name="Theme.DarkTheme" parent="Theme.AppCompat">
|
||||||
@ -82,7 +84,9 @@
|
|||||||
<item name="plusDrawable">@drawable/ic_action_plus_dark</item>
|
<item name="plusDrawable">@drawable/ic_action_plus_dark</item>
|
||||||
<item name="deleteDrawable">@drawable/ic_action_delete_dark</item>
|
<item name="deleteDrawable">@drawable/ic_action_delete_dark</item>
|
||||||
<item name="starDrawable">@drawable/ic_action_star_dark</item>
|
<item name="starDrawable">@drawable/ic_action_star_dark</item>
|
||||||
|
<item name="tabDrawable">@drawable/ic_action_tabs_dark</item>
|
||||||
<item name="dividerColor">@color/divider_dark</item>
|
<item name="dividerColor">@color/divider_dark</item>
|
||||||
|
<item name="selectedBackground">@drawable/list_bg_dark</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="overFlowButtonStyle" parent="@style/Widget.AppCompat.ActionButton.Overflow">
|
<style name="overFlowButtonStyle" parent="@style/Widget.AppCompat.ActionButton.Overflow">
|
||||||
|
@ -125,7 +125,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
private synchronized void initialize() {
|
private synchronized void initialize() {
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
getWindow().setBackgroundDrawable(null);
|
||||||
mToolbar = (Toolbar) findViewById(R.id.toolbar);
|
mToolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(mToolbar);
|
setSupportActionBar(mToolbar);
|
||||||
|
|
||||||
@ -147,7 +147,6 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
}
|
}
|
||||||
mActivity = this;
|
mActivity = this;
|
||||||
mClickHandler = new ClickHandler(this);
|
mClickHandler = new ClickHandler(this);
|
||||||
getWindow().setBackgroundDrawable(null);
|
|
||||||
mBrowserFrame = (FrameLayout) findViewById(R.id.content_frame);
|
mBrowserFrame = (FrameLayout) findViewById(R.id.content_frame);
|
||||||
mToolbarLayout = (LinearLayout) findViewById(R.id.toolbar_layout);
|
mToolbarLayout = (LinearLayout) findViewById(R.id.toolbar_layout);
|
||||||
mPageLayout = (LinearLayout) findViewById(R.id.main_layout);
|
mPageLayout = (LinearLayout) findViewById(R.id.main_layout);
|
||||||
@ -896,7 +895,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
mIsNewIntent = false;
|
mIsNewIntent = false;
|
||||||
selectItem(position);
|
showTab(mWebViews.get(position));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1107,18 +1106,10 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
// don't delete the tab because the browser will close and mess stuff up
|
// don't delete the tab because the browser will close and mess stuff up
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectItem(final int position) {
|
|
||||||
// update selected item and title, then close the drawer
|
|
||||||
|
|
||||||
showTab(mWebViews.get(position));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override
|
@Override
|
||||||
public void onTrimMemory(int level) {
|
public void onTrimMemory(int level) {
|
||||||
if (level > TRIM_MEMORY_RUNNING_MODERATE
|
if (level > TRIM_MEMORY_MODERATE && Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||||
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
|
||||||
Log.d(Constants.TAG, "Low Memory, Free Memory");
|
Log.d(Constants.TAG, "Low Memory, Free Memory");
|
||||||
for (LightningView view : mWebViews) {
|
for (LightningView view : mWebViews) {
|
||||||
view.getWebView().freeMemory();
|
view.getWebView().freeMemory();
|
||||||
@ -1380,7 +1371,7 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
supportInvalidateOptionsMenu();
|
supportInvalidateOptionsMenu();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1553,8 +1544,6 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
mToolbarLayout.setBackgroundColor(finalColor);
|
|
||||||
mPageLayout.setBackgroundColor(finalColor);
|
|
||||||
anim.setDuration(300);
|
anim.setDuration(300);
|
||||||
anim.start();
|
anim.start();
|
||||||
}
|
}
|
||||||
@ -1778,23 +1767,6 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateProgress(int n) {
|
public void updateProgress(int n) {
|
||||||
/*
|
|
||||||
* if (n > mProgressBar.getProgress()) { ObjectAnimator animator =
|
|
||||||
* ObjectAnimator.ofInt(mProgressBar, "progress", n);
|
|
||||||
* animator.setDuration(200); animator.setInterpolator(new
|
|
||||||
* DecelerateInterpolator()); animator.start(); } else if (n <
|
|
||||||
* mProgressBar.getProgress()) { ObjectAnimator animator =
|
|
||||||
* ObjectAnimator.ofInt(mProgressBar, "progress", 0, n);
|
|
||||||
* animator.setDuration(200); animator.setInterpolator(new
|
|
||||||
* DecelerateInterpolator()); animator.start(); } if (n >= 100) {
|
|
||||||
* Handler handler = new Handler(); handler.postDelayed(new Runnable() {
|
|
||||||
*
|
|
||||||
* @Override public void run() {
|
|
||||||
* mProgressBar.setVisibility(View.INVISIBLE); setIsFinishedLoading(); }
|
|
||||||
* }, 200);
|
|
||||||
*
|
|
||||||
* } else { mProgressBar.setVisibility(View.VISIBLE); setIsLoading(); }
|
|
||||||
*/
|
|
||||||
if (n >= 100) {
|
if (n >= 100) {
|
||||||
setIsFinishedLoading();
|
setIsFinishedLoading();
|
||||||
} else {
|
} else {
|
||||||
@ -2534,42 +2506,42 @@ public class BrowserActivity extends ThemableActivity implements BrowserControll
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
switch (v.getId()) {
|
switch (v.getId()) {
|
||||||
case R.id.action_back:
|
case R.id.action_back:
|
||||||
if (mCurrentView != null) {
|
if (mCurrentView != null) {
|
||||||
if (mCurrentView.canGoBack()) {
|
if (mCurrentView.canGoBack()) {
|
||||||
mCurrentView.goBack();
|
mCurrentView.goBack();
|
||||||
|
} else {
|
||||||
|
deleteTab(mDrawerListLeft.getCheckedItemPosition());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case R.id.action_forward:
|
||||||
|
if (mCurrentView != null) {
|
||||||
|
if (mCurrentView.canGoForward()) {
|
||||||
|
mCurrentView.goForward();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case R.id.arrow_button:
|
||||||
|
if (mSearch != null && mSearch.hasFocus()) {
|
||||||
|
mCurrentView.requestFocus();
|
||||||
} else {
|
} else {
|
||||||
deleteTab(mDrawerListLeft.getCheckedItemPosition());
|
mDrawerLayout.openDrawer(mDrawerLeft);
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
case R.id.new_tab_button:
|
||||||
case R.id.action_forward:
|
newTab(null, true);
|
||||||
if (mCurrentView != null) {
|
break;
|
||||||
if (mCurrentView.canGoForward()) {
|
case R.id.button_next:
|
||||||
mCurrentView.goForward();
|
mCurrentView.getWebView().findNext(false);
|
||||||
}
|
break;
|
||||||
}
|
case R.id.button_back:
|
||||||
break;
|
mCurrentView.getWebView().findNext(true);
|
||||||
case R.id.arrow_button:
|
break;
|
||||||
if (mSearch != null && mSearch.hasFocus()) {
|
case R.id.button_quit:
|
||||||
mCurrentView.requestFocus();
|
mCurrentView.getWebView().clearMatches();
|
||||||
} else {
|
mSearchBar.setVisibility(View.GONE);
|
||||||
mDrawerLayout.openDrawer(mDrawerLeft);
|
break;
|
||||||
}
|
|
||||||
break;
|
|
||||||
case R.id.new_tab_button:
|
|
||||||
newTab(null, true);
|
|
||||||
break;
|
|
||||||
case R.id.button_next:
|
|
||||||
mCurrentView.getWebView().findNext(false);
|
|
||||||
break;
|
|
||||||
case R.id.button_back:
|
|
||||||
mCurrentView.getWebView().findNext(true);
|
|
||||||
break;
|
|
||||||
case R.id.button_quit:
|
|
||||||
mCurrentView.getWebView().clearMatches();
|
|
||||||
mSearchBar.setVisibility(View.GONE);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user