Commit cc9fa4c4 authored by Max Lv's avatar Max Lv

refine the drawer indicator

parent 9041404f
...@@ -495,10 +495,16 @@ class Shadowsocks ...@@ -495,10 +495,16 @@ class Shadowsocks
menuAdapter.setListener(this) menuAdapter.setListener(this)
listView.setAdapter(menuAdapter) listView.setAdapter(menuAdapter)
drawer.setMenuView(listView) drawer.setMenuView(listView)
// The drawable that replaces the up indicator in the action bar
drawer.setSlideDrawable(R.drawable.ic_drawer) if (Utils.isLollipopOrAbove) {
// Whether the previous drawable should be shown drawer.setDrawerIndicatorEnabled(false)
drawer.setDrawerIndicatorEnabled(true) } else {
// The drawable that replaces the up indicator in the action bar
drawer.setSlideDrawable(R.drawable.ic_drawer)
// Whether the previous drawable should be shown
drawer.setDrawerIndicatorEnabled(true)
}
if (!isSinglePane) { if (!isSinglePane) {
drawer.openMenu(false) drawer.openMenu(false)
} }
...@@ -518,7 +524,7 @@ class Shadowsocks ...@@ -518,7 +524,7 @@ class Shadowsocks
getWindow.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); getWindow.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
getWindow.setStatusBarColor(getResources().getColor(R.color.grey3)); getWindow.setStatusBarColor(getResources().getColor(R.color.grey3));
getActionBar.setDisplayHomeAsUpEnabled(true) getActionBar.setDisplayHomeAsUpEnabled(true)
getActionBar.setDisplayShowHomeEnabled(false) getActionBar.setHomeAsUpIndicator(R.drawable.ic_drawer)
} else { } else {
getActionBar.setIcon(R.drawable.ic_stat_shadowsocks) getActionBar.setIcon(R.drawable.ic_stat_shadowsocks)
} }
...@@ -916,13 +922,13 @@ class Shadowsocks ...@@ -916,13 +922,13 @@ class Shadowsocks
private def showQrCode() { private def showQrCode() {
val image = new ImageView(this) val image = new ImageView(this)
image.setPadding(0, dp2px(20), 0, dp2px(20))
image.setLayoutParams(new LinearLayout.LayoutParams(-1, -1)) image.setLayoutParams(new LinearLayout.LayoutParams(-1, -1))
val qrcode = QRCode.from(Parser.generate(currentProfile)) val qrcode = QRCode.from(Parser.generate(currentProfile))
.withSize(dp2px(250), dp2px(250)).asInstanceOf[QRCode] .withSize(dp2px(250), dp2px(250)).asInstanceOf[QRCode]
image.setImageBitmap(qrcode.bitmap()) image.setImageBitmap(qrcode.bitmap())
new AlertDialog.Builder(this) new AlertDialog.Builder(this)
.setTitle(getString(R.string.qrcode))
.setCancelable(true) .setCancelable(true)
.setNegativeButton(getString(R.string.close), new DialogInterface.OnClickListener() { .setNegativeButton(getString(R.string.close), new DialogInterface.OnClickListener() {
override def onClick(dialog: DialogInterface, id: Int) { override def onClick(dialog: DialogInterface, id: Int) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment