한국어

스마트폰앱

온누리070 플레이스토어 다운로드
    acrobits softphone
     온누리 070 카카오 프러스 친구추가온누리 070 카카오 프러스 친구추가친추
     카카오톡 채팅 상담 카카오톡 채팅 상담카톡
    
     라인상담
     라인으로 공유

     페북공유

   ◎위챗 : speedseoul


  
     PAYPAL
     
     PRICE
     

pixel.gif

    before pay call 0088 from app


http://howrobotswork.wordpress.com/2013/08/16/creating-a-fullscreen-dialogfragment-with-a-custom-background/


Creating a fullscreen DialogFragment with a custom background

The default Dialogs (or rather the DialogFragments) look pretty good in Android since Honeycomb, but the Holo look-and-feel doesn’t go well together with all app designs. Not to mention sometimes you need a fully different layout, a custom background color, or a semitransparent background with no grey dimming at all. We’re talking about Android, where (almost) everything is possible, so there is a solution for this problem as well.

Customizing a DialogFragment is a quite easy task. Create a class extending DialogFragment, and override the onCreateDialog method, which is responsible for creating the Dialog. Instantiate a Dialog, then make the following calls on the instance:

  • requestWindowFeature(Window.FEATURE_NO_TITLE) – removes the dialog’s title
  • getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) forces the dialog to occupy the whole screen estate
  • setBackgroundDrawable() – sets the dimming drawable. This can be transparent, a solid color, a gradient or a custom drawable (even an image)
  • create the layout and set it to the dialog using setContentView()

These four steps give you an empty fullscreen layout to play with, with the option to add a semi-transparent background, revealing the underlying activity. From this point, only your imagination is the limit; a good example of what can be achieved is the following screen, taken from an upcoming app:

custom_dialogfragment

You can find more on using and customizing the DialogFragment at the official developer site. Here is a short sample code illustrating a DialogFragment with a yellow background and an empty layout.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public class CustomDialogFragment extends DialogFragment {
 
    public CustomDialogFragment() {}
 
    @Override
    public Dialog onCreateDialog(final Bundle savedInstanceState) {
 
        // the content
        final RelativeLayout root = new RelativeLayout(getActivity());
        root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
 
        // creating the fullscreen dialog
        final Dialog dialog = new Dialog(getActivity());
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(root);
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.YELLOW));
        dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
 
        return dialog;
    }
 
}
조회 수 :
19699
등록일 :
2014.02.09
18:19:09 (*.251.139.148)
엮인글 :
http://webs.co.kr/index.php?document_srl=38608&act=trackback&key=242
게시글 주소 :
http://webs.co.kr/index.php?document_srl=38608
List of Articles
번호 제목 글쓴이 날짜 조회 수
50 mjsip sip sample code program admin 2019-09-07 2840
49 Package org.linphone.core Description admin 2017-10-22 7850
48 Sqlite detail easy tutorial. admin 2017-09-09 7860
47 Change package name Linphone Android admin 2017-08-25 11541
46 Liblinphone - import Linphone library in Android Studio 2017 admin 2017-08-25 8627
45 I am able to build the limphone on mac by follow the steps describe here admin 2017-08-25 8175
44 To build liblinphone for Android, you must COMPILATION INSTRUCTIONS admin 2017-08-25 10990
43 sipdroid source code admin 2017-08-08 8289
42 안드로이드 주소록 전체가져오기 이름만가져오기 사진가져오기 코드 admin 2015-04-13 50850
41 the sipdroid Research Miscellaneous admin 2015-03-26 11609
40 HSS070 English Korean 무료 국제전화 미국 중국 카나다 무료 통화 제공 admin 2014-12-28 32263
39 Softphones admin 2014-09-20 13950
38 /xxxxx/gen already exists but is not a source folder. Convert to a source folder or rename it. admin 2014-09-03 17835
37 Improving QoE of SIP-based Automated Voice Interaction in Mobile Networks file admin 2014-03-20 15862
36 speex support in android admin 2014-03-19 15064
35 voxmobile Source and how to build admin 2014-02-18 16460
34 PJSIP hung the phone constantly corrected the problem admin 2014-02-09 24090
33 Csipsimple code rebuilding source 다운로드 구성 csipsimple 소스 프로젝트 admin 2014-02-09 18306
32 Android DialogFragment Tutorial admin 2014-02-09 16700
» Creating a fullscreen DialogFragment with a custom background admin 2014-02-09 19699
30 [Android API] 네트워크 상태 체크하기 admin 2013-12-19 21780
29 [안드로이드] 네트워크 연결 상태 체크 함수. admin 2013-12-19 18270
28 안드로이드 인터넷연결체크 ( 3g/lte/wifi ) 메서드 admin 2013-12-19 25487
27 Android Get Phone Contacts details with Contact Image admin 2013-12-15 21244
26 안드로이드 커스텀 타이틀바 How to add custom title bar to android application admin 2013-10-02 20703
25 How to create a custom title bar admin 2013-07-15 18748
24 Rotary Dialer clip art admin 2013-04-20 27204
23 Java 프로그램 실행화일 만들기 : Launch4j admin 2013-02-21 24003
22 java network programming source code, learning socket programming admin 2012-12-04 20092
21 Unicode Tables v4 admin 2012-10-16 116169