Skip to content

Commit

Permalink
optimize resources
Browse files Browse the repository at this point in the history
* remove redundant resources
* remove redundant code
* code optimization
  • Loading branch information
fr3ts0n committed Jan 6, 2017
1 parent 24c01ee commit c1093ef
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 527 deletions.
2 changes: 2 additions & 0 deletions project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@

# Project target.
target=android-25
manifestmerger.enabled=false
android.package.excludes=info
Binary file removed res/drawable-hdpi/drawer_shadow.9.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_drawer.png
Binary file not shown.
Binary file removed res/drawable-hdpi/ic_launcher.png
Binary file not shown.
Binary file removed res/drawable-mdpi/drawer_shadow.9.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_drawer.png
Binary file not shown.
Binary file removed res/drawable-mdpi/ic_launcher.png
Binary file not shown.
Binary file removed res/drawable-xhdpi/drawer_shadow.9.png
Binary file not shown.
Binary file removed res/drawable-xhdpi/ic_drawer.png
Binary file not shown.
Binary file removed res/drawable-xhdpi/ic_launcher.png
Binary file not shown.
9 changes: 0 additions & 9 deletions res/menu/global.xml

This file was deleted.

52 changes: 8 additions & 44 deletions src/com/fr3ts0n/stagefever/NavigationDrawerFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
Expand Down Expand Up @@ -145,9 +143,12 @@ public void setUp(int fragmentId, DrawerLayout drawerLayout)
.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
// set up the drawer's list view with items and click listener

ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
ActionBar actionBar = getActivity().getActionBar();
if (actionBar != null)
{
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
}

// ActionBarDrawerToggle ties together the the proper interactions
// between the navigation drawer and the action bar app icon.
Expand Down Expand Up @@ -257,8 +258,8 @@ public void onAttach(Activity activity)
@Override
public void onDetach()
{
super.onDetach();
mCallbacks = null;
super.onDetach();
}

@Override
Expand All @@ -276,47 +277,10 @@ public void onConfigurationChanged(Configuration newConfig)
mDrawerToggle.onConfigurationChanged(newConfig);
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater)
{
// If the drawer is open, show the global app actions in the action bar. See
// also
// showGlobalContextActionBar, which controls the top-left area of the
// action bar.
if (mDrawerLayout != null && isDrawerOpen())
{
inflater.inflate(R.menu.global, menu);
showGlobalContextActionBar();
}
super.onCreateOptionsMenu(menu, inflater);
}

@Override
public boolean onOptionsItemSelected(MenuItem item)
{
if (mDrawerToggle.onOptionsItemSelected(item))
{
return true;
}

return super.onOptionsItemSelected(item);
}

/**
* Per the navigation drawer design guidelines, updates the action bar to show
* the global app 'context', rather than just what's in the current screen.
*/
private void showGlobalContextActionBar()
{
ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
actionBar.setTitle(R.string.app_name);
}

private ActionBar getActionBar()
{
return getActivity().getActionBar();
return mDrawerToggle.onOptionsItemSelected(item) || super.onOptionsItemSelected(item);
}

/**
Expand Down
191 changes: 0 additions & 191 deletions src/com/fr3ts0n/stagefever/util/SystemUiHider.java

This file was deleted.

72 changes: 0 additions & 72 deletions src/com/fr3ts0n/stagefever/util/SystemUiHiderBase.java

This file was deleted.

Loading

0 comments on commit c1093ef

Please sign in to comment.