본문 바로가기

개발

(54)
[안드로이드/java]scrollview 안에 recyclerview 스크롤 문제 xml에 리사이클러뷰 감싸는 레이아웃에 android:descendantFocusability="blocksDescendants" 추가, java에서는 recyclerView.setHasFixedSize(true); recyclerView.setNestedScrollingEnabled(false); 추가하면 된다. 코드 전체 recyclerView.setHasFixedSize(true); RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(mContext); recyclerView.setLayoutManager(mLayoutManager); adapter = new Adapter(mContext, dongList, listener); ..
[안드로이드/java] BottomSheet 스크롤 할 때 slideOffset 으로 background 조절 int colorFromTop = getResources().getColor(R.color.downy); int colorFromBottom = getResources().getColor(R.color.scooter); int colorTo = getResources().getColor(R.color.transparent); int[] colors = {interpolateColor(slideOffset, colorFromTop, colorTo), interpolateColor(slideOffset, colorFromBottom, colorTo)}; GradientDrawable gd = new GradientDrawable(GradientDrawable.Orientation.TOP_BOTTOM, col..
[안드로이드] TextView 한 줄만 표시하기 (뒷 부분 ... 으로 생략) xml 파일 텍스트뷰 속성에 해당 설정을 추가하면 된다. android:ellipsize="end" android:singleLine="true" ※ TextView 가 wrap_content 상태일 경우 적용되지 않는다.
[안드로이드/java] 안드로이드 웹뷰 캐시 삭제 자바 코드로 해당 라인을 추가하면 된다. webView.clearCache(true);
[안드로이드] EditText 키보드 다음/완료 등 엔터 버튼 변경 XML 에서 EditText에 해당 코드 추가 singleLine 이 적용되어야 imeOptions 가 동작한다. android:imeOptions="actionNext" android:singleLine="true" actionNext = 다음 actionDone = 완료 actionGo = 이동 actionSearch = 검색 actionSend = 보내기 actionPrevious = 이전
[안드로이드/java] 문자 수신 감지(BroadcastReceiver) 1. manifest permission 추가 2. Receiver 생성 public class SmsReceiver extends BroadcastReceiver { @Override public void onReceive(final Context context, Intent intent) { Bundle bundle = intent.getExtras(); SmsMessage[] message = null; String str = ""; String phoneNumber = ""; if (bundle != null) { Object[] pdus = (Object[]) bundle.get("pdus"); message = new SmsMessage[pdus.length]; for (int i=0; i