Adapter2 Adapter 어댑터 패턴 - 구조, client 가 요구하는 인터페이스와 제공된 클래스의 인터페이스가 일치하지 않을 때 | Design Pattern 디자인 패턴 구조에 따른 패턴 분류 적용 범위 Scope 클래스 class - 클래스 간 관계 - 주로 inheritance 사용 - 정적) 컴파일 시 결정됨 Adapter (class) (상속) 객체 object - 객체 간 관계 - 주로 composition 사용 - 동적) 실행 시 변경 가능 Adapter (object) (구성) Facade (퍼사드) Composite Decorator Proxy Bridge Flyweight 인터페이스 관련 패턴 • Adapter pattern • Facade pattern • Composite pattern • Bridge pattern ※ 모두 구조 패턴에 속함 Adapter 구조 패턴 언제 ? -> Interface mismatching client 가 요구하는 인터페.. 2021. 10. 10. Android studio (안드로이드 스튜디오) ListVIew, BaseAdapter, headerview, footerview / Spoon라디오 처럼 구현해보기 리스트뷰 스크롤이동시 -> 리스트가 빠져나가 어댑터로 -> 어댑터는 리스트뷰를 TextVIew에 임시저장(뷰 비워둠) -> 재활용 메인.java public class MainActivity extends AppCompatActivity { ArrayList list; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ListView listView = findViewById(R.id.List_view); addList(); //headerview, footerview LayoutInflater layoutI.. 2020. 3. 5. 이전 1 다음