android:id="@+id/message_edit" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginRight="3dp" android:hint="@string/chat_room_message_hint" android:paddingLeft="5dp" android:textSize="13sp"android:inputType="textMultiLine"android:scrollbars="vertical"android:singleLine="false"android:minLines="2"android:maxLines="5" />
// 토스트 폰트 통일 final LinearLayout toastLayout = (LinearLayout) toast.getView(); final TextView toastTV = (TextView) toastLayout.getChildAt(0); toastTV.setTypeface(Typeface.createFromAsset(getAssetManager(), "NanumGothic.otf")); if(singleLine) { toastTV.setSingleLine(true); toastTV.setEllipsize(TextUtils.TruncateAt.END); } toast.show();
/** * Detects and toggles immersive mode (also known as "hidey bar" mode). */ public void toggleHideyBar() { // BEGIN_INCLUDE (get_current_ui_flags) // The UI options currently enabled are represented by a bitfield. // getSystemUiVisibility() gives us that bitfield. int uiOptions = getActivity().getWindow().getDecorView().getSystemUiVisibility(); int newUiOptions = uiOptions; // END_INCLUDE (get..
팝업 윈도우를 타이틀바(액션바)를 포함하여 풀스크린으로 띄우고 싶을 때는 다음과 같은 코드를 이용한다.new를 할때와 showAtLocation할때 동일한 view가 들어가는 것에 유의하자. final View view = getLayoutInflater().inflate(R.layout.rotate_popup, null); private PopupWindow rotatePopup;rotatePopup = new PopupWindow(view, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);rotatePopup.setFocusable(true);rotatePopup.showAtLocation(view, Gravity.C..
public static void hideKeyBoard(View v) { InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(v.getApplicationWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } public static void showKeyBoard(View v) { InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(INPUT_METHOD_SERVICE); imm.showSoftIn..
public static String getDeviceUUID(final Context context) { // preference에서 저장된 것이 있는지 확인해봄 final SharedPreferences prefs = context.getSharedPreferences("UUIDTEST", MODE_PRIVATE); final String id = prefs.getString("UUID", null); UUID uuid = null; if (id != null) { uuid = UUID.fromString(id); } else { final String androidId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure..
http://stackoverflow.com/questions/4369759/how-to-recieve-post-data-sent-using-application-octet-stream-in-php 같이 일하는 회사에서 JSON 포맷을 data stream 형태로 POST 방식으로 보내준다고 하였다. 그런데 PHP를 한지 하도 오래되어서 몰랐는데 이런 것이 있었다. 정식 명칭은 application/octet-stream이다. $rawPost = file_get_contents('php://input');
- Total
- Today
- Yesterday