mirror of
https://github.com/TimeCrafters/TimeCraftersConfigurationTool.git
synced 2025-12-15 05:02:33 +00:00
Stubbed fragments for groups, actions, and variables.
This commit is contained in:
@@ -23,15 +23,6 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".ui.settings.presets.PresetsActivity"
|
||||
android:label="@string/settings_manage_presets">
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.settings.configurations.ConfigurationsActivity"
|
||||
android:label="@string/settings_manage_configurations">
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -19,6 +19,7 @@ import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
@@ -37,6 +38,8 @@ public class Backend {
|
||||
loadSettings();
|
||||
if (!settings.config.isEmpty()) {
|
||||
loadConfig(settings.config);
|
||||
} else {
|
||||
config = new Config();
|
||||
}
|
||||
tacnet = new TACNET();
|
||||
|
||||
@@ -69,10 +72,11 @@ public class Backend {
|
||||
public boolean isConfigChanged() { return configChanged; }
|
||||
|
||||
public void loadConfig(String name) {
|
||||
File file = new File("" + TAC.CONFIGS_PATH + File.separator + name);
|
||||
String path = "" + TAC.CONFIGS_PATH + File.separator + name;
|
||||
File file = new File(path);
|
||||
|
||||
if (file.exists() && file.isFile()) {
|
||||
// TODO: Load configuration
|
||||
config = new Config(name, path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +144,7 @@ public class Backend {
|
||||
.create();
|
||||
}
|
||||
|
||||
private String readFromFile(String path) {
|
||||
protected String readFromFile(String path) {
|
||||
StringBuilder text = new StringBuilder();
|
||||
|
||||
try {
|
||||
|
||||
@@ -2,17 +2,69 @@ package org.timecrafters.TimeCraftersConfigurationTool.backend;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
public class Config {
|
||||
private String name;
|
||||
private Configuration configuration;
|
||||
private ArrayList<Group> groups;
|
||||
private ArrayList<Preset> presets;
|
||||
|
||||
public Config(String name) {
|
||||
// Do things
|
||||
parse(name);
|
||||
// DELETE ME
|
||||
public Config() {
|
||||
this.name = "DEBUG ONLY";
|
||||
this.configuration = new Configuration(new Date(), new Date(), 0, 32);
|
||||
groups = new ArrayList<>();
|
||||
presets = new ArrayList<>();
|
||||
|
||||
ArrayList<Action> actions = new ArrayList<>();
|
||||
ArrayList<Variable> variables = new ArrayList<>();
|
||||
variables.add(new Variable("VarName", "Dx90.45"));
|
||||
variables.add(new Variable("VarName2", "FxFx90.45"));
|
||||
variables.add(new Variable("VarName3", "Dx90.45"));
|
||||
variables.add(new Variable("distance", "Ix90"));
|
||||
variables.add(new Variable("variable", "Dx90.45"));
|
||||
variables.add(new Variable("tea_time", "SxThe Tea Party was quite enjoyable."));
|
||||
|
||||
actions.add(new Action("DriverOne", "This is a comment", true, variables));
|
||||
actions.add(new Action("DriverTwo", "", true, variables));
|
||||
actions.add(new Action("DriverAlt", "This is also is a comment", true, variables));
|
||||
actions.add(new Action("DriverOne", "This is a comment", true, variables));
|
||||
actions.add(new Action("DriverTwo", "", true, variables));
|
||||
actions.add(new Action("DriverAlt", "This is also is a comment", true, variables));
|
||||
actions.add(new Action("DriverOne", "This is a comment", true, variables));
|
||||
actions.add(new Action("DriverTwo", "", true, variables));
|
||||
actions.add(new Action("DriverAlt", "This is also is a comment", true, variables));
|
||||
actions.add(new Action("DriverOne", "This is a comment", true, variables));
|
||||
actions.add(new Action("DriverTwo", "", true, variables));
|
||||
actions.add(new Action("DriverAlt", "This is also is a comment", true, variables));
|
||||
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
groups.add(new Group("TeleOp", actions));
|
||||
groups.add(new Group("BlueLeftA", actions));
|
||||
}
|
||||
|
||||
|
||||
public Config(String name, String path) {
|
||||
this.name = name;
|
||||
parse(path);
|
||||
}
|
||||
|
||||
public Config(Configuration configuration, ArrayList<Group> groups, ArrayList<Preset> presets) {
|
||||
@@ -21,6 +73,8 @@ public class Config {
|
||||
this.presets = presets;
|
||||
}
|
||||
|
||||
public String getName() { return name; }
|
||||
|
||||
public Configuration getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
@@ -33,9 +87,14 @@ public class Config {
|
||||
return groups;
|
||||
}
|
||||
|
||||
private void parse(String name) {
|
||||
private void parse(String path) {
|
||||
Gson gson = new Gson();
|
||||
gson.fromJson("", Config.class);
|
||||
String json = Backend.instance().readFromFile(path);
|
||||
Config config = gson.fromJson(json, Config.class);
|
||||
|
||||
this.configuration = config.configuration;
|
||||
this.groups = config.groups;
|
||||
this.presets = config.presets;
|
||||
}
|
||||
|
||||
public class Configuration {
|
||||
@@ -88,6 +147,8 @@ public class Config {
|
||||
this.enabled = enabled;
|
||||
this.variables = variables;
|
||||
}
|
||||
|
||||
public ArrayList<Variable> getVariables() { return variables; }
|
||||
}
|
||||
|
||||
public class Variable {
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool.ui.editor;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Switch;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.R;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Backend;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Config;
|
||||
|
||||
public class ActionsFragment extends Fragment {
|
||||
private Config config;
|
||||
private Config.Group group;
|
||||
private LinearLayout container;
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
final View root = inflater.inflate(R.layout.fragment_actions, container, false);
|
||||
this.container = root.findViewById(R.id.container);
|
||||
|
||||
this.config = Backend.instance().getConfig();
|
||||
this.group = config.getGroups().get(0);
|
||||
if (config != null) {
|
||||
((AppCompatActivity)getActivity()).getSupportActionBar().setTitle("Group: " + group.name);
|
||||
|
||||
populateActions();
|
||||
}
|
||||
return root;
|
||||
}
|
||||
|
||||
private void populateActions() {
|
||||
int i = 0;
|
||||
for (final Config.Action action : group.getActions()) {
|
||||
View view = View.inflate(getContext(), R.layout.fragment_part_actions, null);
|
||||
Switch name = view.findViewById(R.id.name);
|
||||
ImageButton edit = view.findViewById(R.id.edit);
|
||||
ImageButton rename = view.findViewById(R.id.rename);
|
||||
ImageButton delete = view.findViewById(R.id.delete);
|
||||
TextView comment = view.findViewById(R.id.comment);
|
||||
|
||||
if (i % 2 == 0) { // even
|
||||
view.setBackgroundColor(getResources().getColor(R.color.list_even));
|
||||
} else {
|
||||
view.setBackgroundColor(getResources().getColor(R.color.list_odd));
|
||||
}
|
||||
|
||||
name.setText(action.name);
|
||||
name.setChecked(action.enabled);
|
||||
styleSwitch(name, action.enabled);
|
||||
name.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
action.enabled = isChecked;
|
||||
|
||||
styleSwitch(buttonView, isChecked);
|
||||
}
|
||||
});
|
||||
|
||||
edit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Navigation.findNavController(v).navigate(R.id.variablesFragment);
|
||||
}
|
||||
});
|
||||
|
||||
if (action.comment.length() > 0) {
|
||||
comment.setText(action.comment);
|
||||
} else {
|
||||
comment.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
i++;
|
||||
container.addView(view);
|
||||
}
|
||||
}
|
||||
|
||||
private void styleSwitch(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
buttonView.setBackground(getResources().getDrawable(R.drawable.button));
|
||||
} else {
|
||||
buttonView.setBackground(getResources().getDrawable(R.drawable.dangerous_button));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,80 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool.ui.editor;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.R;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Backend;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Config;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Config.Group;
|
||||
|
||||
public class EditorFragment extends Fragment {
|
||||
|
||||
final private String TAG = "EditorFragment";
|
||||
|
||||
private EditorViewModel editorViewModel;
|
||||
private Config config;
|
||||
private TextView configName;
|
||||
private LinearLayout container;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
editorViewModel =
|
||||
ViewModelProviders.of(this).get(EditorViewModel.class);
|
||||
View root = inflater.inflate(R.layout.fragment_editor, container, false);
|
||||
final TextView textView = root.findViewById(R.id.text_editor);
|
||||
editorViewModel.getText().observe(getViewLifecycleOwner(), new Observer<String>() {
|
||||
@Override
|
||||
public void onChanged(@Nullable String s) {
|
||||
textView.setText(s);
|
||||
}
|
||||
});
|
||||
final View root = inflater.inflate(R.layout.fragment_editor, container, false);
|
||||
this.configName = root.findViewById(R.id.configuration_name);
|
||||
this.container = root.findViewById(R.id.container);
|
||||
|
||||
this.config = Backend.instance().getConfig();
|
||||
if (config != null) {
|
||||
configName.setVisibility(View.GONE);
|
||||
((AppCompatActivity)getActivity()).getSupportActionBar().setTitle("Config: " + config.getName());
|
||||
|
||||
populateGroups();
|
||||
} else {
|
||||
Log.d(TAG, "config not set");
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private void populateGroups() {
|
||||
int i = 0;
|
||||
for (Group group : config.getGroups()) {
|
||||
View view = View.inflate(getContext(), R.layout.fragment_part_groups, null);
|
||||
Button name = view.findViewById(R.id.name);
|
||||
ImageButton rename = view.findViewById(R.id.rename);
|
||||
ImageButton delete = view.findViewById(R.id.delete);
|
||||
|
||||
if (i % 2 == 0) { // even
|
||||
view.setBackgroundColor(getResources().getColor(R.color.list_even));
|
||||
} else {
|
||||
view.setBackgroundColor(getResources().getColor(R.color.list_odd));
|
||||
}
|
||||
|
||||
name.setText(group.name);
|
||||
name.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Navigation.findNavController(v).navigate(R.id.actionsFragment);
|
||||
}
|
||||
});
|
||||
|
||||
i++;
|
||||
container.addView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool.ui.editor;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.NavAction;
|
||||
import androidx.navigation.Navigation;
|
||||
import androidx.navigation.ui.NavigationUI;
|
||||
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.R;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Backend;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.backend.Config;
|
||||
|
||||
public class VariablesFragment extends Fragment {
|
||||
private Config config;
|
||||
private LinearLayout container;
|
||||
private Config.Group group;
|
||||
private Config.Action action;
|
||||
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
final View root = inflater.inflate(R.layout.fragment_variables, container, false);
|
||||
this.container = root.findViewById(R.id.container);
|
||||
|
||||
this.config = Backend.instance().getConfig();
|
||||
this.group = config.getGroups().get(0);
|
||||
this.action = group.getActions().get(0);
|
||||
if (config != null) {
|
||||
((AppCompatActivity)getActivity()).getSupportActionBar().setTitle("Action: " + action.name);
|
||||
|
||||
populateVariables();
|
||||
}
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
private void populateVariables() {
|
||||
int i = 0;
|
||||
for (Config.Variable variable : action.getVariables()) {
|
||||
View view = View.inflate(getContext(), R.layout.fragment_part_variables, null);
|
||||
TextView name = view.findViewById(R.id.name);
|
||||
TextView value = view.findViewById(R.id.value);
|
||||
ImageButton rename = view.findViewById(R.id.rename);
|
||||
ImageButton delete = view.findViewById(R.id.delete);
|
||||
|
||||
if (i % 2 == 0) { // even
|
||||
view.setBackgroundColor(getResources().getColor(R.color.list_even));
|
||||
} else {
|
||||
view.setBackgroundColor(getResources().getColor(R.color.list_odd));
|
||||
}
|
||||
|
||||
name.setText(variable.name);
|
||||
value.setText("" + variable.value());
|
||||
|
||||
i++;
|
||||
container.addView(view);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,17 +6,15 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.R;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.ui.settings.configurations.ConfigurationsActivity;
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.ui.settings.presets.PresetsActivity;
|
||||
|
||||
public class SettingsFragment extends Fragment {
|
||||
|
||||
@@ -26,21 +24,21 @@ public class SettingsFragment extends Fragment {
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
settingsViewModel =
|
||||
ViewModelProviders.of(this).get(SettingsViewModel.class);
|
||||
View root = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
final View root = inflater.inflate(R.layout.fragment_settings, container, false);
|
||||
final Button managePresets = root.findViewById(R.id.manage_presets);
|
||||
final Button manageConfigurations = root.findViewById(R.id.manage_configurations);
|
||||
|
||||
managePresets.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(getContext(), PresetsActivity.class));
|
||||
Navigation.findNavController(root).navigate(R.id.presetsFragment);
|
||||
}
|
||||
});
|
||||
|
||||
manageConfigurations.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(getContext(), ConfigurationsActivity.class));
|
||||
Navigation.findNavController(root).navigate(R.id.configurationsFragment);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool.ui.settings.configurations;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.R;
|
||||
|
||||
public class ConfigurationsActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.activity_manage_configurations);
|
||||
LinearLayout v = findViewById(R.id.configurations);
|
||||
v.setBackgroundColor(getResources().getColor(R.color.list_even));
|
||||
|
||||
View vv = v.inflate(getApplicationContext(), R.layout.fragment_configuration, null);
|
||||
v.addView(vv);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool.ui.settings.configurations;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import org.timecrafters.TimeCraftersConfigurationTool.R;
|
||||
|
||||
public class ConfigurationsFragment extends Fragment {
|
||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||
ViewGroup container, Bundle savedInstanceState) {
|
||||
final View root = inflater.inflate(R.layout.activity_manage_configurations, container, false);
|
||||
|
||||
|
||||
LinearLayout v = root.findViewById(R.id.configurations);
|
||||
v.setBackgroundColor(getResources().getColor(R.color.list_even));
|
||||
|
||||
View vv = v.inflate(getContext(), R.layout.fragment_configuration, null);
|
||||
v.addView(vv);
|
||||
|
||||
return root;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool.ui.settings.presets;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
public class PresetsActivity extends AppCompatActivity {
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.timecrafters.TimeCraftersConfigurationTool.ui.settings.presets;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
public class PresetsFragment extends Fragment {
|
||||
}
|
||||
@@ -71,6 +71,7 @@ public class TACNETFragment extends Fragment {
|
||||
public void onClick(View v) {
|
||||
VariableDialog dialog = new VariableDialog();
|
||||
dialog.show(getFragmentManager(), null);
|
||||
Backend.instance().saveSettings();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
20
app/src/main/res/layout/fragment_actions.xml
Normal file
20
app/src/main/res/layout/fragment_actions.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.editor.EditorFragment">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -2,37 +2,20 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/configuration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<Button
|
||||
android:id="@+id/configuration_name"
|
||||
style="@style/Button"
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:text="Button"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/rename_configuration"
|
||||
style="@style/Button"
|
||||
<LinearLayout
|
||||
android:id="@+id/configuration"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:src="@drawable/gear"
|
||||
app:layout_constraintStart_toStartOf="@+id/configuration_name"
|
||||
app:layout_constraintTop_toTopOf="@+id/configuration_name" />
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"></LinearLayout>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/delete_configuration"
|
||||
style="@style/DangerousButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:src="@drawable/trash"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</LinearLayout>
|
||||
@@ -8,20 +8,22 @@
|
||||
tools:context=".ui.editor.EditorFragment">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_editor"
|
||||
android:id="@+id/configuration_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center" />
|
||||
android:background="@color/list_even"
|
||||
android:text="No configuration active"
|
||||
android:textAlignment="center"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<LinearLayout
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
<LinearLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="TODO" />
|
||||
</LinearLayout>
|
||||
android:orientation="vertical" />
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
61
app/src/main/res/layout/fragment_part_actions.xml
Normal file
61
app/src/main/res/layout/fragment_part_actions.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Switch
|
||||
android:id="@+id/name"
|
||||
style="@style/ToggleButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="Switch" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
app:srcCompat="@drawable/editor" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/rename"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
app:srcCompat="@drawable/gear" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/delete"
|
||||
style="@style/DangerousButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
app:srcCompat="@drawable/trash" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/comment"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/button_margin_left"
|
||||
android:layout_marginRight="@dimen/button_margin_right"
|
||||
android:layout_marginBottom="@dimen/button_margin_bottom"
|
||||
android:layout_weight="1" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
40
app/src/main/res/layout/fragment_part_configuration.xml
Normal file
40
app/src/main/res/layout/fragment_part_configuration.xml
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<Button
|
||||
android:id="@+id/name"
|
||||
style="@style/Button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:text="Button" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/rename"
|
||||
style="@style/Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:src="@drawable/gear" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/delete"
|
||||
style="@style/DangerousButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
android:src="@drawable/trash" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
37
app/src/main/res/layout/fragment_part_groups.xml
Normal file
37
app/src/main/res/layout/fragment_part_groups.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:text="Button" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/rename"
|
||||
style="@style/Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
app:srcCompat="@drawable/gear" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/delete"
|
||||
style="@style/DangerousButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
app:srcCompat="@drawable/trash" />
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
56
app/src/main/res/layout/fragment_part_variables.xml
Normal file
56
app/src/main/res/layout/fragment_part_variables.xml
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/group"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/button_margin_left"
|
||||
android:layout_marginTop="@dimen/button_margin_top"
|
||||
android:layout_marginRight="@dimen/button_margin_right"
|
||||
android:layout_marginBottom="@dimen/button_margin_bottom"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="TextView"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/rename"
|
||||
style="@style/Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
app:srcCompat="@drawable/gear" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/delete"
|
||||
style="@style/DangerousButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.2"
|
||||
app:srcCompat="@drawable/trash" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/value"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="@dimen/button_margin_left"
|
||||
android:layout_marginTop="@dimen/button_margin_top"
|
||||
android:layout_marginRight="@dimen/button_margin_right"
|
||||
android:layout_marginBottom="@dimen/button_margin_bottom"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:text="TextView" />
|
||||
</LinearLayout>
|
||||
20
app/src/main/res/layout/fragment_variables.xml
Normal file
20
app/src/main/res/layout/fragment_variables.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".ui.editor.EditorFragment">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" />
|
||||
</ScrollView>
|
||||
</LinearLayout>
|
||||
@@ -15,16 +15,47 @@
|
||||
android:id="@+id/navigation_editor"
|
||||
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.editor.EditorFragment"
|
||||
android:label="@string/title_editor"
|
||||
tools:layout="@layout/fragment_editor" />
|
||||
tools:layout="@layout/fragment_editor" >
|
||||
<action
|
||||
android:id="@+id/action_navigation_editor_to_actionsFragment"
|
||||
app:destination="@id/actionsFragment" />
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/navigation_settings"
|
||||
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.settings.SettingsFragment"
|
||||
android:label="@string/title_settings"
|
||||
tools:layout="@layout/fragment_settings" />
|
||||
tools:layout="@layout/fragment_settings" >
|
||||
<action
|
||||
android:id="@+id/action_navigation_settings_to_configurationsFragment"
|
||||
app:destination="@id/configurationsFragment" />
|
||||
<action
|
||||
android:id="@+id/action_navigation_settings_to_presetsFragment"
|
||||
app:destination="@id/presetsFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/navigation_search"
|
||||
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.search.SearchFragment"
|
||||
android:label="@string/title_search"
|
||||
tools:layout="@layout/fragment_search" />
|
||||
<fragment
|
||||
android:id="@+id/actionsFragment"
|
||||
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.editor.ActionsFragment"
|
||||
android:label="Actions" >
|
||||
<action
|
||||
android:id="@+id/action_actionsFragment_to_variablesFragment"
|
||||
app:destination="@id/variablesFragment" />
|
||||
</fragment>
|
||||
<fragment
|
||||
android:id="@+id/variablesFragment"
|
||||
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.editor.VariablesFragment"
|
||||
android:label="Variables" />
|
||||
<fragment
|
||||
android:id="@+id/configurationsFragment"
|
||||
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.settings.configurations.ConfigurationsFragment"
|
||||
android:label="Manage Configurations" />
|
||||
<fragment
|
||||
android:id="@+id/presetsFragment"
|
||||
android:name="org.timecrafters.TimeCraftersConfigurationTool.ui.settings.presets.PresetsFragment"
|
||||
android:label="Manage Presets" />
|
||||
</navigation>
|
||||
@@ -23,6 +23,8 @@
|
||||
<color name="tacnetPrimary">#003f7f</color>
|
||||
<color name="tacnetSecondary">#007f7f</color>
|
||||
|
||||
<color name="switchOn">#ff8800</color>
|
||||
|
||||
<color name="dialogBackground">#ddd</color>
|
||||
<color name="dialogTitle">#fff</color>
|
||||
<color name="dialogLabel">#222</color>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
<string name="settings_manage_configurations">Manage Configurations</string>
|
||||
|
||||
<string name="search">Search</string>
|
||||
<string name="groups">Groups</string>
|
||||
|
||||
<string name="dialog_close">Close</string>
|
||||
<string name="dialog_cancel">Cancel</string>
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<item name="android:fontFamily">@font/dejavusans_condensed_fontfamily</item>
|
||||
|
||||
<item name="buttonStyle">@style/Button</item>
|
||||
<item name="imageButtonStyle">@style/Button</item>
|
||||
<item name="bottomNavigationStyle">@style/NavigationBar</item>
|
||||
<item name="editTextStyle">@style/TextInput</item>
|
||||
<item name="switchStyle">@style/ToggleButton</item>
|
||||
|
||||
Reference in New Issue
Block a user