로봇 모션 편집기 4/4 UNIT 25 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 에디트 텍스트를 사용할 수 있다. 아이템을 삭제할 수 있다. 아이템을 편집할 수 있다. 2.

Slides:



Advertisements
Similar presentations
User Interface Android Applications. Activities An activity presents a visual user interface. Each activity is given a default window to draw in. The.
Advertisements

Layout and Control in UI The user interface (UI) is the graphical interface user can see and interact with your app comprising UI controls like textbox,
Presenting Lists of Data. Lists of Data Issues involved – unknown number of elements – allowing the user to scroll Data sources – most common ArrayList.
Android development the first app. Andoid vs iOS which is better? Short answer: neither Proponents on both sides For an iOS side, see this article on.
Android Hard & Soft Keyboards Notes are based on: The Busy Coder's Guide to Android Development by Mark L. Murphy Copyright © CommonsWare, LLC.
Android Layouts. Layouts Define the user interface for an activity Layouts are defined in.xml files – within /res/layout folder – different layout can.
ANDROID – INTERFACE AND LAYOUT L. Grewe. Interfaces: Two Alternatives Code or XML  You have two ways you can create the interface(s) of your Application.
Package org.androidtown.database.query; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase;
로봇 모니터링 2/2 UNIT 21 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Broadcasting Service 2.
로봇 전화번호부 4/4 UNIT 12 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 뷰 홀더 패턴을 사용할 수 있다. 토스트를 사용할 수 있다. 클릭 이벤트를 처리할 수 있다. 2.
1/29/ Android Programming: FrameLayout By Dr. Ramji M. Makwana Professor and Head, Computer Engineering Department A.D. Patel.
ListView.
전광판 만들기 UNIT 04 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Layout XML 이란 ? 기본 XML 속성 Text View 2.
Programming with Android: Layouts, Widgets and Events Luca Bedogni Marco Di Felice Dipartimento di Scienze dell’Informazione Università di Bologna.
로봇을 조종하자 3/4 UNIT 17 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 스마트 폰의 센서를 사용할 수 있다. 2.
Import import android.graphics.Bitmap; import android.widget.ImageView;
Copyright© Jeffrey Jongko, Ateneo de Manila University Basic Views and Layouts.
로봇 모니터링 1/2 UNIT 20 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Message Queue Handler 2.
Activity 생명주기 UNIT 13 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Logcat 액티비티 생명주기를 설명할 수 있다. 현재 상태를 저장할 수 있다. 2.
1 Introducing Activity and Intent. 2 Memory LinearLayout, weight=2 LinearLayout, weight=1 TextView ListView.
데이터 저장 & Fragment UNIT 28 로봇 SW 콘텐츠 교육원 조용수. 데이터 저장 & Fragment SharedPreference 로 데이터 저장 Fragment 의 이해 2.
Copyright© Jeffrey Jongko, Ateneo de Manila University Custom ListAdapters.
Mobile Programming Lecture 7 Dialogs, Menus, and SharedPreferences.
네트워크 전송 1/2 UNIT 29 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Android Network 통신 2.
로봇을 조종하자 4/4 UNIT 18 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Intent Activity 호출 2.
로봇을 조종하자 1/5 UNIT 14 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 터치 이벤트를 처리할 수 있다. 2.
Custom Widget 2 UNIT 27 로봇 SW 콘텐츠 교육원 조용수. 학습 목표 Custom Widget –Canvas 를 이용하여 Custom Widget 을 만든다. 2.
Android Alert Dialog. Alert Dialog Place Button to open the dialog. public class MainActivity extends ActionBarActivity { private static Button button_sbm;
Android 基本 I/O. 基本 I/O 介面元件 在此節中主要介紹常見的 I/O 使用者介 面元件 – Button, TextView, 以及 EditText , 學習者可以學會: – Android 的視窗表單設計 res/layout/main.xml – Android SDK –
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
CMPE419 Mobile Application Development Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren
Lab7 – Appendix.
Introduction to android
CS499 – Mobile Application Development
UNIT 11 로봇 전화번호부 3/4 로봇 SW 콘텐츠 교육원 조용수.
several communicating screens
CS240: Advanced Programming Concepts
GUI Programming Fundamentals
Further android gui programming
ListView: Part 2.
CS499 – Mobile Application Development
Android Hard & Soft Keyboards
Android Widgets 1 7 August 2018
Android Introduction Hello Views Part 1.
android architecture components with mvvm
Android Introduction Hello Views Part 2.
CS323 Android Model-View-Controller Architecture
CIS 470 Mobile App Development
CIS 470 Mobile App Development
CMPE419 Mobile Application Development
CA16R405 - Mobile Application Development (Theory)
CMPE419 Mobile Application Development
UNIT 08 그림책 만들기 2/2 로봇 SW 콘텐츠 교육원 조용수.
BMI Android Application will take weight and height from the users to calculate Body Mass Index (BMI) with the information, whether user is underweight,
Android Developer Fundamentals V2
Activities and Intents
Android Developer Fundamentals V2 Lesson 4
CIS 470 Mobile App Development
Android Developer Fundamentals V2
CMPE419 Mobile Application Development
Adding Components to Activity
Korea Software HRD Center
CMPE419 Mobile Application Development
CMPE419 Mobile Application Development
BLP 4216 MOBİL UYGULAMA GELİŞTİRME-2
CMPE419 Mobile Application Development
CS 240 – Advanced Programming Concepts
Lasalle-App Tecnología Móvil.
Android Sensor Programming
Android Sensor Programming
Presentation transcript:

로봇 모션 편집기 4/4 UNIT 25 로봇 SW 콘텐츠 교육원 조용수

학습 목표 에디트 텍스트를 사용할 수 있다. 아이템을 삭제할 수 있다. 아이템을 편집할 수 있다. 2

TextView 에디트 텍스트 3 Object View EditText

XML 속성 : inputType none text, textUri, text Address number, numberSigned, numberDecimal phone datetime, date, time textPassword 4 <RelativeLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="none" />

XML 속성 : inputType 5 nonetexttextUritext Address

XML 속성 : inputType 6 numbernumberSignednumberDecimalphone

XML 속성 : inputType 7 datetimedatetimetextPassword

XML 속성 : hint 8 <RelativeLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="text" />

로봇 움직이기 9 <LinearLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="10dp"> <RadioGroup android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" /> <RadioButton android:layout_width="match_parent" android:layout_height="wrap_content" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="number" />

로봇 움직이기 10 private final int DIALOG_ADD = 1; View layout = null; RadioGroup radioGroup = null; CheckBox checkBox = null; EditText etSpeed = null; private void ShowDialog(int id, Bundle bundle) { switch(id) { case DIALOG_ADD: layout = View.inflate(this, R.layout.action, null); radioGroup = (RadioGroup)layout.findViewById(R.id.rgAction); etSpeed = (EditText)layout.findViewById(R.id.etSpeed); etSpeed.setText("50"); new AlertDialog.Builder(this).setTitle("Add Actions").setIcon(R.drawable.ic_launcher).setView(layout).setPositiveButton("OK", new DialogInterface.OnClickListener() public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub int action = radioGroup.getCheckedRadioButtonId() == R.id.rbforward? Action.FORWARD: Action.TURN_LEFT; int speed = 0; try{ speed = Integer.parseInt(etSpeed.getText().toString()); } catch (NumberFormatException ne) { } actions.add(new Action(action,speed)); adapter.notifyDataSetChanged(); } }).setNegativeButton("Cancel", null).setCancelable(false).show(); break;

아이템 편집 11 private static final class Action { int id; int icon; int name; int speed; private final int[] icons = new int[] { R.drawable.forward_on, R.drawable.left_on }; private final int[] names = new int[] { R.string.forward, R.string.turn_left }; static final int FORWARD = 0; static final int TURN_LEFT = 1; Action(int id, int speed) { this.id = id; this.icon = icons[id]; this.name = names[id]; this.speed = speed; } void update(int id, int speed) { this.id = id; this.icon = icons[id]; this.name = names[id]; this.speed = speed; }

아이템 편집 12 public class MainActivity extends RobotActivity implements View.OnClickListener { private Button startButton; private Button stopButton; private final ArrayList actions = new ArrayList (); private ActionListAdapter adapter; private Device leftWheelDevice; private Device rightWheelDevice; private int time; private int index; private boolean running; private static final int DIALOG_ADD = 1; private static final int DIALOG_EDIT = 2;

아이템 편집 13 case DIALOG_EDIT: final int position = bundle.getInt("Position"); final Action item = actions.get(position); layout = View.inflate(this, R.layout.action, null); radioGroup = (RadioGroup)layout.findViewById(R.id.rgAction); if(item.id == Action.FORWARD){ radioGroup.check(R.id.rbforward); } else { radioGroup.check(R.id.rbTurnLeft); } checkBox = (CheckBox)layout.findViewById(R.id.ckSpeed); checkBox.setVisibility(View.GONE); etSpeed = (EditText)layout.findViewById(R.id.etSpeed); etSpeed.setText("" + item.speed); …

아이템 갱신 14 new AlertDialog.Builder(this).setTitle("Edit Actions").setIcon(R.drawable.ic_launcher).setView(layout).setPositiveButton("OK", new DialogInterface.OnClickListener() public void onClick(DialogInterface dialog, int which) { // TODO Auto-generated method stub int action = radioGroup.getCheckedRadioButtonId() == R.id.rbforward? Action.FORWARD: Action.TURN_LEFT; int speed = 0; try{ speed = Integer.parseInt(etSpeed.getText().toString()); } catch (NumberFormatException ne) { } item.update(action, speed); adapter.notifyDataSetChanged(); } }).setNegativeButton("Cancel", null).setCancelable(false).show();

아이템 선택 15 listView.setOnItemClickListener(new OnItemClickListener() public void onItemClick(AdapterView parent, View view, int position, long id) { // TODO Auto-generated method stub Bundle bundle = new Bundle(); bundle.putInt("Position", position); ShowDialog(DIALOG_EDIT, bundle); } });

로봇 조정기 완성 16 2 가지 방향 추가 - 후진 - 우회전