1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class SampleActivity extends AppCompatActivity {
     private AsyncThread mAsyncThread;
 
     @BindView(R.id.root)
     LinearLayout root;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
         //팝업창 만들때!!
         //extends Activity
         //android:theme="@android:style/Theme.Translucent"
         supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
 
         setContentView(R.layout.activity_room_list);
         ButterKnife.bind(this);
 
         //매니페스트에서 세로 고정하면 에러남.. 여기서 해줌
         try {
             setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
         } catch (Exception e) {
             e.printStackTrace();
         }
         //
 
         initView(root);
 
     }
 
     private void initView(View view) {
         SetViewScale setvs = new SetViewScale(this);
 
         if (view instanceof ViewGroup) {
             ViewGroup group = (ViewGroup) view;
             for (int i=0; i<group.getChildCount(); i++) {
                 View childView = group.getChildAt(i);
                 initView(childView);
             }
         } else {
             if (view.getLayoutParams().width > 0) {
                 setvs.setViewScale(view, view.getLayoutParams().width, view.getLayoutParams().height);
             }
         }
     }
 
     @Override
     public void onBackPressed() {
         finish();
         overridePendingTransition(00);
 
     }
 
     @OnClick(R.id.btn_back)
         public void back() {
             onBackPressed();
         }
}
cs

'Android' 카테고리의 다른 글

안드로이드 AsyncTask 코드  (0) 2020.03.29
안드로이드 RecyclerAdapter 코드  (0) 2020.03.29
안드로이드 기본 Flagment 코드  (0) 2020.03.29
안드로이드 기본 레이아웃 설정  (0) 2020.03.29
build.gradle(Module: app) 세팅  (0) 2020.03.29

+ Recent posts