use of com.cpjd.roblu.ui.UIHandler in project Roblu by wdavies973.
the class MetricEditor method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.add_element, menu);
new UIHandler(this, menu).updateMenu();
return true;
}
use of com.cpjd.roblu.ui.UIHandler in project Roblu by wdavies973.
the class PredefinedFormSelector method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.predefined, menu);
new UIHandler(this, menu).updateMenu();
return true;
}
use of com.cpjd.roblu.ui.UIHandler in project Roblu by wdavies973.
the class PredefinedFormSelector method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_predefined);
/*
* Setup UI
*/
// Toolbar
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Template forms");
getSupportActionBar().setSubtitle("You can still edit predefined forms later");
}
/*
* Load and process predefined forms
*/
try {
forms = new ArrayList<>();
String[] files = getAssets().list("predefinedForms");
items = new String[files.length];
sub_items = new String[files.length];
for (int i = 0; i < files.length; i++) {
forms.add(processForm(i, files[i]));
}
} catch (IOException e) {
Log.d("RBS", "Unable to process predefined forms.");
}
// Bind predefined forms to the list
ListView sharingView = findViewById(R.id.listView1);
List<Map<String, String>> data = new ArrayList<>();
for (int i = 0; i < items.length; i++) {
Map<String, String> datum = new HashMap<>(2);
datum.put("item", items[i]);
datum.put("description", sub_items[i]);
data.add(datum);
}
SimpleAdapter adapter = new SimpleAdapter(this, data, android.R.layout.simple_list_item_2, new String[] { "item", "description" }, new int[] { android.R.id.text1, android.R.id.text2 });
sharingView.setAdapter(adapter);
sharingView.setOnItemClickListener(this);
// Sync UI with user settings
new UIHandler(this, toolbar).update();
}
use of com.cpjd.roblu.ui.UIHandler in project Roblu by wdavies973.
the class Drawing method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.drawing, menu);
new UIHandler(this, menu).updateMenu();
return true;
}
use of com.cpjd.roblu.ui.UIHandler in project Roblu by wdavies973.
the class TBAEventSelector method onCreateOptionsMenu.
/**
* Syncs the menu items with the UI
* @param menu the menu to sync
* @return true if the menu was created successfully here
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.api_eventpicker, menu);
new UIHandler(this, menu).updateMenu();
return true;
}
Aggregations