Commit d989110c authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf
Browse files

Update to Sliding Menu API

parent 624a5a2d
...@@ -124,13 +124,13 @@ public class MainActivity extends SherlockFragmentActivity { ...@@ -124,13 +124,13 @@ public class MainActivity extends SherlockFragmentActivity {
updateMenuOffset(); updateMenuOffset();
View v_main = LayoutInflater.from(this).inflate(R.layout.main, null); View v_main = LayoutInflater.from(this).inflate(R.layout.main, null);
mMenu.setViewAbove(v_main); mMenu.setContent(v_main);
View sidebar = LayoutInflater.from(this).inflate(R.layout.sidebar, null); View sidebar = LayoutInflater.from(this).inflate(R.layout.sidebar, null);
((ListView)sidebar).setFooterDividersEnabled(true); ((ListView)sidebar).setFooterDividersEnabled(true);
final ListView listView = (ListView)sidebar.findViewById(android.R.id.list); final ListView listView = (ListView)sidebar.findViewById(android.R.id.list);
mSidebarAdapter = new SidebarAdapter(getSupportFragmentManager()); mSidebarAdapter = new SidebarAdapter(getSupportFragmentManager());
listView.setAdapter(mSidebarAdapter); listView.setAdapter(mSidebarAdapter);
mMenu.setViewBehind(sidebar); mMenu.setMenu(sidebar);
/* Get the current version from package */ /* Get the current version from package */
PackageInfo pinfo = null; PackageInfo pinfo = null;
...@@ -184,7 +184,7 @@ public class MainActivity extends SherlockFragmentActivity { ...@@ -184,7 +184,7 @@ public class MainActivity extends SherlockFragmentActivity {
/* Add padding between the home button and the arrow */ /* Add padding between the home button and the arrow */
ImageView home = (ImageView)findViewById(Util.isHoneycombOrLater() ImageView home = (ImageView)findViewById(Util.isHoneycombOrLater()
? android.R.id.home : R.id.abs__home); ? android.R.id.home : R.id.abs__home);
if (home != null) if (home != null)
home.setPadding(20, 0, 0, 0); home.setPadding(20, 0, 0, 0);
/* Set up the sidebar click listener */ /* Set up the sidebar click listener */
......
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