Browse Source

Updated drawer UI and font

master
Anthony Restaino 11 years ago
parent
commit
dabddc2bf5
  1. BIN
      res/drawable-hdpi/ic_action_plus.png
  2. BIN
      res/drawable-hdpi/ic_action_star.png
  3. BIN
      res/drawable-mdpi/ic_action_plus.png
  4. BIN
      res/drawable-mdpi/ic_action_star.png
  5. BIN
      res/drawable-xhdpi/ic_action_plus.png
  6. BIN
      res/drawable-xhdpi/ic_action_star.png
  7. BIN
      res/drawable-xxhdpi/ic_action_plus.png
  8. BIN
      res/drawable-xxhdpi/ic_action_star.png
  9. 103
      res/layout/activity_main.xml
  10. 1
      res/layout/bookmark_list_item.xml
  11. 19
      res/layout/tab_list_item.xml
  12. 1
      res/values/styles.xml
  13. 12
      src/acr/browser/lightning/BrowserActivity.java

BIN
res/drawable-hdpi/ic_action_plus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

BIN
res/drawable-hdpi/ic_action_star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

BIN
res/drawable-mdpi/ic_action_plus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

BIN
res/drawable-mdpi/ic_action_star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

BIN
res/drawable-xhdpi/ic_action_plus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
res/drawable-xhdpi/ic_action_star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
res/drawable-xxhdpi/ic_action_plus.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

BIN
res/drawable-xxhdpi/ic_action_star.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

103
res/layout/activity_main.xml

@ -1,6 +1,4 @@ @@ -1,6 +1,4 @@
<!--
Copyright 2014 ACR Development
-->
<!-- Copyright 2014 ACR Development -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_layout"
android:layout_width="match_parent"
@ -25,33 +23,17 @@ @@ -25,33 +23,17 @@
android:progressDrawable="@drawable/progress" />
</LinearLayout>
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<!--
As the main content view, the view below consumes the entire
space available using match_parent in both dimensions.
-->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<!--
android:layout_gravity="start" tells DrawerLayout to treat
this as a sliding drawer on the left side for left-to-right
languages and on the right side for right-to-left languages.
The drawer is given a fixed width in dp and extends the full height of
the container. A solid background is used for contrast
with the content view.
-->
<RelativeLayout
android:id="@+id/drawer"
android:layout_width="@dimen/navigation_width"
@ -61,20 +43,44 @@ @@ -61,20 +43,44 @@
android:clickable="true"
android:orientation="vertical" >
<TextView
<RelativeLayout
android:id="@+id/new_tab_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@drawable/list_bg"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:id="@+id/plusIcon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="2dp"
android:contentDescription="Favicon"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:src="@drawable/ic_action_plus" >
</ImageView>
<TextView
android:id="@+id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/plusIcon"
android:gravity="center_vertical"
android:maxLines="1"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingLeft="12dp"
android:textStyle="bold"
android:paddingRight="16dp"
android:text="@string/action_new_tab"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000000" />
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:textColor="@color/black"
android:textStyle="bold" />
</RelativeLayout>
<View
android:id="@+id/view"
@ -89,9 +95,9 @@ @@ -89,9 +95,9 @@
android:layout_height="match_parent"
android:layout_above="@+id/lineView"
android:layout_below="@+id/view"
android:listSelector="@drawable/list_bg"
android:choiceMode="singleChoice"
android:dividerHeight="1dp" />
android:dividerHeight="1dp"
android:listSelector="@drawable/list_bg" />
<View
android:id="@+id/lineView"
@ -129,7 +135,6 @@ @@ -129,7 +135,6 @@
android:src="@drawable/ic_action_back" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/action_forward"
android:layout_width="match_parent"
@ -161,18 +166,44 @@ @@ -161,18 +166,44 @@
android:clickable="true"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/bookmark_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@drawable/list_bg"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:id="@+id/starIcon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="2dp"
android:contentDescription="Favicon"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:src="@drawable/ic_action_star" >
</ImageView>
<TextView
android:id="@+id/textView1"
android:id="@+id/text2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/starIcon"
android:gravity="center_vertical"
android:maxLines="1"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingLeft="12dp"
android:paddingRight="16dp"
android:text="@string/action_bookmarks"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#000000" />
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:textColor="@color/black"
android:textStyle="bold" />
</RelativeLayout>
<View
android:layout_width="fill_parent"
@ -183,9 +214,9 @@ @@ -183,9 +214,9 @@
android:id="@+id/right_drawer_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:listSelector="@drawable/list_bg"
android:divider="#bababa"
android:dividerHeight="1dp" />
android:dividerHeight="1dp"
android:listSelector="@drawable/list_bg" />
</LinearLayout>
</android.support.v4.widget.DrawerLayout>

1
res/layout/bookmark_list_item.xml

@ -23,6 +23,7 @@ @@ -23,6 +23,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:fontFamily="sans-serif-light"
android:maxLines="1"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingRight="4dp"

19
res/layout/tab_list_item.xml

@ -2,20 +2,20 @@ @@ -2,20 +2,20 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="56dp"
android:gravity="center_vertical"
android:background="@drawable/list_bg"
android:gravity="center_vertical"
android:orientation="horizontal" >
<ImageView
android:id="@+id/favicon1"
android:layout_width="24dp"
android:layout_height="24dp"
android:contentDescription="Favicon"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="2dp"
android:contentDescription="Favicon"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp" >
</ImageView>
@ -24,11 +24,12 @@ @@ -24,11 +24,12 @@
android:id="@+id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_centerVertical="true"
android:maxLines="1"
android:layout_toRightOf="@+id/favicon1"
android:layout_toLeftOf="@+id/delete1"
android:layout_toRightOf="@+id/favicon1"
android:fontFamily="sans-serif-light"
android:gravity="center_vertical"
android:maxLines="1"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:textColor="@color/dark_text" />
@ -36,15 +37,15 @@ @@ -36,15 +37,15 @@
<ImageView
android:id="@+id/delete1"
android:layout_width="30dp"
android:layout_centerVertical="true"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:contentDescription="Delete Tab"
android:gravity="center_vertical"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="6dp"
android:src="@drawable/ic_action_delete" >
</ImageView>

1
res/values/styles.xml

@ -43,6 +43,7 @@ @@ -43,6 +43,7 @@
<style name="normalText" >
<item name="android:textStyle">normal</item>
<item name="android:fontFamily">sans-serif-light</item>
</style>
</resources>

12
src/acr/browser/lightning/BrowserActivity.java

@ -107,7 +107,7 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -107,7 +107,7 @@ public class BrowserActivity extends Activity implements BrowserController {
private RelativeLayout mDrawer;
private LinearLayout mDrawerRight;
private ListView mDrawerListRight;
private TextView mNewTab;
private RelativeLayout mNewTab;
private ActionBarDrawerToggle mDrawerToggle;
private List<LightningView> mWebViews = new ArrayList<LightningView>();
private List<Integer> mIdList = new ArrayList<Integer>();
@ -187,7 +187,7 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -187,7 +187,7 @@ public class BrowserActivity extends Activity implements BrowserController {
mBrowserFrame = (FrameLayout) findViewById(R.id.content_frame);
mProgress = (ProgressBar) findViewById(R.id.activity_bar);
mProgress.setVisibility(View.GONE);
mNewTab = (TextView) findViewById(R.id.new_tab_button);
mNewTab = (RelativeLayout) findViewById(R.id.new_tab_button);
mDrawer = (RelativeLayout) findViewById(R.id.drawer);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerList = (ListView) findViewById(R.id.left_drawer);
@ -850,8 +850,16 @@ public class BrowserActivity extends Activity implements BrowserController { @@ -850,8 +850,16 @@ public class BrowserActivity extends Activity implements BrowserController {
if (mCurrentView != null) {
mCurrentView.loadUrl(mBookmarkList.get(position).getUrl());
}
// keep any jank from happening when the drawer is closed after the
// URL starts to load
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
mDrawerLayout.closeDrawer(mDrawerRight);
}
}, 150);
}
}
private class BookmarkItemLongClickListener implements

Loading…
Cancel
Save