66import android .os .Bundle ;
77import android .view .Display ;
88import android .view .DragEvent ;
9+ import android .view .Gravity ;
910import android .view .KeyEvent ;
1011import android .view .LayoutInflater ;
1112import android .view .View ;
13+ import android .view .ViewGroup ;
1214import android .view .WindowManager ;
1315import android .view .inputmethod .EditorInfo ;
16+ import android .widget .Button ;
1417import android .widget .EditText ;
1518import android .widget .LinearLayout ;
1619import android .widget .RelativeLayout ;
@@ -27,6 +30,7 @@ public class RoboticArmActivity extends AppCompatActivity {
2730 private LinearLayout servo1TimeLine , servo2TimeLine , servo3TimeLine , servo4TimeLine ;
2831 private int degree ;
2932 private boolean editEnter = false ;
33+ private Button playButton , pauseButton , stopButton ;
3034
3135 @ Override
3236 protected void onCreate (Bundle savedInstanceState ) {
@@ -55,6 +59,9 @@ protected void onCreate(Bundle savedInstanceState) {
5559 servo2TimeLine = findViewById (R .id .servo2_timeline );
5660 servo3TimeLine = findViewById (R .id .servo3_timeline );
5761 servo4TimeLine = findViewById (R .id .servo4_timeline );
62+ playButton = findViewById (R .id .timeline_play_button );
63+ pauseButton = findViewById (R .id .timeline_pause_button );
64+ stopButton = findViewById (R .id .timeline_stop_button );
5865 LinearLayout timeLineControlsLayout = findViewById (R .id .servo_timeline_controls );
5966
6067 LinearLayout .LayoutParams servoControllerParams = new LinearLayout .LayoutParams (screen_width / 4 - 4 , screen_height / 2 - 4 );
@@ -64,7 +71,7 @@ protected void onCreate(Bundle savedInstanceState) {
6471 servo3Layout .setLayoutParams (servoControllerParams );
6572 servo4Layout .setLayoutParams (servoControllerParams );
6673
67- LinearLayout .LayoutParams servoTimeLineParams = new LinearLayout .LayoutParams (screen_width * 10 , screen_height / 8 );
74+ LinearLayout .LayoutParams servoTimeLineParams = new LinearLayout .LayoutParams (screen_width * 10 , screen_height / 8 - 3 );
6875 servoTimeLineParams .setMargins (2 , 0 , 2 , 4 );
6976
7077 servo1TimeLine .setLayoutParams (servoTimeLineParams );
@@ -229,7 +236,6 @@ public boolean onLongClick(View v) {
229236 }
230237 });
231238
232-
233239 servo2Layout .findViewById (R .id .drag_handle ).setOnLongClickListener (new View .OnLongClickListener () {
234240 @ Override
235241 public boolean onLongClick (View v ) {
@@ -308,6 +314,11 @@ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
308314 return false ;
309315 }
310316 });
317+
318+ LinearLayout timeIndicatorLayout = findViewById (R .id .time_indicator );
319+ LinearLayout .LayoutParams timeIndicatorParams = new LinearLayout .LayoutParams (screen_width / 6 - 2 , 12 );
320+ timeIndicatorParams .setMargins (3 , 0 , 0 , 0 );
321+ timeIndicatorLayout .setLayoutParams (timeIndicatorParams );
311322 }
312323
313324 private View .OnDragListener servo1DragListener = new View .OnDragListener () {
0 commit comments