728x90
반응형

전체 글 624

FCM 푸시 헤드업 알림 안뜨는 경우 ( 포어그라운드 상태 )

// foreground 상태에서 해드업 알림 private void sendNotification2(String title, String body, Intent intent) { NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); String NOTIFICATION_CHANNEL_ID = "fore001"; if (intent == null) intent = Intent.makeRestartActivityTask(new ComponentName(this, SplashActivity.class)); PendingIntent pendingIntent = Pen..

Android 2020.09.03

스크롤뷰 안에 ListView 가 늘어나지 않고, 스크롤 바가 생기는 이슈

// test public static void setListViewHeightBasedOnChildren(ListView listView) { ListAdapter listAdapter = listView.getAdapter(); if (listAdapter == null) { return; } int desiredWidth = View.MeasureSpec.makeMeasureSpec(listView.getWidth(), View.MeasureSpec.AT_MOST); int totalHeight = 0; View view = null; for (int i = 0; i < listAdapter.getCount(); i++) { view = listAdapter.getView(i, view, listV..

Android 2020.08.26

리덕스 사용예제 1

> npm install redux > npm install react-redux 설치는 굉장히 간단하다. 하지만 Redux를 처음 접한다면 상당히 어렵다. Redux를 사용하는 가장 중요한 이유는 컴포넌트들의 상태를 공유하기 위함이다. 아래는 중요한 코드만 적어두겠다. //********************************************** ******************** App.js ******************** ************************************************// ... 생략 ... import { createStore } from 'redux'; import { Provider } from 'react-redux'; const ini..

Redux 2020.08.15

Redux 업데이트

리듀서 내부에 있는 데이터의 값이 변경되지 않는 경우가 있다. 리덕스의 경우 리듀서 내부의 데이터는 불변한 것이라고 예측하기 때문에 데이터의 일부를 변경하는 것은 불가능 하다. 그렇기 때문에 새로운 데이터를 만들어 덮어 씌우는 방법으로 업데이트를 해야 한다. 리덕스 도큐먼트에서는 아래의 코드를 예시로 던져주고 있다. const initialState = { value: 0 } function counterReducer(state = initialState, action) { // Check to see if the reducer cares about this action if (action.type === 'counter/increment') { // If so, make a copy of `state`..

Redux 2020.08.15
728x90
반응형