From 80875baa1df3550dd46e1c29418fa83c338fac7b Mon Sep 17 00:00:00 2001 From: neel1998 Date: Fri, 17 May 2019 22:55:15 +0530 Subject: [PATCH 1/5] layout to control servo of robotic arm ceated --- app/build.gradle | 1 + app/src/main/AndroidManifest.xml | 8 +- .../io/pslab/activity/RoboticArmActivity.java | 116 ++++++++++++++++++ .../pslab/fragment/InstrumentsFragment.java | 11 +- .../main/res/layout/activity_robotic_arm.xml | 49 ++++++++ .../res/layout/servo_controller_layout.xml | 29 +++++ app/src/main/res/values/strings.xml | 6 + 7 files changed, 216 insertions(+), 4 deletions(-) create mode 100644 app/src/main/java/io/pslab/activity/RoboticArmActivity.java create mode 100644 app/src/main/res/layout/activity_robotic_arm.xml create mode 100644 app/src/main/res/layout/servo_controller_layout.xml diff --git a/app/build.gradle b/app/build.gradle index 090d5b33d..00f6e48db 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,6 +65,7 @@ dependencies { implementation "org.apache.commons:commons-math3:$rootProject.commonMathVersion" implementation "org.apache.commons:commons-lang3:$rootProject.commonLangVersion" implementation "com.squareup.picasso:picasso:$rootProject.picassoVersion" + implementation 'com.github.GoodieBag:ProtractorView:v1.2' implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion" implementation 'com.android.support.constraint:constraint-layout:1.1.3' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 306a0856d..84ef98878 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -21,6 +21,8 @@ android:roundIcon="@drawable/app_icon_round" android:supportsRtl="true" android:theme="@style/AppTheme"> + - + - diff --git a/app/src/main/java/io/pslab/activity/RoboticArmActivity.java b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java new file mode 100644 index 000000000..299621c99 --- /dev/null +++ b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java @@ -0,0 +1,116 @@ +package io.pslab.activity; + +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.view.View; +import android.widget.TextView; + +import com.goodiebag.protractorview.ProtractorView; + +import io.pslab.R; + +public class RoboticArmActivity extends AppCompatActivity { + + ProtractorView protractorView1, protractorView2, protractorView3, protractorView4; + TextView degreeText1, degreeText2, degreeText3, degreeText4; + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_robotic_arm); + + View servo1Layout = findViewById(R.id.servo_1); + View servo2Layout = findViewById(R.id.servo_2); + View servo3Layout = findViewById(R.id.servo_3); + View servo4Layout = findViewById(R.id.servo_4); + + TextView servo1Title = servo1Layout.findViewById(R.id.servo_title); + servo1Title.setText(getResources().getString(R.string.servo1_title)); + + TextView servo2Title = servo2Layout.findViewById(R.id.servo_title); + servo2Title.setText(getResources().getString(R.string.servo2_title)); + + TextView servo3Title = servo3Layout.findViewById(R.id.servo_title); + servo3Title.setText(getResources().getString(R.string.servo3_title)); + + TextView servo4Title = servo4Layout.findViewById(R.id.servo_title); + servo4Title.setText(getResources().getString(R.string.servo4_title)); + + protractorView1 = servo1Layout.findViewById(R.id.protractorView); + protractorView2 = servo2Layout.findViewById(R.id.protractorView); + protractorView3 = servo3Layout.findViewById(R.id.protractorView); + protractorView4 = servo4Layout.findViewById(R.id.protractorView); + degreeText1 = servo1Layout.findViewById(R.id.degreeText); + degreeText2 = servo2Layout.findViewById(R.id.degreeText); + degreeText3 = servo3Layout.findViewById(R.id.degreeText); + degreeText4 = servo4Layout.findViewById(R.id.degreeText); + protractorView1.setTickIntervals(15); + protractorView2.setTickIntervals(15); + protractorView3.setTickIntervals(15); + protractorView4.setTickIntervals(15); + + protractorView1.setOnProtractorViewChangeListener(new ProtractorView.OnProtractorViewChangeListener() { + @Override + public void onProgressChanged(ProtractorView protractorView, int i, boolean b) { + degreeText1.setText(String.valueOf(i)); + } + + @Override + public void onStartTrackingTouch(ProtractorView protractorView) { + + } + + @Override + public void onStopTrackingTouch(ProtractorView protractorView) { + + } + }); + protractorView2.setOnProtractorViewChangeListener(new ProtractorView.OnProtractorViewChangeListener() { + @Override + public void onProgressChanged(ProtractorView protractorView, int i, boolean b) { + degreeText2.setText(String.valueOf(i)); + } + + @Override + public void onStartTrackingTouch(ProtractorView protractorView) { + + } + + @Override + public void onStopTrackingTouch(ProtractorView protractorView) { + + } + }); + protractorView3.setOnProtractorViewChangeListener(new ProtractorView.OnProtractorViewChangeListener() { + @Override + public void onProgressChanged(ProtractorView protractorView, int i, boolean b) { + degreeText3.setText(String.valueOf(i)); + } + + @Override + public void onStartTrackingTouch(ProtractorView protractorView) { + + } + + @Override + public void onStopTrackingTouch(ProtractorView protractorView) { + + } + }); + protractorView4.setOnProtractorViewChangeListener(new ProtractorView.OnProtractorViewChangeListener() { + @Override + public void onProgressChanged(ProtractorView protractorView, int i, boolean b) { + degreeText4.setText(String.valueOf(i)); + } + + @Override + public void onStartTrackingTouch(ProtractorView protractorView) { + + } + + @Override + public void onStopTrackingTouch(ProtractorView protractorView) { + + } + }); + } +} diff --git a/app/src/main/java/io/pslab/fragment/InstrumentsFragment.java b/app/src/main/java/io/pslab/fragment/InstrumentsFragment.java index 77707aac1..e8f545c0d 100644 --- a/app/src/main/java/io/pslab/fragment/InstrumentsFragment.java +++ b/app/src/main/java/io/pslab/fragment/InstrumentsFragment.java @@ -24,6 +24,7 @@ import io.pslab.activity.MultimeterActivity; import io.pslab.activity.OscilloscopeActivity; import io.pslab.activity.PowerSourceActivity; +import io.pslab.activity.RoboticArmActivity; import io.pslab.activity.SensorActivity; import io.pslab.activity.WaveGeneratorActivity; import io.pslab.adapters.ApplicationAdapter; @@ -106,6 +107,10 @@ public void onItemClick(ApplicationItem item) { intent = new Intent(context, GyroscopeActivity.class); startActivity(intent); break; + case "Robotic Arm": + intent = new Intent(context, RoboticArmActivity.class); + startActivity(intent); + break; default: break; } @@ -149,7 +154,8 @@ protected Void doInBackground(Void... params) { R.string.accelerometer_description, R.string.baro_meter_description, R.string.compass_description, - R.string.gyroscope_description + R.string.gyroscope_description, + R.string.robotic_arm_descriptoin }; applicationItemList.add(new ApplicationItem( @@ -185,6 +191,9 @@ protected Void doInBackground(Void... params) { applicationItemList.add(new ApplicationItem( getResources().getString(R.string.gyroscope), R.drawable.gyroscope_logo, getResources().getString(descriptions[10]) )); + applicationItemList.add(new ApplicationItem( + getResources().getString(R.string.robotic_arm), R.drawable.gyroscope_logo, getResources().getString(descriptions[11]) + )); return null; } diff --git a/app/src/main/res/layout/activity_robotic_arm.xml b/app/src/main/res/layout/activity_robotic_arm.xml new file mode 100644 index 000000000..dbfc5efdc --- /dev/null +++ b/app/src/main/res/layout/activity_robotic_arm.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/servo_controller_layout.xml b/app/src/main/res/layout/servo_controller_layout.xml new file mode 100644 index 000000000..05e9aa46b --- /dev/null +++ b/app/src/main/res/layout/servo_controller_layout.xml @@ -0,0 +1,29 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index db30cf76e..7d2ee6bce 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -712,6 +712,12 @@ Device does not have a barometer + Robotic Arm + Controls servos of a robotic arm + Servo 1 + Servo 2 + Servo 3 + Servo 4 Built-In BMP180 From 1bd3bb437f7fe0e56e0bf03b1c75950a6dff91fe Mon Sep 17 00:00:00 2001 From: neel1998 Date: Sun, 19 May 2019 00:57:13 +0530 Subject: [PATCH 2/5] new layout created with circular seekbars --- app/build.gradle | 2 + app/src/main/AndroidManifest.xml | 2 + .../io/pslab/activity/RoboticArmActivity.java | 59 ++++++++++--------- .../res/layout/servo_controller_layout.xml | 22 ++++--- 4 files changed, 48 insertions(+), 37 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 00f6e48db..1ca903af3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -65,7 +65,9 @@ dependencies { implementation "org.apache.commons:commons-math3:$rootProject.commonMathVersion" implementation "org.apache.commons:commons-lang3:$rootProject.commonLangVersion" implementation "com.squareup.picasso:picasso:$rootProject.picassoVersion" + implementation 'com.github.GoodieBag:ProtractorView:v1.2' + implementation 'com.github.Triggertrap:SeekArc:v1.1' implementation "com.jakewharton:butterknife:$rootProject.butterKnifeVersion" implementation 'com.android.support.constraint:constraint-layout:1.1.3' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 84ef98878..913bca735 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,5 +1,6 @@ @@ -14,6 +15,7 @@ - \ No newline at end of file From 603ac0e2f46451df1ed6f570d2b9e489f5e55bfd Mon Sep 17 00:00:00 2001 From: neel1998 Date: Mon, 20 May 2019 23:47:29 +0530 Subject: [PATCH 3/5] started working on drag and drop feature for robotic arm --- .../io/pslab/activity/RoboticArmActivity.java | 214 +++++++++++++----- .../main/res/layout/activity_robotic_arm.xml | 9 +- .../res/layout/servo_controller_layout.xml | 23 +- 3 files changed, 168 insertions(+), 78 deletions(-) diff --git a/app/src/main/java/io/pslab/activity/RoboticArmActivity.java b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java index d23b4e423..7d10ad2ee 100644 --- a/app/src/main/java/io/pslab/activity/RoboticArmActivity.java +++ b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java @@ -1,12 +1,21 @@ package io.pslab.activity; +import android.content.ClipData; +import android.content.ClipDescription; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.text.Editable; +import android.text.TextWatcher; import android.util.Log; +import android.view.DragEvent; +import android.view.KeyEvent; +import android.view.MotionEvent; import android.view.View; +import android.view.ViewGroup; +import android.widget.EditText; +import android.widget.RelativeLayout; import android.widget.TextView; -import com.goodiebag.protractorview.ProtractorView; import com.triggertrap.seekarc.SeekArc; import io.pslab.R; @@ -15,6 +24,9 @@ public class RoboticArmActivity extends AppCompatActivity { TextView degreeText1, degreeText2, degreeText3, degreeText4; SeekArc seekArc1, seekArc2, seekArc3, seekArc4; + private int _xDelta; + private int _yDelta; + private android.widget.RelativeLayout.LayoutParams layoutParams; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -41,76 +53,154 @@ protected void onCreate(Bundle savedInstanceState) { degreeText2 = servo2Layout.findViewById(R.id.degreeText); degreeText3 = servo3Layout.findViewById(R.id.degreeText); degreeText4 = servo4Layout.findViewById(R.id.degreeText); - seekArc1 = servo1Layout.findViewById(R.id.seek_arc); - seekArc2 = servo2Layout.findViewById(R.id.seek_arc); - seekArc3 = servo3Layout.findViewById(R.id.seek_arc); - seekArc4 = servo4Layout.findViewById(R.id.seek_arc); - - seekArc1.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { - @Override - public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText1.setText(String.valueOf(Math.round(i*3.6))); - } - - @Override - public void onStartTrackingTouch(SeekArc seekArc) { - - } - +// seekArc1 = servo1Layout.findViewById(R.id.seek_arc); +// seekArc2 = servo2Layout.findViewById(R.id.seek_arc); +// seekArc3 = servo3Layout.findViewById(R.id.seek_arc); +// seekArc4 = servo4Layout.findViewById(R.id.seek_arc); +// +// seekArc1.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { +// @Override +// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { +// degreeText1.setText(String.valueOf(Math.round(i*3.6))); +// } +// +// @Override +// public void onStartTrackingTouch(SeekArc seekArc) { +// +// } +// +// @Override +// public void onStopTrackingTouch(SeekArc seekArc) { +// +// } +// }); +// +// seekArc2.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { +// @Override +// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { +// degreeText2.setText(String.valueOf(Math.round(i*3.6))); +// } +// +// @Override +// public void onStartTrackingTouch(SeekArc seekArc) { +// +// } +// +// @Override +// public void onStopTrackingTouch(SeekArc seekArc) { +// +// } +// }); +// +// seekArc3.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { +// @Override +// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { +// degreeText3.setText(String.valueOf(Math.round(i*3.6))); +// } +// +// @Override +// public void onStartTrackingTouch(SeekArc seekArc) { +// +// } +// +// @Override +// public void onStopTrackingTouch(SeekArc seekArc) { +// +// } +// }); +// +// seekArc4.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { +// @Override +// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { +// degreeText4.setText(String.valueOf(Math.round(i*3.6))); +// } +// +// @Override +// public void onStartTrackingTouch(SeekArc seekArc) { +// +// } +// +// @Override +// public void onStopTrackingTouch(SeekArc seekArc) { +// +// } +// }); + servo1Layout.setOnTouchListener(new View.OnTouchListener() { @Override - public void onStopTrackingTouch(SeekArc seekArc) { - + public boolean onTouch(View view, MotionEvent event) { + if (event.getAction() == MotionEvent.ACTION_DOWN) { + ClipData data = ClipData.newPlainText("", ""); + View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view); + view.startDrag(data, shadowBuilder, view, 0); + view.setVisibility(View.INVISIBLE); + return true; + }else { + return false; + } } }); - - seekArc2.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { + servo1Layout.setOnLongClickListener(new View.OnLongClickListener() { @Override - public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText2.setText(String.valueOf(Math.round(i*3.6))); - } + public boolean onLongClick(View v) { + ClipData.Item item = new ClipData.Item((CharSequence)v.getTag()); + String[] mimeTypes = {ClipDescription.MIMETYPE_TEXT_PLAIN}; - @Override - public void onStartTrackingTouch(SeekArc seekArc) { - - } - - @Override - public void onStopTrackingTouch(SeekArc seekArc) { + ClipData dragData = new ClipData(v.getTag().toString(),mimeTypes, item); + View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo1Layout); + v.startDrag(dragData,myShadow,null,0); + return true; } }); - - seekArc3.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { + servo1Layout.setOnDragListener(new View.OnDragListener() { @Override - public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText3.setText(String.valueOf(Math.round(i*3.6))); - } - - @Override - public void onStartTrackingTouch(SeekArc seekArc) { - - } - - @Override - public void onStopTrackingTouch(SeekArc seekArc) { - - } - }); - - seekArc4.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { - @Override - public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText4.setText(String.valueOf(Math.round(i*3.6))); - } - - @Override - public void onStartTrackingTouch(SeekArc seekArc) { - - } - - @Override - public void onStopTrackingTouch(SeekArc seekArc) { - + public boolean onDrag(View v, DragEvent event) { + int action = event.getAction(); + switch (action) { + case DragEvent.ACTION_DRAG_STARTED: + layoutParams = (RelativeLayout.LayoutParams)v.getLayoutParams(); + Log.d("drag", "Action is DragEvent.ACTION_DRAG_STARTED"); + + // Do nothing + break; + + case DragEvent.ACTION_DRAG_ENTERED: + Log.d("drag", "Action is DragEvent.ACTION_DRAG_ENTERED"); + int x_cord = (int) event.getX(); + int y_cord = (int) event.getY(); + break; + + case DragEvent.ACTION_DRAG_EXITED : + Log.d("drag", "Action is DragEvent.ACTION_DRAG_EXITED"); + x_cord = (int) event.getX(); + y_cord = (int) event.getY(); + layoutParams.leftMargin = x_cord; + layoutParams.topMargin = y_cord; + v.setLayoutParams(layoutParams); + break; + + case DragEvent.ACTION_DRAG_LOCATION : + Log.d("drag", "Action is DragEvent.ACTION_DRAG_LOCATION"); + x_cord = (int) event.getX(); + y_cord = (int) event.getY(); + break; + + case DragEvent.ACTION_DRAG_ENDED : + Log.d("drag", "Action is DragEvent.ACTION_DRAG_ENDED"); + + // Do nothing + break; + + case DragEvent.ACTION_DROP: + Log.d("drag", "ACTION_DROP event"); + v.setVisibility(View.VISIBLE); + ((View) event.getLocalState()).setVisibility(View.VISIBLE); + // Do nothing + break; + default: break; + } + ((View) event.getLocalState()).setVisibility(View.VISIBLE); + return true; } }); } diff --git a/app/src/main/res/layout/activity_robotic_arm.xml b/app/src/main/res/layout/activity_robotic_arm.xml index dbfc5efdc..be627a4a9 100644 --- a/app/src/main/res/layout/activity_robotic_arm.xml +++ b/app/src/main/res/layout/activity_robotic_arm.xml @@ -6,7 +6,7 @@ + android:layout_margin="5dp" + android:visibility="gone"/> + android:visibility="gone"/> + android:visibility="gone"/> \ No newline at end of file diff --git a/app/src/main/res/layout/servo_controller_layout.xml b/app/src/main/res/layout/servo_controller_layout.xml index fdc2b2d15..777f2a262 100644 --- a/app/src/main/res/layout/servo_controller_layout.xml +++ b/app/src/main/res/layout/servo_controller_layout.xml @@ -12,18 +12,17 @@ android:layout_marginStart="10dp" android:layout_marginTop="10dp" /> - + + + + + + + + + + + Date: Wed, 22 May 2019 01:05:28 +0530 Subject: [PATCH 4/5] drag and drop of servo controllers working, timeline and UI needs to be changed --- .../io/pslab/activity/RoboticArmActivity.java | 310 +++++++++--------- .../main/res/layout/activity_robotic_arm.xml | 114 +++++-- .../layout/robotic_arm_timeline_textview.xml | 8 + .../res/layout/servo_controller_layout.xml | 33 +- 4 files changed, 271 insertions(+), 194 deletions(-) create mode 100644 app/src/main/res/layout/robotic_arm_timeline_textview.xml diff --git a/app/src/main/java/io/pslab/activity/RoboticArmActivity.java b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java index 7d10ad2ee..2f1e7e111 100644 --- a/app/src/main/java/io/pslab/activity/RoboticArmActivity.java +++ b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java @@ -1,19 +1,11 @@ package io.pslab.activity; -import android.content.ClipData; -import android.content.ClipDescription; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; -import android.text.Editable; -import android.text.TextWatcher; -import android.util.Log; import android.view.DragEvent; -import android.view.KeyEvent; -import android.view.MotionEvent; +import android.view.LayoutInflater; import android.view.View; -import android.view.ViewGroup; -import android.widget.EditText; -import android.widget.RelativeLayout; +import android.widget.LinearLayout; import android.widget.TextView; import com.triggertrap.seekarc.SeekArc; @@ -24,9 +16,7 @@ public class RoboticArmActivity extends AppCompatActivity { TextView degreeText1, degreeText2, degreeText3, degreeText4; SeekArc seekArc1, seekArc2, seekArc3, seekArc4; - private int _xDelta; - private int _yDelta; - private android.widget.RelativeLayout.LayoutParams layoutParams; + LinearLayout servo1TimeLine, servo2TimeLine, servo3TimeLine, servo4TimeLine; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -37,6 +27,10 @@ protected void onCreate(Bundle savedInstanceState) { View servo3Layout = findViewById(R.id.servo_3); View servo4Layout = findViewById(R.id.servo_4); + servo1TimeLine = findViewById(R.id.servo1_timeline); + servo2TimeLine = findViewById(R.id.servo2_timeline); + servo3TimeLine = findViewById(R.id.servo3_timeline); + servo4TimeLine = findViewById(R.id.servo4_timeline); TextView servo1Title = servo1Layout.findViewById(R.id.servo_title); servo1Title.setText(getResources().getString(R.string.servo1_title)); @@ -53,153 +47,175 @@ protected void onCreate(Bundle savedInstanceState) { degreeText2 = servo2Layout.findViewById(R.id.degreeText); degreeText3 = servo3Layout.findViewById(R.id.degreeText); degreeText4 = servo4Layout.findViewById(R.id.degreeText); -// seekArc1 = servo1Layout.findViewById(R.id.seek_arc); -// seekArc2 = servo2Layout.findViewById(R.id.seek_arc); -// seekArc3 = servo3Layout.findViewById(R.id.seek_arc); -// seekArc4 = servo4Layout.findViewById(R.id.seek_arc); -// -// seekArc1.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { -// @Override -// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { -// degreeText1.setText(String.valueOf(Math.round(i*3.6))); -// } -// -// @Override -// public void onStartTrackingTouch(SeekArc seekArc) { -// -// } -// -// @Override -// public void onStopTrackingTouch(SeekArc seekArc) { -// -// } -// }); -// -// seekArc2.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { -// @Override -// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { -// degreeText2.setText(String.valueOf(Math.round(i*3.6))); -// } -// -// @Override -// public void onStartTrackingTouch(SeekArc seekArc) { -// -// } -// -// @Override -// public void onStopTrackingTouch(SeekArc seekArc) { -// -// } -// }); -// -// seekArc3.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { -// @Override -// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { -// degreeText3.setText(String.valueOf(Math.round(i*3.6))); -// } -// -// @Override -// public void onStartTrackingTouch(SeekArc seekArc) { -// -// } -// -// @Override -// public void onStopTrackingTouch(SeekArc seekArc) { -// -// } -// }); -// -// seekArc4.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { -// @Override -// public void onProgressChanged(SeekArc seekArc, int i, boolean b) { -// degreeText4.setText(String.valueOf(Math.round(i*3.6))); -// } -// -// @Override -// public void onStartTrackingTouch(SeekArc seekArc) { -// -// } -// -// @Override -// public void onStopTrackingTouch(SeekArc seekArc) { -// -// } -// }); - servo1Layout.setOnTouchListener(new View.OnTouchListener() { - @Override - public boolean onTouch(View view, MotionEvent event) { - if (event.getAction() == MotionEvent.ACTION_DOWN) { - ClipData data = ClipData.newPlainText("", ""); - View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder(view); - view.startDrag(data, shadowBuilder, view, 0); - view.setVisibility(View.INVISIBLE); - return true; - }else { - return false; + seekArc1 = servo1Layout.findViewById(R.id.seek_arc); + seekArc2 = servo2Layout.findViewById(R.id.seek_arc); + seekArc3 = servo3Layout.findViewById(R.id.seek_arc); + seekArc4 = servo4Layout.findViewById(R.id.seek_arc); + + seekArc1.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { + @Override + public void onProgressChanged(SeekArc seekArc, int i, boolean b) { + degreeText1.setText(String.valueOf(Math.round(i*3.6))); + } + + @Override + public void onStartTrackingTouch(SeekArc seekArc) { + + } + + @Override + public void onStopTrackingTouch(SeekArc seekArc) { + + } + }); + + seekArc2.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { + @Override + public void onProgressChanged(SeekArc seekArc, int i, boolean b) { + degreeText2.setText(String.valueOf(Math.round(i*3.6))); + } + + @Override + public void onStartTrackingTouch(SeekArc seekArc) { + + } + + @Override + public void onStopTrackingTouch(SeekArc seekArc) { + + } + }); + + seekArc3.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { + @Override + public void onProgressChanged(SeekArc seekArc, int i, boolean b) { + degreeText3.setText(String.valueOf(Math.round(i*3.6))); + } + + @Override + public void onStartTrackingTouch(SeekArc seekArc) { + + } + + @Override + public void onStopTrackingTouch(SeekArc seekArc) { + + } + }); + + seekArc4.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { + @Override + public void onProgressChanged(SeekArc seekArc, int i, boolean b) { + degreeText4.setText(String.valueOf(Math.round(i*3.6))); + } + + @Override + public void onStartTrackingTouch(SeekArc seekArc) { + + } + + @Override + public void onStopTrackingTouch(SeekArc seekArc) { + + } + }); + + servo1Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo1Layout); + v.startDrag(null,myShadow,servo1Layout,0); + return true; + } + }); + + servo1TimeLine.setOnDragListener(new View.OnDragListener() { + @Override + public boolean onDrag(View v, DragEvent event) { + if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { + View view = (View)event.getLocalState(); + TextView text = view.findViewById(R.id.degreeText); + TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + new_text.setText(text.getText()); + if (view.getId() == R.id.servo_1) { + servo1TimeLine.addView(new_text, servo1TimeLine.getChildCount()); + } } + return true; } }); - servo1Layout.setOnLongClickListener(new View.OnLongClickListener() { + + servo2Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { - ClipData.Item item = new ClipData.Item((CharSequence)v.getTag()); - String[] mimeTypes = {ClipDescription.MIMETYPE_TEXT_PLAIN}; + View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo2Layout); + v.startDrag(null,myShadow,servo2Layout,0); + return true; + } + }); - ClipData dragData = new ClipData(v.getTag().toString(),mimeTypes, item); - View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo1Layout); + servo2TimeLine.setOnDragListener(new View.OnDragListener() { + @Override + public boolean onDrag(View v, DragEvent event) { + if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { + View view = (View)event.getLocalState(); + TextView text = view.findViewById(R.id.degreeText); + TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + new_text.setText(text.getText()); + if (view.getId() == R.id.servo_2) { + servo2TimeLine.addView(new_text, servo2TimeLine.getChildCount()); + } + } + return true; + } + }); - v.startDrag(dragData,myShadow,null,0); + servo3Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo3Layout); + v.startDrag(null,myShadow,servo3Layout,0); return true; } }); - servo1Layout.setOnDragListener(new View.OnDragListener() { + + servo3TimeLine.setOnDragListener(new View.OnDragListener() { + @Override + public boolean onDrag(View v, DragEvent event) { + if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { + View view = (View)event.getLocalState(); + TextView text = view.findViewById(R.id.degreeText); + TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + new_text.setText(text.getText()); + if (view.getId() == R.id.servo_3) { + servo3TimeLine.addView(new_text, servo3TimeLine.getChildCount()); + } + } + return true; + } + }); + + servo4Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo4Layout); + v.startDrag(null,myShadow,servo4Layout,0); + return true; + } + }); + + servo4TimeLine.setOnDragListener(new View.OnDragListener() { @Override public boolean onDrag(View v, DragEvent event) { - int action = event.getAction(); - switch (action) { - case DragEvent.ACTION_DRAG_STARTED: - layoutParams = (RelativeLayout.LayoutParams)v.getLayoutParams(); - Log.d("drag", "Action is DragEvent.ACTION_DRAG_STARTED"); - - // Do nothing - break; - - case DragEvent.ACTION_DRAG_ENTERED: - Log.d("drag", "Action is DragEvent.ACTION_DRAG_ENTERED"); - int x_cord = (int) event.getX(); - int y_cord = (int) event.getY(); - break; - - case DragEvent.ACTION_DRAG_EXITED : - Log.d("drag", "Action is DragEvent.ACTION_DRAG_EXITED"); - x_cord = (int) event.getX(); - y_cord = (int) event.getY(); - layoutParams.leftMargin = x_cord; - layoutParams.topMargin = y_cord; - v.setLayoutParams(layoutParams); - break; - - case DragEvent.ACTION_DRAG_LOCATION : - Log.d("drag", "Action is DragEvent.ACTION_DRAG_LOCATION"); - x_cord = (int) event.getX(); - y_cord = (int) event.getY(); - break; - - case DragEvent.ACTION_DRAG_ENDED : - Log.d("drag", "Action is DragEvent.ACTION_DRAG_ENDED"); - - // Do nothing - break; - - case DragEvent.ACTION_DROP: - Log.d("drag", "ACTION_DROP event"); - v.setVisibility(View.VISIBLE); - ((View) event.getLocalState()).setVisibility(View.VISIBLE); - // Do nothing - break; - default: break; + if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { + View view = (View)event.getLocalState(); + TextView text = view.findViewById(R.id.degreeText); + TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + new_text.setText(text.getText()); + if (view.getId() == R.id.servo_4) { + servo4TimeLine.addView(new_text, servo4TimeLine.getChildCount()); + } } - ((View) event.getLocalState()).setVisibility(View.VISIBLE); return true; } }); diff --git a/app/src/main/res/layout/activity_robotic_arm.xml b/app/src/main/res/layout/activity_robotic_arm.xml index be627a4a9..1d6023dbb 100644 --- a/app/src/main/res/layout/activity_robotic_arm.xml +++ b/app/src/main/res/layout/activity_robotic_arm.xml @@ -6,45 +6,87 @@ - - - - - - - + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/robotic_arm_timeline_textview.xml b/app/src/main/res/layout/robotic_arm_timeline_textview.xml new file mode 100644 index 000000000..2d0518b5f --- /dev/null +++ b/app/src/main/res/layout/robotic_arm_timeline_textview.xml @@ -0,0 +1,8 @@ + + diff --git a/app/src/main/res/layout/servo_controller_layout.xml b/app/src/main/res/layout/servo_controller_layout.xml index 777f2a262..dab0a85f3 100644 --- a/app/src/main/res/layout/servo_controller_layout.xml +++ b/app/src/main/res/layout/servo_controller_layout.xml @@ -12,17 +12,28 @@ android:layout_marginStart="10dp" android:layout_marginTop="10dp" /> - - - - - - - - - - - + + Date: Wed, 22 May 2019 20:08:00 +0530 Subject: [PATCH 5/5] timeline layout created, timeline controlls panel added --- .../io/pslab/activity/RoboticArmActivity.java | 133 +++++++++---- .../main/res/drawable/servo_drag_handle.png | Bin 0 -> 302 bytes .../main/res/layout/activity_robotic_arm.xml | 178 ++++++++++-------- .../layout/robotic_arm_timeline_textview.xml | 8 +- .../res/layout/servo_controller_layout.xml | 64 ++++--- 5 files changed, 236 insertions(+), 147 deletions(-) create mode 100644 app/src/main/res/drawable/servo_drag_handle.png diff --git a/app/src/main/java/io/pslab/activity/RoboticArmActivity.java b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java index 2f1e7e111..459093740 100644 --- a/app/src/main/java/io/pslab/activity/RoboticArmActivity.java +++ b/app/src/main/java/io/pslab/activity/RoboticArmActivity.java @@ -1,10 +1,14 @@ package io.pslab.activity; +import android.graphics.Point; +import android.os.Build; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.view.Display; import android.view.DragEvent; import android.view.LayoutInflater; import android.view.View; +import android.view.WindowManager; import android.widget.LinearLayout; import android.widget.TextView; @@ -14,23 +18,57 @@ public class RoboticArmActivity extends AppCompatActivity { - TextView degreeText1, degreeText2, degreeText3, degreeText4; - SeekArc seekArc1, seekArc2, seekArc3, seekArc4; - LinearLayout servo1TimeLine, servo2TimeLine, servo3TimeLine, servo4TimeLine; + private TextView degreeText1, degreeText2, degreeText3, degreeText4; + private SeekArc seekArc1, seekArc2, seekArc3, seekArc4; + private LinearLayout servo1TimeLine, servo2TimeLine, servo3TimeLine, servo4TimeLine; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_robotic_arm); + Display display = getWindowManager().getDefaultDisplay(); + Point size = new Point(); + display.getSize(size); + int screen_width = size.x; + int screen_height = size.y; + View servo1Layout = findViewById(R.id.servo_1); View servo2Layout = findViewById(R.id.servo_2); View servo3Layout = findViewById(R.id.servo_3); View servo4Layout = findViewById(R.id.servo_4); - + degreeText1 = servo1Layout.findViewById(R.id.degreeText); + degreeText2 = servo2Layout.findViewById(R.id.degreeText); + degreeText3 = servo3Layout.findViewById(R.id.degreeText); + degreeText4 = servo4Layout.findViewById(R.id.degreeText); + seekArc1 = servo1Layout.findViewById(R.id.seek_arc); + seekArc2 = servo2Layout.findViewById(R.id.seek_arc); + seekArc3 = servo3Layout.findViewById(R.id.seek_arc); + seekArc4 = servo4Layout.findViewById(R.id.seek_arc); servo1TimeLine = findViewById(R.id.servo1_timeline); servo2TimeLine = findViewById(R.id.servo2_timeline); servo3TimeLine = findViewById(R.id.servo3_timeline); servo4TimeLine = findViewById(R.id.servo4_timeline); + LinearLayout timeLineControlsLayout = findViewById(R.id.servo_timeline_controls); + + LinearLayout.LayoutParams servoControllerParams = new LinearLayout.LayoutParams(screen_width / 4 - 4, screen_height / 2 - 4); + servoControllerParams.setMargins(2, 5, 2, 0); + servo1Layout.setLayoutParams(servoControllerParams); + servo2Layout.setLayoutParams(servoControllerParams); + servo3Layout.setLayoutParams(servoControllerParams); + servo4Layout.setLayoutParams(servoControllerParams); + + LinearLayout.LayoutParams servoTimeLineParams = new LinearLayout.LayoutParams(screen_width - 4 - screen_width / 15, screen_height / 8 - 2); + servoTimeLineParams.setMargins(2, 2, 2, 0); + + servo1TimeLine.setLayoutParams(servoTimeLineParams); + servo2TimeLine.setLayoutParams(servoTimeLineParams); + servo3TimeLine.setLayoutParams(servoTimeLineParams); + servo4TimeLine.setLayoutParams(servoTimeLineParams); + + LinearLayout.LayoutParams timeLineControlsParams = new LinearLayout.LayoutParams(screen_width / 15, screen_height / 2); + timeLineControlsLayout.setLayoutParams(timeLineControlsParams); + TextView servo1Title = servo1Layout.findViewById(R.id.servo_title); servo1Title.setText(getResources().getString(R.string.servo1_title)); @@ -43,19 +81,11 @@ protected void onCreate(Bundle savedInstanceState) { TextView servo4Title = servo4Layout.findViewById(R.id.servo_title); servo4Title.setText(getResources().getString(R.string.servo4_title)); - degreeText1 = servo1Layout.findViewById(R.id.degreeText); - degreeText2 = servo2Layout.findViewById(R.id.degreeText); - degreeText3 = servo3Layout.findViewById(R.id.degreeText); - degreeText4 = servo4Layout.findViewById(R.id.degreeText); - seekArc1 = servo1Layout.findViewById(R.id.seek_arc); - seekArc2 = servo2Layout.findViewById(R.id.seek_arc); - seekArc3 = servo3Layout.findViewById(R.id.seek_arc); - seekArc4 = servo4Layout.findViewById(R.id.seek_arc); seekArc1.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { @Override public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText1.setText(String.valueOf(Math.round(i*3.6))); + degreeText1.setText(String.valueOf(Math.round(i * 3.6))); } @Override @@ -72,7 +102,7 @@ public void onStopTrackingTouch(SeekArc seekArc) { seekArc2.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { @Override public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText2.setText(String.valueOf(Math.round(i*3.6))); + degreeText2.setText(String.valueOf(Math.round(i * 3.6))); } @Override @@ -89,7 +119,7 @@ public void onStopTrackingTouch(SeekArc seekArc) { seekArc3.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { @Override public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText3.setText(String.valueOf(Math.round(i*3.6))); + degreeText3.setText(String.valueOf(Math.round(i * 3.6))); } @Override @@ -106,7 +136,7 @@ public void onStopTrackingTouch(SeekArc seekArc) { seekArc4.setOnSeekArcChangeListener(new SeekArc.OnSeekArcChangeListener() { @Override public void onProgressChanged(SeekArc seekArc, int i, boolean b) { - degreeText4.setText(String.valueOf(Math.round(i*3.6))); + degreeText4.setText(String.valueOf(Math.round(i * 3.6))); } @Override @@ -120,11 +150,11 @@ public void onStopTrackingTouch(SeekArc seekArc) { } }); - servo1Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { + servo1Layout.findViewById(R.id.drag_handle).setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo1Layout); - v.startDrag(null,myShadow,servo1Layout,0); + v.startDrag(null, myShadow, servo1Layout, 0); return true; } }); @@ -133,23 +163,26 @@ public boolean onLongClick(View v) { @Override public boolean onDrag(View v, DragEvent event) { if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { - View view = (View)event.getLocalState(); - TextView text = view.findViewById(R.id.degreeText); - TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); - new_text.setText(text.getText()); - if (view.getId() == R.id.servo_1) { - servo1TimeLine.addView(new_text, servo1TimeLine.getChildCount()); - } + View view = (View) event.getLocalState(); + TextView text = view.findViewById(R.id.degreeText); + TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + LinearLayout.LayoutParams timeLineTextParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + timeLineTextParams.setMargins(5, 1, 1, 1); + new_text.setLayoutParams(timeLineTextParams); + new_text.setText(text.getText()); + if (view.getId() == R.id.servo_1) { + servo1TimeLine.addView(new_text, servo1TimeLine.getChildCount()); + } } return true; } }); - servo2Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { + servo2Layout.findViewById(R.id.drag_handle).setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo2Layout); - v.startDrag(null,myShadow,servo2Layout,0); + v.startDrag(null, myShadow, servo2Layout, 0); return true; } }); @@ -158,9 +191,12 @@ public boolean onLongClick(View v) { @Override public boolean onDrag(View v, DragEvent event) { if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { - View view = (View)event.getLocalState(); + View view = (View) event.getLocalState(); TextView text = view.findViewById(R.id.degreeText); TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + LinearLayout.LayoutParams timeLineTextParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + timeLineTextParams.setMargins(5, 1, 1, 1); + new_text.setLayoutParams(timeLineTextParams); new_text.setText(text.getText()); if (view.getId() == R.id.servo_2) { servo2TimeLine.addView(new_text, servo2TimeLine.getChildCount()); @@ -170,11 +206,11 @@ public boolean onDrag(View v, DragEvent event) { } }); - servo3Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { + servo3Layout.findViewById(R.id.drag_handle).setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo3Layout); - v.startDrag(null,myShadow,servo3Layout,0); + v.startDrag(null, myShadow, servo3Layout, 0); return true; } }); @@ -183,9 +219,12 @@ public boolean onLongClick(View v) { @Override public boolean onDrag(View v, DragEvent event) { if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { - View view = (View)event.getLocalState(); + View view = (View) event.getLocalState(); TextView text = view.findViewById(R.id.degreeText); TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + LinearLayout.LayoutParams timeLineTextParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + timeLineTextParams.setMargins(5, 1, 1, 1); + new_text.setLayoutParams(timeLineTextParams); new_text.setText(text.getText()); if (view.getId() == R.id.servo_3) { servo3TimeLine.addView(new_text, servo3TimeLine.getChildCount()); @@ -195,11 +234,11 @@ public boolean onDrag(View v, DragEvent event) { } }); - servo4Layout.findViewById(R.id.drag_text).setOnLongClickListener(new View.OnLongClickListener() { + servo4Layout.findViewById(R.id.drag_handle).setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { View.DragShadowBuilder myShadow = new View.DragShadowBuilder(servo4Layout); - v.startDrag(null,myShadow,servo4Layout,0); + v.startDrag(null, myShadow, servo4Layout, 0); return true; } }); @@ -208,9 +247,12 @@ public boolean onLongClick(View v) { @Override public boolean onDrag(View v, DragEvent event) { if (event.getAction() == DragEvent.ACTION_DRAG_ENTERED) { - View view = (View)event.getLocalState(); + View view = (View) event.getLocalState(); TextView text = view.findViewById(R.id.degreeText); TextView new_text = (TextView) LayoutInflater.from(RoboticArmActivity.this).inflate(R.layout.robotic_arm_timeline_textview, null); + LinearLayout.LayoutParams timeLineTextParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT); + timeLineTextParams.setMargins(5, 1, 1, 1); + new_text.setLayoutParams(timeLineTextParams); new_text.setText(text.getText()); if (view.getId() == R.id.servo_4) { servo4TimeLine.addView(new_text, servo4TimeLine.getChildCount()); @@ -220,4 +262,27 @@ public boolean onDrag(View v, DragEvent event) { } }); } + + @Override + protected void onResume() { + super.onResume(); + removeStatusBar(); + } + + private void removeStatusBar() { + if (Build.VERSION.SDK_INT < 16) { + getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, + WindowManager.LayoutParams.FLAG_FULLSCREEN); + } else { + View decorView = getWindow().getDecorView(); + + decorView.setSystemUiVisibility((View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY)); + } + } } diff --git a/app/src/main/res/drawable/servo_drag_handle.png b/app/src/main/res/drawable/servo_drag_handle.png new file mode 100644 index 0000000000000000000000000000000000000000..12e2669a7160e7118e8a6068de9ae3ed7defe984 GIT binary patch literal 302 zcmeAS@N?(olHy`uVBq!ia0vp^9zZP1!2%=~FMrelq*&4&eH|GXHuiJ>Nn{1`6_P!I zd>I(3)EF2VS{N990fib~Fff!FFfhDIU|_JC!N4G1FlSew4N!t9$=lt9;eUJonf*W> zdx@v7EBj+sF*Zd`frzPIKp`_v7srr@!*8!C@-ZmzupB(}|9^}OlaQ8Tird_nO2Ii> zcYf-fRA-s2>@h*1;r>r&QO72hgGmf+icIpZvx4h@Ca9LUMwFx^mZVxG7o`Fz1|tJQ zOI-s~T_d9q12ZdQV=Dt7*Tl-eVEJ^ha1;%>`6-!cmAExrJGJgLPy>UftDnm{r-UW| Dd#+Ql literal 0 HcmV?d00001 diff --git a/app/src/main/res/layout/activity_robotic_arm.xml b/app/src/main/res/layout/activity_robotic_arm.xml index 1d6023dbb..f9eea5ece 100644 --- a/app/src/main/res/layout/activity_robotic_arm.xml +++ b/app/src/main/res/layout/activity_robotic_arm.xml @@ -1,92 +1,114 @@ - + android:layout_height="wrap_content" + android:background="@color/grey_light" + android:gravity="center_horizontal" + tools:context=".activity.RoboticArmActivity"> - + android:orientation="horizontal" + android:scrollbars="horizontal"> - - - + android:layout_height="wrap_content" /> - + - + - + + - - - + - - + android:layout_height="wrap_content" + android:layout_weight="0.9" + android:orientation="vertical"> + + + + + + + + + + - - \ No newline at end of file + android:id="@+id/servo_timeline_controls" + android:layout_width="10dp" + android:layout_height="match_parent" + android:layout_weight="0.1" + android:background="@color/colorPrimary" + android:gravity="center_vertical|center_horizontal" + android:orientation="vertical"> + +