한국어

스마트폰앱

온누리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;
    }
 
}
조회 수 :
16073
등록일 :
2014.02.09
18:19:09 (*.251.139.148)
엮인글 :
http://webs.co.kr/index.php?document_srl=38608&act=trackback&key=bfa
게시글 주소 :
http://webs.co.kr/index.php?document_srl=38608
List of Articles
번호 제목 글쓴이 날짜 조회 수
66 mjsip sip sample code program admin 2019-09-07 41
65 Package org.linphone.core Description admin 2017-10-22 4748
64 Sqlite detail easy tutorial. admin 2017-09-09 4919
63 Change package name Linphone Android admin 2017-08-25 5078
62 Liblinphone - import Linphone library in Android Studio 2017 admin 2017-08-25 5436
61 I am able to build the limphone on mac by follow the steps describe here admin 2017-08-25 4990
60 To build liblinphone for Android, you must COMPILATION INSTRUCTIONS admin 2017-08-25 5302
59 sipdroid source code admin 2017-08-08 5091
58 안드로이드 주소록 전체가져오기 이름만가져오기 사진가져오기 코드 admin 2015-04-13 24819
57 the sipdroid Research Miscellaneous admin 2015-03-26 8369
56 HSS070 English Korean 무료 국제전화 미국 중국 카나다 무료 통화 제공 admin 2014-12-28 14401
55 Softphones admin 2014-09-20 10757
54 /xxxxx/gen already exists but is not a source folder. Convert to a source folder or rename it. admin 2014-09-03 13927
53 CSIPSimple building Rebuilding Detail on Eclips Good All is heare perfect admin 2014-08-15 11676
52 Improving QoE of SIP-based Automated Voice Interaction in Mobile Networks file admin 2014-03-20 12491
51 speex support in android admin 2014-03-19 11871
50 voxmobile Source and how to build admin 2014-02-18 13184
49 PJSIP hung the phone constantly corrected the problem admin 2014-02-09 13172
48 Csipsimple code rebuilding source sip 통신 Call Mechanism admin 2014-02-09 73019
47 Csipsimple code rebuilding source sip 통신 technical interviewer admin 2014-02-09 13188
46 Csipsimple code rebuilding source 주요인터페이스분석 admin 2014-02-09 176639
45 Csipsimple code rebuilding source 다운로드 구성 csipsimple 소스 프로젝트 admin 2014-02-09 15024
44 Android DialogFragment Tutorial admin 2014-02-09 12927
» Creating a fullscreen DialogFragment with a custom background admin 2014-02-09 16073
42 [Android API] 네트워크 상태 체크하기 admin 2013-12-19 18173
41 [안드로이드] 네트워크 연결 상태 체크 함수. admin 2013-12-19 14766
40 안드로이드 인터넷연결체크 ( 3g/lte/wifi ) 메서드 admin 2013-12-19 20737
39 Android Get Phone Contacts details with Contact Image admin 2013-12-15 13820
38 안드로이드 커스텀 타이틀바 How to add custom title bar to android application admin 2013-10-02 16990
37 How to create a custom title bar admin 2013-07-15 15429