Replaced anonymous classes with lambda

This commit is contained in:
Moez Bhatti
2015-10-30 19:59:52 -04:00
parent 9186e5a9cb
commit bcef7a225f
@@ -19,7 +19,6 @@ import android.view.MenuInflater;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView; import android.widget.ImageView;
import com.melnykov.fab.FloatingActionButton; import com.melnykov.fab.FloatingActionButton;
@@ -115,9 +114,7 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
mFab.setColorPressed(ColorUtils.lighten(ThemeManager.getColor())); mFab.setColorPressed(ColorUtils.lighten(ThemeManager.getColor()));
mFab.attachToRecyclerView(mRecyclerView); mFab.attachToRecyclerView(mRecyclerView);
mFab.getDrawable().setColorFilter(new PorterDuffColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.MULTIPLY)); mFab.getDrawable().setColorFilter(new PorterDuffColorFilter(ThemeManager.getTextOnColorPrimary(), PorterDuff.Mode.MULTIPLY));
mFab.setOnClickListener(new View.OnClickListener() { mFab.setOnClickListener(v -> {
@Override
public void onClick(View v) {
// Show the compose fragment, showing the keyboard and focusing on the recipients edittext. // Show the compose fragment, showing the keyboard and focusing on the recipients edittext.
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putBoolean(ComposeFragment.ARG_SHOW_KEYBOARD, true); args.putBoolean(ComposeFragment.ARG_SHOW_KEYBOARD, true);
@@ -125,7 +122,6 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
Fragment content = getFragmentManager().findFragmentById(R.id.content_frame); Fragment content = getFragmentManager().findFragmentById(R.id.content_frame);
switchFragment(ComposeFragment.getInstance(args, content)); switchFragment(ComposeFragment.getInstance(args, content));
}
}); });
mViewHasLoaded = true; mViewHasLoaded = true;
@@ -252,9 +248,7 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
dialog.addMenuItem(R.string.menu_delete_conversation, MENU_DELETE_CONVERSATION); dialog.addMenuItem(R.string.menu_delete_conversation, MENU_DELETE_CONVERSATION);
dialog.buildMenu(new AdapterView.OnItemClickListener() { dialog.buildMenu((parent, view1, position, id) -> {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch ((int) id) { switch ((int) id) {
case MENU_MUTE_CONVERSATION: case MENU_MUTE_CONVERSATION:
conversationPrefs.putBoolean(SettingsFragment.NOTIFICATIONS, false); conversationPrefs.putBoolean(SettingsFragment.NOTIFICATIONS, false);
@@ -306,7 +300,6 @@ public class ConversationListFragment extends QKFragment implements LoaderManage
DialogHelper.showDeleteFailedMessagesDialog((MainActivity) mContext, threadId); DialogHelper.showDeleteFailedMessagesDialog((MainActivity) mContext, threadId);
break; break;
} }
}
}).show(mContext.getFragmentManager(), "conversation options"); }).show(mContext.getFragmentManager(), "conversation options");
} }