示例#1
0
 @Override
 public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
   if (PREF_DIRECTORY.equals(key)) {
     adapter.updateItem(
         adapter.getItemCount() - 1,
         new NavDrawerItem(
             R.drawable.ic_settings_applications_grey,
             NewMaterialApp.getDirectory(),
             NavDrawerItem.Type.Primary));
   }
 }
示例#2
0
 public void showPlayerElement(final boolean flag) {
   int count = adapter.getItemCount();
   if (!flag) {
     if (count <= COUNT_FRAGMENT) return;
     adapter.delete(4);
   } else {
     if (count > COUNT_FRAGMENT) return;
     adapter.add(
         4,
         new NavDrawerItem(
             R.drawable.ic_headset_grey,
             getResources().getString(R.string.tab_now_playing),
             NavDrawerItem.Type.Primary));
   }
 }
示例#3
0
 public void setItemChecked(int position) {
   adapter.selectPosition(--position);
 }