@@ -0,0 +1,3418 @@
+/*%0A * The MIT License (MIT)%0A *%0A * Copyright (c) 2012-2014 lacolaco.net%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in all%0A * copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0A * SOFTWARE.%0A */%0A%0Apackage net.lacolaco.smileessence.view.dialog;%0A%0Aimport android.app.Activity;%0Aimport android.app.AlertDialog;%0Aimport android.app.Dialog;%0Aimport android.os.Bundle;%0Aimport android.view.View;%0Aimport android.widget.ListView;%0Aimport net.lacolaco.smileessence.R;%0Aimport net.lacolaco.smileessence.activity.MainActivity;%0Aimport net.lacolaco.smileessence.command.Command;%0Aimport net.lacolaco.smileessence.entity.Account;%0Aimport net.lacolaco.smileessence.view.adapter.CustomListAdapter;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Apublic class PostMenuDialogFragment extends MenuDialogFragment%0A%7B%0A%0A    // ------------------------------ FIELDS ------------------------------%0A%0A    private static final String KEY_TEXT = %22text%22;%0A%0A    // --------------------- GETTER / SETTER METHODS ---------------------%0A%0A    public String getText()%0A    %7B%0A        return getArguments().getString(KEY_TEXT);%0A    %7D%0A%0A    public void setText(String text)%0A    %7B%0A        Bundle args = new Bundle();%0A        args.putString(KEY_TEXT, text);%0A        setArguments(args);%0A    %7D%0A%0A    // ------------------------ OVERRIDE METHODS ------------------------%0A%0A    @Override%0A    public Dialog onCreateDialog(Bundle savedInstanceState)%0A    %7B%0A        MainActivity activity = (MainActivity)getActivity();%0A        Account account = activity.getCurrentAccount();%0A        String text = getText();%0A        List%3CCommand%3E commands = getCommands(activity, text);%0A        filterCommands(commands);%0A        View body = activity.getLayoutInflater().inflate(R.layout.dialog_menu_list, null);%0A        ListView listView = (ListView)body.findViewById(R.id.listview_dialog_menu_list);%0A        CustomListAdapter%3CCommand%3E adapter = new CustomListAdapter%3C%3E(activity, Command.class);%0A        listView.setAdapter(adapter);%0A        for(Command command : commands)%0A        %7B%0A            adapter.addToBottom(command);%0A        %7D%0A        adapter.update();%0A        listView.setOnItemClickListener(onItemClickListener);%0A%0A        return new AlertDialog.Builder(activity)%0A                .setView(body)%0A                .setCancelable(true)%0A                .create();%0A    %7D%0A%0A    public List%3CCommand%3E getCommands(Activity activity, String user)%0A    %7B%0A        ArrayList%3CCommand%3E commands = new ArrayList%3C%3E();%0A        return commands;%0A    %7D%0A%7D%0A

Add PostMenuDialogFragment