-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustomFragment.java
35 lines (26 loc) · 984 Bytes
/
CustomFragment.java
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
package br.com.esolucoes.ecards.util;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import br.com.esolucoes.ecards.R;
/**
* Created by Diogo on 31/01/2017.
*/
public class CustomFragment extends Fragment {
private LinearLayout linearLayout;
//UTILS
public void showProgress(){
linearLayout = new LinearLayout(getActivity());
linearLayout.setGravity(Gravity.CENTER);
ProgressBar progressBar = new ProgressBar(getActivity());
progressBar.setLayoutParams(new ViewGroup.LayoutParams(200, 200));
linearLayout.addView(progressBar);
((FrameLayout)getActivity().findViewById(R.id.main_content)).addView(linearLayout);
}
public void dismissProgress(){
((FrameLayout)getActivity().findViewById(R.id.main_content)).removeView(linearLayout);
}
}