기본 콘텐츠로 건너뛰기

7월, 2019의 게시물 표시

Firebase, Coustom objects 사용

Coustom 객체를 사용한 조회
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15db.collection("company").get().addOnCompleteListener(newOnCompleteListener<QuerySnapshot>(){@OverridepublicvoidonComplete(@NonNullTask<QuerySnapshot>task){if(task.isSuccessful()){for(QueryDocumentSnapshotdocument:task.getResult()){companyList.add(document.toObject(Company.class));}}else{Log.w(TAG,"Error getting company documents.",task.getException());}}});
1 2// 조회된 데이터 매핑Companycompany=document.toObject(Company.class);

Coustom 객체를 사용한 추가
1 2 3 4 5 6 7 8 9 10 11 12 13 14db.collection("company").add(company)// 객체를 넣어준다..addOnSuccessListener(newOnSuccessListener<DocumentReference>(){@OverridepublicvoidonSuccess(DocumentReferencedocumentReference){finish();}}).addOnFailureListener(newOnFailureListener(){@OverridepublicvoidonFailure(@NonNullExceptione){Log.w(TAG,"Failure save");}});

circularImageView-안드로이드에서 간단하게 원형 이미지 생성

Web site
https://github.com/lopspower/CircularImageView

build.gradle(Module:app)에 추가
1 2 3dependencies{implementation'com.mikhaellopez:circularimageview:4.0.1'}
Properties
app:civ_circle_color (color) -> default WHITEapp:civ_border (boolean) -> default trueapp:civ_border_color (color) -> default WHITEapp:civ_border_width (dimension) -> default 4dpapp:civ_shadow (boolean) -> default falseapp:civ_shadow_color (color) -> default BLACKapp:civ_shadow_radius (float) -> default 8.0fapp:civ_shadow_gravity (center, top, bottom, start or end) -> default bottom
XML
1 2 3 4 5 6 7 8 9<com.mikhaellopez.circularimageview.CircularImageViewandroid:layout_width="250dp"android:layout_height="250dp"android:src="@drawable/image"app:civ_border_color="#3f51b5"app:civ_border_width="4dp"app:civ_shadow="true"app:civ_shadow_radius="10"app:civ_shadow_color="#3f51b5"/>
JAVA

1 2 3 4 5 6 7 8 9 10…

안드로이드에서 Picasso사용

Web site
https://square.github.io/picasso/

Last version
https://github.com/square/picasso

build.gradle 추가
12 3dependencies{implementation'com.squareup.picasso:picasso:2.71828'}


1Picasso.get().load("http://i.imgur.com/DvpvklR.png").into(imageView);