Added basic configuration
This commit is contained in:
parent
b305095ab3
commit
1aec61f810
3 changed files with 69 additions and 18 deletions
|
|
@ -10,11 +10,14 @@ import android.widget.LinearLayout;
|
|||
import android.widget.TextView;
|
||||
|
||||
import com.ericsson.uecontrol.R;
|
||||
import com.ericsson.uecontrol.gui.util.Configurator;
|
||||
import com.ericsson.uecontrol.gui.util.Configurator.ConfigurationParam;
|
||||
|
||||
/**
|
||||
* Created by ezivkoc on 2014-07-24.
|
||||
*/
|
||||
public class ConfigureBehaviourDialog extends DialogFragment {
|
||||
private Configurator confer;
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
|
|
@ -22,24 +25,52 @@ public class ConfigureBehaviourDialog extends DialogFragment {
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||
builder.setTitle(R.string.configure_behaviour);
|
||||
|
||||
LinearLayout root = new LinearLayout(getActivity());
|
||||
root.setOrientation(LinearLayout.VERTICAL);
|
||||
root.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT));
|
||||
|
||||
for(ConfigurationParam confParam : confer.getConfiguration()){
|
||||
LinearLayout layout = new LinearLayout(getActivity());
|
||||
layout.setOrientation(LinearLayout.HORIZONTAL);
|
||||
layout.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT));
|
||||
|
||||
TextView label = new TextView(getActivity());
|
||||
label.setText("Test: ");
|
||||
label.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT));
|
||||
layout.addView(label);
|
||||
|
||||
EditText input = new EditText(getActivity());
|
||||
label.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||
LinearLayout.LayoutParams.MATCH_PARENT));
|
||||
layout.addView(input);
|
||||
|
||||
root.addView(layout);
|
||||
}
|
||||
|
||||
|
||||
builder.setPositiveButton(R.string.action_save, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
// User clicked OK button
|
||||
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.action_cancel, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {}
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
ConfigureBehaviourDialog.this.getDialog().cancel();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
LinearLayout root = new LinearLayout(getActivity());
|
||||
|
||||
LinearLayout param = new LinearLayout(getActivity());
|
||||
param.addView(new TextView(getActivity()));
|
||||
param.addView(new EditText(getActivity()));
|
||||
root.addView(param);
|
||||
|
||||
builder.setView(root);
|
||||
return builder.create();
|
||||
}
|
||||
|
||||
public void setConfigurator(Configurator c) {
|
||||
confer = c;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue